/[smecontribs]/rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12318-bz12412-NC26andhigher.patch
ViewVC logotype

Contents of /rpms/smeserver-nextcloud/contribs10/smeserver-nextcloud-1.2.0-bz12318-bz12412-NC26andhigher.patch

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


Revision 1.1 - (show annotations) (download)
Mon Jan 29 20:22:24 2024 UTC (9 months, 3 weeks ago) by jpp
Branch: MAIN
CVS Tags: smeserver-nextcloud-1_2_0-31_el7_sme, smeserver-nextcloud-1_2_0-29_el7_sme, smeserver-nextcloud-1_2_0-30_el7_sme, HEAD
* Mon Jan 29 2024 Jean-Philippe Pialasse <tests@pialasse.com> 1.2.0-29.sme
- require nextcloud-src >= 26 [SME: 12318]
  multiple fixes and rewrites
- restore default log level [SME: 12412]

1 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
2 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/events/actions/nextcloud-conf 2024-01-29 14:29:10.203000000 -0500
3 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/events/actions/nextcloud-conf 2024-01-29 15:04:46.803000000 -0500
4 @@ -11,9 +11,9 @@
5 dbuser=`/sbin/e-smith/db configuration getprop nextcloud DbUser || echo "nextcloud"`
6 adminuser=`/sbin/e-smith/db configuration getprop nextcloud AdminUser || echo "admin"`
7 adminpass=`/sbin/e-smith/db configuration getprop nextcloud AdminPassword ||/sbin/e-smith/db configuration getprop sysconfig SystemID || echo "password;109"`
8 -#occ config:system:get dbhost
9 -host="localhost"
10 -socket="--socket=/var/lib/mysql/mysql.sock"
11 +
12 +host="localhost:/var/lib/mysql/mariadb105.sock"
13 +socket="--socket=/var/lib/mysql/mariadb105.sock"
14 # need to check what db we are supposed to use. starting NC 21 mariadb >= 102 is needed core is 55
15 # are we fresh install or update ?
16 installed=$(/usr/bin/occ status --output json |jq -r '.installed')
17 @@ -29,45 +29,48 @@
18 /usr/bin/mysql --defaults-file=/root/.my.cnf $socket -e "grant all on $dbname.* to '$dbuser'@'localhost' identified by '$password';"
19 /usr/bin/mysql --defaults-file=/root/.my.cnf $socket -e "FLUSH PRIVILEGES"
20
21 -# check if we are migrating from release 10 to 11
22 -if [ -f /var/www/html/nextcloud/config/config.php ]; then
23 - mv /var/www/html/nextcloud/config/config.php /usr/share/nextcloud/config/config.php
24 - rm -rf /var/www/html/nextcloud/
25 -fi
26 -
27 res=`/usr/bin/mysql --defaults-file=/root/.my.cnf $socket -e "select count(*) from information_schema.tables where table_type = 'BASE TABLE' and table_schema = '$dbname'" | tail -n1`;
28
29 if [[ $res == '0' ]]; then
30 /usr/bin/occ maintenance:install --database mysql --database-host $host --database-name $dbname --database-user $dbuser --database-pass $password --admin-user $adminuser --admin-pass $adminpass --data-dir /home/e-smith/files/nextcloud/data/
31
32 /usr/bin/occ app:enable user_ldap
33 - /usr/bin/occ ldap:create-empty-config # create config with empty id
34 - /usr/bin/occ ldap:create-empty-config # create config with id s01
35 - /usr/bin/occ ldap:delete-config '' # delete config with empty id
36 + # might create s01 or empty id depending on version
37 + /usr/bin/occ ldap:create-empty-config
38 + # create config with id s01 if not already present
39 + /usr/bin/occ ldap:show-config s01 1>/dev/null || /usr/bin/occ ldap:create-empty-config
40 + # delete config with empty id if exist
41 + /usr/bin/occ ldap:delete-config '' 1>/dev/null
42 mkdir -p /home/e-smith/files/nextcloud/skeleton/ibays
43 - /usr/bin/occ config:system:set skeletondirectory --value="/home/e-smith/files/nextcloud/skeleton"
44 - #/usr/bin/occ config:system:set templatedirectory --value=""
45 -else
46 - mkdir -p /home/e-smith/files/nextcloud/skeleton/ibays
47 - /usr/bin/occ config:system:set skeletondirectory --value="/home/e-smith/files/nextcloud/skeleton"
48 - # to satisfy code integrity check
49 - if [ -f /usr/share/nextcloud/.htaccess.rpmsave ]; then
50 - rm -f /usr/share/nextcloud/.htaccess.rpmsave
51 - fi
52 - if [ -f /usr/share/nextcloud/.htaccess.rpmnew ]; then
53 - rm -f /usr/share/nextcloud/.htaccess.rpmnew
54 - fi
55 - /usr/bin/occ upgrade
56 - /usr/bin/occ maintenance:mode --off
57 - /usr/bin/occ integrity:check-core
58 - # Catch 'Nextcloud is already latest version' message
59 - if [ $? -eq 3 ]; then
60 - exit 0
61 - fi
62 fi
63
64 +mkdir -p /home/e-smith/files/nextcloud/skeleton/ibays
65 +/usr/bin/occ config:system:set skeletondirectory --value="/home/e-smith/files/nextcloud/skeleton"
66 +#/usr/bin/occ config:system:set templatedirectory --value=""
67 +
68 +# to satisfy code integrity check
69 +if [ -f /usr/share/nextcloud/.htaccess.rpmsave ]; then
70 + rm -f /usr/share/nextcloud/.htaccess.rpmsave
71 +fi
72 +if [ -f /usr/share/nextcloud/.htaccess.rpmnew ]; then
73 + rm -f /usr/share/nextcloud/.htaccess.rpmnew
74 +fi
75 +
76 +# upgrade and check integrity
77 +/usr/bin/occ upgrade
78 +/usr/bin/occ maintenance:mode --off
79 +/usr/bin/occ integrity:check-core
80 +## Catch 'Nextcloud is already latest version' message
81 +#if [ $? -eq 3 ]; then
82 +# exit 0
83 +#fi
84 +
85 +# remove signup link
86 /usr/bin/occ config:system:set --type=bool --value=false simpleSignUpLink.shown
87
88 +#set default loglevel SME 12412
89 +/usr/bin/occ config:system:set loglevel --value=3
90 +
91 #Redis index File Cache
92 /usr/bin/occ config:system:set redis host --value="localhost"
93 /usr/bin/occ config:system:set redis port --value="6379"
94 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
95 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/crontab/98nextcloud 2024-01-29 14:29:10.184000000 -0500
96 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/crontab/98nextcloud 2024-01-29 15:09:42.494000000 -0500
97 @@ -1,13 +1,13 @@
98 # nextcloud cron
99 */15 * * * * www {
100 - $OUT="/usr/bin/php74";
101 - $version="24";
102 + $OUT="/usr/bin/php81";
103 + $version="26";
104 $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
105 if ( open NC, "</usr/share/nextcloud/config/config.php") {
106 map {$version = $1 if /$search/ } <NC>;
107 close NC;
108 }
109 - $OUT="/usr/bin/php81" if $version >= 25;
110 + $OUT="/usr/bin/php74" if $version <= 24;
111 } --define apc.enable_cli=1 --define memory_limit={ $memory=$nextcloud{'memory_limit'}||'1024M';} -f /usr/share/nextcloud/cron.php > /dev/null 2>&1
112
113 # nextcloud db update
114 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
115 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2024-01-29 14:29:10.185000000 -0500
116 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98nextcloud 2024-01-29 15:08:20.056000000 -0500
117 @@ -46,14 +46,14 @@
118 _EOF
119 }
120 if ($fastcgi_mod eq 'mod_proxy_fcgi'){
121 - my $phpversion="74";
122 - my $version="24";
123 + my $phpversion="81";
124 + my $version="26";
125 my $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
126 if ( open NC, "</usr/share/nextcloud/config/config.php") {
127 map {$version = $1 if /$search/ } <NC>;
128 close NC;
129 }
130 - $phpversion="81" if $version >= 25;
131 + $phpversion="74" if $version <= 24;
132
133 $php =<<"_EOF";
134 <FilesMatch \\.php\$>
135 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
136 --- smeserver-nextcloud-1.2.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud 2024-01-29 14:29:10.197000000 -0500
137 +++ smeserver-nextcloud-1.2.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15Nextcloud 2024-01-29 15:09:06.970000000 -0500
138 @@ -1,12 +1,12 @@
139 {
140 - my $phpversion="74";
141 - my $version="24";
142 + my $phpversion="81";
143 + my $version="26";
144 my $search=qr/\s*'version'\s*=>\s*'([0-9]{2})\.[0-9]{1,2}.*/;
145 if ( open NC, "</usr/share/nextcloud/config/config.php") {
146 map {$version = $1 if /$search/ } <NC>;
147 close NC;
148 }
149 - $phpversion="81" if $version >= 25;
150 + $phpversion="74" if $version <= 24;
151
152 if ($PHP_VERSION eq $phpversion){
153 if (($nextcloud{'status'} || 'disabled') eq 'enabled'){
154 diff -Nur --no-dereference smeserver-nextcloud-1.2.0.old/root/usr/bin/occ smeserver-nextcloud-1.2.0/root/usr/bin/occ
155 --- smeserver-nextcloud-1.2.0.old/root/usr/bin/occ 2024-01-29 14:29:10.187000000 -0500
156 +++ smeserver-nextcloud-1.2.0/root/usr/bin/occ 2024-01-29 15:05:48.699000000 -0500
157 @@ -1,8 +1,8 @@
158 #!/bin/bash
159 majversion=$(/usr/bin/grep -Eo "'version'.*[0-9]{2}\." /usr/share/nextcloud/config/config.php |/usr/bin/grep -Eo "[0-9]{2}"|head -1)
160 memory=$(config getprop nextcloud memory_limit|| echo "1024M")
161 -myphp=/usr/bin/php74
162 -if [[ $majversion -ge '25' ]]; then
163 - myphp=/usr/bin/php81
164 +myphp=/usr/bin/php81
165 +if [[ $majversion -le '24' ]]; then
166 + myphp=/usr/bin/php74
167 fi
168 /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