update nextcloud

This commit is contained in:
Sebastian Hugentobler 2018-01-30 08:36:21 +01:00
parent d2b4a329c7
commit 8673377a89
6 changed files with 58 additions and 58 deletions

View File

@ -8,9 +8,11 @@ RUN apk add --no-cache \
postgresql-client \
nextcloud \
nextcloud-user_ldap \
nextcloud-pgsql
nextcloud-pgsql \
php7-opcache
RUN chown -R nginx:nginx /var/lib/nextcloud
RUN chown -R nginx:nginx /etc/nextcloud
RUN chown -R nginx:nginx /usr/share/webapps/nextcloud
RUN mkdir /run/nginx

View File

@ -42,7 +42,7 @@ Local part in the from address for notification emails.
## MAIL_SMTP_HOST
SMTP host used for notification emails.
## MAILSMTPPORT
## MAIL_SMTP_PORT
- default: 587
SMTP host port.
@ -53,7 +53,7 @@ SMTP host port.
Connection security for the SMTP host.
## MAIL_SMTP_AUTH
- default: true
- default: 1
Whether to use authentication with the SMTP host.

View File

@ -1,6 +1,6 @@
[template]
src = "config.php.tmpl"
dest = "/var/lib/nextcloud/config/config.php"
dest = "/var/lib/nextcloud/config/config.php.sample"
gid = 101
uid = 100
mode = "0660"

View File

@ -23,7 +23,7 @@ $CONFIG = array(
'mail_smtpdebug' => false,
'mail_smtpmode' => 'smtp',
'mail_smtphost' => '{{getenv "MAIL_SMTP_HOST"}}',
'mail_smtpport' => {{getenv "MAILSMTPPORT" "587"}},
'mail_smtpport' => {{getenv "MAIL_SMTP_PORT" "587"}},
'mail_smtptimeout' => 10,
'mail_smtpsecure' => '{{getenv "MAIL_SMTP_SECURITY" "tls"}}',
'mail_smtpauth' => {{getenv "MAIL_SMTP_AUTH" "true"}},

View File

@ -1,53 +0,0 @@
#!/usr/bin/with-contenv sh
set -ex
chmod +x /var/lib/nextcloud/occ # for some reason it doesn't work when done from the Dockerfile
if [ ! -f /var/lib/nextcloud/data/.ocdata ]; then
touch /var/lib/nextcloud/data/.ocdata
fi
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '${DB_TABLE_PREFIX}appconfig')" | grep f
if [ $? -ne 1 ]; then
cd /var/lib/nextcloud
if [ -f /var/lib/nextcloud/config/config.php ]; then
sed -i -e "s/'installed' => true,/'installed' => false,/g" /var/lib/nextcloud/config/config.php
fi
s6-setuidgid nginx ./occ maintenance:install \
--database=pgsql \
--database-host=$DB_HOST \
--database-name=$DB_NAME \
--database-user=$DB_USER \
--database-pass=$DB_PASSWORD \
--database-table-prefix=$DB_TABLE_PREFIX \
--admin-user=$ADMIN_USER \
--admin-pass=$ADMIN_PASSWORD \
--no-interaction
s6-setuidgid nginx ./occ config:app:set --value cron core backgroundjobs_mode
s6-setuidgid nginx ./occ app:enable user_ldap
s6-setuidgid nginx ./occ ldap:create-empty-config
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' turnOffCertCheck "$LDAP_TURN_OFF_CERT_CHECK"
s6-setuidgid nginx ./occ ldap:set-config 's01' ldapConfigurationActive "1"
fi

View File

@ -0,0 +1,51 @@
#!/usr/bin/with-contenv sh
set -ex
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '${DB_TABLE_PREFIX}appconfig')" | grep f
if [ $? -ne 1 ]; then
cd /usr/share/webapps/nextcloud
s6-setuidgid nginx ./occ maintenance:install \
--database=pgsql \
--database-host=$DB_HOST \
--database-name=$DB_NAME \
--database-user=$DB_USER \
--database-pass=$DB_PASSWORD \
--database-table-prefix=$DB_TABLE_PREFIX \
--admin-user=$ADMIN_USER \
--admin-pass=$ADMIN_PASSWORD \
--data-dir=/var/lib/nextcloud/data/ \
--no-interaction
s6-setuidgid nginx ./occ config:app:set --value cron core backgroundjobs_mode
s6-setuidgid nginx ./occ app:enable user_ldap
s6-setuidgid nginx ./occ app:enable files_sharing
s6-setuidgid nginx ./occ config:system:set --value "https://$DOMAIN" overwrite.cli.url
s6-setuidgid nginx ./occ config:system:set --value ["localhost", "$DOMAIN"] trusted_domains
s6-setuidgid nginx ./occ config:system:set --value "smtp" mail_smtpmode
s6-setuidgid nginx ./occ config:system:set --value "${MAIL_SMTP_AUTH_TYPE:-PLAIN}" mail_smtpauthtype
s6-setuidgid nginx ./occ config:system:set --value "$MAIL_FROM" mail_from_address
s6-setuidgid nginx ./occ config:system:set --value "$MAIL_DOMAIN" mail_domain
s6-setuidgid nginx ./occ config:system:set --value "${MAIL_SMTP_SECURITY:-tls}" mail_smtpsecure
s6-setuidgid nginx ./occ config:system:set --value "${MAIL_SMTP_AUTH:-1}" mail_smtpauth
s6-setuidgid nginx ./occ config:system:set --value "$MAIL_SMTP_HOST" mail_smtphost
s6-setuidgid nginx ./occ config:system:set --value "${MAIL_SMTP_PORT:-587}" mail_smtpport
s6-setuidgid nginx ./occ config:system:set --value "$MAIL_SMTP_NAME" mail_smtpname
s6-setuidgid nginx ./occ config:system:set --value "$MAIL_SMTP_PASSWORD" mail_smtppassword
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BASE_GROUP_DN" user_ldap ldap_base_groups
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_EMAIL_ATTRIBUTE" user_ldap ldap_email_attr
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_USER_FILTER" user_ldap ldap_userlist_filter
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_LOGIN_FILTER" user_ldap ldap_login_filter
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_TLS" user_ldap ldap_tls
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_HOST" user_ldap ldap_host
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BIND_USER" user_ldap ldap_dn
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BIND_PASSWORD" user_ldap ldap_agent_password
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_GROUP_FILTER" user_ldap ldap_group_filter
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_USER_DISPLAY_NAME" user_ldap ldap_display_name
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_PORT" user_ldap ldap_port
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BASE_USER_DN" user_ldap ldap_base_users
fi