/[smecontribs]/rpms/smeserver-phplist/contribs10/smeserver-phplist-0.2.1-sme10.patch
ViewVC logotype

Annotation of /rpms/smeserver-phplist/contribs10/smeserver-phplist-0.2.1-sme10.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Tue Aug 2 19:54:45 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
Changes since 1.1: +2 -9 lines
* Tue Aug 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 0.2.1-2.sme
- fix [SME: ]

1 jpp 1.1 diff -Nur --no-dereference smeserver-phplist-0.2.1.old/createlinks smeserver-phplist-0.2.1/createlinks
2     --- smeserver-phplist-0.2.1.old/createlinks 2020-03-18 13:12:54.000000000 -0400
3     +++ smeserver-phplist-0.2.1/createlinks 2022-08-02 15:51:25.684000000 -0400
4     @@ -15,13 +15,34 @@
5    
6     safe_symlink("/var/qmail/alias/.qmail-phplistbounces", "root/var/qmail/alias/.qmail-phplistbounces-default");
7    
8     -safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/phplist');
9     -safe_symlink("/var/service/phplist" , 'root/service/phplist');
10     -safe_touch("root/var/service/phplist/down");
11     safe_symlink("restart", "root/etc/e-smith/events/webapps-update/services2adjust/phplist");
12    
13     -service_link_enhanced('phplist', 'S98', '7');
14     -service_link_enhanced('phplist', 'K12', '6');
15     -service_link_enhanced('phplist', 'K12', '0');
16    
17     safe_touch("root/var/lib/phplist/bounces.mbox");
18     +
19     +my $event="smeserver-phplist-udpdate";
20     +event_templates($event, qw(
21     +/etc/httpd/conf/httpd.conf
22     +/etc/opt/remi/php80/php-fpm.d/www.conf
23     +/etc/e-smith/sql/init/phplistdb
24     +/etc/phplist/config.php
25     +
26     +));
27     +
28     +event_services($event, qw(
29     + php80-php-fpm restart
30     + httpd-e-smith restart
31     + phplist restart
32     +));
33     +
34     +event_actions($event, qw(
35     + phplist-create-pseudo 55
36     + systemd-default 88
37     + systemd-reload 89
38     +));
39     +
40     +use esmith::Build::Backup qw(:all);
41     +backup_includes("smeserver-phplist-udpdate", qw(
42     +/var/lib/phplist
43     +/var/log/phplist
44     +));
45     diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist
46     --- smeserver-phplist-0.2.1.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2020-03-18 13:12:54.000000000 -0400
47 jpp 1.2 +++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2022-08-02 15:53:59.215000000 -0400
48 jpp 1.1 @@ -6,7 +6,7 @@
49     my $alias = $phplist{'AliasOnPrimary'} || 'enabled';
50     my $ver = $sysconfig{'ReleaseVersion'} || '8.1';
51    
52     -my $allow = ( $access eq 'public' ) ? 'all' : "$localAccess $externalSSLAccess";
53     +my $allow = ( $access eq 'public' ) ? 'all granted' : "ip $localAccess $externalSSLAccess";
54     $alias = ($alias ne 'enabled') ? '' : 'Alias /lists /usr/share/phplist/www/';
55     $auth = ( $auth eq 'http' ) ? 'AuthName "phplist"' . "\n" .
56     " AuthType Basic\n" .
57 jpp 1.2 @@ -22,42 +22,30 @@
58 jpp 1.1 Options None +FollowSymLinks
59     AllowOverride None
60     DirectoryIndex index.php
61     - AddType application/x-httpd-php .php .php3
62     - php_admin_value openbase_dir /usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist
63     - php_admin_flag file_uploads on
64     - php_admin_value upload_max_filesize 5M
65     - php_admin_value post_max_size 6M
66     - php_admin_value memory_limit 128M
67     - php_admin_value session.save_path /var/lib/phplist/tmp
68     - php_admin_value upload_tmp_dir /var/lib/phplist/tmp
69     + AddType application/x-httpd-php .php
70     <FilesMatch "\\.(php|inc)\$">
71     - Order allow,deny
72     - deny from all
73     + Require all denied
74     </FilesMatch>
75     <FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php)\$">
76     - Order allow,deny
77     - allow from all
78     + Require all granted
79     + SetHandler "proxy:unix:/var/run/php-fpm/php80-phplist.sock|fcgi://localhost"
80     </FilesMatch>
81     - Order deny,allow
82     - deny from all
83     - allow from $allow
84     + Require $allow
85     </Directory>
86    
87     # Admin section
88     <Directory /usr/share/phplist/www/admin>
89     SSLRequireSSL on
90     <FilesMatch "\\.(php|inc)\$">
91     - Order allow,deny
92     - Deny from all
93     + Require all denied
94     </FilesMatch>
95     <FilesMatch "(index.php|connector.php|upload.php)\$">
96     - Order allow,deny
97     - allow from all
98     + Require all granted
99     </FilesMatch>
100     - order deny,allow
101     - deny from all
102     - allow from $allow
103     - $auth
104     + <RequireAll>
105     + Require $allow
106     + $auth
107     + </RequireAll>
108     </Directory>
109    
110    
111     diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist
112     --- smeserver-phplist-0.2.1.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist 1969-12-31 19:00:00.000000000 -0500
113     +++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist 2022-08-02 15:49:11.805000000 -0400
114     @@ -0,0 +1,65 @@
115     +{
116     +
117     +if ($PHP_VERSION eq '80'){
118     + if (($phplist{'status'} || 'disabled') eq 'enabled'){
119     + my $max_upload_size = ($phplist{MaxUploadSize} || '6M');
120     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
121     + my $memory_limit = ($phplist{MemoryLimit} || '128M');
122     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
123     + my $open_basedir= $phplist{PHPBaseDir} || '';
124     + $open_basedir = "/usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist:$open_basedir";
125     + my $id = 'cacti';
126     + my $max_children = $phplist{'PHPmaxChildren'} || 20;
127     + my $min_spare_servers = $phplist{'PHPminServers'} || 4;
128     + my $start_servers = $phplist{'PHPstartServers'} || 6;
129     + my $max_spare_servers = $phplist{'PHPmaxServers'} || 8;
130     + my $max_requests = $phplist{'PHPmaxRequests'} || 1000;
131     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
132     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
133     +
134     + $OUT .=<<_EOF;
135     +
136     +[php$PHP_VERSION-$id]
137     +user = www
138     +group = www
139     +listen.owner = root
140     +listen.group = www
141     +listen.mode = 0660
142     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
143     +pm = dynamic
144     +pm.max_children = $max_children
145     +pm.start_servers = $start_servers
146     +pm.min_spare_servers = $min_spare_servers
147     +pm.max_spare_servers = $max_spare_servers
148     +pm.max_requests = $max_requests
149     +php_admin_value[session.save_path] = /var/lib/php/$id/session
150     +php_admin_value[session.gc_maxlifetime] = 86400
151     +php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
152     +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
153     +php_admin_value[error_log] = /var/log/php/$id/error.log
154     +slowlog = /var/log/php/phplist/slow.log
155     +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
156     +php_admin_flag[display_errors] = off
157     +php_admin_flag[log_errors] = on
158     +php_admin_value[error_log] = syslog
159     +php_admin_value[memory_limit] = $memory_limit
160     +php_admin_value[max_execution_time] = 3600
161     +php_admin_value[post_max_size] = $max_upload_size
162     +php_admin_value[upload_max_filesize] = $max_upload_size
163     +php_admin_value[disable_functions] = system, show_source, symlink, dl, passthru, phpinfo, escapeshellarg, escapeshellcmd
164     +php_admin_value[open_basedir] = $open_basedir
165     +php_admin_flag[allow_url_fopen] = on
166     +php_admin_flag[file_uploads] = on
167     +php_admin_flag[session.cookie_httponly] = on
168     +php_admin_flag[allow_url_include] = off
169     +php_admin_value[session.save_handler] = files
170     +php_admin_flag[output_buffering] = off
171     +
172     +_EOF
173     +
174     + }
175     + else{
176     + $OUT .= '; phplist is disabled';
177     + }
178     +}
179     +}
180     diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/usr/lib/systemd/system/phplist.service smeserver-phplist-0.2.1/root/usr/lib/systemd/system/phplist.service
181     --- smeserver-phplist-0.2.1.old/root/usr/lib/systemd/system/phplist.service 1969-12-31 19:00:00.000000000 -0500
182     +++ smeserver-phplist-0.2.1/root/usr/lib/systemd/system/phplist.service 2022-08-02 15:34:42.017000000 -0400
183     @@ -0,0 +1,13 @@
184     +[Unit]
185     +Description=phplist process queues
186     +After=network-online.target
187     +
188     +[Service]
189     +ExecStartPre=/sbin/e-smith/service-status phplist
190     +ExecStart=/usr/sbin/e-smith/systemd/phplist
191     +Restart=always
192     +Restartsec=10s
193     +RemainAfterExit=yes
194     +
195     +[Install]
196     +WantedBy=sme-server.target
197     diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/usr/sbin/e-smith/systemd/phplist smeserver-phplist-0.2.1/root/usr/sbin/e-smith/systemd/phplist
198     --- smeserver-phplist-0.2.1.old/root/usr/sbin/e-smith/systemd/phplist 1969-12-31 19:00:00.000000000 -0500
199     +++ smeserver-phplist-0.2.1/root/usr/sbin/e-smith/systemd/phplist 2020-03-18 13:12:54.000000000 -0400
200     @@ -0,0 +1,10 @@
201     +#!/bin/sh
202     +
203     +exec 2>&1
204     +
205     +cd /usr/share/phplist/bin
206     +while true; do
207     + /usr/local/bin/setuidgid www ./phplist -pprocessbounces
208     + /usr/local/bin/setuidgid www ./phplist -pprocessqueue
209     + sleep 120
210     +done
211     diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/var/service/phplist/run smeserver-phplist-0.2.1/root/var/service/phplist/run
212     --- smeserver-phplist-0.2.1.old/root/var/service/phplist/run 2020-03-18 13:12:54.000000000 -0400
213     +++ smeserver-phplist-0.2.1/root/var/service/phplist/run 1969-12-31 19:00:00.000000000 -0500
214     @@ -1,10 +0,0 @@
215     -#!/bin/sh
216     -
217     -exec 2>&1
218     -
219     -cd /usr/share/phplist/bin
220     -while true; do
221     - /usr/local/bin/setuidgid www ./phplist -pprocessbounces
222     - /usr/local/bin/setuidgid www ./phplist -pprocessqueue
223     - sleep 120
224     -done

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed