From 50c1f3f34946f3c2e66e8368176bb5f94f9f942a Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Fri, 23 Jul 2021 09:47:47 +0000 Subject: [PATCH] implemented debug config differently and fixed missing table issue --- gitpod/docker-compose.yml | 1 + gitpod/nextcloud/Dockerfile | 7 ++++--- gitpod/nextcloud/after-install.sh | 18 ++++++++++++++++++ gitpod/nextcloud/debug.config.php | 4 ---- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 gitpod/nextcloud/after-install.sh delete mode 100644 gitpod/nextcloud/debug.config.php diff --git a/gitpod/docker-compose.yml b/gitpod/docker-compose.yml index cae7a51e1..635c8bb74 100644 --- a/gitpod/docker-compose.yml +++ b/gitpod/docker-compose.yml @@ -56,6 +56,7 @@ services: - NEXTCLOUD_ADMIN_PASSWORD=t2qQ1C6ktYUv7 - NEXTCLOUD_TRUSTED_DOMAINS=*.gitpod.io - OVERWRITEPROTOCOL=https + - NEXTCLOUD_UPDATE=1 simplesamlphp: build: diff --git a/gitpod/nextcloud/Dockerfile b/gitpod/nextcloud/Dockerfile index 125499e83..56ab94a16 100644 --- a/gitpod/nextcloud/Dockerfile +++ b/gitpod/nextcloud/Dockerfile @@ -1,12 +1,13 @@ FROM nextcloud COPY custom-entrypoint.sh /custom-entrypoint.sh -RUN chmod +x /custom-entrypoint.sh +COPY after-install.sh /after-install.sh -COPY debug.config.php /debug.config.php +RUN chmod +x /custom-entrypoint.sh +RUN chmod +x /after-install.sh ENTRYPOINT ["/custom-entrypoint.sh"] # Needs to be set again, even though it is already in base image # reference: https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact -CMD ["apache2-foreground"] +CMD ["/after-install.sh"] diff --git a/gitpod/nextcloud/after-install.sh b/gitpod/nextcloud/after-install.sh new file mode 100644 index 000000000..9060c6af5 --- /dev/null +++ b/gitpod/nextcloud/after-install.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +echo "after install !!!!!" + +run_as() { + if [ "$(id -u)" = 0 ]; then + su -p www-data -s /bin/sh -c "$1" + else + sh -c "$1" + fi +} + +run_as "php /var/www/html/occ config:system:set debug --value='true' --type=boolean" + +# Weirdly the Nextcloud docker activates user_saml app automatically but doesn't run the migration steps necessary for it to work +run_as "php /var/www/html/occ migrations:migrate user_saml" + +apache2-foreground \ No newline at end of file diff --git a/gitpod/nextcloud/debug.config.php b/gitpod/nextcloud/debug.config.php deleted file mode 100644 index 7f04018c3..000000000 --- a/gitpod/nextcloud/debug.config.php +++ /dev/null @@ -1,4 +0,0 @@ - true, -);