Compare commits

...

27 Commits
sme9 ... master

Author SHA1 Message Date
Daniel Berteaud 8528f83fb0 Automatic commit of package [smeserver-dl] release [0.2.3-1]. 7 years ago
Daniel Berteaud 1e3940ebcf Use alt php binary when expiring tickets 7 years ago
Daniel Berteaud ea995a00cd Automatic commit of package [smeserver-dl] release [0.2.2-1]. 7 years ago
Daniel Berteaud e16a36fe97 Prepare spec file for tito 7 years ago
Daniel Berteaud fd758b930b Automatic commit of package [smeserver-dl] release [0.2.1-1]. 7 years ago
Daniel Berteaud ac89dac938 Configure tito 7 years ago
Daniel Berteaud 65b0c3e60a Initialized to use tito. 7 years ago
Daniel Berteaud 8dacc3e1a7 Spec file update 8 years ago
Daniel Berteaud 2e4c0c312a output_buffering is a flag not a value 8 years ago
Daniel Berteaud 5e9a9489de Add /var/lib/php/dl to the open_basedir 8 years ago
Daniel Berteaud f6928fbd5b MB are assumed if no unit is specified 8 years ago
Daniel Berteaud f1ab5e2195 Remove hardcoded PHP version 8 years ago
Daniel Berteaud 47287ab61f Spec file update 8 years ago
Daniel Berteaud 18bc9ed30a Limit max_requests to 1000 8 years ago
Daniel Berteaud f9da9e670f Remove hardcoded php version from the code 8 years ago
Daniel Berteaud 9d8dcb147c Cleanups in fpm pool template 8 years ago
Daniel Berteaud 66cd0917bb Fixes in php-fpm template 8 years ago
Daniel Berteaud 6c1b33e547 Correct path for php pool template 8 years ago
Daniel Berteaud 52db1b9e75 Use php56 instead of php71 8 years ago
Daniel Berteaud 1affd0666b Rename tempalte fragment for www.conf 8 years ago
Daniel Berteaud 8300d5f428 Add fastcgi wrapper directives 8 years ago
Daniel Berteaud e2c18a4b78 Use php71 8 years ago
Daniel Berteaud a21a1117c2 Merge branch 'sme9' 8 years ago
Daniel Berteaud df1608db0f Spec file update 9 years ago
Daniel Berteaud c1b0d270c0 Fix cron job output 9 years ago
Daniel Berteaud 1d7195efc1 Spec file update 9 years ago
Daniel Berteaud eba4367fc5 Fix cron job output 9 years ago
  1. 3
      .tito/packages/.readme
  2. 1
      .tito/packages/smeserver-dl
  3. 1
      .tito/releasers.conf
  4. 6
      .tito/tito.props
  5. 2
      root/etc/cron.daily/dl-expire
  6. 2
      root/etc/e-smith/templates/etc/e-smith/sql/init/dl
  7. 9
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/68FastCGIConfig15Dl
  8. 29
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98Dl
  9. 52
      root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Dl
  10. 37
      smeserver-dl.spec

@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

@ -0,0 +1 @@
../../tito_libs/releasers.conf

@ -0,0 +1,6 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
lib_dir = ../tito_libs

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
su -s /bin/bash - -c "cd /usr/share/dl/include/scripts && /usr/bin/php ./expire.php" su -s /bin/bash -c "cd /usr/share/dl/include/scripts && /usr/bin/php__PHP_VERSION__ ./expire.php"

@ -11,7 +11,7 @@ if [ ! -d /var/lib/mysql/$db ]; then
/usr/bin/mysql -e 'create database $db' /usr/bin/mysql -e 'create database $db'
/usr/bin/mysql $db < $dbstruct /usr/bin/mysql $db < $dbstruct
else else
su -s /bin/bash - www -c "cd /usr/share/dl/include/scripts && /usr/bin/php ./dbupgrade.php" su -s /bin/bash - www -c "cd /usr/share/dl/include/scripts && /usr/bin/php__PHP_VERSION__ ./dbupgrade.php"
fi fi
/usr/bin/mysql <<EOF /usr/bin/mysql <<EOF

@ -0,0 +1,9 @@
{
if ($fastcgi_mod eq 'mod_fastcgi'){
$OUT .=<<_EOF;
Action phpdl-fastcgi /php-cgi-bin/phpdl-wrapper
Alias /php-cgi-bin/phpdl-wrapper /var/www/php-cgi-bin/phpdl-wrapper
FastCgiExternalServer /var/www/php-cgi-bin/phpdl-wrapper -socket /var/run/php-fpm/php__PHP_VERSION__-dl.sock -pass-header Authorization -idle-timeout 120
_EOF
}
}

@ -23,15 +23,8 @@ EOF
} }
if ($dl{'status'} eq 'enabled'){ if ($dl{'status'} eq 'enabled'){
$OUT .=<<"END" my $php =<<_EOF;
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
AddType application/x-httpd-php .php AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/dl:/etc/dl.php:/var/lib/dl:/var/log/dl.log
php_admin_flag file_uploads On php_admin_flag file_uploads On
php_admin_flag magic_quotes Off php_admin_flag magic_quotes Off
php_admin_flag magic_quotes_gpc Off php_admin_flag magic_quotes_gpc Off
@ -43,6 +36,26 @@ $alias
php_admin_value upload_tmp_dir /var/lib/dl/tmp php_admin_value upload_tmp_dir /var/lib/dl/tmp
php_admin_value session.save_path /var/lib/dl/tmp php_admin_value session.save_path /var/lib/dl/tmp
php_admin_value session.gc_maxlifetime 86400 php_admin_value session.gc_maxlifetime 86400
_EOF
if ($fastcgi_mod eq 'mod_fastcgi'){
$php = " AddHandler phpdl-fastcgi .php\n";
}
elsif ($fascgi_mod eq 'mod_proxy_fcgi'){
$php =<<'_EOF';
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/php__PHP_VERSION__-dl.sock|fcgi://localhost"
</FilesMatch>
_EOF
}
$OUT .=<<"END"
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
$php
order deny,allow order deny,allow
deny from all deny from all
allow from $allow allow from $allow

@ -0,0 +1,52 @@
{
if ($PHP_VERSION eq '__PHP_VERSION__'){
if (($dl{'status'} || 'disabled') eq 'enabled'){
my $max_upload_size = ($dl{MaxUploadSize} || '4096');
$max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
my $id = 'dl';
$OUT .=<<_EOF;
[php$PHP_VERSION-$id]
user = www
group = www
listen.owner = root
listen.group = www
listen.mode = 0660
listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
pm = dynamic
pm.max_children = 15
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 4
pm.max_requests = 1000
php_admin_value[session.save_path] = /var/lib/php/$id/session
php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
php_admin_value[error_log] = /var/log/php/$id/error.log
slowlog = /var/log/php/dl/slow.log
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
php_admin_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[error_log] = syslog
php_admin_value[memory_limit] = 128M
php_admin_value[max_execution_time] = 0
php_admin_value[post_max_size] = $max_upload_size
php_admin_value[upload_max_filesize] = $max_upload_size
php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd
php_admin_value[open_basedir] = /usr/share/dl:/etc/dl.php:/var/lib/dl:/var/log/dl.log:/var/lib/php/dl
php_admin_flag[allow_url_fopen] = off
php_admin_flag[file_upload] = on
php_admin_flag[session.cookie_httponly] = on
php_admin_flag[allow_url_include] = off
php_admin_value[session.save_handler] = files
php_admin_flag[output_buffering] = off
_EOF
}
else{
$OUT .= '; Dl is disabled';
}
}
}

@ -1,10 +1,9 @@
%define name smeserver-dl %define phpversion 56
%define version 0.1.3
%define release 1
Summary: sme server integration of dl Summary: sme server integration of dl
Name: %{name} Name: smeserver-dl
Version: %{version} Version: 0.2.3
Release: %{release}%{?dist} Release: 1%{?dist}
Epoch: 9 Epoch: 9
License: GNU GPL version 2 License: GNU GPL version 2
URL: http://www.thregr.org/~wavexx/software/dl/ URL: http://www.thregr.org/~wavexx/software/dl/
@ -22,6 +21,24 @@ Requires: smeserver-webapps-common
smserver integration of dl smserver integration of dl
%changelog %changelog
* Sun Jan 21 2018 Daniel Berteaud <daniel@firewall-services.com> 0.2.3-1
- Use alt php binary when expiring tickets [SME: 10495] (daniel@firewall-
services.com)
* Sun Nov 19 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.2-1
- Prepare spec file for tito (daniel@firewall-services.com)
* Wed Jul 26 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.1-1.sme
- Add /var/lib/php/dl to open_basedir for the fpm pool
- Assume MB if no unit is specified for max file size
- Remove hardcoded PHP version, replaced at build time
* Thu Jul 13 2017 Daniel Berteaud <daniel@firewall-services.com> 0.2.0-1.sme
- Support smeserver-php-fpm
* Tue May 31 2016 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1.sme
- Fix cron job output [SME: 9116]
* Wed Apr 23 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1.sme * Wed Apr 23 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1.sme
- Fix basic auth on SME9 - Fix basic auth on SME9
@ -39,12 +56,20 @@ smserver integration of dl
%build %build
perl ./createlinks perl ./createlinks
find root/ -type f | xargs grep -l __PHP_VERSION__ | xargs sed -i -e "s/__PHP_VERSION__/%{phpversion}/g"
%{__mkdir_p} root/var/log/php/dl
%{__mkdir_p} root/var/lib/php/dl/{tmp,opcache,session}
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--dir /var/log/php/dl 'attr(0770,root,www)' \
--dir /var/lib/php/dl 'attr(0770,root,www)' \
--dir /var/lib/php/dl/tmp 'attr(0770,root,www)' \
--dir /var/lib/php/dl/opcache 'attr(0770,root,www)' \
--dir /var/lib/php/dl/session 'attr(0770,root,www)' \
> %{name}-%{version}-filelist > %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist

Loading…
Cancel
Save