From 92f652c74ad843f8b2409fd843d7d4ef2bafe2d9 Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 7 Nov 2023 19:33:50 +0100 Subject: [PATCH] nextcloud in alias redirect --- src/envole-1.0/docker-compose.yml | 6 ++-- src/envole-1.0/env/.env | 13 ++++---- src/envole-1.0/env/.env.zapp.nextcloud | 3 +- src/envole-1.0/envole.sh | 33 +++++++++---------- .../volume/nextcloud/prestart/prestart.sh | 19 +++++++---- 5 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/envole-1.0/docker-compose.yml b/src/envole-1.0/docker-compose.yml index 8188295..d83e2f5 100644 --- a/src/envole-1.0/docker-compose.yml +++ b/src/envole-1.0/docker-compose.yml @@ -73,13 +73,13 @@ services: networks: - envole-network ports: - - "9001:80" + - "9000:80" volumes: - ./volume/ninegate/data/private:/app/uploads - ./volume/ninegate/data/public:/app/public/uploads nextcloud: - image: reg.cadoles.com/envole/nextcloud + image: docker.io/library/nextcloud container_name: envole-nextcloud restart: always healthcheck: @@ -90,7 +90,7 @@ services: networks: - envole-network ports: - - 9002:80 + - 9001:80 volumes: - ./volume/nextcloud/html:/var/www/html - ./volume/nextcloud/app:/var/www/html/custom_apps diff --git a/src/envole-1.0/env/.env b/src/envole-1.0/env/.env index b1b298b..fc52b56 100644 --- a/src/envole-1.0/env/.env +++ b/src/envole-1.0/env/.env @@ -6,6 +6,7 @@ RELEASE_SYSTEM=linux # GLOBAL APP_ENV=PROD WEB_URL=localhost +WEB_PROTOCOL=http # ADMIN USER ADMIN_USER=admin @@ -56,35 +57,35 @@ CAS_PASSWORD=${ADMIN_PASSWORD}-keycloak CAS_HOST=keycloak CAS_PORT=8443 CAS_PATH=/auth/realms/envole/protocol/cas -CAS_URL=https://${CAS_HOST}:${CAS_PORT} +CAS_URL=${WEB_PROTOCOL}://${CAS_HOST}:${CAS_PORT} # NINEGATE NINEGATE_SERVICE_NAME=ninegate NINEGATE_ACTIVATE=1 NINEGATE_LOCAL=1 -NINEGATE_URL=http://localhost:8000 +NINEGATE_URL=${WEB_PROTOCOL}://${WEB_URL}:9000 # NINEGATE NEXTCLOUD_SERVICE_NAME=nextcloud NEXTCLOUD_ACTIVATE=0 NEXTCLOUD_LOCAL=1 -NEXTCLOUD_URL=http://localhost:8001 +NEXTCLOUD_URL=${WEB_PROTOCOL}://${WEB_URL}:9001 # ADMINER ADMINER_SERVICE_NAME=adminer ADMINER_ACTIVATE=0 ADMINER_LOCAL=1 -ADMINER_URL=http://localhost:9000/?server=${MARIADB_SERVICE_NAME}&username=${MARIADB_USER} +ADMINER_URL=${WEB_PROTOCOL}://${WEB_URL}:9100/?server=${MARIADB_SERVICE_NAME}&username=${MARIADB_USER} # PHPLDAPADMIN PHPLDAPADMIN_SERVICE_NAME=phpldapadmin PHPLDAPADMIN_ACTIVATE=0 PHPLDAPADMIN_LOCAL=1 -PHPLDAPADMIN_URL=http://localhost:9001 +PHPLDAPADMIN_URL=${WEB_PROTOCOL}://${WEB_URL}:9101 # NINEAPACHE NINEAPACHE_SERVICE_NAME=nineapache NINEAPACHE_ACTIVATE=0 NINEAPACHE_LOCAL=1 -NINEAPACHE_URL=http://localhost:9002 +NINEAPACHE_URL=${WEB_PROTOCOL}://${WEB_URL}:9102 diff --git a/src/envole-1.0/env/.env.zapp.nextcloud b/src/envole-1.0/env/.env.zapp.nextcloud index a278834..c32c38d 100644 --- a/src/envole-1.0/env/.env.zapp.nextcloud +++ b/src/envole-1.0/env/.env.zapp.nextcloud @@ -7,5 +7,4 @@ MYSQL_USER=${MARIADB_USER} MYSQL_PASSWORD=${MARIADB_PASSWORD} NEXTCLOUD_ADMIN_USER=${ADMIN_USER} NEXTCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} -NEXTCLOUD_ALIAS=/ - +NEXTCLOUD_ALIAS= diff --git a/src/envole-1.0/envole.sh b/src/envole-1.0/envole.sh index dcaae0f..756812f 100755 --- a/src/envole-1.0/envole.sh +++ b/src/envole-1.0/envole.sh @@ -6,19 +6,23 @@ # Fusionner l'ensemble des fichier .env en un seul rm -f ./.env.local cat ./env/.env* >> ./.env.local -. ./.env.local +. ./misc/tools/e-ihm.sh +. .env +. ./env/.env +. ./env/.env.local +# Start script +clear +BigTitle "ENVOLE" + +echo "========" +echo ${WEB_URL} +echo "========" # on remplace les valeur reprise dans les autres .env car podman interprète mal -#while IFS= read -r match; do -# eval "val=\${$match}" -# echo ${ADMIN_PASSWORD} -# echo ${match} -# echo ${!match} -# echo $val -# sed -i "s/${match}/${val}/g" ./.env.local -#done < <(grep -oP '\$\{\w+\}' ./.env.local) - +sed -i 's#${WEB_URL}#'${WEB_URL}'#g' ./.env.local +sed -i 's#${WEB_PROTOCOL}#'${WEB_PROTOCOL}'#g' ./.env.local +. ./.env.local sed -i 's#${ADMIN_PASSWORD}#'${ADMIN_PASSWORD}'#g' ./.env.local sed -i 's#${ADMIN_USER}#'${ADMIN_USER}'#g' ./.env.local @@ -49,14 +53,9 @@ sed -i 's#${NEXTCLOUD_ACTIVATE}#'${NEXTCLOUD_ACTIVATE}'#g' ./.env.local sed -i 's#${NEXTCLOUD_URL}#'${NEXTCLOUD_URL}'#g' ./.env.local # Include -. .env -. ./misc/tools/e-ihm.sh -. ./env/.env -. ./env/.env.local +. ./.env.local + -# Start script -clear -BigTitle "ENVOLE" #=========================================================================================================================================== #== STOP =================================================================================================================================== diff --git a/src/envole-1.0/volume/nextcloud/prestart/prestart.sh b/src/envole-1.0/volume/nextcloud/prestart/prestart.sh index 39676c1..4426262 100755 --- a/src/envole-1.0/volume/nextcloud/prestart/prestart.sh +++ b/src/envole-1.0/volume/nextcloud/prestart/prestart.sh @@ -14,8 +14,8 @@ echo "== INSTALLATION APP NEXTCLOUD ============================================ echo "== CONFIG" run_as 'php occ config:system:set trusted_domains 1 --value '${WEB_URL} run_as 'php occ config:system:set overwrite.cli.url --value '${NEXTCLOUD_URL} -#run_as 'php occ config:system:set htaccess.RewriteBase --value '${NEXTCLOUD_ALIAS} run_as 'php occ config:system:set overwritewebroot --value '${NEXTCLOUD_ALIAS} +run_as 'php occ config:system:set htaccess.RewriteBase --value '${NEXTCLOUD_ALIAS} echo echo "== CALENDAR" @@ -59,14 +59,14 @@ run_as 'php occ app:install files_mindmap' run_as 'php occ app:update files_mindmap' run_as 'php occ app:enable files_mindmap' +echo +echo "== USER CAS" if [[ "${MODE_AUTH}" == "CAS" && "${CAS_ACTIVATE}" == "1" ]] then - echo - echo "== USER CAS" 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' - run_as 'php occ config:app:set user_cas cas_server_path --value=/'${CAS_PATH}' -q' + run_as 'php occ config:app:set user_cas cas_server_path --value='${CAS_PATH}' -q' 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' @@ -80,9 +80,14 @@ fi echo echo "== USER LDAP" -run_as 'php occ app:install user_ldap' -run_as 'php occ app:update user_ldap' -run_as 'php occ app:enable user_ldap' +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 echo echo \ No newline at end of file