diff -Nur --no-dereference smeserver-roundcube-1.2.old/createlinks smeserver-roundcube-1.2/createlinks --- smeserver-roundcube-1.2.old/createlinks 2024-02-24 09:22:05.481000000 -0500 +++ smeserver-roundcube-1.2/createlinks 2024-02-24 12:24:54.824000000 -0500 @@ -8,7 +8,8 @@ #see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event foreach my $file (qw( - /etc/systemd/system-preset/49-koozali.preset + /etc/systemd/system-preset/49-koozali.preset + /etc/httpd/conf/httpd.conf )) { templates2events( $file, $event ); @@ -38,6 +39,7 @@ templates2events("/usr/share/roundcubemail/plugins/managesieve/config.inc.php", $event); templates2events("/etc/roundcubemail/config.inc.php", $event); templates2events("/etc/e-smith/sql/init/80roundcube", $event); + } #restart specific services to avoid to reboot after the installation @@ -47,8 +49,10 @@ roundcube-update )) { + templates2events("/etc/opt/remi/php81/php-fpm.d/www.conf",$event); templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/dovecot/dovecot.conf", $event); + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/php81-php-fpm"); safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dovecot"); @@ -64,6 +68,7 @@ )) { event_link("qmail-update-user", $event, "20"); + event_link("roundcube-conf", $event, "20"); } safe_symlink("/usr/share/php/Net/LDAP3","root/usr/share/pear/Net/LDAP3"); safe_symlink("/usr/share/php/Net/LDAP3.php","root/usr/share/pear/Net/LDAP3.php"); diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/access smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/access --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/access 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/access 2024-02-24 11:59:38.299000000 -0500 @@ -0,0 +1 @@ +public diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList 2024-02-24 09:22:05.478000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList 2024-02-24 11:31:22.111000000 -0500 @@ -1 +1 @@ -globaladdressbook,contextmenu,markasjunk,vcard_attachments,newmail_notifier,emoticons,managesieve +globaladdressbook,contextmenu,markasjunk,vcard_attachments,newmail_notifier,emoticons,managesieve,nextcloud_attachments diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess 2015-04-01 20:05:54.000000000 -0400 +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ -global diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube 2015-04-01 20:05:54.000000000 -0400 +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube 2024-02-24 11:45:39.162000000 -0500 @@ -3,6 +3,15 @@ my $rec = $DB->get('roundcube') || $DB->new_record('roundcube', {type => 'service'}); +# migrate PublicAccess to access + if ( my $PublicAccess = $DB->get_prop_and_delete('roundcube','PublicAccess') ) { + $DB->set_prop('roundcube','access', "private"); + $DB->set_prop('roundcube','access', "public") if ($PublicAccess =~ /global/); + $DB->set_prop('roundcube','status', "disabled") if ($PublicAccess == "none"); + } + + + my $pw = $rec->prop('DbPassword'); return "" if $pw; diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration 2024-02-24 09:22:05.479000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration 2024-02-24 11:31:03.956000000 -0500 @@ -6,6 +6,12 @@ return unless ($plugins ne ''); +#nextcloud_attachements is used +if ($plugins !~ 'nextcloud_attachments') + { + $plugins = $plugins.',nextcloud_attachments'; + $cdb->set_prop('roundcube','PluginsList',"$plugins"); + } #sieverule is now used instead of if ($plugins !~ 'managesieve') { @@ -18,35 +24,30 @@ $plugins =~ s/,sieverule//g; $cdb->set_prop('roundcube','PluginsList',"$plugins"); } - # markasjunk2 deprecated if ($plugins =~ 'markasjunk') { $plugins =~ s/markasjunk2/markasjunk/g; $cdb->set_prop('roundcube','PluginsList',"$plugins"); } - #Carddav is a really bad plugin, when available it will become usefull if ($plugins =~ 'carddav') { $plugins =~ s/,carddav//g; $cdb->set_prop('roundcube','PluginsList',"$plugins"); } - #remove calendar if ($plugins =~ 'calendar') { $plugins =~ s/,calendar//g; $cdb->set_prop('roundcube','PluginsList',"$plugins"); } - #remove libcalendaring if ($plugins =~ 'libcalendaring') { $plugins =~ s/,libcalendaring//g; $cdb->set_prop('roundcube','PluginsList',"$plugins"); } - #remove tasklist if ($plugins =~ 'tasklist') { diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/events/actions/roundcube-conf smeserver-roundcube-1.2/root/etc/e-smith/events/actions/roundcube-conf --- smeserver-roundcube-1.2.old/root/etc/e-smith/events/actions/roundcube-conf 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/events/actions/roundcube-conf 2024-02-24 12:23:40.761000000 -0500 @@ -0,0 +1,2 @@ +#!/bin/bash +/usr/bin/rcplugin_update.sh diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube --- smeserver-roundcube-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube 2024-02-24 09:22:05.466000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube 2024-02-24 11:53:20.478000000 -0500 @@ -4,49 +4,17 @@ unless $status eq 'enabled'; $OUT = ""; - my $allow = 'all granted'; - my $pass = '0'; + my $allow = "ip $localAccess"; my $satisfy = 'all'; my $name = $roundcube{'Name'} || 'RoundCube IMAP Client'; + my $version = 81; # php version to use for ('exit-if-none') { - if ($roundcube{'PublicAccess'}) + if ( (exists($roundcube{'access'}) && ($roundcube{'access'} eq 'public') ) { - if ($roundcube{'PublicAccess'} eq 'none') - { - next; - } - elsif ($roundcube{'PublicAccess'} eq 'local') - { - $allow = "ip $localAccess"; - $pass = 0; - $satisfy = 'all'; - } - elsif ($roundcube{'PublicAccess'} eq 'local-pw') - { - $allow = "ip $localAccess"; - $pass = 1; - $satisfy = 'all'; - } - elsif ($roundcube{'PublicAccess'} eq 'global') - { $allow = 'all granted'; - $pass = 0; $satisfy = 'all'; - } - elsif ($roundcube{'PublicAccess'} eq 'global-pw') - { - $allow = 'all granted'; - $pass = 1; - $satisfy = 'all'; - } - elsif ($roundcube{'PublicAccess'} eq 'global-pw-remote') - { - $allow = "ip $localAccess"; - $pass = 1; - $satisfy = 'any'; - } } $OUT .= "#------------------------------------------------------------\n"; @@ -64,30 +32,15 @@ $OUT .= "\n"; $OUT .= "\n"; $OUT .= " Require $allow\n"; - - if ($pass) - { - $OUT .= " AuthName \"$name\"\n"; - $OUT .= " AuthBasicProvider external\n"; - $OUT .= " AuthType Basic\n"; - $OUT .= " AuthExternal pwauth\n"; - $OUT .= " require valid-user\n"; - $OUT .= " Satisfy $satisfy\n"; - } - $OUT .= " AddType application/x-httpd-php .php\n"; - $version = 74; - $OUT .= "\n"; - $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n"; - $OUT .= "\n"; -# $OUT .= " php_admin_value eaccelerator.enable 1\n"; - $OUT .= "\n"; - + $OUT .= " AddType application/x-httpd-php .php\n"; + $OUT .= "\n"; + $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version-roundcube.sock|fcgi://localhost\"\n"; + $OUT .= "\n"; + $OUT .= "\n"; $OUT .= qq ( Require all denied ); - - } } diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15roundcube smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15roundcube --- smeserver-roundcube-1.2.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15roundcube 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15roundcube 2024-02-24 11:22:54.752000000 -0500 @@ -0,0 +1,67 @@ +{ + my $phpversion="81"; + +if ($PHP_VERSION eq $phpversion){ + if (($roundcube{'status'} || 'disabled') eq 'enabled'){ + my $max_upload_size = ($roundcube{MaxUploadSize} || '100M'); + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); + my $memory_limit = ($roundcube{MemoryLimit} || '512M'); + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); + my $open_basedir= $roundcube{PHPBaseDir} || ''; + $open_basedir = "/usr/share/roundcube:/var/lib/roundcube:/var/log/roundcube.log:/var/lib/php/roundcube:/home/e-smith/files/roundcube:/dev/urandom:/proc/meminfo:/usr/share/GeoIP/GeoLite2-Country.mmdb:/proc/cpuinfo:$open_basedir"; + my $id = 'roundcube'; + my $max_children = $roundcube{'PHPmaxChildren'} || 20; + my $min_spare_servers = $roundcube{'PHPminServers'} || 4; + my $start_servers = $roundcube{'PHPstartServers'} || 6; + my $max_spare_servers = $roundcube{'PHPmaxServers'} || 8; + my $max_requests = $roundcube{'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[sys_temp_dir] = /var/lib/php/$id/tmp +php_admin_value[session.save_path] = /var/lib/php/$id/session +php_admin_value[session.gc_maxlifetime] = 86400 +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/roundcube/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 +php_admin_value[open_basedir] = $open_basedir +php_admin_flag[allow_url_fopen] = on +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 .= '; RoudnCube is disabled'; + } +} +} + diff -Nur --no-dereference smeserver-roundcube-1.2.old/root/usr/bin/rcplugin_update.sh smeserver-roundcube-1.2/root/usr/bin/rcplugin_update.sh --- smeserver-roundcube-1.2.old/root/usr/bin/rcplugin_update.sh 2024-02-24 09:22:05.482000000 -0500 +++ smeserver-roundcube-1.2/root/usr/bin/rcplugin_update.sh 2024-02-24 11:27:35.284000000 -0500 @@ -1,19 +1,20 @@ #!/bin/bash -/sbin/e-smith/db configuration setprop php AllowUrlFopen On -/sbin/e-smith/expand-template /etc/php.ini -/etc/init.d/httpd-e-smith restart >/dev/null 2>&1 +/sbin/e-smith/db configuration setprop php81 AllowUrlFopen On +/sbin/e-smith/expand-template /etc/opt/remi/php81/php.ini +/usr/bin/systemctl restart php81-php-fpm >/dev/null 2>&1 +#/etc/init.d/httpd-e-smith restart >/dev/null 2>&1 pathroundcube=$(pwd) cd /usr/share/roundcubemail -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require johndoh/contextmenu --with-dependencies -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require johndoh/globaladdressbook ~2.1 --with-dependencies -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require roundcube/larry ~1.6.0 --with-dependencies +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require johndoh/contextmenu --with-dependencies +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require johndoh/globaladdressbook ~2.1 --with-dependencies +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require roundcube/larry ~1.6.0 --with-dependencies +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require bennet0496/nextcloud_attachments --with-dependencies - -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer self-update -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer update --with-dependencies -/sbin/e-smith/db configuration setprop php74 AllowUrlFopen off -/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini -/usr/bin/systemctl restart php74-php-fpm >/dev/null 2>&1 +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer self-update +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer update --with-dependencies +/sbin/e-smith/db configuration setprop php81 AllowUrlFopen off +/sbin/e-smith/expand-template /etc/opt/remi/php81/php.ini +/usr/bin/systemctl restart php81-php-fpm >/dev/null 2>&1 cd $pathroundcube