First commit

This commit is contained in:
Daniel Berteaud 2013-11-18 19:32:28 +01:00
commit a4977de824
15 changed files with 151 additions and 0 deletions

10
createlinks Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# Templates to expand
templates2events("/etc/dl.php", qw(bootstrap-console-save webapps-update));
# PHP header and footer
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/dl.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/etc/dl.php/template-end");

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
webapp

View File

@ -0,0 +1,3 @@
PERMS=0640
UID="root"
GID="www"

View File

@ -0,0 +1,14 @@
{
use esmith::DomainsDB;
my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB";
my $vhost = "$SystemName.$DomainName/dl";
foreach ($d->get_all_by_prop(type => 'domain'), $d->get_all_by_prop(type => 'vhost')){
my $root = $_->prop('DocumentRoot') || '';
if ($root eq '/usr/share/dl'){
$vhost = $_->key;
last;
}
}
$OUT .= "\$masterPath = '$vhost'";
}

View File

@ -0,0 +1 @@
$fromAddr = "dl <nobody@{$DomainName}>";

View File

@ -0,0 +1 @@
$spoolDir = "/var/lib/dl/";

View File

@ -0,0 +1,5 @@
{
my $local = $sysconfig{'Language'} || 'en_US';
$locale = (-e "/usr/share/dl/include/locale/$locale") ? "$locale":'en_US';
$OUT .= "\$defLocale = '$locale'";
}

View File

@ -0,0 +1,4 @@
$defaultTicketTotalDays = 30;
$defaultTicketLastDlDays = 7;
$defaultTicketMaxDl = 0;
$defaultGrantTotalDays = 30;

View File

@ -0,0 +1,4 @@
{
my $ver = `rpm -q --qf %{version} dl`;
$OUT .= "\$cfgVersion = '$ver';";
}

View File

@ -0,0 +1 @@
$logFile = "dl_ticket";

View File

@ -0,0 +1 @@
$authRealm = "dl";

View File

@ -0,0 +1 @@
$dsn = "sqlite:$spoolDir/data.sql";

View File

@ -0,0 +1,58 @@
{
my $access = $dl{'access'} || 'private';
my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess";
my $auth = $dl{'Authentication'} || 'http';
my $alias = (($dl{'AliasOnPrimary'} || 'enabled') eq 'enabled') ?
'Alias /dl /usr/share/dl' : '';
my $authuser = '';
my $authadmin = '';
if ($auth eq 'http'){
$auth =<<'EOF';
<FilesMatch "^(admin|rest)\.php">
SSLRequireSSL on
AuthName "dl"
AuthType Basic
AuthExternal pwauth
Require valid-user
</FilesMatch>
EOF
}
if ($dl{'status'} eq 'enabled'){
$OUT .=<<"END"
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dl:/etc/dl.php:/var/lib/dl
php_admin_flag file_uploads On
php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off
php_admin_value upload_max_filesize 1024M
php_admin_value post_max_size 1025M
php_admin_value memory_limit 100M
php_admin_flag output_buffering Off
php_admin_value max_execution_time 0
php_admin_value upload_tmp_dir /var/lib/dl/tmp
php_admin_value session.save_path /var/lib/dl/tmp
php_admin_value session.gc_maxlifetime 86400
order deny,allow
deny from all
allow from $allow
$authuser
</Directory>
<Directory /usr/share/dl/include>
Deny from all
</Directory>
<Directory /usr/share/dl/style/include>
Deny from all
</Directory>
END
}
else{
$OUT .= "# dl is disabled\n";
}
}

46
smeserver-dl.spec Normal file
View File

@ -0,0 +1,46 @@
%define name smeserver-dl
%define version 0.1.0
%define release 1.beta0
Summary: sme server integration of dl
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GNU GPL version 2
URL: http://www.thregr.org/~wavexx/software/dl/
Group: SMEserver/addon
Source: %{name}-%{version}.tar.gz
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: e-smith-base
Requires: dl
Requires: smeserver-webapps-common
%description
smserver integration of dl
%changelog
* Mon Nov 18 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1.sme
- First release
%prep
%setup
%build
perl ./createlinks
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%postun