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'
|
|
|
|
|
|
|
|
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'
|
|
|
|
else
|
|
|
|
run_as 'php occ app:disable user_ldap'
|
|
|
|
fi
|
2023-11-02 14:22:16 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|