Compare commits
39 Commits
2b78bbfc6c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e865a59757 | |||
| abb146483f | |||
| d363411dae | |||
| 9ebf787775 | |||
| 3312071f2d | |||
| a73c2db27d | |||
| ffd284e2c8 | |||
| f0b650e9ed | |||
| c8e7cebfd6 | |||
| cb24266167 | |||
| c5bced89d8 | |||
| 6e72fef23e | |||
| a2ca914b62 | |||
| f3fa9a33e5 | |||
| 6dd19e07a3 | |||
| c7c8d5be3c | |||
| d99bf81014 | |||
| 71ae93752a | |||
| 95d468913d | |||
| b1817e2c16 | |||
| 573c087b4d | |||
| 0dbe6115ca | |||
| eafa62ffb9 | |||
| 33f49eb78a | |||
| 421276dc83 | |||
| f219b2d339 | |||
| 1d822f66c9 | |||
| ff07c8aee7 | |||
| 598e215ed1 | |||
| ea9febcde0 | |||
| 51d57223c9 | |||
| bb4fefcdda | |||
| 47f708045e | |||
| fdd94bc9a1 | |||
| 366c019c0e | |||
| d9f642ecf7 | |||
| ea58b63659 | |||
| f1f99aafeb | |||
| 7e0de9ee8b |
@@ -1,6 +1,7 @@
|
||||
# kaz
|
||||
|
||||
[Kaz](https://kaz.bzh/) est un CHATONS du Morbihan. Nous proposons ici un moyen de le répliquer dans d'autres lieux. Il y a des éléments de configuration à définir avant d'initialiser ce simulateur.
|
||||
[Kaz](https://kaz.bzh/) est un CHATONS du Morbihan. Nous proposons ici un moyen de le répliquer dans d'autres lieux. Il y a des éléments de configuration à définir avant d'initialiser ce
|
||||
simulateur..
|
||||
|
||||
|
||||
Il est possible de simuler notre CHATONS dans une VirtualBox pour mettre au point nos différents services (voir [kaz-vagrant](https://git.kaz.bzh/KAZ/kaz-vagrant)).
|
||||
|
||||
+9
-4
@@ -4,14 +4,14 @@
|
||||
#Kan: 2021
|
||||
#Koi: gestion dockers
|
||||
|
||||
#02/07/2026: fab: ajout de la sauvegarde pour pollaris
|
||||
|
||||
# 20/04/2025: Did : Ajout des sauvegardes de peertube dans les services generaux
|
||||
|
||||
# 15/01/2025: Dernière modif by fab: ne pas redémarrer Traefik en cas de créaio d'orga
|
||||
# Did : 13 fevrier 2025 modif des save en postgres et mysql
|
||||
# Did : ajout des sauvegardes de mobilizon et mattermost en postgres
|
||||
|
||||
# 20/04/2025
|
||||
# Did : Ajout des sauvegardes de peertube dans les services generaux
|
||||
|
||||
|
||||
# En cas d'absence de postfix, il faut lancer :
|
||||
# docker network create postfix_mailNet
|
||||
|
||||
@@ -229,6 +229,11 @@ saveComposes () {
|
||||
. $KAZ_KEY_DIR/env-mastodonDB
|
||||
saveDB ${mastodonDBName} "${POSTGRES_USER}" "${POSTGRES_PASSWORD}" "${POSTGRES_DB}" mastodon postgres
|
||||
;;
|
||||
pollaris)
|
||||
echo "save pollaris (new kazdate)"
|
||||
. $KAZ_KEY_DIR/env-pollarisDB
|
||||
saveDB ${pollarisDBName} "${POSTGRES_USER}" "${POSTGRES_PASSWORD}" "${POSTGRES_DB}" pollaris postgres
|
||||
;;
|
||||
roundcube)
|
||||
echo "save roundcube"
|
||||
. $KAZ_KEY_DIR/env-roundcubeDB
|
||||
|
||||
+120
-20
@@ -5,6 +5,8 @@
|
||||
# ki : fab
|
||||
# test git du 02/10/2023 depuis snster
|
||||
|
||||
#maj by fab du 05/07/2026: remplacer les appels mmctl soit par l'api REST soit par un webhook entrant
|
||||
|
||||
# !!! need by htpasswd
|
||||
# apt-get install apache2-utils dos2unix
|
||||
|
||||
@@ -42,6 +44,7 @@ cd "${KAZ_ROOT}"
|
||||
. $KAZ_KEY_DIR/env-ldapServ
|
||||
. $KAZ_KEY_DIR/env-sympaServ
|
||||
. $KAZ_KEY_DIR/env-paheko
|
||||
. $KAZ_KEY_DIR/env-mattermostAdmin
|
||||
|
||||
# DOCK_DIR="${KAZ_COMP_DIR}" # ???
|
||||
|
||||
@@ -218,15 +221,36 @@ FILE_LDIF=/home/sauve/ldap.ldif
|
||||
gunzip ${FILE_LDIF}.gz -f
|
||||
grep -aEiorh '([[:alnum:]]+([._-][[:alnum:]]+)*@[[:alnum:]]+([._-][[:alnum:]]+)*\.[[:alpha:]]{2,6})' ${FILE_LDIF} | sort -u > ${TFILE_EMAIL}
|
||||
|
||||
echo "récupération des login mattermost... "
|
||||
docker exec -i mattermostServ bin/mmctl user list --all | grep ":.*(" | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort > "${TFILE_MM}"
|
||||
# remplacé par la l'API REST
|
||||
# echo "récupération des login mattermost... "
|
||||
# docker exec -i mattermostServ bin/mmctl user list --all | grep ":.*(" | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort > "${TFILE_MM}"
|
||||
|
||||
> "${TFILE_MM}"
|
||||
|
||||
page=0
|
||||
while true; do
|
||||
json=$(curl -s \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
"https://${URL_AGORA}/api/v4/users?page=${page}&per_page=200")
|
||||
|
||||
nb=$(echo "${json}" | jq 'length')
|
||||
|
||||
if [ "${nb}" -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "${json}" | jq -r '.[].username' >> "${TFILE_MM}"
|
||||
page=$((page + 1))
|
||||
done
|
||||
sort -o "${TFILE_MM}" "${TFILE_MM}"
|
||||
|
||||
|
||||
dos2unix "${TFILE_MM}"
|
||||
echo "done"
|
||||
|
||||
# remplacé par la l'API REST
|
||||
# se connecter à l'agora pour ensuite pouvoir passer toutes les commandes mmctl
|
||||
. $KAZ_KEY_DIR/env-mattermostAdmin
|
||||
echo "docker exec -i mattermostServ bin/mmctl auth login ${httpProto}://${URL_AGORA} --name local-server --username ${mattermost_user} --password ${mattermost_pass}" | tee -a "${CMD_INIT}"
|
||||
# . $KAZ_KEY_DIR/env-mattermostAdmin
|
||||
# echo "docker exec -i mattermostServ bin/mmctl auth login ${httpProto}://${URL_AGORA} --name local-server --username ${mattermost_user} --password ${mattermost_pass}" | tee -a "${CMD_INIT}"
|
||||
|
||||
# vérif des emails
|
||||
regex="^(([A-Za-z0-9]+((\.|\-|\_|\+)?[A-Za-z0-9]?)*[A-Za-z0-9]+)|[A-Za-z0-9]+)@(([A-Za-z0-9]+)+((\.|\-|\_)?([A-Za-z0-9]+)+)*)+\.([A-Za-z]{2,})+$"
|
||||
@@ -591,25 +615,90 @@ userPassword: {CRYPT}${pass}\n\n' | ldapmodify -c -H ldap://${LDAP_IP} -D \"cn=$
|
||||
fi
|
||||
|
||||
if grep -q "^${IDENT_KAZ}$" "${TFILE_MM}" 2>/dev/null; then
|
||||
echo "${IDENT_KAZ} existe déjà sur mattermost" | tee -a "${LOG}"
|
||||
echo "${IDENT_KAZ} existe déjà sur mattermost" | tee -a "${LOG}"
|
||||
else
|
||||
# on créé le compte mattermost
|
||||
echo "docker exec -i mattermostServ bin/mmctl user create --email ${EMAIL_SOUHAITE} --username ${IDENT_KAZ} --password ${PASSWORD}" | tee -a "${CMD_LOGIN}"
|
||||
# et enfin on ajoute toujours le user à l'équipe KAZ et aux 2 channels publiques
|
||||
echo "docker exec -i mattermostServ bin/mmctl team users add kaz ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:une-question--un-soucis ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:cafe-du-commerce--ouvert-2424h ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
|
||||
# on créé le compte mattermost
|
||||
#echo "docker exec -i mattermostServ bin/mmctl user create --email ${EMAIL_SOUHAITE} --username ${IDENT_KAZ} --password ${PASSWORD}" | tee -a "${CMD_LOGIN}"
|
||||
#on remplace par l'api rest
|
||||
|
||||
#KAZ a quelle team id ?
|
||||
KAZ_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/kaz" | jq -r '.id')
|
||||
CHAN1_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/kaz/channels/name/une-question--un-soucis" | jq -r '.id')
|
||||
CHAN2_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/kaz/channels/name/cafe-du-commerce--ouvert-2424h" | jq -r '.id')
|
||||
|
||||
cat >> "${CMD_LOGIN}" <<EOF
|
||||
resp=\$(curl -s -X POST "https://${URL_AGORA}/api/v4/users" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"${EMAIL_SOUHAITE}","username":"${IDENT_KAZ}","password":"${PASSWORD}"}')
|
||||
|
||||
USER_ID=\$(echo "\$resp" | jq -r '.id')
|
||||
|
||||
# et enfin on ajoute toujours le user à l'équipe KAZ et aux 2 channels publiques
|
||||
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/teams/${KAZ_ID}/members" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "team_id": "${KAZ_ID}", "user_id": "'"\${USER_ID}"'"}'
|
||||
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/channels/${CHAN1_ID}/members" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "user_id": "'"\${USER_ID}"'"}'
|
||||
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/channels/${CHAN2_ID}/members" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "user_id": "'"\${USER_ID}"'"}'
|
||||
EOF
|
||||
|
||||
# echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:une-question--un-soucis ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
# echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:cafe-du-commerce--ouvert-2424h ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
|
||||
NB_SERVICES_BASE=$((NB_SERVICES_BASE+1))
|
||||
fi
|
||||
|
||||
if [ "${EQUIPE_AGORA}" != "" -a "${EQUIPE_AGORA}" != "kaz" ]; then
|
||||
# l'équipe existe t-elle déjà ?
|
||||
nb=$(docker exec mattermostServ bin/mmctl team list | grep -w "${EQUIPE_AGORA}" | wc -l)
|
||||
if [ "${nb}" == "0" ];then # non, on la créé en mettant le user en admin de l'équipe
|
||||
echo "docker exec -i mattermostServ bin/mmctl team create --name ${EQUIPE_AGORA} --display-name ${EQUIPE_AGORA} --email ${EMAIL_SOUHAITE}" --private | tee -a "${CMD_INIT}"
|
||||
fi
|
||||
# puis ajouter le user à l'équipe
|
||||
echo "docker exec -i mattermostServ bin/mmctl team users add ${EQUIPE_AGORA} ${EMAIL_SOUHAITE}" | tee -a "${CMD_INIT}"
|
||||
# l'équipe existe t-elle déjà ?
|
||||
|
||||
#nb=$(docker exec mattermostServ bin/mmctl team list | grep -w "${EQUIPE_AGORA}" | wc -l)
|
||||
http_code=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/${EQUIPE_AGORA}")
|
||||
[ "$http_code" -eq 200 ] && nb=1 || nb=0
|
||||
|
||||
if [ "${nb}" == "0" ];then # non, on la créé en mettant le user en admin de l'équipe
|
||||
|
||||
#echo "docker exec -i mattermostServ bin/mmctl team create --name ${EQUIPE_AGORA} --display-name ${EQUIPE_AGORA} --email ${EMAIL_SOUHAITE}" --private | tee -a "${CMD_INIT}"
|
||||
|
||||
#################################
|
||||
cat >> "${CMD_LOGIN}" <<EOF
|
||||
resp=\$(curl -s -X POST "https://${URL_AGORA}/api/v4/teams" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "name":"${EQUIPE_AGORA}", "display_name":"${EQUIPE_AGORA}", "type":"I"}')
|
||||
|
||||
TEAM_ID=\$(echo "\$resp" | jq -r '.id')
|
||||
|
||||
#puis ajouter le user à l'équipe
|
||||
#echo "docker exec -i mattermostServ bin/mmctl team users add ${EQUIPE_AGORA} ${EMAIL_SOUHAITE}" | tee -a "${CMD_INIT}"
|
||||
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/teams/\${TEAM_ID}/members" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "team_id": "'"\${TEAM_ID}"'", "user_id": "'"\${USER_ID}"'" }'
|
||||
|
||||
#et on le rend admin de son équipe
|
||||
curl -s -X PUT "https://${URL_AGORA}/api/v4/teams/\${TEAM_ID}/members/\${USER_ID}/roles" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"scheme_admin": true , "scheme_user": true }'
|
||||
EOF
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if [ -n "${CREATE_ORGA_SERVICES}" ]; then
|
||||
@@ -757,8 +846,19 @@ bisou!"
|
||||
EOF" | tee -a "${CMD_MSG}"
|
||||
|
||||
echo " # on envoie la confirmation d'inscription sur l'agora " | tee -a "${CMD_MSG}"
|
||||
echo "docker exec -i mattermostServ bin/mmctl post create kaz:Creation-Comptes --message \"${MAIL_KAZ}\"" | tee -a "${CMD_MSG}"
|
||||
#echo "docker exec -i mattermostServ bin/mmctl post create kaz:Creation-Comptes --message \"${MAIL_KAZ}\"" | tee -a "${CMD_MSG}"
|
||||
|
||||
#pas réussi à le mettre dans CMD_MSG :(, je balance direct)
|
||||
payload=$(jq -n \
|
||||
--arg channel "creation-comptes" \
|
||||
--arg text "$MAIL_KAZ" \
|
||||
'{channel: $channel, text: $text}')
|
||||
|
||||
curl -i -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$payload" \
|
||||
"https://${URL_AGORA}/hooks/${token_webhook}"
|
||||
|
||||
# fin des inscriptions
|
||||
done <<< "${ALL_LINES}"
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ CONTAINERS_TYPES=
|
||||
|
||||
|
||||
declare -A DockerServNames # le nom des containers correspondant
|
||||
DockerServNames=( [cloud]="${nextcloudServName}" [agora]="${mattermostServName}" [wiki]="${dokuwikiServName}" [wp]="${wordpressServName}" [office]="${officeServName}" [paheko]="${pahekoServName}" [castopod]="${castopodServName}" [spip]="${spipServName}" )
|
||||
DockerServNames=( [cloud]="${nextcloudServName}" [agora]="${mattermostServName}" [wiki]="${dokuwikiServName}" [wp]="${wordpressServName}" [office]="${officeServName}" [paheko]="${pahekoServName}" [castopod]="${castopodServName}" [spip]="${spipServName}" [webdav]="${webdavServName}" )
|
||||
|
||||
declare -A FilterLsVolume # Pour trouver quel volume appartient à quel container
|
||||
FilterLsVolume=( [cloud]="cloudMain" [agora]="matterConfig" [wiki]="wikiConf" [wp]="wordpress" [castopod]="castopodMedia" [spip]="spip")
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
KAZ_ROOT=/kaz
|
||||
. $KAZ_ROOT/bin/.commonFunctions.sh
|
||||
setKazVars
|
||||
|
||||
. $DOCKERS_ENV
|
||||
. $KAZ_KEY_DIR/env-ldapServ
|
||||
|
||||
LDAP_IP=$(docker inspect -f '{{.NetworkSettings.Networks.ldapNet.IPAddress}}' ldapServ)
|
||||
|
||||
read -p "quel éditeur ? [vi] " EDITOR
|
||||
EDITOR=${EDITOR:-vi}
|
||||
|
||||
# if [ ${EDITOR} = 'emacs' ]; then
|
||||
# echo "ALERTE ALERTE !!! quelqu'un a voulu utiliser emacs :) :) :)"
|
||||
# exit
|
||||
# fi
|
||||
|
||||
EDITOR=${EDITOR:-vi}
|
||||
export EDITOR=${EDITOR}
|
||||
|
||||
ldapvi -h $LDAP_IP -D "cn=${LDAP_CONFIG_ADMIN_USERNAME},cn=config" -w ${LDAP_CONFIG_ADMIN_PASSWORD} -b cn=config
|
||||
@@ -41,7 +41,7 @@ CONTAINERS_TYPES=
|
||||
|
||||
|
||||
declare -A DockerServNames # le nom des containers correspondant
|
||||
DockerServNames=( [cloud]="${nextcloudServName}" [agora]="${mattermostServName}" [wiki]="${dokuwikiServName}" [wp]="${wordpressServName}" [office]="${officeServName}" [paheko]="${pahekoServName}" [castopod]="${castopodServName}" [spip]="${spipServName}" )
|
||||
DockerServNames=( [cloud]="${nextcloudServName}" [agora]="${mattermostServName}" [wiki]="${dokuwikiServName}" [wp]="${wordpressServName}" [office]="${officeServName}" [paheko]="${pahekoServName}" [castopod]="${castopodServName}" [spip]="${spipServName}" [webdav]="${webdavServName}")
|
||||
|
||||
declare -A FilterLsVolume # Pour trouver quel volume appartient à quel container
|
||||
FilterLsVolume=( [cloud]="cloudMain" [agora]="matterConfig" [wiki]="wikiConf" [wp]="wordpress" [castopod]="castopodMedia" [spip]="spip")
|
||||
|
||||
@@ -94,9 +94,11 @@ traefikHost=dashboard
|
||||
vaultwardenHost=koffre
|
||||
vigiloHost=vigilo
|
||||
webHost=
|
||||
webdavHost=webdav
|
||||
webmailHost=webmail
|
||||
wordpressHost=wp
|
||||
|
||||
|
||||
########################################
|
||||
# ports internes
|
||||
|
||||
@@ -152,6 +154,7 @@ vaultwardenServName=vaultwardenServ
|
||||
vaultwardenDBName=vaultwardenDB
|
||||
vigiloServName=vigiloServ
|
||||
vigiloDBName=vigiloDB
|
||||
webdavServName=webdavServ
|
||||
webServName=webServ
|
||||
wordpressServName=wpServ
|
||||
wordpressDBName=wpDB
|
||||
|
||||
@@ -229,8 +229,26 @@ services:
|
||||
volumes:
|
||||
- spip:/usr/src/spip
|
||||
#}}
|
||||
|
||||
|
||||
#{{webdav
|
||||
webdav:
|
||||
image: httpd:2.4
|
||||
container_name: ${orga}-${webdavServName}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- orgaNet
|
||||
environment:
|
||||
#surcharge dans compose.override.yml
|
||||
- LDAP_USERS=
|
||||
- DOMAIN=${domain}
|
||||
- LDAP_ROOT=${ldap_root}
|
||||
volumes:
|
||||
- wordpress:/var/www/webdav
|
||||
- ./webdav-conf/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
|
||||
- ./webdav-conf/httpd-webdav.conf:/usr/local/apache2/conf/extra/httpd-webdav.conf:ro
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${orga}-${webdavServName}.rule=Host(`${orga}-${webdavHost}.${domain}`)"
|
||||
#}}
|
||||
|
||||
|
||||
#{{services
|
||||
|
||||
+109
-2
@@ -5,7 +5,8 @@
|
||||
#KAN: ???
|
||||
|
||||
#MAJ le 04/06/2026 by fab: créer une entrée orga dans le dns pour simplifier les url (avec utilisation de compose-override.yml)
|
||||
|
||||
#MAJ le 16/06/2026 by fab: ajouter le menu +/-webdav
|
||||
#MAJ le 20/06/2026 by fab: générer le contenu du mail qui est à envoyer à l'orga après une création de service
|
||||
|
||||
# XXX pb arret des services retiré
|
||||
|
||||
@@ -40,8 +41,9 @@ usage(){
|
||||
echo " +/- matter*|agora : on/off agora"
|
||||
echo " +/- wiki : on/off wiki"
|
||||
echo " +/- wp|word* : on/off wp"
|
||||
echo " +/- webdav : on/off webdav"
|
||||
echo " +/- casto*|pod : on/off castopod"
|
||||
echo " +/- spip : on/off spip"
|
||||
echo " +/- spip : on/off spip"
|
||||
echo " x[GMk] : set quota"
|
||||
echo " OrgaName : name must contain a-z0-9_\-"
|
||||
}
|
||||
@@ -149,6 +151,7 @@ export collabora=$(flagInCompose docker-compose.yml collabora: off)
|
||||
export agora=$(flagInCompose docker-compose.yml agora: off)
|
||||
export wiki=$(flagInCompose docker-compose.yml dokuwiki: off)
|
||||
export wp=$(flagInCompose docker-compose.yml wordpress: off)
|
||||
export webdav=$(flagInCompose docker-compose.yml webdav: off)
|
||||
export castopod=$(flagInCompose docker-compose.yml castopod: off)
|
||||
export spip=$(flagInCompose docker-compose.yml spip: off)
|
||||
export db="off"
|
||||
@@ -202,6 +205,9 @@ for ARG in "$@"; do
|
||||
'-wp' | '-word'* )
|
||||
wp="off"
|
||||
;;
|
||||
'-webdav' )
|
||||
webdav="off"
|
||||
;;
|
||||
'-pod' | '-casto'* )
|
||||
castopod="off"
|
||||
;;
|
||||
@@ -233,6 +239,9 @@ for ARG in "$@"; do
|
||||
DBaInitialiser="$DBaInitialiser wp"
|
||||
INITCMD2="$INITCMD2 -wp"
|
||||
;;
|
||||
'+webdav' )
|
||||
webdav="on"
|
||||
;;
|
||||
'+pod' | '+casto'* )
|
||||
castopod="on"
|
||||
DBaInitialiser="$DBaInitialiser castopod"
|
||||
@@ -316,6 +325,12 @@ if [[ "${wp}" = "on" ]]; then
|
||||
else
|
||||
DEL_DOMAIN+="${ORGA}-${wordpressHost} "
|
||||
fi
|
||||
if [[ "${webdav}" = "on" ]]; then
|
||||
DOMAIN_AREA+=" - ${ORGA}-\${webdavServName}:${ORGA}-\${webdavHost}.\${domain}\n"
|
||||
ADD_DOMAIN+="${ORGA}-${webdavHost} "
|
||||
else
|
||||
DEL_DOMAIN+="${ORGA}-${webdavHost} "
|
||||
fi
|
||||
if [[ "${castopod}" = "on" ]]; then
|
||||
DOMAIN_AREA+=" - ${ORGA}-\${castopodServName}:${ORGA}-\${castopodHost}.\${domain}\n"
|
||||
ADD_DOMAIN+="${ORGA}-${castopodHost} "
|
||||
@@ -431,6 +446,8 @@ if [[ -n "${STAGE_DEFAULT}${STAGE_CREATE}" ]]; then
|
||||
ln -sf ../../config/orgaTmpl/wiki-conf/
|
||||
ln -sf ../../config/orgaTmpl/reload.sh
|
||||
ln -sf ../../config/orgaTmpl/init-db.sh
|
||||
ln -sf ../../config/orgaTmpl/webdav-conf/
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -d "${KAZ_KEY_DIR}/orgas/$ORGA/" ]; then
|
||||
@@ -494,6 +511,9 @@ if [[ -n "${STAGE_DEFAULT}" ]]; then
|
||||
wp)
|
||||
DockerServName="${ORGA}-${wordpressServName}"
|
||||
;;
|
||||
webdav)
|
||||
DockerServName="${ORGA}-${webdavServName}"
|
||||
;;
|
||||
esac
|
||||
if checkDockerRunning "${DockerServName}" "${service}"; then
|
||||
printKazMsg " - stop ${service}"
|
||||
@@ -524,3 +544,90 @@ if [[ -n "${STAGE_DEFAULT}" ]]; then
|
||||
# ########## update status web page
|
||||
${KAZ_COMP_DIR}/web/web-gen.sh
|
||||
fi
|
||||
|
||||
##### DEBUT MAIL
|
||||
#construction du mail qui peut être envoyé à l'orga en cas de création de services
|
||||
|
||||
if [[ -n "${STAGE_DEFAULT}${STAGE_CREATE}" ]]; then
|
||||
|
||||
GREEN='\e[32m'
|
||||
RESET='\e[0m'
|
||||
|
||||
MAIL="Bonjour,
|
||||
|
||||
et hop ! voici les accès au(x) service(s) demandé(s):
|
||||
"
|
||||
|
||||
if [[ "${wp}" = "on" ]]; then
|
||||
MAIL_ADMIN=`grep WORDPRESS_ADMIN_USER /kaz/secret/orgas/${ORGA}/env-wpServ | cut -f2 -d=`
|
||||
MAIL_ADMIN_PASS=`grep WORDPRESS_ADMIN_PASSWORD /kaz/secret/orgas/${ORGA}/env-wpServ | cut -f2 -d=`
|
||||
|
||||
MAIL="$MAIL
|
||||
Site Web:
|
||||
adresse: https://${ORGA}-wp.kaz.bzh
|
||||
identifiant: ${MAIL_ADMIN}
|
||||
mot de passe: ${MAIL_ADMIN_PASS}
|
||||
|
||||
doc: https://wiki.kaz.bzh/wordpress/start
|
||||
La première chose à faire est de paramétrer ton site pour qu'il puisse envoyer des mails: https://wiki.kaz.bzh/wordpress/premiere_connexion
|
||||
|
||||
Si tu as envie d'avoir comme adresse de site , https://${ORGA}.kaz.bzh au lieu de https://${ORGA}-wp.kaz.bzh, fais nous signe !
|
||||
"
|
||||
fi
|
||||
|
||||
if [[ "${cloud}" = "on" ]]; then
|
||||
MAIL_ADMIN=`grep NEXTCLOUD_ADMIN_USER /kaz/secret/orgas/${ORGA}/env-nextcloudServ | cut -f2 -d=`
|
||||
MAIL_ADMIN_PASS=`grep NEXTCLOUD_ADMIN_PASSWORD /kaz/secret/orgas/${ORGA}/env-nextcloudServ | cut -f2 -d=`
|
||||
|
||||
MAIL="$MAIL
|
||||
Cloud:
|
||||
adresse: https://${ORGA}-cloud.kaz.bzh
|
||||
identifiant: ${MAIL_ADMIN}
|
||||
mot de passe: ${MAIL_ADMIN_PASS}
|
||||
|
||||
doc: https://wiki.kaz.bzh/nextcloud/start
|
||||
La première chose à faire est de paramétrer ton cloud pour qu'il puisse envoyer des mails: https://wiki.kaz.bzh/nextcloud/administration/start#pour_parametrer_l_envoi_des_mails_de_notification_depuis_votre_cloud
|
||||
"
|
||||
fi
|
||||
|
||||
if [[ "${paheko}" = "on" ]]; then
|
||||
MAIL_ADMIN_PASS=$(apg -n 1 -m 16 -M NCL)
|
||||
|
||||
MAIL="$MAIL
|
||||
Paheko:
|
||||
adresse: https://${ORGA}-paheko.kaz.bzh/admin/
|
||||
identifiant: ${GREEN}--mettre ici le mail de l'orga--${RESET}
|
||||
mot de passe: ${MAIL_ADMIN_PASS}
|
||||
|
||||
doc: https://wiki.kaz.bzh/paheko/start
|
||||
"
|
||||
fi
|
||||
|
||||
MAIL="$MAIL
|
||||
Pour tes prochaines questions, nous t'invitons à les poser sur notre agora, dans le canal \"Un soucis, une question\" sur
|
||||
https://agora.kaz.bzh/kaz/channels/une-question--un-soucis
|
||||
Il faut te connecter avec ton compte kaz.
|
||||
|
||||
Ainsi, tout le monde pourra répondre mais aussi bénéficier des réponses apportées. On la joue collectif.
|
||||
|
||||
Bonne journée 😉
|
||||
|
||||
L'équipe Sysadmin, pour la collégiale de Kaz."
|
||||
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}"
|
||||
echo "*****************************************************"
|
||||
echo "Voici le mail à copier/coller et à envoyer à l'orga :"
|
||||
echo "*****************************************************"
|
||||
echo -e "${RESET}"
|
||||
echo -e "$MAIL"
|
||||
echo -e "${GREEN}"
|
||||
echo "MAIS AVANT D'ENVOYER CE MAIL, IL FAUT :
|
||||
* completer la fiche paheko de l'orga en cochant les services crees"
|
||||
|
||||
if [[ "${paheko}" = "on" ]]; then
|
||||
echo " * lancer /kaz/dockers/paheko/docker-compose-gen.sh, restart le docker puis finir d'installer paheko en allant sur https://${ORGA}-paheko.kaz.bzh/admin/"
|
||||
fi
|
||||
echo -e ${RESET}
|
||||
##### FIN MAIL
|
||||
|
||||
@@ -54,6 +54,7 @@ OVERRIDE_FILE="compose.override.yml"
|
||||
# sauvegarde si le fichier existe déjà
|
||||
if [ -f "$OVERRIDE_FILE" ]; then
|
||||
cp "$OVERRIDE_FILE" "${OVERRIDE_FILE}.$(date +%Y%m%d-%H%M%S).bak"
|
||||
echo "'tention, un $OVERRIDE_FILE existe déjà, il vient d'être sauvegardé !"
|
||||
fi
|
||||
|
||||
#on récupère toutes les variables utiles
|
||||
|
||||
@@ -12,11 +12,13 @@ Alias / /var/www/webdav/
|
||||
AuthName "WebDAV LDAP"
|
||||
AuthBasicProvider ldap
|
||||
|
||||
#variables présentes dans /kaz/secret/env-ldapServ
|
||||
AuthLDAPURL ${LDAP_URL}
|
||||
AuthLDAPBindDN ${LDAP_BIND_DN}
|
||||
AuthLDAPBindPassword ${LDAP_ADMIN_PASSWORD}
|
||||
AuthLDAPURL ldaps://ldap.${DOMAIN}:636/ou=users,${LDAP_ROOT}?mail?sub
|
||||
AuthLDAPInitialBindPattern (.+) cn=$1,ou=users,${LDAP_ROOT}
|
||||
AuthLDAPInitialBindAsUser on
|
||||
AuthLDAPCompareAsUser on
|
||||
AuthLDAPSearchAsUser on
|
||||
|
||||
#variable présente dans le docker-compose.yml de l'orga
|
||||
Require ldap-user ${LDAP_USERS}
|
||||
</Directory>
|
||||
|
||||
</Directory>
|
||||
@@ -16,6 +16,7 @@ olcAccess: {1}to dn.subtree="$LDAPROOT"
|
||||
by dn="cn=mobilizon,ou=applications,$LDAPROOT" read
|
||||
by dn="cn=mastodon,ou=applications,$LDAPROOT" read
|
||||
by dn="$BINDDN" write
|
||||
by users search
|
||||
by * none
|
||||
olcAccess: {2}to *
|
||||
by dn="$BINDDN" write
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
|
||||
app:
|
||||
image: mattermost/mattermost-team-edition:11.6.1
|
||||
image: mattermost/mattermost-team-edition:11.7.7
|
||||
container_name: ${mattermostServName}
|
||||
restart: ${restartPolicy}
|
||||
volumes:
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/environment:/etc/environment:ro
|
||||
- ./mostlymatter-amd64-v11.6.1:/mattermost/bin/mattermost
|
||||
- ./mostlymatter-amd64-v11.7.7:/mattermost/bin/mattermost
|
||||
env_file:
|
||||
- ../../secret/env-${mattermostServName}
|
||||
environment:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
reverse-proxy:
|
||||
image: traefik:v3.7.1
|
||||
image: traefik:v3.7.5
|
||||
container_name: ${traefikServName}
|
||||
restart: ${restartPolicy}
|
||||
# Enables the web UI and tells Traefik to listen to docker
|
||||
|
||||
@@ -8,7 +8,3 @@ LDAP_MATTERMOST_PASSWORD=@@pass@@ldapmm@@p@@
|
||||
LDAP_CLOUD_PASSWORD=@@pass@@ldapcloud@@p@@
|
||||
LDAP_MOBILIZON_PASSWORD=@@pass@@ldapmobilizon@@p@@
|
||||
LDAP_MASTODON_PASSWORD=@@pass@@ldapmastodon@@p@@
|
||||
|
||||
#utilisé pour webdav
|
||||
LDAP_URL=
|
||||
LDAP_BIND_DN=
|
||||
|
||||
Reference in New Issue
Block a user