diff --git a/seed/nextcloud/applicationservice.yml b/seed/nextcloud/applicationservice.yml index 023692d6..66a288ce 100644 --- a/seed/nextcloud/applicationservice.yml +++ b/seed/nextcloud/applicationservice.yml @@ -1,7 +1,7 @@ format: '0.1' description: Nextcloud depends: - - base-fedora-35 + - base-fedora-36 - postgresql-client - ldap-client-fedora - redis-client diff --git a/seed/nextcloud/templates/nextcloud-config.php b/seed/nextcloud/templates/nextcloud-config.php index c08a4625..7d6902b5 100644 --- a/seed/nextcloud/templates/nextcloud-config.php +++ b/seed/nextcloud/templates/nextcloud-config.php @@ -52,8 +52,8 @@ $CONFIG = array ( 'maintenance' => false, 'appstoreenabled' => false, 'appcodechecker' => false, - 'memcache.distributed' => '\\OC\\Memcache\\Redis', - 'memcache.locking' => '\\OC\\Memcache\\Redis', +# 'memcache.distributed' => '\\OC\\Memcache\\Redis', +# 'memcache.locking' => '\\OC\\Memcache\\Redis', 'trusted_proxies' => '%%revprox_client_server_ip', 'overwritehost' => '%%revprox_client_external_domainnames[0]', 'filelocking.enabled' => true, @@ -69,7 +69,7 @@ $CONFIG = array ( 'local_cert' => '/etc/pki/tls/certs/redis.crt', 'local_pk' => '/etc/pki/tls/private/redis.key', 'cafile' => '/etc/pki/ca-trust/source/anchors/ca_Redis.crt', - ) + ), ), 'default_phone_region' => 'FR', # OIDC login diff --git a/seed/nextcloud/templates/nextcloud.init b/seed/nextcloud/templates/nextcloud.init index f42da5f2..5df91ef1 100644 --- a/seed/nextcloud/templates/nextcloud.init +++ b/seed/nextcloud/templates/nextcloud.init @@ -1,11 +1,15 @@ %echo "#!/bin/bash -ex" if [ ! -f /srv/nextcloud/keys/secret.txt ]; then + sed -i "s/'config_is_read_only' => true,/'config_is_read_only' => false,/g" /etc/nextcloud/config.php /usr/bin/php /usr/share/nextcloud/occ maintenance:install --no-interaction --data-dir /srv/nextcloud/data/ --database "pgsql" --database-host "%%pg_client_server_domainname" --database-name "%%pg_client_database" --database-user "%%pg_client_username" --database-pass "%%pg_client_password" --admin-user "admin" --admin-pass "%%nextcloud_admin_password" + sed -i "s/'config_is_read_only' => false,/'config_is_read_only' => true,/g" /etc/nextcloud/config.php umask 027 /usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get passwordsalt > /srv/nextcloud/keys/passwordsalt.txt /usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get secret > /srv/nextcloud/keys/secret.txt - /usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get version > /srv/nextcloud/keys/version.txt + VERSION=$(/usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get version) + if ! echo "$VERSION"|grep -E '^[0-9][0-9.]*$'; then echo "unknown version: $VERSION"; exit 1; fi + echo $VERSION > /srv/nextcloud/keys/version.txt /usr/bin/php /usr/share/nextcloud/occ app:enable user_ldap -q /usr/bin/php /usr/share/nextcloud/occ ldap:create-empty-config -q @@ -15,11 +19,14 @@ else sed -i "s'{{VERSION}}'$(cat /srv/nextcloud/keys/version.txt)'g" /etc/nextcloud/config.php sed -i "s/'installed' => false,/'installed' => true,/g" /etc/nextcloud/config.php # Upgrade + cp -f /etc/nextcloud/config.php /srv/nextcloud/keys/config.ORI.php sha256sum /etc/nextcloud/config.php > /tmp/sha sed -i "s/'config_is_read_only' => true,/'config_is_read_only' => false,/g" /etc/nextcloud/config.php /usr/bin/php /usr/share/nextcloud/occ upgrade || true sed -i "s/'config_is_read_only' => false,/'config_is_read_only' => true,/g" /etc/nextcloud/config.php - /usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get version > /srv/nextcloud/keys/version.txt + VERSION=$(/usr/bin/php /usr/share/nextcloud/occ --no-warnings config:system:get version) + if ! echo "$VERSION"|grep -E '^[0-9][0-9.]*$'; then echo "unknown version: $VERSION"; exit 1; fi + echo $VERSION > /srv/nextcloud/keys/version.txt ## if file is modified, copy upgraded version sha256sum -c /tmp/sha || cp -a /etc/nextcloud/config.php /srv/nextcloud/keys/config.UPGRADED.php # Configure LDAP