/[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.1 - (hide annotations) (download)
Tue Aug 2 19:54:10 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
* 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     +++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2022-08-02 15:44:22.300000000 -0400
48     @@ -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     @@ -22,42 +22,37 @@
58     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     +# php_admin_value openbase_dir /usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist
71     +# php_admin_flag file_uploads on
72     +# php_admin_value upload_max_filesize 5M
73     +# php_admin_value post_max_size 6M
74     +# php_admin_value memory_limit 128M
75     +# php_admin_value session.save_path /var/lib/phplist/tmp
76     +# php_admin_value upload_tmp_dir /var/lib/phplist/tmp
77     <FilesMatch "\\.(php|inc)\$">
78     - Order allow,deny
79     - deny from all
80     + Require all denied
81     </FilesMatch>
82     <FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php)\$">
83     - Order allow,deny
84     - allow from all
85     + Require all granted
86     + SetHandler "proxy:unix:/var/run/php-fpm/php80-phplist.sock|fcgi://localhost"
87     </FilesMatch>
88     - Order deny,allow
89     - deny from all
90     - allow from $allow
91     + Require $allow
92     </Directory>
93    
94     # Admin section
95     <Directory /usr/share/phplist/www/admin>
96     SSLRequireSSL on
97     <FilesMatch "\\.(php|inc)\$">
98     - Order allow,deny
99     - Deny from all
100     + Require all denied
101     </FilesMatch>
102     <FilesMatch "(index.php|connector.php|upload.php)\$">
103     - Order allow,deny
104     - allow from all
105     + Require all granted
106     </FilesMatch>
107     - order deny,allow
108     - deny from all
109     - allow from $allow
110     - $auth
111     + <RequireAll>
112     + Require $allow
113     + $auth
114     + </RequireAll>
115     </Directory>
116    
117    
118     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
119     --- 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
120     +++ 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
121     @@ -0,0 +1,65 @@
122     +{
123     +
124     +if ($PHP_VERSION eq '80'){
125     + if (($phplist{'status'} || 'disabled') eq 'enabled'){
126     + my $max_upload_size = ($phplist{MaxUploadSize} || '6M');
127     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
128     + my $memory_limit = ($phplist{MemoryLimit} || '128M');
129     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
130     + my $open_basedir= $phplist{PHPBaseDir} || '';
131     + $open_basedir = "/usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist:$open_basedir";
132     + my $id = 'cacti';
133     + my $max_children = $phplist{'PHPmaxChildren'} || 20;
134     + my $min_spare_servers = $phplist{'PHPminServers'} || 4;
135     + my $start_servers = $phplist{'PHPstartServers'} || 6;
136     + my $max_spare_servers = $phplist{'PHPmaxServers'} || 8;
137     + my $max_requests = $phplist{'PHPmaxRequests'} || 1000;
138     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
139     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
140     +
141     + $OUT .=<<_EOF;
142     +
143     +[php$PHP_VERSION-$id]
144     +user = www
145     +group = www
146     +listen.owner = root
147     +listen.group = www
148     +listen.mode = 0660
149     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
150     +pm = dynamic
151     +pm.max_children = $max_children
152     +pm.start_servers = $start_servers
153     +pm.min_spare_servers = $min_spare_servers
154     +pm.max_spare_servers = $max_spare_servers
155     +pm.max_requests = $max_requests
156     +php_admin_value[session.save_path] = /var/lib/php/$id/session
157     +php_admin_value[session.gc_maxlifetime] = 86400
158     +php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache
159     +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
160     +php_admin_value[error_log] = /var/log/php/$id/error.log
161     +slowlog = /var/log/php/phplist/slow.log
162     +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
163     +php_admin_flag[display_errors] = off
164     +php_admin_flag[log_errors] = on
165     +php_admin_value[error_log] = syslog
166     +php_admin_value[memory_limit] = $memory_limit
167     +php_admin_value[max_execution_time] = 3600
168     +php_admin_value[post_max_size] = $max_upload_size
169     +php_admin_value[upload_max_filesize] = $max_upload_size
170     +php_admin_value[disable_functions] = system, show_source, symlink, dl, passthru, phpinfo, escapeshellarg, escapeshellcmd
171     +php_admin_value[open_basedir] = $open_basedir
172     +php_admin_flag[allow_url_fopen] = on
173     +php_admin_flag[file_uploads] = on
174     +php_admin_flag[session.cookie_httponly] = on
175     +php_admin_flag[allow_url_include] = off
176     +php_admin_value[session.save_handler] = files
177     +php_admin_flag[output_buffering] = off
178     +
179     +_EOF
180     +
181     + }
182     + else{
183     + $OUT .= '; phplist is disabled';
184     + }
185     +}
186     +}
187     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
188     --- smeserver-phplist-0.2.1.old/root/usr/lib/systemd/system/phplist.service 1969-12-31 19:00:00.000000000 -0500
189     +++ smeserver-phplist-0.2.1/root/usr/lib/systemd/system/phplist.service 2022-08-02 15:34:42.017000000 -0400
190     @@ -0,0 +1,13 @@
191     +[Unit]
192     +Description=phplist process queues
193     +After=network-online.target
194     +
195     +[Service]
196     +ExecStartPre=/sbin/e-smith/service-status phplist
197     +ExecStart=/usr/sbin/e-smith/systemd/phplist
198     +Restart=always
199     +Restartsec=10s
200     +RemainAfterExit=yes
201     +
202     +[Install]
203     +WantedBy=sme-server.target
204     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
205     --- smeserver-phplist-0.2.1.old/root/usr/sbin/e-smith/systemd/phplist 1969-12-31 19:00:00.000000000 -0500
206     +++ smeserver-phplist-0.2.1/root/usr/sbin/e-smith/systemd/phplist 2020-03-18 13:12:54.000000000 -0400
207     @@ -0,0 +1,10 @@
208     +#!/bin/sh
209     +
210     +exec 2>&1
211     +
212     +cd /usr/share/phplist/bin
213     +while true; do
214     + /usr/local/bin/setuidgid www ./phplist -pprocessbounces
215     + /usr/local/bin/setuidgid www ./phplist -pprocessqueue
216     + sleep 120
217     +done
218     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
219     --- smeserver-phplist-0.2.1.old/root/var/service/phplist/run 2020-03-18 13:12:54.000000000 -0400
220     +++ smeserver-phplist-0.2.1/root/var/service/phplist/run 1969-12-31 19:00:00.000000000 -0500
221     @@ -1,10 +0,0 @@
222     -#!/bin/sh
223     -
224     -exec 2>&1
225     -
226     -cd /usr/share/phplist/bin
227     -while true; do
228     - /usr/local/bin/setuidgid www ./phplist -pprocessbounces
229     - /usr/local/bin/setuidgid www ./phplist -pprocessqueue
230     - sleep 120
231     -done

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