fix : correctifs 002 a 006 et de 008 a 019

This commit is contained in:
2026-03-18 10:12:33 +01:00
parent fb1aaac418
commit 0dddecd08f
12 changed files with 89 additions and 61 deletions

View File

@@ -281,7 +281,12 @@ REMOTE_DIR="${IA_BASE_DIR}"
log "Creating remote directories"
if ! ssh "${SSH_OPTS[@]}" "$IA_SSH" "mkdir -p '${REMOTE_DIR}/ferme' '${REMOTE_DIR}/sirh' '${REMOTE_DIR}/inventory' '${REMOTE_DIR}/user'"; then
MKDIR_CMD="mkdir -p '${REMOTE_DIR}/user'"
for DB in "${DBS_ARRAY[@]}"; do
MKDIR_CMD+=" '${REMOTE_DIR}/${DB}'"
done
if ! ssh "${SSH_OPTS[@]}" "$IA_SSH" "$MKDIR_CMD"; then
log "ERROR: remote mkdir failed"
discord_msg_users_error "" "" "Remote mkdir failed"
exit 1

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# -e omis volontairement : check_site retourne 1 pour les sites down
set -uo pipefail
###############################################################################
@@ -200,6 +201,8 @@ check_site() {
#######################################
main() {
trap '[[ -n "$STDERR_TMP" ]] && rm -f "$STDERR_TMP"' EXIT
local failures=0
for site in "${SITES[@]}"; do

View File

@@ -36,7 +36,7 @@ APP_URLS="ferme.malio-dev.fr inventory.malio-dev.fr sirh.malio-dev.fr"
###############################################################################
# Webhook Discord pour envoyer le résumé des vérifications
DISCORD_WEBHOOK_URL=https:
DISCORD_WEBHOOK_URL=
# Mention Discord en cas de problème
DISCORD_PING=@here

View File

@@ -135,7 +135,7 @@ send_discord_message() {
return 0
fi
payload="$(python3 -c 'import json,sys; print(json.dumps({"content": sys.argv[1]}))' "$message")" || {
payload="$(jq -n --arg content "$message" '{content: $content}')" || {
log "Impossible de construire le payload JSON Discord."
return 0
}
@@ -376,6 +376,10 @@ if [[ -n "$LOCAL_ROLES_FILE" ]]; then
if [[ -s "$ROLES_CREATE_LIST" ]]; then
while IFS= read -r role_name; do
[[ -z "$role_name" ]] && continue
if [[ ! "$role_name" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
log "WARNING: nom de rôle suspect ignoré : ${role_name}"
continue
fi
ROLE_EXISTS="$(
psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d postgres -tAc \