Merge branch 'develop'

This commit is contained in:
afornerot 2024-07-27 11:05:35 +02:00
commit 5e139177f7
141 changed files with 35 additions and 146 deletions

3
env/.env vendored
View File

@ -111,7 +111,6 @@ CAS_PORT=8999
CAS_PATH=/auth/realms/nine/protocol/cas CAS_PATH=/auth/realms/nine/protocol/cas
CAS_URL=${PROTOCOLE}://${CAS_HOST}:${CAS_PORT} CAS_URL=${PROTOCOLE}://${CAS_HOST}:${CAS_PORT}
# DOKUWIKI # DOKUWIKI
DOKUWIKI_SERVICE_NAME=dokuwiki DOKUWIKI_SERVICE_NAME=dokuwiki
DOKUWIKI_ACTIVATE=0 DOKUWIKI_ACTIVATE=0
@ -120,7 +119,7 @@ DOKUWIKI_URL=${PROTOCOLE}://${WEB_URL}/dokuwiki
# NEXTCLOUD # NEXTCLOUD
NEXTCLOUD_SERVICE_NAME=nextcloud NEXTCLOUD_SERVICE_NAME=nextcloud
NEXTCLOUD_ACTIVATE=0 NEXTCLOUD_ACTIVATE=1
NEXTCLOUD_LOCAL=1 NEXTCLOUD_LOCAL=1
NEXTCLOUD_URL=${PROTOCOLE}://${WEB_URL}/nextcloud NEXTCLOUD_URL=${PROTOCOLE}://${WEB_URL}/nextcloud
NEXTCLOUD_SAMBA=0 NEXTCLOUD_SAMBA=0

23
nine.sh
View File

@ -139,7 +139,6 @@ apache(){
if [ -f "$dir/apache/apache.conf" ]; then if [ -f "$dir/apache/apache.conf" ]; then
cp "$dir/apache/apache.conf" services/10-nineapache/volume/apache/$valueservice.conf cp "$dir/apache/apache.conf" services/10-nineapache/volume/apache/$valueservice.conf
fi fi
done done
} }
@ -155,12 +154,25 @@ template() {
done done
} }
#===========================================================================================================================================
#== SERVICES ===============================================================================================================================
#===========================================================================================================================================
# Liste des services
services() {
Title "SERVICES"
for dir in $(ls -d "services"/[0-9][0-9]-* | sort); do
keyservice="${dir##*-}"
valueservice="${dir##*/}"
Echo $keyservice
done
}
#=========================================================================================================================================== #===========================================================================================================================================
#== MAIN =================================================================================================================================== #== MAIN ===================================================================================================================================
#=========================================================================================================================================== #===========================================================================================================================================
# Include variable d'environnement global # Include variable d'environnement global
mergeenv env/.env.merge env/.env env/.env.local mergeenv env/.env.merge env/.env env/.env.local
. env/.env.merge . env/.env.merge
@ -234,6 +246,9 @@ then
else else
destroy$2 destroy$2
fi fi
elif [[ $1 == "services" ]]
then
services
elif [[ $1 == "logs" ]] elif [[ $1 == "logs" ]]
then then
docker-compose logs -f $2 docker-compose logs -f $2
@ -266,12 +281,12 @@ else
EchoRouge "nine.sh bash monservice> lance un terminel dans le conteneur de monservice" EchoRouge "nine.sh bash monservice> lance un terminel dans le conteneur de monservice"
EchoRouge "nine.sh destroyall> détruit l'ensemble des services avec l'ensemble des BDD et des volumes persistant" EchoRouge "nine.sh destroyall> détruit l'ensemble des services avec l'ensemble des BDD et des volumes persistant"
EchoRouge "nine.sh destroy monservice> détruit monservices et si souhaitez sa BDD et ses volumes persistant" EchoRouge "nine.sh destroy monservice> détruit monservices et si souhaitez sa BDD et ses volumes persistant"
EchoRouge "nine.sh services > Liste des Services"
EchoRouge "nine.sh logs > LOGS de l'ensemble des services" EchoRouge "nine.sh logs > LOGS de l'ensemble des services"
EchoRouge "nine.sh logs monservice > LOGS de monservice" EchoRouge "nine.sh logs monservice > LOGS de monservice"
EchoRouge "nine.sh iswait monservice > monservice est-il en cours de construction" EchoRouge "nine.sh iswait monservice > monservice est-il en cours de construction"
EchoRouge "nine.sh regen > lance destroyall puis up sur l'ensemble des service" EchoRouge "nine.sh regen > lance destroyall puis up sur l'ensemble des service"
EchoRouge "nine.sh regen monservice > lance destroy monservice puis up monservice" EchoRouge "nine.sh regen monservice > lance destroy monservice puis up monservice"
fi fi
echo echo
echo echo

View File

@ -35,7 +35,7 @@ function destroykeycloak {
if [[ "$response" == 0 || ! -z $1 ]] if [[ "$response" == 0 || ! -z $1 ]]
then then
EchoRouge "Delete BDD = $KEYCLOAK_SERVICE_NAME" EchoRouge "Delete BDD = $KEYCLOAK_SERVICE_NAME"
docker-compose exec $KEYCLOAK_SERVICE_NAME /nine/delete.sh $KEYCLOAK_SERVICE_NAME docker-compose exec $MARIADB_SERVICE_NAME /nine/delete.sh $KEYCLOAK_SERVICE_NAME
fi fi
echo "" echo ""

View File

@ -5,11 +5,7 @@
nextcloud: nextcloud:
image: reg.cadoles.com/envole/nextcloud image: reg.cadoles.com/envole/nextcloud
container_name: nine-nextcloud container_name: nine-nextcloud
restart: unless-stopped restart: unless-stopped
healthcheck:
test: curl --fail http://localhost || exit 1
interval: 1s
timeout: 60s
env_file: ./services/50-nextcloud/env/.env.merge env_file: ./services/50-nextcloud/env/.env.merge
networks: networks:
- nine-network - nine-network

View File

@ -7,5 +7,5 @@ MYSQL_USER=${MARIADB_USER}
MYSQL_PASSWORD=${MARIADB_PASSWORD} MYSQL_PASSWORD=${MARIADB_PASSWORD}
NEXTCLOUD_ADMIN_USER=${ADMIN_USER} NEXTCLOUD_ADMIN_USER=${ADMIN_USER}
NEXTCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD} NEXTCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
NEXTCLOUD_ALIAS= NEXTCLOUD_ALIAS=${NEXTCLOUD_SERVICE_NAME}

View File

@ -4,7 +4,16 @@ function upnextcloud {
if [[ $NEXTCLOUD_ACTIVATE == 1 && $NEXTCLOUD_LOCAL == 1 ]] if [[ $NEXTCLOUD_ACTIVATE == 1 && $NEXTCLOUD_LOCAL == 1 ]]
then then
Title ${NEXTCLOUD_SERVICE_NAME^^} Title ${NEXTCLOUD_SERVICE_NAME^^}
# CREATE BDD
if [[ $MARIADB_ACTIVATE == 1 && $MARIADB_LOCAL == 1 ]]
then
EchoVert "DATABASE"
Echo ${NEXTCLOUD_SERVICE_NAME^^}
docker-compose exec $MARIADB_SERVICE_NAME /nine/init.sh $NEXTCLOUD_SERVICE_NAME
Echo
fi
EchoVert "CONTAINER" EchoVert "CONTAINER"
upservice ${NEXTCLOUD_SERVICE_NAME} upservice ${NEXTCLOUD_SERVICE_NAME}
Echo Echo
@ -26,6 +35,7 @@ function destroynextcloud {
if [[ "$response" == 0 || ! -z $1 ]] if [[ "$response" == 0 || ! -z $1 ]]
then then
EchoRouge "Purge = $NEXTCLOUD_SERVICE_NAME" EchoRouge "Purge = $NEXTCLOUD_SERVICE_NAME"
docker-compose exec $MARIADB_SERVICE_NAME /nine/delete.sh $NEXTCLOUD_SERVICE_NAME
rm -rf services/50-nextcloud/volume/data rm -rf services/50-nextcloud/volume/data
rm -rf services/50-nextcloud/volume/html rm -rf services/50-nextcloud/volume/html
rm -rf services/50-nextcloud/volume/app rm -rf services/50-nextcloud/volume/app

View File

@ -1,132 +0,0 @@
#!/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 ================================================"
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 overwritewebroot --value '${NEXTCLOUD_ALIAS}
run_as 'php occ config:system:set htaccess.RewriteBase --value '${NEXTCLOUD_ALIAS}
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'
if [[ "${NEXTCLOUD_SAMBA}" == "1" ]]
then
run_as 'php occ files_external:import /nine/mount.json -q'
fi
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'
echo
echo "== USER CAS"
if [[ "${MODE_AUTH}" == "CAS" && "${CAS_ACTIVATE}" == "1" ]]
then
cp -rf /nine/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_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
echo
echo "== 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'
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
echo
echo

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More