diff --git a/docker/.vscode/settings.json b/.vscode/settings.json similarity index 100% rename from docker/.vscode/settings.json rename to .vscode/settings.json diff --git a/dicos/90_envole.xml b/dicos/90_envole.xml index f4885b9..e424e11 100644 --- a/dicos/90_envole.xml +++ b/dicos/90_envole.xml @@ -3,7 +3,14 @@ + + + + + + + envole @@ -84,7 +91,9 @@ non + DOMSCRIBE nextcloud + @@ -109,6 +118,9 @@ ['CAS', 'SQL', 'LDAP'] + + ['none', 'byuser', 'byadmin'] + @@ -203,6 +215,7 @@ oui + openldap_ldaptemplate openldap_host openldap_port openldap_tls @@ -305,6 +318,7 @@ non nextcloud_samba_host + nextcloud_samba_domaine nextcloud_samba_name diff --git a/docker/doc/etude.html b/doc/etude.html similarity index 100% rename from docker/doc/etude.html rename to doc/etude.html diff --git a/docker/doc/etude.md b/doc/etude.md similarity index 100% rename from docker/doc/etude.md rename to doc/etude.md diff --git a/docker/doc/etude.pdf b/doc/etude.pdf similarity index 100% rename from docker/doc/etude.pdf rename to doc/etude.pdf diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d83e2f5..018dc7e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -66,7 +66,7 @@ services: container_name: envole-ninegate restart: always healthcheck: - test: curl --fail http://localhost || exit 1 + test: curl --fail http://localhost/ninegate || exit 1 interval: 1s timeout: 60s env_file: ./.env.local @@ -79,7 +79,7 @@ services: - ./volume/ninegate/data/public:/app/public/uploads nextcloud: - image: docker.io/library/nextcloud + image: reg.cadoles.com/envole/nextcloud container_name: envole-nextcloud restart: always healthcheck: diff --git a/docker/env/.env b/docker/env/.env index d504c3e..35eaf38 100644 --- a/docker/env/.env +++ b/docker/env/.env @@ -6,7 +6,7 @@ RELEASE_SYSTEM=linux # GLOBAL APP_ENV=PROD WEB_URL=localhost -WEB_PROTOCOL=http +PROTOCOLE=http # ADMIN USER ADMIN_USER=admin @@ -50,8 +50,12 @@ LDAP_TEMPLATE= LDAP_USERNAME=uid LDAP_FIRSTNAME=givenname LDAP_LASTNAME=sn +LDAP_DISPLAYNAME=displayName LDAP_EMAIL=mail LDAP_MEMBER=memberUid +LDAP_USER_FILTER="(&(${LDAP_USERNAME}=*)(objectClass=person)(!(description=Computer)))" +LDAP_LOGIN_FILTER="(&(${LDAP_USERNAME}=%uid)(objectClass=person)(!(description=Computer)))" +LDAP_GROUP_FILTER="(&(objectClass=posixGroup))" SCRIBE_GROUP=1 SCRIBE_MASTER=1 OPENLDAPREQNIVEAU01= @@ -81,6 +85,7 @@ NEXTCLOUD_SERVICE_NAME=nextcloud NEXTCLOUD_ACTIVATE=0 NEXTCLOUD_LOCAL=1 NEXTCLOUD_URL=${WEB_PROTOCOL}://${WEB_URL}:9001 +NEXTCLOUD_SAMBA=0 # ADMINER ADMINER_SERVICE_NAME=adminer @@ -94,6 +99,10 @@ PHPLDAPADMIN_ACTIVATE=0 PHPLDAPADMIN_LOCAL=1 PHPLDAPADMIN_URL=${WEB_PROTOCOL}://${WEB_URL}:9101 +# GENCONFIG +GENCONFIG_ACTIVATE=0 +GENCONFIG_URL=${WEB_PROTOCOL}://${WEB_URL}:9102 + # NINEAPACHE NINEAPACHE_SERVICE_NAME=nineapache NINEAPACHE_ACTIVATE=0 diff --git a/docker/env/.env.zapp.nextcloud b/docker/env/.env.zapp.nextcloud index c32c38d..1b53403 100644 --- a/docker/env/.env.zapp.nextcloud +++ b/docker/env/.env.zapp.nextcloud @@ -8,3 +8,4 @@ MYSQL_PASSWORD=${MARIADB_PASSWORD} NEXTCLOUD_ADMIN_USER=${ADMIN_USER} NEXTCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} NEXTCLOUD_ALIAS= + diff --git a/docker/env/.env.zapp.ninegate b/docker/env/.env.zapp.ninegate index 816d08e..12bc379 100644 --- a/docker/env/.env.zapp.ninegate +++ b/docker/env/.env.zapp.ninegate @@ -11,3 +11,5 @@ WIDPHPLDAPADMIN_URL=${PHPLDAPADMIN_URL} ACTIVATE_WIDNEXTCLOUD=${NEXTCLOUD_ACTIVATE} WIDNEXTCLOUD_URL=${NEXTCLOUD_URL} +ACTIVATE_WIDGENCONFIG=${GENCONFIG_ACTIVATE} +WIDGENCONFIG_URL=${GENCONFIG_URL} \ No newline at end of file diff --git a/docker/envole.sh b/docker/envole.sh index eddcdc5..b9b422e 100755 --- a/docker/envole.sh +++ b/docker/envole.sh @@ -6,13 +6,12 @@ # Fusionner l'ensemble des fichier .env en un seul rm -f ./.env.local cat ./env/.env* >> ./.env.local -. ./misc/tools/e-ihm.sh +. ./misc/e-ihm.sh . .env . ./env/.env . ./env/.env.local # Start script -clear BigTitle "ENVOLE" # on remplace les valeur reprise dans les autres .env car podman interprète mal @@ -124,6 +123,9 @@ up(){ Title "NETWORK" # On réinstall docker-ce car le reconf détruit le reseau docker, la reinstall de docker-ce rétablit le reseau apt-get install docker-ce --reinstall + + # ATTENTION A REVOIR car ouvre complétement le firewall + iptables -P INPUT ACCEPT fi # MARIADB diff --git a/docker/misc/tools/e-ihm.sh b/docker/misc/e-ihm.sh similarity index 100% rename from docker/misc/tools/e-ihm.sh rename to docker/misc/e-ihm.sh diff --git a/docker/misc/tools/bash_loading_animations.sh b/docker/misc/tools/bash_loading_animations.sh deleted file mode 100644 index 0985a80..0000000 --- a/docker/misc/tools/bash_loading_animations.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env bash - -# Source: https://github.com/Silejonu/bash_loading_animations - -# shellcheck disable=SC2034 # https://github.com/koalaman/shellcheck/wiki/SC2034 - -### Loading animations list ### -# The first value of an array is the interval (in seconds) between each frame - -## ASCII animations ## -# Will work in any terminal, including the TTY. -BLA_classic=( 0.25 '-' "\\" '|' '/' ) -BLA_box=( 0.2 ┤ ┴ ├ ┬ ) -BLA_bubble=( 0.6 · o O O o · ) -BLA_breathe=( 0.9 '  ()  ' ' (  ) ' '(    )' ' (  ) ' ) -BLA_growing_dots=( 0.5 '.  ' '.. ' '...' '.. ' '.  ' '   ' ) -BLA_passing_dots=( 0.25 '.  ' '.. ' '...' ' ..' '  .' '   ' ) -BLA_metro=( 0.2 '[    ]' '[=   ]' '[==  ]' '[=== ]' '[ ===]' '[  ==]' '[   =]' ) -BLA_snake=( 0.4 '[=     ]' '[~<    ]' '[~~=   ]' '[~~~<  ]' '[ ~~~= ]' '[  ~~~<]' '[   ~~~]' '[    ~~]' '[     ~]' '[      ]' ) -BLA_filling_bar=( 0.25 '█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '███████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '█████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '███████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '█████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '██████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '█████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '██████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒' '███████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒' '████████████████████▒▒▒▒▒▒▒▒▒▒▒▒' '█████████████████████▒▒▒▒▒▒▒▒▒▒▒' '██████████████████████▒▒▒▒▒▒▒▒▒▒' '███████████████████████▒▒▒▒▒▒▒▒▒' '████████████████████████▒▒▒▒▒▒▒▒' '█████████████████████████▒▒▒▒▒▒▒' '██████████████████████████▒▒▒▒▒▒' '███████████████████████████▒▒▒▒▒' '████████████████████████████▒▒▒▒' '█████████████████████████████▒▒▒' '██████████████████████████████▒▒' '███████████████████████████████▒' '████████████████████████████████') - -## UTF-8 animations ## -# Require Unicode support (will work in most modern terminals, but not in TTY). -# Some animations may not render properly with certain fonts. -BLA_classic_utf8=( 0.25 '—' "\\" '|' '/' ) -BLA_bounce=( 0.3 . · ˙ · ) -BLA_vertical_block=( 0.25 ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁ ) -BLA_horizontal_block=( 0.25 ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▉ ▊ ▋ ▌ ▍ ▎ ▏ ) -BLA_quarter=( 0.25 ▖ ▘ ▝ ▗ ) -BLA_triangle=( 0.45 ◢ ◣ ◤ ◥) -BLA_semi_circle=( 0.1 ◐ ◓ ◑ ◒ ) -BLA_rotating_eyes=( 0.4 ◡◡ ⊙⊙ ⊙⊙ ◠◠ ) -BLA_firework=( 0.4 '⢀' '⠠' '⠐' '⠈' '*' '*' ' ' ) -BLA_braille=( 0.2 ⠁ ⠂ ⠄ ⡀ ⢀ ⠠ ⠐ ⠈ ) -BLA_braille_whitespace=( 0.2 ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷ ) -BLA_trigram=( 0.25 ☰ ☱ ☳ ☶ ☴ ) -BLA_arrow=( 0.15 ▹▹▹▹▹ ▸▹▹▹▹ ▹▸▹▹▹ ▹▹▸▹▹ ▹▹▹▸▹ ▹▹▹▹▸ ▹▹▹▹▹ ▹▹▹▹▹ ▹▹▹▹▹ ▹▹▹▹▹ ▹▹▹▹▹ ▹▹▹▹▹ ▹▹▹▹▹ ) -BLA_bouncing_ball=( 0.4 '(●     )' '( ●    )' '(  ●   )' '(   ●  )' '(    ● )' '(     ●)' '(    ● )' '(   ●  )' '(  ●   )' '( ●    )' ) -BLA_big_dot=( 0.7 ∙∙∙ ●∙∙ ∙●∙ ∙∙● ) -BLA_modern_metro=( 0.15 ▰▱▱▱▱▱▱ ▰▰▱▱▱▱▱ ▰▰▰▱▱▱▱ ▱▰▰▰▱▱▱ ▱▱▰▰▰▱▱ ▱▱▱▰▰▰▱ ▱▱▱▱▰▰▰ ▱▱▱▱▱▰▰ ▱▱▱▱▱▱▰ ▱▱▱▱▱▱▱ ▱▱▱▱▱▱▱ ▱▱▱▱▱▱▱ ▱▱▱▱▱▱▱ ) -BLA_pong=( 0.35 '▐⠂       ▌' '▐⠈       ▌' '▐ ⠂      ▌' '▐ ⠠      ▌' '▐  ⡀     ▌' '▐  ⠠     ▌' '▐   ⠂    ▌' '▐   ⠈    ▌' '▐    ⠂   ▌' '▐    ⠠   ▌' '▐     ⡀  ▌' '▐     ⠠  ▌' '▐      ⠂ ▌' '▐      ⠈ ▌' '▐       ⠂▌' '▐       ⠠▌' '▐       ⡀▌' '▐      ⠠ ▌' '▐      ⠂ ▌' '▐     ⠈  ▌' '▐     ⠂  ▌' '▐    ⠠   ▌' '▐    ⡀   ▌' '▐   ⠠    ▌' '▐   ⠂    ▌' '▐  ⠈     ▌' '▐  ⠂     ▌' '▐ ⠠      ▌' '▐ ⡀      ▌' '▐⠠       ▌' ) -BLA_earth=( 0.45 🌍 🌎 🌏 ) -BLA_clock=( 0.2 🕛 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 ) -BLA_moon=( 0.8 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 ) -BLA_orange_pulse=( 0.35 🔸 🔶 🟠 🟠 🔶 ) -BLA_blue_pulse=( 0.35 🔹 🔷 🔵 🔵 🔷 ) -BLA_football=( 0.25 ' 👧⚽️       👦' '👧  ⚽️      👦' '👧   ⚽️     👦' '👧    ⚽️    👦' '👧     ⚽️   👦' '👧      ⚽️  👦' '👧       ⚽️👦 ' '👧      ⚽️  👦' '👧     ⚽️   👦' '👧    ⚽️    👦' '👧   ⚽️     👦' '👧  ⚽️      👦' ) -BLA_blink=( 0.25 😐 😐 😐 😐 😐 😐 😐 😐 😐 😑 ) -BLA_camera=( 0.1 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📷 📸 📷 📸 ) -BLA_sparkling_camera=( 0.1 '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📷 ' '📸✨' '📷 ' '📸✨' ) -BLA_sick=( 0.9 🤢 🤢 🤮 ) -BLA_monkey=( 0.4 🙉 🙈 🙊 🙈 ) -BLA_bomb=( 0.25 '💣   ' ' 💣  ' '  💣 ' '   💣' '   💣' '   💣' '   💣' '   💣' '   💥' '    ' '    ' ) - -declare -a BLA_active_loading_animation - -BLA::play_loading_animation_loop() { - while true ; do - for frame in "${BLA_active_loading_animation[@]}" ; do - printf "\r%s" "${frame}" - sleep "${BLA_loading_animation_frame_interval}" - done - done -} - -BLA::start_loading_animation() { - BLA_active_loading_animation=( "${@}" ) - # Extract the delay between each frame from array BLA_active_loading_animation - BLA_loading_animation_frame_interval="${BLA_active_loading_animation[0]}" - unset "BLA_active_loading_animation[0]" - tput civis # Hide the terminal cursor - BLA::play_loading_animation_loop & - BLA_loading_animation_pid="${!}" -} - -BLA::stop_loading_animation() { - kill "${BLA_loading_animation_pid}" &> /dev/null - printf "\n" - tput cnorm # Restore the terminal cursor -} - - -############################################################################### -################################# USAGE GUIDE ################################# -############################################################################### -################## Read below for the explanations on how to ################## -################### show loading animations in your script. ################### -############################################################################### - -:<<'EXAMPLES' - -## Put these lines at the top of your script: -## (replace /path/to/bash_loading_animations.sh with the appropriate filepath) -# Load in the functions and animations -source /path/to/bash_loading_animations.sh -# Run BLA::stop_loading_animation if the script is interrupted -trap BLA::stop_loading_animation SIGINT - -# Show a loading animation for the command "foo" -BLA::start_loading_animation "${BLA_name_of_the_animation[@]}" -foo -BLA::stop_loading_animation - -# If foo prints some output in the terminal, you may want to add: -foo 1> /dev/null # hide standard output -# or -foo 2> /dev/null # hide error messages -# or -foo &> /dev/null # hide all output - -EXAMPLES diff --git a/docker/volume/nextcloud/envole/app/user_cas/lib/Service/AppService.php b/docker/volume/nextcloud/envole/app/user_cas/lib/Service/AppService.php index ad7e722..93cd175 100644 --- a/docker/volume/nextcloud/envole/app/user_cas/lib/Service/AppService.php +++ b/docker/volume/nextcloud/envole/app/user_cas/lib/Service/AppService.php @@ -299,7 +299,6 @@ class AppService } $serviceBasedUrl = $this->getServiceBasedUrl(); - $this->loggingService->write(\OCA\UserCas\Service\LoggingService::ERROR, 'MON SERVICE BASE = '.$serviceBasedUrl); # Initialize client if ($this->casUseProxy) { diff --git a/docker/volume/nextcloud/prestart/prestart.sh b/docker/volume/nextcloud/prestart/prestart.sh index 4426262..22281d3 100755 --- a/docker/volume/nextcloud/prestart/prestart.sh +++ b/docker/volume/nextcloud/prestart/prestart.sh @@ -52,6 +52,10 @@ 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' +if [[ "${NEXTCLOUD_SAMBA}" == "1" ]] +then +run_as 'php occ files_external:import /envole/mount.json -q' +fi echo echo "== FILES MINDMAP" @@ -85,6 +89,41 @@ 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' + + 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}" + else run_as 'php occ app:disable user_ldap' fi diff --git a/misc/nextcloud/containers/nextcloud/Dockerfile b/misc/nextcloud/containers/nextcloud/Dockerfile new file mode 100755 index 0000000..0d944c3 --- /dev/null +++ b/misc/nextcloud/containers/nextcloud/Dockerfile @@ -0,0 +1,3 @@ +FROM nextcloud:apache + +RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/misc/nextcloud/docker-compose.yml b/misc/nextcloud/docker-compose.yml new file mode 100755 index 0000000..856024b --- /dev/null +++ b/misc/nextcloud/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' + +services: + nextcloud: + build: + context: ./containers/nextcloud + image: reg.cadoles.com/envole/nextcloud + container_name: nextcloud + \ No newline at end of file diff --git a/docker/misc/nineapache7/containers/nineapache/Dockerfile b/misc/nineapache7/containers/nineapache/Dockerfile similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/Dockerfile rename to misc/nineapache7/containers/nineapache/Dockerfile diff --git a/docker/misc/nineapache7/containers/nineapache/apache.conf b/misc/nineapache7/containers/nineapache/apache.conf similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/apache.conf rename to misc/nineapache7/containers/nineapache/apache.conf diff --git a/docker/misc/nineapache7/containers/nineapache/apache2.sh b/misc/nineapache7/containers/nineapache/apache2.sh similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/apache2.sh rename to misc/nineapache7/containers/nineapache/apache2.sh diff --git a/docker/misc/nineapache7/containers/nineapache/index.php b/misc/nineapache7/containers/nineapache/index.php similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/index.php rename to misc/nineapache7/containers/nineapache/index.php diff --git a/docker/misc/nineapache7/containers/nineapache/php.local.ini b/misc/nineapache7/containers/nineapache/php.local.ini similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/php.local.ini rename to misc/nineapache7/containers/nineapache/php.local.ini diff --git a/docker/misc/nineapache7/containers/nineapache/ssl.conf b/misc/nineapache7/containers/nineapache/ssl.conf similarity index 100% rename from docker/misc/nineapache7/containers/nineapache/ssl.conf rename to misc/nineapache7/containers/nineapache/ssl.conf diff --git a/docker/misc/nineapache7/docker-compose.yml b/misc/nineapache7/docker-compose.yml similarity index 100% rename from docker/misc/nineapache7/docker-compose.yml rename to misc/nineapache7/docker-compose.yml diff --git a/docker/misc/nineapache8/containers/nineapache/Dockerfile b/misc/nineapache8/containers/nineapache/Dockerfile similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/Dockerfile rename to misc/nineapache8/containers/nineapache/Dockerfile diff --git a/docker/misc/nineapache8/containers/nineapache/apache.conf b/misc/nineapache8/containers/nineapache/apache.conf similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/apache.conf rename to misc/nineapache8/containers/nineapache/apache.conf diff --git a/docker/misc/nineapache8/containers/nineapache/apache2.sh b/misc/nineapache8/containers/nineapache/apache2.sh similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/apache2.sh rename to misc/nineapache8/containers/nineapache/apache2.sh diff --git a/docker/misc/nineapache8/containers/nineapache/index.php b/misc/nineapache8/containers/nineapache/index.php similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/index.php rename to misc/nineapache8/containers/nineapache/index.php diff --git a/docker/misc/nineapache8/containers/nineapache/php.local.ini b/misc/nineapache8/containers/nineapache/php.local.ini similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/php.local.ini rename to misc/nineapache8/containers/nineapache/php.local.ini diff --git a/docker/misc/nineapache8/containers/nineapache/ssl.conf b/misc/nineapache8/containers/nineapache/ssl.conf similarity index 100% rename from docker/misc/nineapache8/containers/nineapache/ssl.conf rename to misc/nineapache8/containers/nineapache/ssl.conf diff --git a/docker/misc/nineapache8/docker-compose.yml b/misc/nineapache8/docker-compose.yml similarity index 100% rename from docker/misc/nineapache8/docker-compose.yml rename to misc/nineapache8/docker-compose.yml diff --git a/docker/misc/tools/cadoles_theme.css b/misc/tools/cadoles_theme.css similarity index 100% rename from docker/misc/tools/cadoles_theme.css rename to misc/tools/cadoles_theme.css diff --git a/misc/tools/e-ihm.sh b/misc/tools/e-ihm.sh new file mode 100755 index 0000000..75fab37 --- /dev/null +++ b/misc/tools/e-ihm.sh @@ -0,0 +1,186 @@ +#!/bin/bash + +TPUT=/usr/bin/tput +#test si TPUT est utilisable +if [ ! "$TERM" = "" ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then + FANCYTTY=1 +else + FANCYTTY=0 +fi + +Pause() { +if [ "$ModeTxt" == "yes" ];then + echo +elif [ "$ModeEad" == "yes" ];then + echo "
" +else + [ $FANCYTTY = 1 ] && $TPUT setaf 6 + echo " Appuyez sur Entrée pour continuer ..." + [ $FANCYTTY = 1 ] && $TPUT sgr0 + read BiDon +fi +} + +Echo() { +if [ "$ModeEad" != "yes" ]; +then + echo "$1" +else + echo "$1
" +fi +} + +EchoColor() { +if [ "$ModeTxt" = "yes" ];then + echo "$1" +elif [ "$ModeEad" = "yes" ];then + echo " $1
" +else + [ "$FANCYTTY" = 1 ] && $TPUT setaf $2 + echo "$1" + [ "$FANCYTTY" = 1 ] && $TPUT sgr0 +fi +} + +EchoRouge() { + EchoColor "$1" "1" "red" +} + +EchoVert() { + EchoColor "$1" "2" "green" +} + +EchoOrange() { + EchoColor "$1" "3" "orange" +} + +EchoBleu() { + EchoColor "$1" "4" "blue" +} + +EchoMagenta() { + EchoColor "$1" "5" "magenta" +} + +EchoCyan() { + EchoColor "$1" "6" "cyan" +} + +EchoBlanc() { + EchoColor "$1" "7" "white" +} + +EchoGras() { +if [ "$ModeTxt" == "yes" ];then + echo "$1" +elif [ "$ModeEad" == "yes" ];then + echo " $1
" +else + [ $FANCYTTY = 1 ] && $TPUT bold + echo "$1" + [ $FANCYTTY = 1 ] && $TPUT sgr0 +fi +} + +Clear() { +if [ "$ModeEad" != "yes" -a "$ModeTxt" != "yes" ];then + clear +fi +} + +Question_ouinon() { + #attention, il faut synchroniser les modifications avec /usr/share/pyshared/pyeole/ihm.py + question=$1 + [ "$2" = "" ] && interactive='True' || interactive=$2 + [ "$3" = "" ] && default="non" || default=$3 + [ "$4" = "" ] && level="info" || level=$4 + [ "$5" = "" ] && default_uninteractive=$default || default_uninteractive=$5 + [ ! "$interactive" = "True" ] && [ ! "$interactive" = "False" ] && echo "Question_ouinon : interactive doit être True ou False" && exit 1 + [ ! "$default" = "oui" ] && [ ! "$default" = "non" ] && echo "Question_ouinon : default doit etre oui ou non" && exit 1 + [ ! "$default_uninteractive" = "oui" ] && [ ! "$default_uninteractive" = "non" ] && echo "Question_ouinon : default_uninteractive doit etre oui ou non" && exit 1 + [ ! "$level" = "info" ] && [ ! "$level" = "warn" ] && [ ! "$level" = "err" ] && echo "Question_ouinon : level doit etre info, warn ou err" && exit 1 + #non interactive + if [ "$interactive" = "False" ]; then + Rep=default_uninteractive + else + question="$question [oui/non]" + if [ $level = "info" ]; then + echo "$question" + elif [ $level = "warn" ]; then + EchoOrange "$question" + else + EchoRouge "$question" + fi + echo -n "[$default] : " + read Rep + #passe en minuscule + Rep=`echo $Rep | tr A-Z a-z` + fi + if [ "$default" = "non" ]; then + if [ "$Rep" = "oui" -o "$Rep" = "o" -o "$Rep" = "yes" -o "$Rep" = "y" ];then + return 0 + else + return 1 + fi + else + if [ "$Rep" = "non" -o "$Rep" = "n" -o "$Rep" = "no" ];then + return 1 + else + return 0 + fi + fi +} + +EchoStart() { + for i in $(eval echo "{1..30}") + do + ligne+="=" + done + clear +} + +BigTitle(){ + size=`tput cols` + nb=${#1} + nbchar=$(($size - $nb - 4)) + + ligne="" + for i in $(eval echo "{1..$size}") + do + ligne+="=" + done + + finligne="" + for i in $(eval echo "{1..$nbchar}") + do + finligne+="=" + done + + echo + EchoVert $ligne + EchoVert "== $1 $finligne" + EchoVert $ligne + echo +} + +Title(){ + size=`tput cols` + nb=${#1} + nbchar=$(($size - $nb - 4)) + + ligne="" + for i in $(eval echo "{1..$size}") + do + ligne+="=" + done + + finligne="" + for i in $(eval echo "{1..$nbchar}") + do + finligne+="=" + done + + echo + EchoCyan "== $1 $finligne" + echo +} diff --git a/misc/tools/e-reconfigure.sh b/misc/tools/e-reconfigure.sh new file mode 100755 index 0000000..767794b --- /dev/null +++ b/misc/tools/e-reconfigure.sh @@ -0,0 +1,29 @@ +#!/bin/bash +. /usr/share/envole/docker/misc/e-ihm.sh + +RunCmd=CreoleRun + +clear +BigTitle "RECONFIGURE ENVOLE" +container_path_web=$(CreoleGet container_path_web non) + +Title "Rafraichissement creoled" +service creoled restart + +Title "Generation templates" +FILES="/usr/share/eole/creole/distrib/envole*" +for f in $FILES +do + if [ -f "$f" ] + then + EchoRouge $(basename $f) + CreoleCat -t $(basename $f) + fi +done + +Title "Restart apache" +service apache2 restart + +chmod +x $container_path_web/usr/share/envole/docker/envole.sh +$RunCmd "cd /usr/share/envole/docker && ./envole.sh" web + diff --git a/docker/misc/tools/fonts/Roboto/LICENSE.txt b/misc/tools/fonts/Roboto/LICENSE.txt similarity index 100% rename from docker/misc/tools/fonts/Roboto/LICENSE.txt rename to misc/tools/fonts/Roboto/LICENSE.txt diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Black.ttf b/misc/tools/fonts/Roboto/Roboto-Black.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Black.ttf rename to misc/tools/fonts/Roboto/Roboto-Black.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-BlackItalic.ttf b/misc/tools/fonts/Roboto/Roboto-BlackItalic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-BlackItalic.ttf rename to misc/tools/fonts/Roboto/Roboto-BlackItalic.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Bold.ttf b/misc/tools/fonts/Roboto/Roboto-Bold.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Bold.ttf rename to misc/tools/fonts/Roboto/Roboto-Bold.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-BoldItalic.ttf b/misc/tools/fonts/Roboto/Roboto-BoldItalic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-BoldItalic.ttf rename to misc/tools/fonts/Roboto/Roboto-BoldItalic.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Italic.ttf b/misc/tools/fonts/Roboto/Roboto-Italic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Italic.ttf rename to misc/tools/fonts/Roboto/Roboto-Italic.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Light.ttf b/misc/tools/fonts/Roboto/Roboto-Light.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Light.ttf rename to misc/tools/fonts/Roboto/Roboto-Light.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-LightItalic.ttf b/misc/tools/fonts/Roboto/Roboto-LightItalic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-LightItalic.ttf rename to misc/tools/fonts/Roboto/Roboto-LightItalic.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Medium.ttf b/misc/tools/fonts/Roboto/Roboto-Medium.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Medium.ttf rename to misc/tools/fonts/Roboto/Roboto-Medium.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-MediumItalic.ttf b/misc/tools/fonts/Roboto/Roboto-MediumItalic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-MediumItalic.ttf rename to misc/tools/fonts/Roboto/Roboto-MediumItalic.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Regular.ttf b/misc/tools/fonts/Roboto/Roboto-Regular.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Regular.ttf rename to misc/tools/fonts/Roboto/Roboto-Regular.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-Thin.ttf b/misc/tools/fonts/Roboto/Roboto-Thin.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-Thin.ttf rename to misc/tools/fonts/Roboto/Roboto-Thin.ttf diff --git a/docker/misc/tools/fonts/Roboto/Roboto-ThinItalic.ttf b/misc/tools/fonts/Roboto/Roboto-ThinItalic.ttf similarity index 100% rename from docker/misc/tools/fonts/Roboto/Roboto-ThinItalic.ttf rename to misc/tools/fonts/Roboto/Roboto-ThinItalic.ttf diff --git a/docker/misc/tools/logo.png b/misc/tools/logo.png similarity index 100% rename from docker/misc/tools/logo.png rename to misc/tools/logo.png diff --git a/tmpl/envole-nextcloud.env b/tmpl/envole-nextcloud.env index 03e6ff8..29686c5 100644 --- a/tmpl/envole-nextcloud.env +++ b/tmpl/envole-nextcloud.env @@ -1,7 +1,6 @@ -#-- LOCAL +#-- LOCAL --------------------------------------------------------------------------------------------------------------------------------- -NEXTCLOUD_ACTIVATE=1 NEXTCLOUD_ALIAS=/nextcloud -NEXTCLOUD_URL=${WEB_PROTOCOL}://${WEB_URL}/nextcloud - +NEXTCLOUD_URL=${PROTOCOLE}://${WEB_URL}/nextcloud +NEXTCLOUD_SAMBA=%%getBool(%%getVar("nextcloud_samba", "non")) diff --git a/tmpl/envole-nextcloud.mount b/tmpl/envole-nextcloud.mount new file mode 100644 index 0000000..da14175 --- /dev/null +++ b/tmpl/envole-nextcloud.mount @@ -0,0 +1,27 @@ +[ + { + "mount_id": 1, + "mount_point": "\/Envole", + "storage": "\\OCA\\Files_External\\Lib\\Storage\\SMB", + "authentication_type": "password::userprovided", + "configuration": { + "check_acl": true, + "domain": "%%getVar('nextcloud_samba_domaine','')", + "host": "%%getVar('nextcloud_samba_host','')", + "root": "", + "share": "%%getVar('nextcloud_samba_name','')", + "show_hidden": false, + "timeout": "" + }, + "options": { + "enable_sharing": false, + "encoding_compatibility": false, + "encrypt": true, + "filesystem_check_changes": 1, + "previews": true, + "readonly": false + }, + "applicable_users": [], + "applicable_groups": [] + } +] diff --git a/tmpl/envole-ninegate.env b/tmpl/envole-ninegate.env new file mode 100644 index 0000000..302e7f3 --- /dev/null +++ b/tmpl/envole-ninegate.env @@ -0,0 +1,6 @@ + +#-- LOCAL --------------------------------------------------------------------------------------------------------------------------------- + +ALIAS=ninegate/ +FORCE_THEME=%%getBool(%%getVar("ninegate_forcetheme", "non")) +FORCE_THEMENAME=%%getVar("ninegate_forcethemename", "") diff --git a/tmpl/envole-phpldapadmin.env b/tmpl/envole-phpldapadmin.env index ffc3726..eaf3b8a 100644 --- a/tmpl/envole-phpldapadmin.env +++ b/tmpl/envole-phpldapadmin.env @@ -1,7 +1,7 @@ #-- LOCAL -PHPLDAPADMIN_ACTIVATE=1 +PHPLDAPADMIN_LDAP_HOSTS=ldap://${LDAP_HOST}:${LDAP_PORT} PHPLDAPADMIN_URL=/phpldapadmin PHPLDAPADMIN_SERVER_PATH=${PHPLDAPADMIN_URL} diff --git a/tmpl/envole-realm.json b/tmpl/envole-realm.json index 978a0d7..9995a70 100644 --- a/tmpl/envole-realm.json +++ b/tmpl/envole-realm.json @@ -435,16 +435,16 @@ "id": "133d3397-41e7-4ec1-aaf0-a0939da72f58", "clientId": "envole", "name": "envole", - "rootUrl": "https://eolebase.ac-test.fr", - "baseUrl": "https://eolebase.ac-test.fr", + "rootUrl": "https://%%getVar("web_url", 'localhost')", + "baseUrl": "https://%%getVar("web_url", 'localhost')", "surrogateAuthRequired": false, "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "secret": "**********", "redirectUris": [ - "http://eolebase.ac-test.fr*", - "https://eolebase.ac-test.fr*" + "http://%%getVar("web_url", 'localhost')*", + "https://%%getVar("web_url", 'localhost')*" ], "webOrigins": [], "notBefore": 0, @@ -1594,7 +1594,7 @@ "true" ], "usersDn": [ - "ou=users,ou=ninegate,dc=envole,dc=org" + "%%getVar("openldap_basedn", 'dc=envole,dc=org')" ], "cachePolicy": [ "DEFAULT" @@ -1612,13 +1612,13 @@ "uid" ], "bindCredential": [ - "changeme" + "%%getVar("openldap_password", '')" ], "changedSyncPeriod": [ "-1" ], "bindDn": [ - "cn=admin,dc=envole,dc=org" + "cn=%%getVar("openldap_user", 'admin'),%%getVar("openldap_basedn", 'dc=envole,dc=org')" ], "lastSync": [ "1698698495" @@ -1630,7 +1630,7 @@ "entryUUID" ], "connectionUrl": [ - "ldap://openldap:1389" + "ldap://%%getVar("openldap_host", 'openldap'):%%getVar("openldap_port", '1389')" ], "allowKerberosAuthentication": [ "false" @@ -1645,7 +1645,7 @@ "false" ], "searchScope": [ - "1" + "2" ], "useTruststoreSpi": [ "ldapsOnly" diff --git a/tmpl/envole.env b/tmpl/envole.env index 091748c..40e66ba 100644 --- a/tmpl/envole.env +++ b/tmpl/envole.env @@ -4,19 +4,19 @@ # GLOBAL RELEASE_SYSTEM=eole WEB_URL=%%getVar('web_url','') -WEB_PROTOCOL=https +PROTOCOLE=https MASTERIDENTITY=%%getVar('envole_masteridentity','') MODE_AUTH=%%getVar('envole_modeauth','') # ANNUAIRE LDAP_ACTIVATE=%%getBool(%%getVar("activer_openldap", "non")) LDAP_LOCAL=%%getBool(%%getVar("openldap_local", "non")) -LDAP_HOST=%%getVar("openldap_host", '') -LDAP_PORT=%%getVar("openldap_port", '') +LDAP_HOST=%%getVar("openldap_host", 'openldap') +LDAP_PORT=%%getVar("openldap_port", '1389') LDAP_TLS=%%getBool(%%getVar("openldap_tls", "non")) -LDAP_BASEDN="%%getVar("openldap_basedn", '')" -LDAP_ADMIN_USERNAME=%%getVar("openldap_user", '') -LDAP_USER="cn=%%getVar("openldap_user", ''),%%getVar("openldap_basedn", '')" +LDAP_BASEDN="%%getVar("openldap_basedn", 'dc=envole,dc=org')" +LDAP_ADMIN_USERNAME=%%getVar("openldap_user", 'admin') +LDAP_USER="cn=%%getVar("openldap_user", 'admin'),%%getVar("openldap_basedn", 'dc=envole,dc=org')" LDAP_PASSWORD="%%getVar("openldap_password", '')" # SYNCHRONISATION ANNUAIRE<>NINEGATE @@ -43,16 +43,17 @@ LDAP_BASEGROUP="%%getVar(%%ninegate_openldapsubbranchgroup,%%getVar(%%ldap_base_ %end if # CAS -%if %%getVar("MODE_AUTH", '') == "CAS" +%if %%getVar("envole_modeauth", '') == "CAS" CAS_ACTIVATE=1 %else CAS_ACTIVATE=0 %end if CAS_LOCAL=%%getBool(%%getVar("cas_local", "non")) -CAS_HOST=%%getVar("cas_host", "") -CAS_PORT=%%getVar("cas_port", "") -CAS_PATH=%%getVar("cas_path", "") -CAS_URL=https://%%getVar("cas_host", ""):%%getVar("cas_port", "") +CAS_HOST=%%getVar("cas_host", %%getVar("web_url")) +CAS_PORT=%%getVar("cas_port", "8443") +CAS_PATH=%%getVar("cas_path", "/auth/realms/envole/protocol/cas") +CAS_URL=https://%%getVar("cas_host", %%getVar("web_url")):%%getVar("cas_port", "8443") +CAS_PASSWORD=%%getVar("keycload_userpassword", "") # NINEGATE NINEGATE_ACTIVATE=%%getBool(%%getVar("activer_ninegate", "non")) @@ -72,3 +73,7 @@ ADMINER_URL=/adminer/?server=${MARIADB_SERVICE_NAME}&username=${MARIADB_USER} PHPLDAPADMIN_ACTIVATE=%%getBool(%%getVar("activer_phpldapadmin", "non")) PHPLDAPADMIN_LOCAL=1 PHPLDAPADMIN_URL=/phpldapadmin + +# GENCONFIG +GENCONFIG_ACTIVATE=%%getBool(%%getVar("activer_genconfig", "non")) +GENCONFIG_URL=/genconfig