2023-11-02 14:22:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
run_as() {
|
|
|
|
if [ "$(id -u)" = 0 ]; then
|
|
|
|
su -p www-data -s /bin/sh -c "$1"
|
|
|
|
else
|
|
|
|
sh -c "$1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== INSTALLATION APP NEXTCLOUD ================================================"
|
|
|
|
|
2023-11-06 17:12:18 +01:00
|
|
|
echo "== CONFIG"
|
2023-11-06 16:18:09 +01:00
|
|
|
run_as 'php occ config:system:set trusted_domains 1 --value '${WEB_URL}
|
2023-11-06 17:12:18 +01:00
|
|
|
run_as 'php occ config:system:set overwrite.cli.url --value '${NEXTCLOUD_URL}
|
2023-11-06 18:42:03 +01:00
|
|
|
run_as 'php occ config:system:set overwritewebroot --value '${NEXTCLOUD_ALIAS}
|
2023-11-07 19:33:50 +01:00
|
|
|
run_as 'php occ config:system:set htaccess.RewriteBase --value '${NEXTCLOUD_ALIAS}
|
2023-11-06 16:18:09 +01:00
|
|
|
|
2023-11-02 14:22:16 +01:00
|
|
|
echo
|
|
|
|
echo "== CALENDAR"
|
|
|
|
run_as 'php occ app:install calendar'
|
|
|
|
run_as 'php occ app:update calendar'
|
|
|
|
run_as 'php occ app:enable calendar'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "==GROUP FOLDERS"
|
|
|
|
run_as 'php occ app:install groupfolders'
|
|
|
|
run_as 'php occ app:update groupfolders'
|
|
|
|
run_as 'php occ app:enable groupfolders'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== DECK"
|
|
|
|
run_as 'php occ app:install deck'
|
|
|
|
run_as 'php occ app:update deck'
|
|
|
|
run_as 'php occ app:enable deck'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== DRAWIO"
|
|
|
|
run_as 'php occ app:install drawio'
|
|
|
|
run_as 'php occ app:update drawio'
|
|
|
|
run_as 'php occ app:enable drawio'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== TASKS"
|
|
|
|
run_as 'php occ app:install tasks'
|
|
|
|
run_as 'php occ app:update tasks'
|
|
|
|
run_as 'php occ app:enable tasks'
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== FILES EXTERNAL"
|
|
|
|
run_as 'php occ app:install files_external'
|
|
|
|
run_as 'php occ app:update files_external'
|
|
|
|
run_as 'php occ app:enable files_external'
|
2023-11-13 16:40:30 +01:00
|
|
|
if [[ "${NEXTCLOUD_SAMBA}" == "1" ]]
|
|
|
|
then
|
|
|
|
run_as 'php occ files_external:import /envole/mount.json -q'
|
|
|
|
fi
|
2023-11-02 14:22:16 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== FILES MINDMAP"
|
|
|
|
run_as 'php occ app:install files_mindmap'
|
|
|
|
run_as 'php occ app:update files_mindmap'
|
|
|
|
run_as 'php occ app:enable files_mindmap'
|
|
|
|
|
2023-11-07 19:33:50 +01:00
|
|
|
echo
|
|
|
|
echo "== USER CAS"
|
2023-11-06 17:12:18 +01:00
|
|
|
if [[ "${MODE_AUTH}" == "CAS" && "${CAS_ACTIVATE}" == "1" ]]
|
2023-11-06 16:18:09 +01:00
|
|
|
then
|
|
|
|
cp -rf /envole/app/user_cas /var/www/html/custom_apps
|
|
|
|
chown www-data:www-data /var/www/html/custom_apps -R
|
|
|
|
run_as 'php occ config:app:set user_cas cas_server_hostname --value='${CAS_HOST}' -q'
|
2023-11-07 19:33:50 +01:00
|
|
|
run_as 'php occ config:app:set user_cas cas_server_path --value='${CAS_PATH}' -q'
|
2023-11-06 16:18:09 +01:00
|
|
|
run_as 'php occ config:app:set user_cas cas_server_port --value='${CAS_PORT}' -q'
|
|
|
|
run_as 'php occ config:app:set user_cas cas_use_proxy --value=0 -q'
|
|
|
|
run_as 'php occ config:app:set user_cas cas_server_version --value=2.0 -q'
|
|
|
|
run_as 'php occ config:app:set user_cas cas_force_login --value=1 -q'
|
|
|
|
run_as 'php occ config:app:set user_cas cas_disable_logout --value=0 -q'
|
|
|
|
run_as 'php occ app:enable user_cas'
|
|
|
|
else
|
|
|
|
run_as 'php occ app:disable user_cas'
|
|
|
|
rm -rf /var/www/html/custom_apps/user_cas
|
|
|
|
fi
|
2023-11-02 14:22:16 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "== USER LDAP"
|
2023-11-07 19:33:50 +01:00
|
|
|
if [[ "${LDAP_ACTIVATE}" == "1" ]]
|
|
|
|
then
|
|
|
|
run_as 'php occ app:install user_ldap'
|
|
|
|
run_as 'php occ app:update user_ldap'
|
|
|
|
run_as 'php occ app:enable user_ldap'
|
2023-11-13 16:40:30 +01:00
|
|
|
|
|
|
|
run_as 'php occ config:app:set user_ldap bgjRefreshInterval --value=300 -q'
|
|
|
|
run_as 'php occ config:app:set user_ldap cleanUpJobChunkSize --value=300 -q'
|
|
|
|
run_as 'php occ config:app:set user_ldap background_sync_interval --value=300 -q'
|
|
|
|
|
|
|
|
run_as 'php occ ldap:show-config s01' > /tmp/nextcloud-ldap.txt
|
|
|
|
if grep -q "Invalid configID" /tmp/nextcloud-ldap.txt;then run_as 'php occ ldap:create-empty-config -q'; fi
|
|
|
|
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapHost "${LDAP_HOST}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapPort "${LDAP_PORT}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapTLS "${LDAP_TLS}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapAgentName "${LDAP_USER}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapAgentPassword "${LDAP_PASSWORD}"'
|
|
|
|
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapBase "${LDAP_BASEDN}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapBaseGroups "${LDAP_BASEGROUP}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapBaseUsers "${LDAP_BASEUSER}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapConfigurationActive "1"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapExperiencedAdmin "0"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapExpertUUIDUserAttr "${LDAP_USERNAME}"'
|
|
|
|
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapLoginFilter "${LDAP_LOGIN_FILTER}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapUserFilter "${LDAP_USER_FILTER}"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapGroupFilter "${LDAP_GROUP_FILTER}"'
|
|
|
|
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapUserDisplayName "${LDAP_DISPLAYNAME}"'
|
|
|
|
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapCacheTTL "300"'
|
|
|
|
run_as 'php occ ldap:set-config s01 ldapPagingSize "0"'
|
|
|
|
|
|
|
|
#sudo -u www-data php /var/www/html/nextcloud/occ ldap:set-config s01 ldapGroupFilterObjectclass "${ldapGroupFilterObjectclass}"
|
|
|
|
#sudo -u www-data php /var/www/html/nextcloud/occ ldap:set-config s01 ldapGroupMemberAssocAttr "${ldapGroupMemberAssocAttr}"
|
|
|
|
#sudo -u www-data php /var/www/html/nextcloud/occ ldap:set-config s01 ldapUserFilterObjectclass "${ldapUserFilterObjectclass}"
|
|
|
|
#sudo -u www-data php /var/www/html/nextcloud/occ ldap:set-config s01 ldapEmailAttribute "${ldapEmailAttribute}"
|
|
|
|
|
2023-11-07 19:33:50 +01:00
|
|
|
else
|
|
|
|
run_as 'php occ app:disable user_ldap'
|
|
|
|
fi
|
2023-11-02 14:22:16 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|