diff -Nur --no-dereference smeserver-phplist-0.2.1.old/createlinks smeserver-phplist-0.2.1/createlinks --- smeserver-phplist-0.2.1.old/createlinks 2020-03-18 13:12:54.000000000 -0400 +++ smeserver-phplist-0.2.1/createlinks 2022-08-02 22:02:43.291000000 -0400 @@ -6,7 +6,7 @@ templates2events("/etc/phplist/config.php", qw/webapps-update bootstrap-console-save/); safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/webapps-update/S55phplist-qmail-assign"); -foreach my $event (qw/webapps-update ipasserelle-update bootstrap-ldap-save/){ +foreach my $event (qw/webapps-update bootstrap-ldap-save/){ event_link("phplist-create-pseudo", "$event", "55"); } @@ -15,13 +15,36 @@ safe_symlink("/var/qmail/alias/.qmail-phplistbounces", "root/var/qmail/alias/.qmail-phplistbounces-default"); -safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/phplist'); -safe_symlink("/var/service/phplist" , 'root/service/phplist'); -safe_touch("root/var/service/phplist/down"); safe_symlink("restart", "root/etc/e-smith/events/webapps-update/services2adjust/phplist"); -service_link_enhanced('phplist', 'S98', '7'); -service_link_enhanced('phplist', 'K12', '6'); -service_link_enhanced('phplist', 'K12', '0'); safe_touch("root/var/lib/phplist/bounces.mbox"); + +my $event="smeserver-phplist-update"; +event_templates($event, qw( +/etc/httpd/conf/httpd.conf +/etc/opt/remi/php80/php-fpm.d/www.conf +/etc/e-smith/sql/init/phplistdb +/etc/phplist/config.php +/etc/e-smith/sql/init/phplistdb +)); + +event_services($event, qw( + php80-php-fpm restart + httpd-e-smith restart + phplist restart + mysql.init restart +)); +safe_symlink("/var/qmail/bin/qmail-newu", "root/etc/e-smith/events/$event/S55phplist-qmail-assign"); + +event_actions($event, qw( + phplist-create-pseudo 55 + systemd-default 88 + systemd-reload 89 +)); + +use esmith::Build::Backup qw(:all); +backup_includes("smeserver-phplist-udpdate", qw( +/var/lib/phplist +/var/log/phplist +)); 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 --- 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/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phplist 2022-08-02 22:03:20.751000000 -0400 @@ -6,11 +6,12 @@ my $alias = $phplist{'AliasOnPrimary'} || 'enabled'; my $ver = $sysconfig{'ReleaseVersion'} || '8.1'; -my $allow = ( $access eq 'public' ) ? 'all' : "$localAccess $externalSSLAccess"; +my $allow = ( $access eq 'public' ) ? 'all granted' : "ip $localAccess $externalSSLAccess"; $alias = ($alias ne 'enabled') ? '' : 'Alias /lists /usr/share/phplist/www/'; $auth = ( $auth eq 'http' ) ? 'AuthName "phplist"' . "\n" . " AuthType Basic\n" . - " AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') . + " AuthBasicProvider external\n" . + " AuthExternal pwauth\n" . " require valid-user\n" : ''; if ($status eq 'enabled') { @@ -22,42 +23,30 @@ Options None +FollowSymLinks AllowOverride None DirectoryIndex index.php - AddType application/x-httpd-php .php .php3 - 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 + AddType application/x-httpd-php .php - Order allow,deny - deny from all + Require all denied - Order allow,deny - allow from all + Require all granted + SetHandler "proxy:unix:/var/run/php-fpm/php80-phplist.sock|fcgi://localhost" - Order deny,allow - deny from all - allow from $allow + Require $allow # Admin section SSLRequireSSL on - Order allow,deny - Deny from all + Require all denied - Order allow,deny - allow from all + Require all granted - order deny,allow - deny from all - allow from $allow - $auth + + Require $allow + $auth + 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 --- 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/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phplist 2022-08-02 21:50:33.405000000 -0400 @@ -0,0 +1,65 @@ +{ + +if ($PHP_VERSION eq '80'){ + if (($phplist{'status'} || 'disabled') eq 'enabled'){ + my $max_upload_size = ($phplist{MaxUploadSize} || '6M'); + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); + my $memory_limit = ($phplist{MemoryLimit} || '128M'); + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); + my $open_basedir= $phplist{PHPBaseDir} || ''; + $open_basedir = "/usr/share/phplist:/var/lib/phplist:/tmp:/etc/phplist:$open_basedir"; + my $id = 'phplist'; + my $max_children = $phplist{'PHPmaxChildren'} || 20; + my $min_spare_servers = $phplist{'PHPminServers'} || 4; + my $start_servers = $phplist{'PHPstartServers'} || 6; + my $max_spare_servers = $phplist{'PHPmaxServers'} || 8; + my $max_requests = $phplist{'PHPmaxRequests'} || 1000; + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers; + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers; + + $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 = $max_children +pm.start_servers = $start_servers +pm.min_spare_servers = $min_spare_servers +pm.max_spare_servers = $max_spare_servers +pm.max_requests = $max_requests +php_admin_value[session.save_path] = /var/lib/php/$id/session +php_admin_value[session.gc_maxlifetime] = 86400 +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/phplist/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] = $memory_limit +php_admin_value[max_execution_time] = 3600 +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, dl, passthru, phpinfo, escapeshellarg, escapeshellcmd +php_admin_value[open_basedir] = $open_basedir +php_admin_flag[allow_url_fopen] = on +php_admin_flag[file_uploads] = 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 .= '; phplist is disabled'; + } +} +} 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 --- 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/root/usr/lib/systemd/system/phplist.service 2022-08-02 15:34:42.017000000 -0400 @@ -0,0 +1,13 @@ +[Unit] +Description=phplist process queues +After=network-online.target + +[Service] +ExecStartPre=/sbin/e-smith/service-status phplist +ExecStart=/usr/sbin/e-smith/systemd/phplist +Restart=always +Restartsec=10s +RemainAfterExit=yes + +[Install] +WantedBy=sme-server.target 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 --- 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/root/usr/sbin/e-smith/systemd/phplist 2020-03-18 13:12:54.000000000 -0400 @@ -0,0 +1,10 @@ +#!/bin/sh + +exec 2>&1 + +cd /usr/share/phplist/bin +while true; do + /usr/local/bin/setuidgid www ./phplist -pprocessbounces + /usr/local/bin/setuidgid www ./phplist -pprocessqueue + sleep 120 +done 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 --- smeserver-phplist-0.2.1.old/root/var/service/phplist/run 2020-03-18 13:12:54.000000000 -0400 +++ smeserver-phplist-0.2.1/root/var/service/phplist/run 1969-12-31 19:00:00.000000000 -0500 @@ -1,10 +0,0 @@ -#!/bin/sh - -exec 2>&1 - -cd /usr/share/phplist/bin -while true; do - /usr/local/bin/setuidgid www ./phplist -pprocessbounces - /usr/local/bin/setuidgid www ./phplist -pprocessqueue - sleep 120 -done