nextcloud/rootfs/etc/cont-init.d/00-nextcloud

106 lines
7.4 KiB
Plaintext
Raw Normal View History

2018-01-30 07:36:21 +00:00
#!/usr/bin/with-contenv sh
set -ex
2018-01-30 07:55:27 +00:00
cd /usr/share/webapps/nextcloud
2018-01-30 10:11:38 +00:00
#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
2018-01-30 07:36:21 +00:00
2018-01-30 10:11:38 +00:00
if [ ! -f /var/lib/nextcloud/data/.installed ]; then
2018-01-30 07:36:21 +00:00
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
2018-01-30 08:57:44 +00:00
s6-setuidgid nginx ./occ app:enable files_texteditor
2018-01-30 09:56:04 +00:00
s6-setuidgid nginx ./occ app:enable files_pdfviewer
s6-setuidgid nginx ./occ app:enable theming
2018-01-30 10:11:38 +00:00
touch /var/lib/nextcloud/data/.installed
2018-01-30 07:54:21 +00:00
fi
s6-setuidgid nginx ./occ config:system:set --value "https://$DOMAIN" overwrite.cli.url
2018-01-30 09:15:20 +00:00
s6-setuidgid nginx ./occ config:system:set --value "localhost" trusted_domains 0
s6-setuidgid nginx ./occ config:system:set --value "$DOMAIN" trusted_domains 1
2018-01-30 10:48:45 +00:00
s6-setuidgid nginx ./occ config:system:set --value "syslog" log_type
s6-setuidgid nginx ./occ config:system:set --value "" logfile
s6-setuidgid nginx ./occ config:system:set --value "3" loglevel
2018-01-30 07:54:21 +00:00
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
2018-01-30 09:15:20 +00:00
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BASE_DN" user_ldap ldap_base
2018-01-30 07:54:21 +00:00
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
2018-01-30 09:56:04 +00:00
s6-setuidgid nginx ./occ config:app:set --value "$(php -r 'echo base64_encode(getenv("LDAP_BIND_PASSWORD"));')" user_ldap ldap_agent_password
2018-01-30 07:54:21 +00:00
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:-389}" user_ldap ldap_port
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_BASE_USER_DN" user_ldap ldap_base_users
2018-01-30 09:15:20 +00:00
s6-setuidgid nginx ./occ config:app:set --value "$LDAP_UID_ATTRIBUTE" user_ldap ldap_expert_username_attr
2018-01-30 09:32:33 +00:00
s6-setuidgid nginx ./occ config:app:set --value "yes" user_ldap enabled
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_host
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_port
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_port
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_port
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_port
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_backup_port
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_user_display_name_2
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_gid_number
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_userfilter_objectclass
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_userfilter_groups
s6-setuidgid nginx ./occ config:app:set --value "authentication" user_ldap types
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_user_filter_mode
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_group_filter_mode
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_groupfilter_objectclass
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_turn_off_cert_check
s6-setuidgid nginx ./occ config:app:set --value "uniqueMember" user_ldap ldap_group_member_assoc_attribute
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_login_filter_mode
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_loginfilter_email
s6-setuidgid nginx ./occ config:app:set --value "1" user_ldap ldap_loginfilter_username
s6-setuidgid nginx ./occ config:app:set --value "1" user_ldap ldap_loginfilter_attributes
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_quota_attr
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_quota_def
s6-setuidgid nginx ./occ config:app:set --value "600" user_ldap ldap_cache_ttl
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_override_main_server
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_attributes_for_user_search
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_attributes_for_group_search
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_experienced_admin
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap home_folder_naming_rule
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap has_memberof_filter_support
s6-setuidgid nginx ./occ config:app:set --value "1" user_ldap use_memberof_to_detect_membership
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_expert_uuid_user_attr
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_expert_uuid_group_attr
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap last_jpegPhoto_lookup
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_nested_groups
s6-setuidgid nginx ./occ config:app:set --value "500" user_ldap ldap_paging_size
s6-setuidgid nginx ./occ config:app:set --value "0" user_ldap ldap_turn_on_pwd_change
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_dynamic_group_member_url
s6-setuidgid nginx ./occ config:app:set --value "" user_ldap ldap_default_ppolicy_dn
s6-setuidgid nginx ./occ config:app:set --value "1" user_ldap ldap_configuration_active
2018-01-30 11:39:29 +00:00
2018-01-30 11:44:10 +00:00
sed -i -e "s|'maintenance' => false,|'maintenance' => false,'apps_paths' => array (0 => array ('path' => '/usr/share/webapps/nextcloud/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ('path' => '/var/lib/nextcloud/apps', 'url' => '/apps-appstore', 'writable' => true,),),|g" /etc/nextcloud/config.php