/[smecontribs]/rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12329-bz12298-bz12339-bz12401.patch
ViewVC logotype

Contents of /rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12329-bz12298-bz12339-bz12401.patch

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


Revision 1.2 - (show annotations) (download)
Sun Sep 10 03:33:50 2023 UTC (7 months, 3 weeks ago) by jpp
Branch: MAIN
CVS Tags: smeserver-nextcloud-1_2_0-29_el7_sme, smeserver-nextcloud-1_2_0-30_el7_sme, smeserver-nextcloud-1_2_0-28_el7_sme, HEAD
Changes since 1.1: +1 -1 lines
* Sat Sep 09 2023 John Crisp <jcrisp@safeandsoundit.co.uk> 1.2.0-27.sme
- Fix syntax error in 20opcache.ini [SME: 12298]

1 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/createlinks smeserver-nextcloud-1.2.0/createlinks
2 --- smeserver-nextcloud-1.2.0.old/createlinks 2023-08-07 23:05:23.866000000 -0400
3 +++ smeserver-nextcloud-1.2.0/createlinks 2023-08-17 23:52:20.453000000 -0400
4 @@ -2,20 +2,23 @@
5 use esmith::Build::CreateLinks qw(:all);
6
7 event_actions("nextcloud-update", qw(
8 - nextcloud-conf 20
9 + nextcloud-conf 04
10 nextcloud-occ-conf 30
11 ));
12
13 event_templates("nextcloud-update", qw(
14 /etc/httpd/conf/httpd.conf
15 /etc/opt/remi/php74/php.d/20-opcache.ini
16 + /etc/opt/remi/php81/php.d/20-opcache.ini
17 /etc/crontab
18 /etc/opt/remi/php74/php-fpm.d/www.conf
19 + /etc/opt/remi/php81/php-fpm.d/www.conf
20 ));
21
22 event_services("nextcloud-update", qw(
23 httpd-e-smith sigusr1
24 php74-php-fpm reload-or-restart
25 + php81-php-fpm reload-or-restart
26 ));
27
28 event_actions("nextcloud-save", qw(
29 @@ -39,17 +42,29 @@
30 event_templates($event, qw(
31 /etc/httpd/conf/httpd.conf
32 /etc/opt/remi/php74/php.d/20-opcache.ini
33 + /etc/opt/remi/php81/php.d/20-opcache.ini
34 /etc/crontab
35 /etc/opt/remi/php74/php-fpm.d/www.conf
36 + /etc/opt/remi/php81/php-fpm.d/www.conf
37 ));
38
39 event_services($event, qw(
40 httpd-e-smith sigusr1
41 php74-php-fpm reload-or-restart
42 + php81-php-fpm reload-or-restart
43 ));
44 +# this is after service restart as it depends on installation of mariadb
45 +# however if we increase initial version of nextcloud >25 then we need to
46 +# change the default of php to 81 or re expand templates a second time
47 +# or web serice will fail
48 event_link("nextcloud-conf", $event, "91");
49 event_link("nextcloud-occ-conf", $event, "92");
50 -
51 +#maybe changing to
52 +#event_link("nextcloud-conf", $event, "91");
53 +#event_link("generic_template_expand", $event, "92");
54 +#event_link("nextcloud-occ-conf", $event, "93");
55 +#event_link("adjust-services", $event, "95");
56 +# or adding the key element in script
57
58 # Backup
59 use esmith::Build::Backup qw(:all);
60 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf
61 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf 2023-08-07 23:05:23.905000000 -0400
62 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf 2023-08-17 23:26:23.124000000 -0400
63 @@ -66,6 +66,8 @@
64 fi
65 fi
66
67 +/usr/bin/occ config:system:set --type=bool --value=false simpleSignUpLink.shown
68 +
69 #samba needed folder to put gencache.tdb
70 if [ ! -d /var/www/.cache/samba ]; then
71 mkdir -p /var/www/.cache/samba
72 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/crontab/98nextcloud smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/crontab/98nextcloud
73 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/crontab/98nextcloud 2023-08-07 23:05:23.913000000 -0400
74 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/crontab/98nextcloud 2023-08-17 22:59:18.310000000 -0400
75 @@ -1,5 +1,14 @@
76 # nextcloud cron
77 -*/15 * * * * www /usr/bin/php74 --define apc.enable_cli=1 --define memory_limit=512M -f /usr/share/nextcloud/cron.php > /dev/null 2>&1
78 +*/15 * * * * www {
79 + $OUT="/usr/bin/php74";
80 + $version="24";
81 + $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
82 + if ( open NC, "</usr/share/nextcloud/config/config.php") {
83 + map {$version = $1 if /$search/ } <NC>;
84 + close NC;
85 + }
86 + $OUT="/usr/bin/php81" if $version >= 25;
87 +} --define apc.enable_cli=1 --define memory_limit={ $memory=$nextcloud{'memory_limit'}||'1024M';} -f /usr/share/nextcloud/cron.php > /dev/null 2>&1
88
89 # nextcloud db update
90 19 2 * * * root /usr/bin/nc_dbupdate > /dev/null 2>&1
91 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud
92 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2023-08-07 23:05:23.879000000 -0400
93 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2023-08-17 23:12:47.550000000 -0400
94 @@ -46,9 +46,18 @@
95 _EOF
96 }
97 if ($fastcgi_mod eq 'mod_proxy_fcgi'){
98 - $php =<<'_EOF';
99 - <FilesMatch \.php$>
100 - SetHandler "proxy:unix:/var/run/php-fpm/php74-nextcloud.sock|fcgi://localhost"
101 + my $phpversion="74";
102 + my $version="24";
103 + my $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
104 + if ( open NC, "</usr/share/nextcloud/config/config.php") {
105 + map {$version = $1 if /$search/ } <NC>;
106 + close NC;
107 + }
108 + $phpversion="81" if $version >= 25;
109 +
110 + $php =<<"_EOF";
111 + <FilesMatch \\.php\$>
112 + SetHandler "proxy:unix:/var/run/php-fpm/php${phpversion}-nextcloud.sock|fcgi://localhost"
113 </FilesMatch>
114 _EOF
115 }
116 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/opt/remi/php74/php.d/20-opcache.ini/10base smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/opt/remi/php74/php.d/20-opcache.ini/10base
117 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/opt/remi/php74/php.d/20-opcache.ini/10base 2023-08-07 23:05:23.898000000 -0400
118 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/opt/remi/php74/php.d/20-opcache.ini/10base 2023-08-17 23:37:45.136000000 -0400
119 @@ -1,7 +1,7 @@
120 opcache.enable=1
121 opcache.file_cache= /var/opt/remi/php74/lib/php/opcache
122 opcache.enable_cli= 1
123 -opcache.interned_strings_buffer= {$nextcloud{'opcache.interned_strings_buffer'} || 16;}
124 +opcache.interned_strings_buffer= {$nextcloud{'opcache.interned_strings_buffer'} || 32;}
125 opcache.max_accelerated_files= 10000
126 opcache.memory_consumption= {$nextcloud{'opcache.memory_consumption'} || 128;}
127 opcache.save_comments= 1
128 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/opt/remi/php81/php.d/20-opcache.ini/10base smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/opt/remi/php81/php.d/20-opcache.ini/10base
129 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/opt/remi/php81/php.d/20-opcache.ini/10base 1969-12-31 19:00:00.000000000 -0500
130 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/opt/remi/php81/php.d/20-opcache.ini/10base 2023-08-17 23:38:15.437000000 -0400
131 @@ -0,0 +1,9 @@
132 +opcache.enable=1
133 +opcache.file_cache= /var/opt/remi/php81/lib/php/opcache
134 +opcache.enable_cli= 1
135 +opcache.interned_strings_buffer= {$nextcloud{'opcache.interned_strings_buffer'} || 32;}
136 +opcache.max_accelerated_files= 10000
137 +opcache.memory_consumption= {$nextcloud{'opcache.memory_consumption'} || 128;}
138 +opcache.save_comments= 1
139 +opcache.revalidate_freq= 1
140 +
141 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud
142 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud 2023-08-07 23:05:23.898000000 -0400
143 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud 2023-08-17 23:17:32.313000000 -0400
144 @@ -1,13 +1,21 @@
145 {
146 + my $phpversion="74";
147 + my $version="24";
148 + my $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
149 + if ( open NC, "</usr/share/nextcloud/config/config.php") {
150 + map {$version = $1 if /$search/ } <NC>;
151 + close NC;
152 + }
153 + $phpversion="81" if $version >= 25;
154
155 -if ($PHP_VERSION eq '74'){
156 +if ($PHP_VERSION eq $phpversion){
157 if (($nextcloud{'status'} || 'disabled') eq 'enabled'){
158 my $max_upload_size = ($nextcloud{MaxUploadSize} || '4096');
159 $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/);
160 my $memory_limit = ($nextcloud{MemoryLimit} || '512M');
161 $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/);
162 my $open_basedir= $nextcloud{PHPBaseDir} || '';
163 - $open_basedir = "/usr/share/nextcloud:/var/lib/nextcloud:/var/log/nextcloud.log:/var/lib/php/nextcloud:/home/e-smith/files/nextcloud:/dev/urandom:/proc/meminfo:$open_basedir";
164 + $open_basedir = "/usr/share/nextcloud:/var/lib/nextcloud:/var/log/nextcloud.log:/var/lib/php/nextcloud:/home/e-smith/files/nextcloud:/dev/urandom:/proc/meminfo:/usr/share/GeoIP/GeoLite2-Country.mmdb:/proc/cpuinfo:$open_basedir";
165 my $id = 'nextcloud';
166 my $max_children = $nextcloud{'PHPmaxChildren'} || 20;
167 my $min_spare_servers = $nextcloud{'PHPminServers'} || 4;
168 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/usr/bin/occ smeserver-nextcloud-1.2.0/root/usr/bin/occ
169 --- smeserver-nextcloud-1.2.0.old/root/usr/bin/occ 2023-08-07 23:05:23.914000000 -0400
170 +++ smeserver-nextcloud-1.2.0/root/usr/bin/occ 2023-08-17 22:58:48.265000000 -0400
171 @@ -1,3 +1,8 @@
172 #!/bin/bash
173 -
174 -/usr/sbin/runuser -u www -- /usr/bin/php74 -d memory_limit=1024M -d apc.enable_cli=1 /usr/share/nextcloud/occ "$@"
175 +majversion=$(/usr/bin/grep -Eo "'version'.*[0-9]{2}\." /usr/share/nextcloud/config/config.php |/usr/bin/grep -Eo "[0-9]{2}"|head -1)
176 +memory=$(config getprop nextcloud memory_limit|| echo "1024M")
177 +myphp=/usr/bin/php74
178 +if [[ $majversion -ge '25' ]]; then
179 + myphp=/usr/bin/php81
180 +fi
181 +/usr/sbin/runuser -u www -- $myphp -d memory_limit=$memory -d apc.enable_cli=1 /usr/share/nextcloud/occ "$@"

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