Compare commits

...

28 Commits

Author SHA1 Message Date
Daniel Berteaud
8528f83fb0 Automatic commit of package [smeserver-dl] release [0.2.3-1].
Created by command:

/usr/bin/tito tag
2018-01-21 10:12:21 +01:00
Daniel Berteaud
1e3940ebcf Use alt php binary when expiring tickets
[SME: 10495]
2018-01-21 10:11:37 +01:00
Daniel Berteaud
ea995a00cd Automatic commit of package [smeserver-dl] release [0.2.2-1].
Created by command:

/usr/bin/tito tag
2017-11-19 10:57:53 +01:00
Daniel Berteaud
e16a36fe97 Prepare spec file for tito 2017-11-19 10:57:43 +01:00
Daniel Berteaud
fd758b930b Automatic commit of package [smeserver-dl] release [0.2.1-1].
Created by command:

/usr/bin/tito tag
2017-11-19 10:56:52 +01:00
Daniel Berteaud
ac89dac938 Configure tito 2017-11-19 10:56:40 +01:00
Daniel Berteaud
65b0c3e60a Initialized to use tito. 2017-11-19 10:56:06 +01:00
Daniel Berteaud
8dacc3e1a7 Spec file update 2017-07-27 14:13:01 +02:00
Daniel Berteaud
2e4c0c312a output_buffering is a flag not a value 2017-07-26 19:10:22 +02:00
Daniel Berteaud
5e9a9489de Add /var/lib/php/dl to the open_basedir 2017-07-26 18:45:26 +02:00
Daniel Berteaud
f6928fbd5b MB are assumed if no unit is specified 2017-07-26 18:44:50 +02:00
Daniel Berteaud
f1ab5e2195 Remove hardcoded PHP version 2017-07-26 18:44:34 +02:00
Daniel Berteaud
47287ab61f Spec file update 2017-07-26 17:51:14 +02:00
Daniel Berteaud
18bc9ed30a Limit max_requests to 1000 2017-07-18 11:30:35 +02:00
Daniel Berteaud
f9da9e670f Remove hardcoded php version from the code
Replace it at build time so it's easy to change
2017-07-18 11:23:26 +02:00
Daniel Berteaud
9d8dcb147c Cleanups in fpm pool template 2017-07-14 11:52:30 +02:00
Daniel Berteaud
66cd0917bb Fixes in php-fpm template 2017-07-13 18:26:03 +02:00
Daniel Berteaud
6c1b33e547 Correct path for php pool template 2017-07-13 17:56:15 +02:00
Daniel Berteaud
52db1b9e75 Use php56 instead of php71 2017-07-13 17:44:41 +02:00
Daniel Berteaud
1affd0666b Rename tempalte fragment for www.conf 2017-07-13 17:28:44 +02:00
Daniel Berteaud
8300d5f428 Add fastcgi wrapper directives 2017-07-13 17:20:42 +02:00
Daniel Berteaud
e2c18a4b78 Use php71 2017-07-13 17:14:23 +02:00
Daniel Berteaud
a21a1117c2 Merge branch 'sme9' 2017-07-13 16:47:35 +02:00
Daniel Berteaud
df1608db0f Spec file update 2016-05-31 13:13:00 +02:00
Daniel Berteaud
1d7195efc1 Spec file update 2016-05-31 13:11:45 +02:00
Daniel Berteaud
eba4367fc5 Fix cron job output 2016-05-31 13:09:55 +02:00
Daniel Berteaud
a29afa4b7c Spec file update 2014-04-23 09:16:08 +02:00
Daniel Berteaud
7d02690e47 Fix basic auth on SME9 2014-04-23 09:13:27 +02:00
10 changed files with 131 additions and 16 deletions

3
.tito/packages/.readme Normal file
View File

@ -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.

View File

@ -0,0 +1 @@
0.2.3-1 ./

1
.tito/releasers.conf Symbolic link
View File

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

6
.tito/tito.props Normal file
View File

@ -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

View File

@ -1,2 +1,2 @@
#!/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"

View File

@ -11,7 +11,7 @@ if [ ! -d /var/lib/mysql/$db ]; then
/usr/bin/mysql -e 'create database $db'
/usr/bin/mysql $db < $dbstruct
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
/usr/bin/mysql <<EOF

View File

@ -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
}
}

View File

@ -15,6 +15,7 @@ if ($authtype eq 'http'){
SSLRequireSSL on
AuthName "dl"
AuthType Basic
AuthBasicProvider external
AuthExternal pwauth
Require valid-user
</FilesMatch>
@ -22,15 +23,8 @@ EOF
}
if ($dl{'status'} eq 'enabled'){
$OUT .=<<"END"
# dl Configuration
$alias
<Directory /usr/share/dl>
AllowOverride Limit
my $php =<<_EOF;
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 magic_quotes Off
php_admin_flag magic_quotes_gpc Off
@ -42,6 +36,26 @@ $alias
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
_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
deny from all
allow from $allow

View File

@ -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';
}
}
}

View File

@ -1,10 +1,10 @@
%define name smeserver-dl
%define version 0.1.2
%define release 1
%define phpversion 56
Summary: sme server integration of dl
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Name: smeserver-dl
Version: 0.2.3
Release: 1%{?dist}
Epoch: 9
License: GNU GPL version 2
URL: http://www.thregr.org/~wavexx/software/dl/
Group: SMEserver/addon
@ -21,6 +21,27 @@ Requires: smeserver-webapps-common
smserver integration of dl
%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
- Fix basic auth on SME9
* Tue Feb 4 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1.sme
- Grant admin privileges to the admin user
@ -35,12 +56,20 @@ smserver integration of dl
%build
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
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 \
--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
%files -f %{name}-%{version}-filelist