From 0c886e2875e9ad3d4a17e7a911a7a189f8eeb3df Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Mon, 12 Sep 2022 20:45:47 -0400 Subject: [PATCH 1/3] missed a place where read only config had to be set false. --- setup/nextcloud.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 073967eb..df6be861 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -289,6 +289,9 @@ hide_output sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/console.php app sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ upgrade if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi +# Turn off read only in case it wasn't turned off before. +sed -ie '/config_is_read_only/d' $STORAGE_ROOT/owncloud/config.php + # Disable default apps that we don't support sudo -u www-data \ php$PHP_VER /usr/local/lib/owncloud/occ app:disable \ @@ -296,6 +299,7 @@ sudo -u www-data \ notifications files_pdfviewer password_policy systemtags comments \ privacy recommendations files_rightclick sharebymail support text \ theming survey_client user_status weather_status files_videoplayer \ + contactsinteraction \ | (grep -v "No such app enabled" || /bin/true) # Update config.php. From 6b8aff4cc1c6617b0bccb39f1d2083f974cda9c9 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Wed, 14 Sep 2022 12:32:47 -0400 Subject: [PATCH 2/3] Fixed JSON formatting. Added check for unset or "C" locale for LC_TELEPHONE. Fixed an issue with the sed command leaving a backup. --- setup/nextcloud.sh | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 22 deletions(-) mode change 100755 => 100644 setup/nextcloud.sh diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh old mode 100755 new mode 100644 index df6be861..d9670402 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -126,8 +126,9 @@ InstallNextcloud() { echo "...which seemed to work." fi - # Add missing indices. NextCloud didn't include this in the normal upgrade because it might take some time. + # Add missing indices and primary keys. NextCloud didn't include this in the normal upgrade because it might take some time. sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:add-missing-indices + sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:add-missing-primary-keys # Run conversion to BigInt identifiers, this process may take some time on large tables. sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ db:convert-filecache-bigint --no-interaction @@ -193,7 +194,7 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc fi # Remove the read-onlyness of the config. - sed -ie '/config_is_read_only/d' $STORAGE_ROOT/owncloud/config.php + sed -i -e '/config_is_read_only/d' $STORAGE_ROOT/owncloud/config.php if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^22 ]]; then InstallNextcloud 23.0.9 b6ac7ffa6c1c1c6187fea7d9efc7a32300cdc377 4.1.0 697f6b4a664e928d72414ea2731cb2c9d1dc3077 3.2.2 ce4030ab57f523f33d5396c6a81396d440756f5f 3.0.0 0df781b261f55bbde73d8c92da3f99397000972f @@ -225,20 +226,20 @@ if [ ! -f $STORAGE_ROOT/owncloud/owncloud.db ]; then "overwrite.cli.url": "https://${PRIMARY_HOSTNAME}/cloud", "user_backends": [ { - "class": "\\\OCA\\\UserExternal\\\IMAP", + "class": "\\\\OCA\\\\UserExternal\\\\IMAP", "arguments": [ "127.0.0.1", 143, null, null, false, false ] } ], - "memcache.local": "\\\OC\\\Memcache\\\APCu", - "mail_smtpmode": "sendmail", - "mail_smtpsecure": "", - "mail_smtpauthtype": "LOGIN", - "mail_smtpauth": false, - "mail_smtphost": "", - "mail_smtpport": "", - "mail_smtpname": "", - "mail_smtppassword": "", - "mail_from_address": "owncloud" + "memcache.local": "\\\\OC\\\\Memcache\\\\APCu", + "mail_smtpmode": "sendmail", + "mail_smtpsecure": "", + "mail_smtpauthtype": "LOGIN", + "mail_smtpauth": false, + "mail_smtphost": "", + "mail_smtpport": "", + "mail_smtpname": "", + "mail_smtppassword": "", + "mail_from_address": "owncloud" } } EOF @@ -290,7 +291,7 @@ sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ upgrade if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi # Turn off read only in case it wasn't turned off before. -sed -ie '/config_is_read_only/d' $STORAGE_ROOT/owncloud/config.php +sed -i -e '/config_is_read_only/d' $STORAGE_ROOT/owncloud/config.php # Disable default apps that we don't support sudo -u www-data \ @@ -316,18 +317,31 @@ sudo -u www-data \ TIMEZONE=$(cat /etc/timezone) instanceid=oc$(echo $PRIMARY_HOSTNAME | sha1sum | fold -w 10 | head -n 1) CONFIG_TEMP=/tmp/cfg-$instanceid.json -PHONE_REGION=$(locale | grep TELEPHONE | sed -e 's/LC_.*=".*_//' | sed -e 's/\..*//') -cat > $CONFIG_TEMP <<-EOF + +#try to get the phone region, otherwise leave blank +locale=$(locale | grep LC_TELEPHONE | sed -E 's/(.*=")(.*)\..*/\2/') +shopt -s extglob +case "$locale" in + +([[:alnum:]])_+([[:alnum:]])) + PHONE_REGION=$(sed -E 's/.*_//' <<< "$locale") + ;; + *) + PHONE_REGION='' + ;; +esac +shopt -u extglob + +cat > $CONFIG_TEMP < Date: Wed, 14 Sep 2022 12:40:48 -0400 Subject: [PATCH 3/3] Added overwrite.cli.url to the config update. --- setup/nextcloud.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index d9670402..6e035729 100644 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -342,6 +342,7 @@ cat > $CONFIG_TEMP <