1 |
diff -Nur --no-dereference smeserver-phplist-0.2.1.old/createlinks smeserver-phplist-0.2.1/createlinks |
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 |
--- 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 |
+++ smeserver-phplist-0.2.1/createlinks 2022-08-02 22:34:17.079000000 -0400 |
4 |
@@ -15,13 +15,34 @@ |
@@ -6,7 +6,7 @@ |
5 |
|
templates2events("/etc/phplist/config.php", qw/webapps-update bootstrap-console-save/); |
6 |
|
|
7 |
|
safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/webapps-update/S55phplist-qmail-assign"); |
8 |
|
-foreach my $event (qw/webapps-update ipasserelle-update bootstrap-ldap-save/){ |
9 |
|
+foreach my $event (qw/webapps-update bootstrap-ldap-save/){ |
10 |
|
event_link("phplist-create-pseudo", "$event", "55"); |
11 |
|
} |
12 |
|
|
13 |
|
@@ -15,13 +15,37 @@ |
14 |
|
|
15 |
safe_symlink("/var/qmail/alias/.qmail-phplistbounces", "root/var/qmail/alias/.qmail-phplistbounces-default"); |
safe_symlink("/var/qmail/alias/.qmail-phplistbounces", "root/var/qmail/alias/.qmail-phplistbounces-default"); |
16 |
|
|
25 |
|
|
26 |
safe_touch("root/var/lib/phplist/bounces.mbox"); |
safe_touch("root/var/lib/phplist/bounces.mbox"); |
27 |
+ |
+ |
28 |
+my $event="smeserver-phplist-udpdate"; |
+my $event="smeserver-phplist-update"; |
29 |
+event_templates($event, qw( |
+event_templates($event, qw( |
30 |
+/etc/httpd/conf/httpd.conf |
+/etc/httpd/conf/httpd.conf |
31 |
+/etc/opt/remi/php80/php-fpm.d/www.conf |
+/etc/opt/remi/php80/php-fpm.d/www.conf |
32 |
+/etc/e-smith/sql/init/phplistdb |
+/etc/e-smith/sql/init/phplistdb |
33 |
+/etc/phplist/config.php |
+/etc/phplist/config.php |
34 |
+ |
+/etc/e-smith/sql/init/phplistdb |
35 |
+)); |
+)); |
36 |
+ |
+ |
37 |
+event_services($event, qw( |
+event_services($event, qw( |
38 |
+ php80-php-fpm restart |
+ php80-php-fpm restart |
39 |
+ httpd-e-smith restart |
+ httpd-e-smith restart |
40 |
+ phplist restart |
+ phplist restart |
41 |
|
+ mysql.init restart |
42 |
+)); |
+)); |
43 |
|
+safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S93phplist-qmail-assign"); |
44 |
+ |
+ |
45 |
+event_actions($event, qw( |
+event_actions($event, qw( |
46 |
+ phplist-create-pseudo 55 |
+ phplist-initialise 92 |
47 |
|
+ phplist-create-pseudo 93 |
48 |
+ systemd-default 88 |
+ systemd-default 88 |
49 |
+ systemd-reload 89 |
+ systemd-reload 89 |
50 |
+)); |
+)); |
54 |
+/var/lib/phplist |
+/var/lib/phplist |
55 |
+/var/log/phplist |
+/var/log/phplist |
56 |
+)); |
+)); |
57 |
|
diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/etc/e-smith/db/configuration/defaults/phplist/type smeserver-phplist-0.2.1/root/etc/e-smith/db/configuration/defaults/phplist/type |
58 |
|
--- smeserver-phplist-0.2.1.old/root/etc/e-smith/db/configuration/defaults/phplist/type 2020-03-18 13:12:54.000000000 -0400 |
59 |
|
+++ smeserver-phplist-0.2.1/root/etc/e-smith/db/configuration/defaults/phplist/type 2022-08-02 22:37:07.129000000 -0400 |
60 |
|
@@ -1 +1 @@ |
61 |
|
-webapp |
62 |
|
+service |
63 |
|
diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/etc/e-smith/db/configuration/migrate/phplist-database smeserver-phplist-0.2.1/root/etc/e-smith/db/configuration/migrate/phplist-database |
64 |
|
--- smeserver-phplist-0.2.1.old/root/etc/e-smith/db/configuration/migrate/phplist-database 2020-03-18 13:12:54.000000000 -0400 |
65 |
|
+++ smeserver-phplist-0.2.1/root/etc/e-smith/db/configuration/migrate/phplist-database 2022-08-03 01:38:38.247000000 -0400 |
66 |
|
@@ -24,4 +24,29 @@ |
67 |
|
} |
68 |
|
$rec->set_prop('DbPassword', $pw); |
69 |
|
} |
70 |
|
+ my $apw = $rec->prop('AdminPass'); |
71 |
|
+ if (not $apw or length($apw) < 20){ |
72 |
|
+ use MIME::Base64 qw(encode_base64); |
73 |
|
+ $apw = "not set due to error"; |
74 |
|
+ if ( open( RANDOM, "/dev/urandom" ) ){ |
75 |
|
+ my $buf; |
76 |
|
+ # 57 bytes is a full line of Base64 coding, and contains |
77 |
|
+ # 456 bits of randomness - given a perfectly random /dev/random |
78 |
|
+ if ( read( RANDOM, $buf, 20 ) != 20 ){ |
79 |
|
+ warn("Short read from /dev/random: $!"); |
80 |
|
+ } |
81 |
|
+ else{ |
82 |
|
+ $apw = encode_base64($buf); |
83 |
|
+ chomp $apw; |
84 |
|
+ } |
85 |
|
+ close RANDOM; |
86 |
|
+ } |
87 |
|
+ else{ |
88 |
|
+ warn "Could not open /dev/urandom: $!"; |
89 |
|
+ } |
90 |
|
+ $rec->set_prop('AdminPass', $apw); |
91 |
|
+ } |
92 |
|
+ my $type = $rec->prop("type"); |
93 |
|
+ $rec->set_prop("type","service") unless ($type eq "service"); |
94 |
|
+ |
95 |
|
} |
96 |
|
diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/etc/e-smith/events/actions/phplist-initialise smeserver-phplist-0.2.1/root/etc/e-smith/events/actions/phplist-initialise |
97 |
|
--- smeserver-phplist-0.2.1.old/root/etc/e-smith/events/actions/phplist-initialise 1969-12-31 19:00:00.000000000 -0500 |
98 |
|
+++ smeserver-phplist-0.2.1/root/etc/e-smith/events/actions/phplist-initialise 2022-08-03 01:38:37.976000000 -0400 |
99 |
|
@@ -0,0 +1,6 @@ |
100 |
|
+#!/bin/bash |
101 |
|
+password=$(config getprop phplist AdminPass) |
102 |
|
+domain=$(config get DomainName) |
103 |
|
+ADMIN_PASSWORD=$password ADMIN_EMAIL=admin@$domain phplist -pinitialise |
104 |
|
+phplist -pdbcheck |
105 |
|
+phplist -pupgrade |
106 |
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 |
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 |
107 |
--- 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 |
--- 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 |
108 |
+++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2022-08-02 15:44:22.300000000 -0400 |
+++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2022-08-03 01:38:38.772000000 -0400 |
109 |
@@ -6,7 +6,7 @@ |
@@ -6,11 +6,12 @@ |
110 |
my $alias = $phplist{'AliasOnPrimary'} || 'enabled'; |
my $alias = $phplist{'AliasOnPrimary'} || 'enabled'; |
111 |
my $ver = $sysconfig{'ReleaseVersion'} || '8.1'; |
my $ver = $sysconfig{'ReleaseVersion'} || '8.1'; |
112 |
|
|
115 |
$alias = ($alias ne 'enabled') ? '' : 'Alias /lists /usr/share/phplist/www/'; |
$alias = ($alias ne 'enabled') ? '' : 'Alias /lists /usr/share/phplist/www/'; |
116 |
$auth = ( $auth eq 'http' ) ? 'AuthName "phplist"' . "\n" . |
$auth = ( $auth eq 'http' ) ? 'AuthName "phplist"' . "\n" . |
117 |
" AuthType Basic\n" . |
" AuthType Basic\n" . |
118 |
@@ -22,42 +22,37 @@ |
- " AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') . |
119 |
|
+ " AuthBasicProvider external\n". |
120 |
|
+ " AuthExternal pwauth\n". |
121 |
|
" require valid-user\n" : ''; |
122 |
|
|
123 |
|
if ($status eq 'enabled') { |
124 |
|
@@ -22,44 +23,45 @@ |
125 |
Options None +FollowSymLinks |
Options None +FollowSymLinks |
126 |
AllowOverride None |
AllowOverride None |
127 |
DirectoryIndex index.php |
DirectoryIndex index.php |
134 |
- php_admin_value session.save_path /var/lib/phplist/tmp |
- php_admin_value session.save_path /var/lib/phplist/tmp |
135 |
- php_admin_value upload_tmp_dir /var/lib/phplist/tmp |
- php_admin_value upload_tmp_dir /var/lib/phplist/tmp |
136 |
+ AddType application/x-httpd-php .php |
+ AddType application/x-httpd-php .php |
|
+# php_admin_value openbase_dir /usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist |
|
|
+# php_admin_flag file_uploads on |
|
|
+# php_admin_value upload_max_filesize 5M |
|
|
+# php_admin_value post_max_size 6M |
|
|
+# php_admin_value memory_limit 128M |
|
|
+# php_admin_value session.save_path /var/lib/phplist/tmp |
|
|
+# php_admin_value upload_tmp_dir /var/lib/phplist/tmp |
|
137 |
<FilesMatch "\\.(php|inc)\$"> |
<FilesMatch "\\.(php|inc)\$"> |
138 |
- Order allow,deny |
- Order allow,deny |
139 |
- deny from all |
- deny from all |
162 |
<FilesMatch "(index.php|connector.php|upload.php)\$"> |
<FilesMatch "(index.php|connector.php|upload.php)\$"> |
163 |
- Order allow,deny |
- Order allow,deny |
164 |
- allow from all |
- allow from all |
165 |
|
+ SetHandler "proxy:unix:/var/run/php-fpm/php80-phplist.sock|fcgi://localhost" |
166 |
+ Require all granted |
+ Require all granted |
167 |
</FilesMatch> |
</FilesMatch> |
168 |
- order deny,allow |
- order deny,allow |
169 |
- deny from all |
- deny from all |
170 |
- allow from $allow |
- allow from $allow |
171 |
- $auth |
- $auth |
172 |
|
+ SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 |
173 |
+ <RequireAll> |
+ <RequireAll> |
174 |
+ Require $allow |
+ Require $allow |
175 |
+ $auth |
+ $auth |
176 |
+ </RequireAll> |
+ </RequireAll> |
177 |
</Directory> |
</Directory> |
178 |
|
|
179 |
|
+<Directory /usr/share/phplist/www/admin/js> |
180 |
|
+ <RequireAny> |
181 |
|
+ Require $allow |
182 |
|
+ </RequireAny> |
183 |
|
+</Directory> |
184 |
|
+ |
185 |
|
+<Directory /usr/share/phplist/www/admin/ui> |
186 |
|
+ <RequireAny> |
187 |
|
+ Require $allow |
188 |
|
+ </RequireAny> |
189 |
|
+</Directory> |
190 |
|
|
191 |
|
EOF |
192 |
|
} |
193 |
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 |
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 |
194 |
--- 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 |
--- 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 |
195 |
+++ 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 |
+++ smeserver-phplist-0.2.1/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist 2022-08-03 01:38:39.035000000 -0400 |
196 |
@@ -0,0 +1,65 @@ |
@@ -0,0 +1,66 @@ |
197 |
+{ |
+{ |
198 |
+ |
+ |
199 |
+if ($PHP_VERSION eq '80'){ |
+if ($PHP_VERSION eq '80'){ |
203 |
+ my $memory_limit = ($phplist{MemoryLimit} || '128M'); |
+ my $memory_limit = ($phplist{MemoryLimit} || '128M'); |
204 |
+ $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); |
+ $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); |
205 |
+ my $open_basedir= $phplist{PHPBaseDir} || ''; |
+ my $open_basedir= $phplist{PHPBaseDir} || ''; |
206 |
+ $open_basedir = "/usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist:$open_basedir"; |
+ $open_basedir = "/usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist:/var/log/phplist:/usr/share/php/auth_translation.php:$open_basedir"; |
207 |
+ my $id = 'cacti'; |
+ my $id = 'phplist'; |
208 |
+ my $max_children = $phplist{'PHPmaxChildren'} || 20; |
+ my $max_children = $phplist{'PHPmaxChildren'} || 20; |
209 |
+ my $min_spare_servers = $phplist{'PHPminServers'} || 4; |
+ my $min_spare_servers = $phplist{'PHPminServers'} || 4; |
210 |
+ my $start_servers = $phplist{'PHPstartServers'} || 6; |
+ my $start_servers = $phplist{'PHPstartServers'} || 6; |
228 |
+pm.min_spare_servers = $min_spare_servers |
+pm.min_spare_servers = $min_spare_servers |
229 |
+pm.max_spare_servers = $max_spare_servers |
+pm.max_spare_servers = $max_spare_servers |
230 |
+pm.max_requests = $max_requests |
+pm.max_requests = $max_requests |
231 |
|
+php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php |
232 |
+php_admin_value[session.save_path] = /var/lib/php/$id/session |
+php_admin_value[session.save_path] = /var/lib/php/$id/session |
233 |
+php_admin_value[session.gc_maxlifetime] = 86400 |
+php_admin_value[session.gc_maxlifetime] = 86400 |
234 |
+php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache |
+php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache |
262 |
+} |
+} |
263 |
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 |
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 |
264 |
--- smeserver-phplist-0.2.1.old/root/usr/lib/systemd/system/phplist.service 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-phplist-0.2.1.old/root/usr/lib/systemd/system/phplist.service 1969-12-31 19:00:00.000000000 -0500 |
265 |
+++ smeserver-phplist-0.2.1/root/usr/lib/systemd/system/phplist.service 2022-08-02 15:34:42.017000000 -0400 |
+++ smeserver-phplist-0.2.1/root/usr/lib/systemd/system/phplist.service 2022-08-02 22:37:29.174000000 -0400 |
266 |
@@ -0,0 +1,13 @@ |
@@ -0,0 +1,13 @@ |
267 |
+[Unit] |
+[Unit] |
268 |
+Description=phplist process queues |
+Description=phplist process queues |
269 |
+After=network-online.target |
+After=network-online.target |
270 |
+ |
+ |
271 |
+[Service] |
+[Service] |
272 |
+ExecStartPre=/sbin/e-smith/service-status phplist |
+ExecStartPre=-/sbin/e-smith/service-status phplist |
273 |
+ExecStart=/usr/sbin/e-smith/systemd/phplist |
+ExecStart=/usr/sbin/e-smith/systemd/phplist |
274 |
+Restart=always |
+Restart=always |
275 |
+Restartsec=10s |
+Restartsec=10s |
277 |
+ |
+ |
278 |
+[Install] |
+[Install] |
279 |
+WantedBy=sme-server.target |
+WantedBy=sme-server.target |
280 |
|
diff -Nur --no-dereference smeserver-phplist-0.2.1.old/root/usr/local/bin/phplist smeserver-phplist-0.2.1/root/usr/local/bin/phplist |
281 |
|
--- smeserver-phplist-0.2.1.old/root/usr/local/bin/phplist 1969-12-31 19:00:00.000000000 -0500 |
282 |
|
+++ smeserver-phplist-0.2.1/root/usr/local/bin/phplist 2022-08-03 01:38:37.727000000 -0400 |
283 |
|
@@ -0,0 +1,2 @@ |
284 |
|
+#!/bin/bash |
285 |
|
+/usr/bin/php80 /usr/share/phplist/www/admin/index.php -c /etc/phplist/config.php $* |
286 |
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 |
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 |
287 |
--- smeserver-phplist-0.2.1.old/root/usr/sbin/e-smith/systemd/phplist 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-phplist-0.2.1.old/root/usr/sbin/e-smith/systemd/phplist 1969-12-31 19:00:00.000000000 -0500 |
288 |
+++ smeserver-phplist-0.2.1/root/usr/sbin/e-smith/systemd/phplist 2020-03-18 13:12:54.000000000 -0400 |
+++ smeserver-phplist-0.2.1/root/usr/sbin/e-smith/systemd/phplist 2022-08-03 01:38:38.509000000 -0400 |
289 |
@@ -0,0 +1,10 @@ |
@@ -0,0 +1,10 @@ |
290 |
+#!/bin/sh |
+#!/bin/sh |
291 |
+ |
+ |
292 |
+exec 2>&1 |
+exec 2>&1 |
293 |
+ |
+ |
294 |
+cd /usr/share/phplist/bin |
+cd /usr/local/bin/ |
295 |
+while true; do |
+while true; do |
296 |
+ /usr/local/bin/setuidgid www ./phplist -pprocessbounces |
+ /usr/local/bin/setuidgid www ./phplist -pprocessbounces |
297 |
+ /usr/local/bin/setuidgid www ./phplist -pprocessqueue |
+ /usr/local/bin/setuidgid www ./phplist -pprocessqueue |