From cb524cb098e786d0571dc06e75f72ff989ab97c4 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 15 Jun 2017 11:46:12 +0200 Subject: [PATCH] ensure installed is false when running installer --- Dockerfile | 4 ++- rootfs/etc/confd/templates/config.php.tmpl | 2 +- rootfs/etc/cont-init.d/00-nextcloud | 42 +++++++++++----------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4728179..717e525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ RUN apk add --no-cache \ php7-json \ php7-xml \ php7-xmlreader \ + php7-xmlwriter \ php7-zlib \ php7-zip \ php7-pgsql \ @@ -33,7 +34,8 @@ RUN apk add --no-cache \ php7-bz2 \ php7-exif \ php7-apcu \ - php7-ldap + php7-ldap \ + php7-simplexml RUN mkdir /var/lib/nextcloud RUN wget -qO- https://download.nextcloud.com/server/releases/nextcloud-$VERSION.tar.bz2 | tar xj -C /var/lib/nextcloud --strip 1 diff --git a/rootfs/etc/confd/templates/config.php.tmpl b/rootfs/etc/confd/templates/config.php.tmpl index 55ae11e..10b366d 100644 --- a/rootfs/etc/confd/templates/config.php.tmpl +++ b/rootfs/etc/confd/templates/config.php.tmpl @@ -53,5 +53,5 @@ $CONFIG = array( 'assetdirectory' => '/var/lib/nextcloud', 'mount_file' => '/var/lib/nextcloud/data/mount.json', 'installed' => true, -'version' => '12.0.0', +'version' => '12.0.0.29', ); diff --git a/rootfs/etc/cont-init.d/00-nextcloud b/rootfs/etc/cont-init.d/00-nextcloud index 17ec502..9037846 100644 --- a/rootfs/etc/cont-init.d/00-nextcloud +++ b/rootfs/etc/cont-init.d/00-nextcloud @@ -11,7 +11,9 @@ PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXIS if [ $? -ne 1 ]; then cd /var/lib/nextcloud - + + sed -i -e "s/'installed' => true,/'installed' => false,/g" /var/lib/nextcloud/config/config.php + s6-setuidgid nginx ./occ maintenance:install \ --database=pgsql \ --database-host=$DB_HOST \ @@ -28,23 +30,23 @@ if [ $? -ne 1 ]; then s6-setuidgid nginx ./occ ldap:create-empty-config - s6-setuidgid nginx ./occ ldap:set-config '' hasMemberOfFilterSupport "1" - s6-setuidgid nginx ./occ ldap:set-config '' ldapExperiencedAdmin "1" - s6-setuidgid nginx ./occ ldap:set-config '' ldapIgnoreNamingRules "1" - s6-setuidgid nginx ./occ ldap:set-config '' ldapHost "$LDAP_HOST" - s6-setuidgid nginx ./occ ldap:set-config '' ldapPort "$LDAP_PORT" - s6-setuidgid nginx ./occ ldap:set-config '' ldapTLS "$LDAP_TLS" - s6-setuidgid nginx ./occ ldap:set-config '' ldapAgentName "$LDAP_BIND_USER" - s6-setuidgid nginx ./occ ldap:set-config '' ldapAgentPassword "$LDAP_BIND_PASSWORD" - s6-setuidgid nginx ./occ ldap:set-config '' ldapLoginFilter "$LDAP_LOGIN_FILTER" - s6-setuidgid nginx ./occ ldap:set-config '' ldapUserDisplayName "$LDAP_USER_DISPLAY_NAME" - s6-setuidgid nginx ./occ ldap:set-config '' ldapUserFilter "$LDAP_USER_FILTER" - s6-setuidgid nginx ./occ ldap:set-config '' ldapBase "$LDAP_BASE_DN" - s6-setuidgid nginx ./occ ldap:set-config '' ldapBaseUsers "$LDAP_BASE_USER_DN" - s6-setuidgid nginx ./occ ldap:set-config '' ldapEmailAttribute "$LDAP_EMAIL_ATTRIBUTE" - s6-setuidgid nginx ./occ ldap:set-config '' ldapBaseGroups "$LDAP_BASE_GROUP_DN" - s6-setuidgid nginx ./occ ldap:set-config '' ldapGroupFilter "$LDAP_GROUP_FILTER" - s6-setuidgid nginx ./occ ldap:set-config '' ldapExpertUsernameAttr "$LDAP_USERNAME_ATTRIBUTE" - s6-setuidgid nginx ./occ ldap:set-config '' turnOffCertCheck "$LDAP_TURN_OFF_CERT_CHECK" - s6-setuidgid nginx ./occ ldap:set-config '' ldapConfigurationActive "1" + s6-setuidgid nginx ./occ ldap:set-config 's01' hasMemberOfFilterSupport "1" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapExperiencedAdmin "1" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapIgnoreNamingRules "1" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapHost "$LDAP_HOST" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapPort "$LDAP_PORT" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapTLS "$LDAP_TLS" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapAgentName "$LDAP_BIND_USER" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapAgentPassword "$LDAP_BIND_PASSWORD" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapLoginFilter "$LDAP_LOGIN_FILTER" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapUserDisplayName "$LDAP_USER_DISPLAY_NAME" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapUserFilter "$LDAP_USER_FILTER" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapBase "$LDAP_BASE_DN" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapBaseUsers "$LDAP_BASE_USER_DN" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapEmailAttribute "$LDAP_EMAIL_ATTRIBUTE" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapBaseGroups "$LDAP_BASE_GROUP_DN" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapGroupFilter "$LDAP_GROUP_FILTER" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapExpertUsernameAttr "$LDAP_USERNAME_ATTRIBUTE" + s6-setuidgid nginx ./occ ldap:set-config 's01' turnOffCertCheck "$LDAP_TURN_OFF_CERT_CHECK" + s6-setuidgid nginx ./occ ldap:set-config 's01' ldapConfigurationActive "1" fi