/[smecontribs]/rpms/smeserver-roundcube/contribs10/smeserver-roundcube-1.2-bz12489-bz12263.patch
ViewVC logotype

Annotation of /rpms/smeserver-roundcube/contribs10/smeserver-roundcube-1.2-bz12489-bz12263.patch

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


Revision 1.1 - (hide annotations) (download)
Sat Feb 24 17:37:05 2024 UTC (8 months, 1 week ago) by jpp
Branch: MAIN
* Sat Feb 24 2024 Jean-Philippe Pialasse <tests@pialasse.com> 1.2-20.sme
- add nextcloud_attachements plugin support [SME: 12489]
  TODO template the file /usr/share/roundcubemail/plugins/nextcloud_attachments/config.inc.php
- simplify access setting using access(private,public)/status [SME: 12263]
- Requires roundcube >= 1.6
  up to php81,   add dedicated php pool
  using update event to config plugins

1 jpp 1.1 diff -Nur --no-dereference smeserver-roundcube-1.2.old/createlinks smeserver-roundcube-1.2/createlinks
2     --- smeserver-roundcube-1.2.old/createlinks 2024-02-24 09:22:05.481000000 -0500
3     +++ smeserver-roundcube-1.2/createlinks 2024-02-24 12:24:54.824000000 -0500
4     @@ -8,7 +8,8 @@
5     #see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
6    
7     foreach my $file (qw(
8     - /etc/systemd/system-preset/49-koozali.preset
9     + /etc/systemd/system-preset/49-koozali.preset
10     + /etc/httpd/conf/httpd.conf
11     ))
12     {
13     templates2events( $file, $event );
14     @@ -38,6 +39,7 @@
15     templates2events("/usr/share/roundcubemail/plugins/managesieve/config.inc.php", $event);
16     templates2events("/etc/roundcubemail/config.inc.php", $event);
17     templates2events("/etc/e-smith/sql/init/80roundcube", $event);
18     +
19     }
20    
21     #restart specific services to avoid to reboot after the installation
22     @@ -47,8 +49,10 @@
23     roundcube-update
24     ))
25     {
26     + templates2events("/etc/opt/remi/php81/php-fpm.d/www.conf",$event);
27     templates2events("/etc/httpd/conf/httpd.conf", $event);
28     templates2events("/etc/dovecot/dovecot.conf", $event);
29     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/php81-php-fpm");
30     safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
31     safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
32     safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dovecot");
33     @@ -64,6 +68,7 @@
34     ))
35     {
36     event_link("qmail-update-user", $event, "20");
37     + event_link("roundcube-conf", $event, "20");
38     }
39     safe_symlink("/usr/share/php/Net/LDAP3","root/usr/share/pear/Net/LDAP3");
40     safe_symlink("/usr/share/php/Net/LDAP3.php","root/usr/share/pear/Net/LDAP3.php");
41     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
42     --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/access 1969-12-31 19:00:00.000000000 -0500
43     +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/access 2024-02-24 11:59:38.299000000 -0500
44     @@ -0,0 +1 @@
45     +public
46     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
47     --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList 2024-02-24 09:22:05.478000000 -0500
48     +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PluginsList 2024-02-24 11:31:22.111000000 -0500
49     @@ -1 +1 @@
50     -globaladdressbook,contextmenu,markasjunk,vcard_attachments,newmail_notifier,emoticons,managesieve
51     +globaladdressbook,contextmenu,markasjunk,vcard_attachments,newmail_notifier,emoticons,managesieve,nextcloud_attachments
52     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
53     --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess 2015-04-01 20:05:54.000000000 -0400
54     +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/defaults/roundcube/PublicAccess 1969-12-31 19:00:00.000000000 -0500
55     @@ -1 +0,0 @@
56     -global
57     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
58     --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube 2015-04-01 20:05:54.000000000 -0400
59     +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube 2024-02-24 11:45:39.162000000 -0500
60     @@ -3,6 +3,15 @@
61    
62     my $rec = $DB->get('roundcube') || $DB->new_record('roundcube', {type => 'service'});
63    
64     +# migrate PublicAccess to access
65     + if ( my $PublicAccess = $DB->get_prop_and_delete('roundcube','PublicAccess') ) {
66     + $DB->set_prop('roundcube','access', "private");
67     + $DB->set_prop('roundcube','access', "public") if ($PublicAccess =~ /global/);
68     + $DB->set_prop('roundcube','status', "disabled") if ($PublicAccess == "none");
69     + }
70     +
71     +
72     +
73     my $pw = $rec->prop('DbPassword');
74     return "" if $pw;
75    
76     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
77     --- smeserver-roundcube-1.2.old/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration 2024-02-24 09:22:05.479000000 -0500
78     +++ smeserver-roundcube-1.2/root/etc/e-smith/db/configuration/migrate/80roundcube_Plugins_Migration 2024-02-24 11:31:03.956000000 -0500
79     @@ -6,6 +6,12 @@
80    
81     return unless ($plugins ne '');
82    
83     +#nextcloud_attachements is used
84     +if ($plugins !~ 'nextcloud_attachments')
85     + {
86     + $plugins = $plugins.',nextcloud_attachments';
87     + $cdb->set_prop('roundcube','PluginsList',"$plugins");
88     + }
89     #sieverule is now used instead of
90     if ($plugins !~ 'managesieve')
91     {
92     @@ -18,35 +24,30 @@
93     $plugins =~ s/,sieverule//g;
94     $cdb->set_prop('roundcube','PluginsList',"$plugins");
95     }
96     -
97     # markasjunk2 deprecated
98     if ($plugins =~ 'markasjunk')
99     {
100     $plugins =~ s/markasjunk2/markasjunk/g;
101     $cdb->set_prop('roundcube','PluginsList',"$plugins");
102     }
103     -
104     #Carddav is a really bad plugin, when available it will become usefull
105     if ($plugins =~ 'carddav')
106     {
107     $plugins =~ s/,carddav//g;
108     $cdb->set_prop('roundcube','PluginsList',"$plugins");
109     }
110     -
111     #remove calendar
112     if ($plugins =~ 'calendar')
113     {
114     $plugins =~ s/,calendar//g;
115     $cdb->set_prop('roundcube','PluginsList',"$plugins");
116     }
117     -
118     #remove libcalendaring
119     if ($plugins =~ 'libcalendaring')
120     {
121     $plugins =~ s/,libcalendaring//g;
122     $cdb->set_prop('roundcube','PluginsList',"$plugins");
123     }
124     -
125     #remove tasklist
126     if ($plugins =~ 'tasklist')
127     {
128     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
129     --- smeserver-roundcube-1.2.old/root/etc/e-smith/events/actions/roundcube-conf 1969-12-31 19:00:00.000000000 -0500
130     +++ smeserver-roundcube-1.2/root/etc/e-smith/events/actions/roundcube-conf 2024-02-24 12:23:40.761000000 -0500
131     @@ -0,0 +1,2 @@
132     +#!/bin/bash
133     +/usr/bin/rcplugin_update.sh
134     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
135     --- smeserver-roundcube-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube 2024-02-24 09:22:05.466000000 -0500
136     +++ smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92roundcube 2024-02-24 11:53:20.478000000 -0500
137     @@ -4,49 +4,17 @@
138     unless $status eq 'enabled';
139    
140     $OUT = "";
141     - my $allow = 'all granted';
142     - my $pass = '0';
143     + my $allow = "ip $localAccess";
144     my $satisfy = 'all';
145     my $name = $roundcube{'Name'} || 'RoundCube IMAP Client';
146     + my $version = 81; # php version to use
147    
148     for ('exit-if-none')
149     {
150     - if ($roundcube{'PublicAccess'})
151     + if ( (exists($roundcube{'access'}) && ($roundcube{'access'} eq 'public') )
152     {
153     - if ($roundcube{'PublicAccess'} eq 'none')
154     - {
155     - next;
156     - }
157     - elsif ($roundcube{'PublicAccess'} eq 'local')
158     - {
159     - $allow = "ip $localAccess";
160     - $pass = 0;
161     - $satisfy = 'all';
162     - }
163     - elsif ($roundcube{'PublicAccess'} eq 'local-pw')
164     - {
165     - $allow = "ip $localAccess";
166     - $pass = 1;
167     - $satisfy = 'all';
168     - }
169     - elsif ($roundcube{'PublicAccess'} eq 'global')
170     - {
171     $allow = 'all granted';
172     - $pass = 0;
173     $satisfy = 'all';
174     - }
175     - elsif ($roundcube{'PublicAccess'} eq 'global-pw')
176     - {
177     - $allow = 'all granted';
178     - $pass = 1;
179     - $satisfy = 'all';
180     - }
181     - elsif ($roundcube{'PublicAccess'} eq 'global-pw-remote')
182     - {
183     - $allow = "ip $localAccess";
184     - $pass = 1;
185     - $satisfy = 'any';
186     - }
187     }
188    
189     $OUT .= "#------------------------------------------------------------\n";
190     @@ -64,30 +32,15 @@
191     $OUT .= "\n";
192     $OUT .= "<Directory /usr/share/roundcubemail>\n";
193     $OUT .= " Require $allow\n";
194     -
195     - if ($pass)
196     - {
197     - $OUT .= " AuthName \"$name\"\n";
198     - $OUT .= " AuthBasicProvider external\n";
199     - $OUT .= " AuthType Basic\n";
200     - $OUT .= " AuthExternal pwauth\n";
201     - $OUT .= " require valid-user\n";
202     - $OUT .= " Satisfy $satisfy\n";
203     - }
204     - $OUT .= " AddType application/x-httpd-php .php\n";
205     - $version = 74;
206     - $OUT .= "<FilesMatch \.php\$\>\n";
207     - $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n";
208     - $OUT .= "</FilesMatch>\n";
209     -# $OUT .= " php_admin_value eaccelerator.enable 1\n";
210     - $OUT .= "</Directory>\n";
211     -
212     + $OUT .= " AddType application/x-httpd-php .php\n";
213     + $OUT .= "<FilesMatch \.php\$\>\n";
214     + $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version-roundcube.sock|fcgi://localhost\"\n";
215     + $OUT .= "</FilesMatch>\n";
216     + $OUT .= "</Directory>\n";
217     $OUT .= qq (
218     <Directory /usr/share/roundcubemail/installer/>
219     Require all denied
220     </Directory>
221     );
222     -
223     -
224     }
225     }
226     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
227     --- 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
228     +++ smeserver-roundcube-1.2/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15roundcube 2024-02-24 11:22:54.752000000 -0500
229     @@ -0,0 +1,67 @@
230     +{
231     + my $phpversion="81";
232     +
233     +if ($PHP_VERSION eq $phpversion){
234     + if (($roundcube{'status'} || 'disabled') eq 'enabled'){
235     + my $max_upload_size = ($roundcube{MaxUploadSize} || '100M');
236     + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
237     + my $memory_limit = ($roundcube{MemoryLimit} || '512M');
238     + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
239     + my $open_basedir= $roundcube{PHPBaseDir} || '';
240     + $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";
241     + my $id = 'roundcube';
242     + my $max_children = $roundcube{'PHPmaxChildren'} || 20;
243     + my $min_spare_servers = $roundcube{'PHPminServers'} || 4;
244     + my $start_servers = $roundcube{'PHPstartServers'} || 6;
245     + my $max_spare_servers = $roundcube{'PHPmaxServers'} || 8;
246     + my $max_requests = $roundcube{'PHPmaxRequests'} || 1000;
247     + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
248     + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
249     +
250     + $OUT .=<<_EOF;
251     +
252     +[php$PHP_VERSION-$id]
253     +user = www
254     +group = www
255     +listen.owner = root
256     +listen.group = www
257     +listen.mode = 0660
258     +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock
259     +pm = dynamic
260     +pm.max_children = $max_children
261     +pm.start_servers = $start_servers
262     +pm.min_spare_servers = $min_spare_servers
263     +pm.max_spare_servers = $max_spare_servers
264     +pm.max_requests = $max_requests
265     +php_admin_value[sys_temp_dir] = /var/lib/php/$id/tmp
266     +php_admin_value[session.save_path] = /var/lib/php/$id/session
267     +php_admin_value[session.gc_maxlifetime] = 86400
268     +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp
269     +php_admin_value[error_log] = /var/log/php/$id/error.log
270     +slowlog = /var/log/php/roundcube/slow.log
271     +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName }
272     +php_admin_flag[display_errors] = off
273     +php_admin_flag[log_errors] = on
274     +php_admin_value[error_log] = syslog
275     +php_admin_value[memory_limit] = $memory_limit
276     +php_admin_value[max_execution_time] = 3600
277     +php_admin_value[post_max_size] = $max_upload_size
278     +php_admin_value[upload_max_filesize] = $max_upload_size
279     +php_admin_value[disable_functions] = system, show_source, symlink, dl, passthru
280     +php_admin_value[open_basedir] = $open_basedir
281     +php_admin_flag[allow_url_fopen] = on
282     +php_admin_flag[file_upload] = on
283     +php_admin_flag[session.cookie_httponly] = on
284     +php_admin_flag[allow_url_include] = off
285     +php_admin_value[session.save_handler] = files
286     +php_admin_flag[output_buffering] = off
287     +
288     +_EOF
289     +
290     + }
291     + else{
292     + $OUT .= '; RoudnCube is disabled';
293     + }
294     +}
295     +}
296     +
297     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
298     --- smeserver-roundcube-1.2.old/root/usr/bin/rcplugin_update.sh 2024-02-24 09:22:05.482000000 -0500
299     +++ smeserver-roundcube-1.2/root/usr/bin/rcplugin_update.sh 2024-02-24 11:27:35.284000000 -0500
300     @@ -1,19 +1,20 @@
301     #!/bin/bash
302     -/sbin/e-smith/db configuration setprop php AllowUrlFopen On
303     -/sbin/e-smith/expand-template /etc/php.ini
304     -/etc/init.d/httpd-e-smith restart >/dev/null 2>&1
305     +/sbin/e-smith/db configuration setprop php81 AllowUrlFopen On
306     +/sbin/e-smith/expand-template /etc/opt/remi/php81/php.ini
307     +/usr/bin/systemctl restart php81-php-fpm >/dev/null 2>&1
308     +#/etc/init.d/httpd-e-smith restart >/dev/null 2>&1
309     pathroundcube=$(pwd)
310    
311     cd /usr/share/roundcubemail
312     -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require johndoh/contextmenu --with-dependencies
313     -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require johndoh/globaladdressbook ~2.1 --with-dependencies
314     -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer require roundcube/larry ~1.6.0 --with-dependencies
315     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require johndoh/contextmenu --with-dependencies
316     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require johndoh/globaladdressbook ~2.1 --with-dependencies
317     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require roundcube/larry ~1.6.0 --with-dependencies
318     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer require bennet0496/nextcloud_attachments --with-dependencies
319    
320     -
321     -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer self-update
322     -COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php74 /usr/local/bin/composer update --with-dependencies
323     -/sbin/e-smith/db configuration setprop php74 AllowUrlFopen off
324     -/sbin/e-smith/expand-template /etc/opt/remi/php74/php.ini
325     -/usr/bin/systemctl restart php74-php-fpm >/dev/null 2>&1
326     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer self-update
327     +COMPOSER_ALLOW_SUPERUSER=1 /usr/bin/php81 /usr/local/bin/composer update --with-dependencies
328     +/sbin/e-smith/db configuration setprop php81 AllowUrlFopen off
329     +/sbin/e-smith/expand-template /etc/opt/remi/php81/php.ini
330     +/usr/bin/systemctl restart php81-php-fpm >/dev/null 2>&1
331     cd $pathroundcube
332    

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