From 2cf98773ccb58805e9065611d7eaa86c38b87f18 Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 7 Jun 2022 00:48:30 +0200 Subject: [PATCH] add a secret to onlyoffice and collabora Signed-off-by: szaimen --- Containers/nextcloud/entrypoint.sh | 2 ++ php/containers.json | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 70aaf9ca..0e810529 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -341,6 +341,8 @@ if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then else php /var/www/html/occ app:update onlyoffice fi + php /var/www/html/occ config:app:set onlyoffice jwt_secret --value="$ONLYOFFICE_SECRET" + php /var/www/html/occ config:app:set onlyoffice jwt_header --value="AuthorizationJwt" php /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value="https://$NC_DOMAIN/onlyoffice" else if [ -d "/var/www/html/custom_apps/onlyoffice" ]; then diff --git a/php/containers.json b/php/containers.json index 32c5f72e..0b8387e4 100644 --- a/php/containers.json +++ b/php/containers.json @@ -128,6 +128,7 @@ "OVERWRITEPROTOCOL=https", "TURN_SECRET=%TURN_SECRET%", "SIGNALING_SECRET=%SIGNALING_SECRET%", + "ONLYOFFICE_SECRET=%ONLYOFFICE_SECRET%", "AIO_URL=%AIO_URL%", "NEXTCLOUD_MOUNT=%NEXTCLOUD_MOUNT%", "CLAMAV_ENABLED=%CLAMAV_ENABLED%", @@ -158,7 +159,8 @@ ], "volumes": [], "secrets": [ - "REDIS_PASSWORD" + "REDIS_PASSWORD", + "ONLYOFFICE_SECRET" ], "maxShutdownTime": 10, "restartPolicy": "unless-stopped" @@ -345,7 +347,10 @@ "80" ], "environmentVariables": [ - "TZ=%TIMEZONE%" + "TZ=%TIMEZONE%", + "JWT_ENABLED=true", + "JWT_HEADER=AuthorizationJwt", + "JWT_SECRET=%ONLYOFFICE_SECRET%" ], "volumes": [ { @@ -354,7 +359,9 @@ "writeable": true } ], - "secrets": [], + "secrets": [ + "ONLYOFFICE_SECRET" + ], "maxShutdownTime": 10, "restartPolicy": "unless-stopped" }