From 1786ab64d0944b28827fe0dd84d885df13452572 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 09:50:03 +0200 Subject: [PATCH 01/23] =?UTF-8?q?Exercice=201.1=20=E2=80=94=20Cr=C3=A9er?= =?UTF-8?q?=20une=20arborescence=20de=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/README.txt | 1 + mon-projet/config/settings.txt | 0 mon-projet/logs/app.log | 0 mon-projet/src/app.sh | 0 4 files changed, 1 insertion(+) create mode 100644 mon-projet/README.txt create mode 100644 mon-projet/config/settings.txt create mode 100644 mon-projet/logs/app.log create mode 100644 mon-projet/src/app.sh diff --git a/mon-projet/README.txt b/mon-projet/README.txt new file mode 100644 index 0000000..d60b8e1 --- /dev/null +++ b/mon-projet/README.txt @@ -0,0 +1 @@ +# Mon projet Bash diff --git a/mon-projet/config/settings.txt b/mon-projet/config/settings.txt new file mode 100644 index 0000000..e69de29 diff --git a/mon-projet/logs/app.log b/mon-projet/logs/app.log new file mode 100644 index 0000000..e69de29 diff --git a/mon-projet/src/app.sh b/mon-projet/src/app.sh new file mode 100644 index 0000000..e69de29 From 01f0c2a329a839e6ea116102cb2451d272b59f74 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 09:51:23 +0200 Subject: [PATCH 02/23] =?UTF-8?q?Exercice=201.2=20=E2=80=94=20Manipuler=20?= =?UTF-8?q?les=20fichiers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/logs/app.log | 22 ++++++++++++++++++++++ mon-projet/logs/app.log.bak | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 mon-projet/logs/app.log.bak diff --git a/mon-projet/logs/app.log b/mon-projet/logs/app.log index e69de29..d2d2378 100644 --- a/mon-projet/logs/app.log +++ b/mon-projet/logs/app.log @@ -0,0 +1,22 @@ +2024-01-15 08:00:01 INFO Application started on port 8080 +2024-01-15 08:00:05 INFO Connected to Azure SQL Database successfully +2024-01-15 08:01:22 WARNING High memory usage detected: 78% +2024-01-15 08:02:45 ERROR Failed to connect to Azure Storage: connection timeout +2024-01-15 08:03:10 INFO Request processed: GET /api/health [200] +2024-01-15 08:05:33 ERROR Authentication failed for service account: deploy_svc +2024-01-15 08:06:15 WARNING CPU usage spike detected: 92% +2024-01-15 08:07:42 ERROR Database query timeout after 30s on table: audit_logs +2024-01-15 08:08:00 INFO Retry attempt 1/3 for Azure Storage connection +2024-01-15 08:08:30 INFO Retry attempt 2/3 for Azure Storage connection +2024-01-15 08:09:00 ERROR Max retries exceeded - Azure Storage service unavailable +2024-01-15 08:10:15 WARNING Disk space below threshold: 15% remaining on /dev/sda1 +2024-01-15 08:11:22 INFO Backup job started: daily-backup-2024-01-15 +2024-01-15 08:12:45 ERROR Backup failed: insufficient permissions on /var/backup/azure +2024-01-15 08:14:03 INFO Alert sent to monitoring team via Azure Monitor +2024-01-15 08:15:00 INFO Scheduled maintenance check completed +2024-01-15 08:16:30 WARNING SSL certificate expires in 14 days for api.azuretech.fr +2024-01-15 08:18:00 CRITICAL Database connection pool exhausted — all 20 connections in use +2024-01-15 08:18:55 INFO Kubernetes pod restarted: api-deployment-7d9f8b-xkp2m +2024-01-15 08:19:30 CRITICAL Azure Key Vault unreachable — secrets cannot be retrieved +2024-01-15 08:20:00 INFO Health check passed: all 3 replicas running +2024-01-15 08:21:00 CRITICAL Disk full on /var/log — logging suspended diff --git a/mon-projet/logs/app.log.bak b/mon-projet/logs/app.log.bak new file mode 100644 index 0000000..d2d2378 --- /dev/null +++ b/mon-projet/logs/app.log.bak @@ -0,0 +1,22 @@ +2024-01-15 08:00:01 INFO Application started on port 8080 +2024-01-15 08:00:05 INFO Connected to Azure SQL Database successfully +2024-01-15 08:01:22 WARNING High memory usage detected: 78% +2024-01-15 08:02:45 ERROR Failed to connect to Azure Storage: connection timeout +2024-01-15 08:03:10 INFO Request processed: GET /api/health [200] +2024-01-15 08:05:33 ERROR Authentication failed for service account: deploy_svc +2024-01-15 08:06:15 WARNING CPU usage spike detected: 92% +2024-01-15 08:07:42 ERROR Database query timeout after 30s on table: audit_logs +2024-01-15 08:08:00 INFO Retry attempt 1/3 for Azure Storage connection +2024-01-15 08:08:30 INFO Retry attempt 2/3 for Azure Storage connection +2024-01-15 08:09:00 ERROR Max retries exceeded - Azure Storage service unavailable +2024-01-15 08:10:15 WARNING Disk space below threshold: 15% remaining on /dev/sda1 +2024-01-15 08:11:22 INFO Backup job started: daily-backup-2024-01-15 +2024-01-15 08:12:45 ERROR Backup failed: insufficient permissions on /var/backup/azure +2024-01-15 08:14:03 INFO Alert sent to monitoring team via Azure Monitor +2024-01-15 08:15:00 INFO Scheduled maintenance check completed +2024-01-15 08:16:30 WARNING SSL certificate expires in 14 days for api.azuretech.fr +2024-01-15 08:18:00 CRITICAL Database connection pool exhausted — all 20 connections in use +2024-01-15 08:18:55 INFO Kubernetes pod restarted: api-deployment-7d9f8b-xkp2m +2024-01-15 08:19:30 CRITICAL Azure Key Vault unreachable — secrets cannot be retrieved +2024-01-15 08:20:00 INFO Health check passed: all 3 replicas running +2024-01-15 08:21:00 CRITICAL Disk full on /var/log — logging suspended From 6e73dc32b011fa92ff1d952a5fbca173a075f670 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 09:57:32 +0200 Subject: [PATCH 03/23] =?UTF-8?q?Exercice=202.1=20=E2=80=94=20Analyser=20s?= =?UTF-8?q?erver.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/README.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mon-projet/README.txt b/mon-projet/README.txt index d60b8e1..209e376 100644 --- a/mon-projet/README.txt +++ b/mon-projet/README.txt @@ -1 +1,23 @@ # Mon projet Bash + +# 1. Combien de lignes contient server.log ? +wc -l server.log + +# 2. Affichez uniquement les 5 premières lignes +head -n 5 server.log + +# 3. Affichez uniquement les 3 dernières lignes +tail -n 3 server.log + +# 4. Combien de lignes contiennent le mot ERROR ? +grep -c "ERROR" server.log + +# 5. Affichez toutes les lignes WARNING +grep "WARNING" server.log + +# 6. Affichez toutes les lignes CRITICAL +grep "CRITICAL" server.log + +# 7. Combien d'erreurs ET de critiques y a-t-il au total ? +# (indice : grep -E "ERROR|CRITICAL") +grep -cE "ERROR|CRITICAL" server.log \ No newline at end of file From 65158a0923db58eb42fe1385870e8cfe67549bdd Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:01:55 +0200 Subject: [PATCH 04/23] =?UTF-8?q?Exercice=202.2=20=E2=80=94=20G=C3=A9n?= =?UTF-8?q?=C3=A9rer=20un=20rapport=20dans=20un=20fichier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/erreurs.txt | 5 +++++ mon-projet/rapport.txt | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 mon-projet/erreurs.txt create mode 100644 mon-projet/rapport.txt diff --git a/mon-projet/erreurs.txt b/mon-projet/erreurs.txt new file mode 100644 index 0000000..259593d --- /dev/null +++ b/mon-projet/erreurs.txt @@ -0,0 +1,5 @@ +2024-01-15 08:02:45 ERROR Failed to connect to Azure Storage: connection timeout +2024-01-15 08:05:33 ERROR Authentication failed for service account: deploy_svc +2024-01-15 08:07:42 ERROR Database query timeout after 30s on table: audit_logs +2024-01-15 08:09:00 ERROR Max retries exceeded - Azure Storage service unavailable +2024-01-15 08:12:45 ERROR Backup failed: insufficient permissions on /var/backup/azure diff --git a/mon-projet/rapport.txt b/mon-projet/rapport.txt new file mode 100644 index 0000000..e34c905 --- /dev/null +++ b/mon-projet/rapport.txt @@ -0,0 +1,5 @@ +=== RAPPORT DE LOGS === +22 ../ressources/server.log +0 +4 +3 From 11e00a7a661c8768d827eab3ac55916e904962a0 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:06:33 +0200 Subject: [PATCH 05/23] =?UTF-8?q?Exercice=203.1=20=E2=80=94=20Premier=20sc?= =?UTF-8?q?ript=20avec=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/info.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 mon-projet/src/info.sh diff --git a/mon-projet/src/info.sh b/mon-projet/src/info.sh new file mode 100644 index 0000000..69c1a07 --- /dev/null +++ b/mon-projet/src/info.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# info.sh — Affiche des informations sur l'environnement + +NOM_PROJET="NexaCloud" +VERSION="1.1.0" +LOG_FILE="ressources/server.log" + +echo "===============================" +echo " Projet : $NOM_PROJET" +echo " Version : $VERSION" +echo "===============================" + +# Vérifier que le fichier de log existe +if [ -f "$LOG_FILE" ]; then + NB_LIGNES=$(wc -l < "$LOG_FILE") + echo " Log : $LOG_FILE ($NB_LIGNES lignes)" +else + echo " Log : fichier introuvable !" +fi + +echo "===============================" From d67076e0fc478deb466b4ee80ed81121b9c52a79 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:06:48 +0200 Subject: [PATCH 06/23] =?UTF-8?q?Exercice=203.2=20=E2=80=94=20Script=20ave?= =?UTF-8?q?c=20conditions=20sur=20les=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/check-logs.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mon-projet/src/check-logs.sh diff --git a/mon-projet/src/check-logs.sh b/mon-projet/src/check-logs.sh new file mode 100644 index 0000000..f9ae9bf --- /dev/null +++ b/mon-projet/src/check-logs.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# check-logs.sh — Vérifie l'état des logs et alerte si nécessaire + +LOG_FILE="ressources/server.log" +SEUIL_ERREURS=3 + +if [ ! -f "$LOG_FILE" ]; then + echo "ERREUR : le fichier $LOG_FILE n'existe pas." + exit 1 +fi + +NB_ERREURS=$(grep -c "ERROR" "$LOG_FILE") +NB_CRITIQUES=$(grep -c "CRITICAL" "$LOG_FILE") +NB_WARNINGS=$(grep -c "WARNING" "$LOG_FILE") + +echo "=== Analyse de $LOG_FILE ===" +echo " INFO : $(grep -c "INFO" "$LOG_FILE")" +echo " WARNING : $NB_WARNINGS" +echo " ERROR : $NB_ERREURS" +echo " CRITICAL : $NB_CRITIQUES" +echo "===========================" + +# Vérifier le seuil d'erreurs +if [ $NB_CRITIQUES -gt 0 ]; then + echo "ALERTE CRITIQUE : $NB_CRITIQUES incident(s) critique(s) détecté(s) !" +elif [ $NB_ERREURS -gt $SEUIL_ERREURS ]; then + echo "ATTENTION : $NB_ERREURS erreurs détectées (seuil : $SEUIL_ERREURS)" +else + echo "OK : les logs sont dans les normes." +fi From af8f478d0bb943473a63a63d61590d1f940ace77 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:12:36 +0200 Subject: [PATCH 07/23] =?UTF-8?q?Pour=20aller=20plus=20loin=20=E2=80=94=20?= =?UTF-8?q?=C3=89tape=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/check-logs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mon-projet/src/check-logs.sh b/mon-projet/src/check-logs.sh index f9ae9bf..a72c170 100644 --- a/mon-projet/src/check-logs.sh +++ b/mon-projet/src/check-logs.sh @@ -1,14 +1,16 @@ #!/bin/bash # check-logs.sh — Vérifie l'état des logs et alerte si nécessaire -LOG_FILE="ressources/server.log" SEUIL_ERREURS=3 -if [ ! -f "$LOG_FILE" ]; then - echo "ERREUR : le fichier $LOG_FILE n'existe pas." +if [ -z "$1" ]; then + echo "Usage : $0 " exit 1 fi +LOG_FILE=$1 +[ -f "$LOG_FILE" ] && echo "Fichier $1 trouvé" || echo "Fichier $1 absent" + NB_ERREURS=$(grep -c "ERROR" "$LOG_FILE") NB_CRITIQUES=$(grep -c "CRITICAL" "$LOG_FILE") NB_WARNINGS=$(grep -c "WARNING" "$LOG_FILE") From c7cf1f820a87bcccc43bd0e244c5af9901951166 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:13:35 +0200 Subject: [PATCH 08/23] =?UTF-8?q?Exercice=204.1=20=E2=80=94=20Boucle=20sur?= =?UTF-8?q?=20les=20niveaux=20de=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/analyse-niveaux.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mon-projet/src/analyse-niveaux.sh diff --git a/mon-projet/src/analyse-niveaux.sh b/mon-projet/src/analyse-niveaux.sh new file mode 100644 index 0000000..77e30d0 --- /dev/null +++ b/mon-projet/src/analyse-niveaux.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# analyse-niveaux.sh — Compte chaque niveau de log + +LOG_FILE="ressources/server.log" + +echo "=== Analyse par niveau ===" + +for NIVEAU in INFO WARNING ERROR CRITICAL; do + NB=$(grep -c "$NIVEAU" "$LOG_FILE") + echo " $NIVEAU : $NB occurrence(s)" +done + +echo "==========================" +echo " TOTAL : $(wc -l < "$LOG_FILE") lignes" From c920c7b64ac6f73a3ed417f5be2edd72e81feebf Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 10:14:42 +0200 Subject: [PATCH 09/23] =?UTF-8?q?Exercice=204.2=20=E2=80=94=20Script=20ave?= =?UTF-8?q?c=20fonctions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/logs/rapport-20260528-101428.txt | 16 ++++++ mon-projet/src/rapport.sh | 55 +++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 mon-projet/logs/rapport-20260528-101428.txt create mode 100644 mon-projet/src/rapport.sh diff --git a/mon-projet/logs/rapport-20260528-101428.txt b/mon-projet/logs/rapport-20260528-101428.txt new file mode 100644 index 0000000..f33c914 --- /dev/null +++ b/mon-projet/logs/rapport-20260528-101428.txt @@ -0,0 +1,16 @@ +RAPPORT D'ANALYSE — 28/05/2026 10:14 + +--- Compteurs --- +INFO=10 WARNING=4 ERROR=5 CRITICAL=3 + +--- Incidents critiques --- +2024-01-15 08:18:00 CRITICAL Database connection pool exhausted — all 20 connections in use +2024-01-15 08:19:30 CRITICAL Azure Key Vault unreachable — secrets cannot be retrieved +2024-01-15 08:21:00 CRITICAL Disk full on /var/log — logging suspended + +--- Erreurs --- +2024-01-15 08:02:45 ERROR Failed to connect to Azure Storage: connection timeout +2024-01-15 08:05:33 ERROR Authentication failed for service account: deploy_svc +2024-01-15 08:07:42 ERROR Database query timeout after 30s on table: audit_logs +2024-01-15 08:09:00 ERROR Max retries exceeded - Azure Storage service unavailable +2024-01-15 08:12:45 ERROR Backup failed: insufficient permissions on /var/backup/azure diff --git a/mon-projet/src/rapport.sh b/mon-projet/src/rapport.sh new file mode 100644 index 0000000..053edd7 --- /dev/null +++ b/mon-projet/src/rapport.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# rapport.sh — Génère un rapport complet avec des fonctions + +LOG_FILE="${1:-ressources/server.log}" +RAPPORT="mon-projet/logs/rapport-$(date +%Y%m%d-%H%M%S).txt" + +# ── Fonctions ────────────────────────────────────────────────────── + +afficher_titre() { + echo "===========================================" + echo " $1" + echo "===========================================" +} + +compter_niveau() { + local niveau="$1" + local fichier="$2" + grep -c "$niveau" "$fichier" 2>/dev/null || echo 0 +} + +ecrire_section() { + local titre="$1" + local contenu="$2" + echo "" >> "$RAPPORT" + echo "--- $titre ---" >> "$RAPPORT" + echo "$contenu" >> "$RAPPORT" +} + +# ── Script principal ─────────────────────────────────────────────── + +if [ ! -f "$LOG_FILE" ]; then + echo "Fichier introuvable : $LOG_FILE" + exit 1 +fi + +afficher_titre "RAPPORT D'ANALYSE — $(date '+%d/%m/%Y %H:%M')" + +INFO=$(compter_niveau "INFO" "$LOG_FILE") +WARNING=$(compter_niveau "WARNING" "$LOG_FILE") +ERROR=$(compter_niveau "ERROR" "$LOG_FILE") +CRITICAL=$(compter_niveau "CRITICAL" "$LOG_FILE") + +echo " INFO : $INFO" +echo " WARNING : $WARNING" +echo " ERROR : $ERROR" +echo " CRITICAL : $CRITICAL" + +# Écrire le rapport dans un fichier +echo "RAPPORT D'ANALYSE — $(date '+%d/%m/%Y %H:%M')" > "$RAPPORT" +ecrire_section "Compteurs" "INFO=$INFO WARNING=$WARNING ERROR=$ERROR CRITICAL=$CRITICAL" +ecrire_section "Incidents critiques" "$(grep 'CRITICAL' "$LOG_FILE")" +ecrire_section "Erreurs" "$(grep 'ERROR' "$LOG_FILE")" + +echo "" +echo "Rapport sauvegardé : $RAPPORT" From 5881e3697c9395fccd2e796648c08b8b9222d52a Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 11:04:32 +0200 Subject: [PATCH 10/23] =?UTF-8?q?Exercice=205.1=20=E2=80=94=20Fonctions=20?= =?UTF-8?q?d'affichage=20color=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/couleurs.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mon-projet/src/couleurs.sh diff --git a/mon-projet/src/couleurs.sh b/mon-projet/src/couleurs.sh new file mode 100644 index 0000000..444f663 --- /dev/null +++ b/mon-projet/src/couleurs.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# couleurs.sh — Tester les fonctions d'affichage + +# Les codes couleur sont fournis +VERT="\033[0;32m" +ROUGE="\033[0;31m" +JAUNE="\033[0;33m" +CYAN="\033[0;36m" +RESET="\033[0m" + +# Ces fonctions sont déjà écrites — observez leur structure +ok() { echo -e "${VERT}[OK]${RESET} $1"; } +info() { echo -e "${CYAN}[INFO]${RESET} $1"; } + +# TODO: écrivez les fonctions warn() et err() sur le même modèle +# warn() doit afficher en jaune avec le préfixe [WARN] +warn() { echo -e "${JAUNE}[WARN]${RESET} $1"; } +# err() doit afficher en rouge avec le préfixe [ERR] +err() { echo -e "${ROUGE}[ERR]${RESET} $1"; } + +# Test — ces lignes doivent afficher chacune dans la bonne couleur +ok "Installation réussie" +info "Démarrage du serveur..." +warn "Mémoire basse : 78%" +err "Connexion échouée" From 16f0f43f786355e50f1b51bcb032530a89cbff86 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 11:19:47 +0200 Subject: [PATCH 11/23] =?UTF-8?q?Exercice=205.2=20=E2=80=94=20Script=20de?= =?UTF-8?q?=20v=C3=A9rification=20de=20l'environnement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/check-env.sh | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 mon-projet/src/check-env.sh diff --git a/mon-projet/src/check-env.sh b/mon-projet/src/check-env.sh new file mode 100644 index 0000000..9c52310 --- /dev/null +++ b/mon-projet/src/check-env.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# check-env.sh — Vérifie que l'environnement est prêt pour NexaCloud + +set -e + +VERT="\033[0;32m" +ROUGE="\033[0;31m" +JAUNE="\033[0;33m" +RESET="\033[0m" + +ok() { echo -e "${VERT} [OK]${RESET} $1"; } +warn() { echo -e "${JAUNE} [WARN]${RESET} $1"; } +err() { echo -e "${ROUGE} [ERR]${RESET} $1"; } + +# Cette fonction vérifie si une commande est installée +# $1 = nom de la commande | $2 = nom à afficher (optionnel) +verifier_commande() { + local cmd="$1" + local nom="${2:-$1}" + # La commande "command -v" vérifie si un programme existe + # &>/dev/null redirige la sortie pour ne rien afficher + if command -v "$cmd" &>/dev/null; then + ok "$nom installé" + else + err "$nom non trouvé" + fi +} + +verifier_fichier() { + local nom_fichier="$1" + if [ -f "$nom_fichier" ]; then + ok "$nom_fichier existe" + else + warn "$nom_fichier non trouvé" + fi +} + +echo "" +echo "=== Vérification de l'environnement NexaCloud ===" +echo "" + +# TODO: appelez verifier_commande pour tester python3, node, npm et git +# Exemple : verifier_commande "python3" "Python" + +verifier_commande "python3" +verifier_commande "Python" + +echo "" + +# TODO: vérifiez que ces deux fichiers existent avec [ -f ] +# et affichez ok ou warn selon le résultat +# Fichiers à vérifier : "config.json" et "ressources/server.log" + +verifier_fichier "config.json" +verifier_fichier "ressources/server.log" + +echo "" +echo "=== Vérification terminée ===" +echo "" From 67e78ba8e20fd02ed3b555382bdcbb0c8bed88d1 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 12:15:22 +0200 Subject: [PATCH 12/23] =?UTF-8?q?Exercice=205.3=20=E2=80=94=20Assembler=20?= =?UTF-8?q?le=20script=20de=20setup=20complet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..1f94daa --- /dev/null +++ b/setup.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# setup.sh — Prépare le projet NexaCloud en une commande + +set -e + +VERT="\033[0;32m" +ROUGE="\033[0;31m" +CYAN="\033[0;36m" +JAUNE="\033[0;33m" +BOLD="\033[1m" +RESET="\033[0m" + +info() { echo -e "${CYAN}[INFO]${RESET} $1"; } +ok() { echo -e "${VERT}[OK]${RESET} $1"; } +warn() { echo -e "${JAUNE}[WARN]${RESET} $1"; } +err() { echo -e "${ROUGE}[ERR]${RESET} $1"; exit 1; } + +# ── Bannière (fournie) ──────────────────────────────────────────────── +echo "" +echo -e "${BOLD}${CYAN}============================================${RESET}" +echo -e "${BOLD}${CYAN} SETUP NEXACLOUD — $(date '+%d/%m/%Y %H:%M')${RESET}" +echo -e "${BOLD}${CYAN}============================================${RESET}" +echo "" + +# ── 1. Vérification des prérequis ───────────────────────────────────── +info "Vérification des prérequis..." + +# TODO: vérifiez que python3, node et npm sont installés +# Si l'une des commandes est absente, appelez err() pour stopper le script +# Indice : command -v python3 &>/dev/null vérifie si python3 existe +# Indice : l'opérateur || execute la commande à droite si celle de gauche échoue + +# Cette fonction vérifie si une commande est installée +# Stoppe le script si elle ne l'est pas +verifier_commande() { + for cmd in $@; do + if [ ! command -v "$cmd" &>/dev/null ]; then + err "Prérequis : $cmd manquant" + fi + done +} + +verifier_commande "python3" "node" "npm" + +ok "Prérequis : Python3, Node.js, npm présents" + +# ── 2. Installation des dépendances Python ──────────────────────────── +info "Installation des dépendances Python..." + +# TODO: vérifiez si le fichier python-api/requirements.txt existe +# Si oui → lancez pip install -r python-api/requirements.txt --quiet +# puis affichez ok() +# Si non → affichez warn() pour prévenir sans bloquer + +requirements_file="python-api/requirements.txt" + +if [ -f "$requirements_file" ]; then + pip install -r $requirements_file --quiet + ok "Requirements installés" +else + warn "Fichier $requirements_file manquant" +fi + +# ── 3. Installation des dépendances Node ───────────────────────────── +info "Installation des dépendances Node..." + +# TODO: même logique pour node-client/package.json +# Si le fichier existe → cd node-client && npm install --silent && cd .. +# Indice : en Bash, on peut chaîner des commandes avec && + +package_file="node-client/package.json" + +if [ -f "$package_file" ]; then + cd node-client && npm install --silent && cd .. + ok "Dépendances node installées" +else + warn "Fichier $package_file manquant" +fi + +# ── 4. Analyse des logs ─────────────────────────────────────────────── +info "Analyse des logs..." +LOG="ressources/server.log" + +# TODO: vérifiez que $LOG existe, puis : +# - comptez les ERROR avec grep -c et stockez dans NB_ERR +# - comptez les CRITICAL avec grep -c et stockez dans NB_CRIT +# - affichez ok() avec les deux compteurs +# - si NB_CRIT > 0, affichez un message d'alerte rouge +# et listez les lignes CRITICAL avec grep + une boucle while + +if [ ! -f "$LOG" ]; then + err "Fichier $LOG manquant" +fi + +NB_ERR=$(grep -c "ERROR" $LOG) +NB_CRIT=$(grep -c "CRITICAL" $LOG) + +ok "$NB_ERR errors, $NB_CRIT criticals" + +if [ $NB_CRIT > 0 ]; then + echo -e "${ROUGE}!!! $NB_CRIT ERREURS CRITIQUES !!! ${RESET}" + grep "CRITICAL" $LOG | while read -r error; do echo $error; done +fi + +# ── 5. Message de fin (fourni) ──────────────────────────────────────── +echo "" +echo -e "${BOLD}${VERT}============================================${RESET}" +echo -e "${BOLD}${VERT} SETUP TERMINÉ AVEC SUCCÈS ${RESET}" +echo -e "${BOLD}${VERT}============================================${RESET}" +echo "" +echo " Lancer l'API Python : cd python-api && python3 app.py" +echo " Lancer le client Node: cd node-client && node app.js" +echo "" From 224637cada7d8df700d73c8edab4f7f467d5c1bd Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 12:15:51 +0200 Subject: [PATCH 13/23] =?UTF-8?q?RE:=20Exercice=205.2=20=E2=80=94=20Script?= =?UTF-8?q?=20de=20v=C3=A9rification=20de=20l'environnement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/check-env.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mon-projet/src/check-env.sh b/mon-projet/src/check-env.sh index 9c52310..3e9b7fa 100644 --- a/mon-projet/src/check-env.sh +++ b/mon-projet/src/check-env.sh @@ -42,9 +42,7 @@ echo "" # TODO: appelez verifier_commande pour tester python3, node, npm et git # Exemple : verifier_commande "python3" "Python" -verifier_commande "python3" -verifier_commande "Python" - +verifier_commande "python3" "Python" echo "" # TODO: vérifiez que ces deux fichiers existent avec [ -f ] From f70b862e9453970a35bbb61e5193638018e7b22f Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 12:24:02 +0200 Subject: [PATCH 14/23] =?UTF-8?q?RE:=20Exercice=205.3=20=E2=80=94=20Assemb?= =?UTF-8?q?ler=20le=20script=20de=20setup=20complet=20&=20Pour=20aller=20p?= =?UTF-8?q?lus=20loin=20=E2=80=94=20=C3=89tape=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + setup.sh | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..f1dd149 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +LOG=ressources/server.log diff --git a/setup.sh b/setup.sh index 1f94daa..6513891 100644 --- a/setup.sh +++ b/setup.sh @@ -22,6 +22,9 @@ echo -e "${BOLD}${CYAN} SETUP NEXACLOUD — $(date '+%d/%m/%Y %H:%M')${RESET}" echo -e "${BOLD}${CYAN}============================================${RESET}" echo "" +# Chargement des variables du .env +export $(grep -v '^#' .env | xargs) + # ── 1. Vérification des prérequis ───────────────────────────────────── info "Vérification des prérequis..." @@ -34,7 +37,7 @@ info "Vérification des prérequis..." # Stoppe le script si elle ne l'est pas verifier_commande() { for cmd in $@; do - if [ ! command -v "$cmd" &>/dev/null ]; then + if ! command -v "$cmd" &>/dev/null; then err "Prérequis : $cmd manquant" fi done @@ -79,7 +82,6 @@ fi # ── 4. Analyse des logs ─────────────────────────────────────────────── info "Analyse des logs..." -LOG="ressources/server.log" # TODO: vérifiez que $LOG existe, puis : # - comptez les ERROR avec grep -c et stockez dans NB_ERR @@ -97,7 +99,7 @@ NB_CRIT=$(grep -c "CRITICAL" $LOG) ok "$NB_ERR errors, $NB_CRIT criticals" -if [ $NB_CRIT > 0 ]; then +if [ $NB_CRIT -gt 0 ]; then echo -e "${ROUGE}!!! $NB_CRIT ERREURS CRITIQUES !!! ${RESET}" grep "CRITICAL" $LOG | while read -r error; do echo $error; done fi From 205bf2a8a9eeec725981bcc50fb25974abcc469f Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 12:30:53 +0200 Subject: [PATCH 15/23] Corrections retours ShellCheck --- mon-projet/src/app.sh | 1 + mon-projet/src/check-logs.sh | 4 ++-- mon-projet/src/rapport.sh | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mon-projet/src/app.sh b/mon-projet/src/app.sh index e69de29..cc1f786 100644 --- a/mon-projet/src/app.sh +++ b/mon-projet/src/app.sh @@ -0,0 +1 @@ +#!/bin/bash \ No newline at end of file diff --git a/mon-projet/src/check-logs.sh b/mon-projet/src/check-logs.sh index a72c170..886371e 100644 --- a/mon-projet/src/check-logs.sh +++ b/mon-projet/src/check-logs.sh @@ -23,9 +23,9 @@ echo " CRITICAL : $NB_CRITIQUES" echo "===========================" # Vérifier le seuil d'erreurs -if [ $NB_CRITIQUES -gt 0 ]; then +if [ "$NB_CRITIQUES" -gt 0 ]; then echo "ALERTE CRITIQUE : $NB_CRITIQUES incident(s) critique(s) détecté(s) !" -elif [ $NB_ERREURS -gt $SEUIL_ERREURS ]; then +elif [ "$NB_ERREURS" -gt "$SEUIL_ERREURS" ]; then echo "ATTENTION : $NB_ERREURS erreurs détectées (seuil : $SEUIL_ERREURS)" else echo "OK : les logs sont dans les normes." diff --git a/mon-projet/src/rapport.sh b/mon-projet/src/rapport.sh index 053edd7..83d6991 100644 --- a/mon-projet/src/rapport.sh +++ b/mon-projet/src/rapport.sh @@ -21,9 +21,11 @@ compter_niveau() { ecrire_section() { local titre="$1" local contenu="$2" - echo "" >> "$RAPPORT" - echo "--- $titre ---" >> "$RAPPORT" - echo "$contenu" >> "$RAPPORT" + { + echo "" + echo "--- $titre ---" + echo "$contenu" + } >> "$RAPPORT" } # ── Script principal ─────────────────────────────────────────────── From 9d0c3d067171b3b3e3b0a5df46ed939edb3ec938 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 13:24:34 +0200 Subject: [PATCH 16/23] Corrections retours ShellCheck --- setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 6513891..87ee58d 100644 --- a/setup.sh +++ b/setup.sh @@ -23,7 +23,7 @@ echo -e "${BOLD}${CYAN}============================================${RESET}" echo "" # Chargement des variables du .env -export $(grep -v '^#' .env | xargs) +export $("grep -v '^#' .env | xargs") # ── 1. Vérification des prérequis ───────────────────────────────────── info "Vérification des prérequis..." @@ -36,7 +36,7 @@ info "Vérification des prérequis..." # Cette fonction vérifie si une commande est installée # Stoppe le script si elle ne l'est pas verifier_commande() { - for cmd in $@; do + for cmd in "$@"; do if ! command -v "$cmd" &>/dev/null; then err "Prérequis : $cmd manquant" fi @@ -94,14 +94,14 @@ if [ ! -f "$LOG" ]; then err "Fichier $LOG manquant" fi -NB_ERR=$(grep -c "ERROR" $LOG) -NB_CRIT=$(grep -c "CRITICAL" $LOG) +NB_ERR=$(grep -c "ERROR" "$LOG") +NB_CRIT=$(grep -c "CRITICAL" "$LOG") ok "$NB_ERR errors, $NB_CRIT criticals" -if [ $NB_CRIT -gt 0 ]; then +if [ "$NB_CRIT" -gt 0 ]; then echo -e "${ROUGE}!!! $NB_CRIT ERREURS CRITIQUES !!! ${RESET}" - grep "CRITICAL" $LOG | while read -r error; do echo $error; done + grep "CRITICAL" "$LOG" | while read -r error; do echo "$error"; done fi # ── 5. Message de fin (fourni) ──────────────────────────────────────── From 6777fa6b307a92f38f445eba10a3de1eb7a3d041 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 13:25:20 +0200 Subject: [PATCH 17/23] Corrections retours ShellCheck --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 87ee58d..24eab98 100644 --- a/setup.sh +++ b/setup.sh @@ -23,7 +23,7 @@ echo -e "${BOLD}${CYAN}============================================${RESET}" echo "" # Chargement des variables du .env -export $("grep -v '^#' .env | xargs") +export "$(grep -v '^#' .env | xargs)" # ── 1. Vérification des prérequis ───────────────────────────────────── info "Vérification des prérequis..." From 85f4bd05f2eb7509a4e2ac5f967b2c0d84aae597 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Thu, 28 May 2026 13:43:37 +0200 Subject: [PATCH 18/23] Corrections retours ShellCheck --- mon-projet/src/check-logs.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mon-projet/src/check-logs.sh b/mon-projet/src/check-logs.sh index 886371e..44c960a 100644 --- a/mon-projet/src/check-logs.sh +++ b/mon-projet/src/check-logs.sh @@ -3,13 +3,18 @@ SEUIL_ERREURS=3 +LOG_FILE="${1:-ressources/server.log}" + if [ -z "$1" ]; then - echo "Usage : $0 " - exit 1 + echo "Pas de fichier de log spécifié, utilisation du fichier $LOG_FILE" fi -LOG_FILE=$1 -[ -f "$LOG_FILE" ] && echo "Fichier $1 trouvé" || echo "Fichier $1 absent" +if [ -f "$LOG_FILE" ]; then + echo "Fichier $LOG_FILE trouvé" +else + echo "Fichier $LOG_FILE absent" + exit 1 +fi NB_ERREURS=$(grep -c "ERROR" "$LOG_FILE") NB_CRITIQUES=$(grep -c "CRITICAL" "$LOG_FILE") From f5ea887e20afccf7629581fb901a88154e92e76b Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Fri, 29 May 2026 09:41:34 +0200 Subject: [PATCH 19/23] =?UTF-8?q?Bonus=201=20=E2=80=94=20Cr=C3=A9er=20et?= =?UTF-8?q?=20g=C3=A9rer=20des=20ressources=20avec=20Azure=20CLI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 966accd..f1f8a3e 100644 --- a/README.md +++ b/README.md @@ -872,7 +872,7 @@ az account set --subscription "Nom ou ID de l'abonnement" ```bash # Variables réutilisables -RESOURCE_GROUP="rg-nexacloud-tp" +RESOURCE_GROUP="ntesseyreRG" LOCATION="francecentral" STORAGE_ACCOUNT="stnexacloud$RANDOM" # Nom unique obligatoire @@ -900,7 +900,7 @@ Créez `mon-projet/src/azure-storage.sh` : set -e -RESOURCE_GROUP="rg-nexacloud-tp" +RESOURCE_GROUP="ntesseyreRG" LOCATION="francecentral" STORAGE_ACCOUNT="stnexacloud$RANDOM" CONTAINER="logs" From b75bfc211fe7ac4ac931ce786667536dffe21399 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Fri, 29 May 2026 09:41:52 +0200 Subject: [PATCH 20/23] =?UTF-8?q?Bonus=202=20=E2=80=94=20Script=20Azure=20?= =?UTF-8?q?:=20cr=C3=A9er=20un=20compte=20de=20stockage=20et=20uploader=20?= =?UTF-8?q?un=20fichier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/azure-storage.sh | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 mon-projet/src/azure-storage.sh diff --git a/mon-projet/src/azure-storage.sh b/mon-projet/src/azure-storage.sh new file mode 100644 index 0000000..33f6188 --- /dev/null +++ b/mon-projet/src/azure-storage.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# azure-storage.sh — Crée un compte de stockage et uploade server.log + +set -e + +RESOURCE_GROUP="ntesseyreRG" +LOCATION="francecentral" +STORAGE_ACCOUNT="stnexacloud$RANDOM" +CONTAINER="logs" +FICHIER_LOCAL="ressources/server.log" +FICHIER_BLOB="server.log" + +echo "=== Création du compte de stockage Azure ===" + +# Créer le compte de stockage +az storage account create \ + --name "$STORAGE_ACCOUNT" \ + --resource-group "$RESOURCE_GROUP" \ + --location "$LOCATION" \ + --sku Standard_LRS \ + --kind StorageV2 \ + --output none + +echo "Compte créé : $STORAGE_ACCOUNT" + +# Récupérer la clé de connexion +CLE=$(az storage account keys list \ + --resource-group "$RESOURCE_GROUP" \ + --account-name "$STORAGE_ACCOUNT" \ + --query "[0].value" \ + --output tsv) + +# Créer un conteneur +az storage container create \ + --name "$CONTAINER" \ + --account-name "$STORAGE_ACCOUNT" \ + --account-key "$CLE" \ + --output none + +echo "Conteneur créé : $CONTAINER" + +# Uploader server.log +az storage blob upload \ + --container-name "$CONTAINER" \ + --file "$FICHIER_LOCAL" \ + --name "$FICHIER_BLOB" \ + --account-name "$STORAGE_ACCOUNT" \ + --account-key "$CLE" \ + --output none + +echo "Fichier uploadé : $FICHIER_BLOB" + +# Lister les blobs du conteneur +echo "" +echo "=== Contenu du conteneur ===" +az storage blob list \ + --container-name "$CONTAINER" \ + --account-name "$STORAGE_ACCOUNT" \ + --account-key "$CLE" \ + --output table \ No newline at end of file From ed8000a40e16aa045b57182b3ec66786f51b224e Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Fri, 29 May 2026 10:09:52 +0200 Subject: [PATCH 21/23] =?UTF-8?q?Bonus=203=20=E2=80=94=20Azure=20Key=20Vau?= =?UTF-8?q?lt=20:=20g=C3=A9rer=20des=20secrets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-projet/src/azure-key-vault.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mon-projet/src/azure-key-vault.sh diff --git a/mon-projet/src/azure-key-vault.sh b/mon-projet/src/azure-key-vault.sh new file mode 100644 index 0000000..3a91883 --- /dev/null +++ b/mon-projet/src/azure-key-vault.sh @@ -0,0 +1,27 @@ +KEYVAULT_NAME="kv-nexacloud-$RANDOM" + +# Créer le Key Vault +az keyvault create \ + --name "$KEYVAULT_NAME" \ + --resource-group "$RESOURCE_GROUP" \ + --location "$LOCATION" + +# Ajouter un secret +az keyvault secret set \ + --vault-name "$KEYVAULT_NAME" \ + --name "db-password" \ + --value "MonMotDePasse123!" + +# Récupérer un secret dans un script +SECRET=$(az keyvault secret show \ + --vault-name "$KEYVAULT_NAME" \ + --name "db-password" \ + --query "value" \ + --output tsv) + +echo "Secret récupéré (longueur : ${#SECRET} caractères)" + +# Lister tous les secrets +az keyvault secret list \ + --vault-name "$KEYVAULT_NAME" \ + --output table \ No newline at end of file From 3abb7e78c1e832e1aa52fdbc873477c29ac4dd92 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Fri, 29 May 2026 16:39:26 +0200 Subject: [PATCH 22/23] Create VM --- mon-projet/src/azure-create-vm.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mon-projet/src/azure-create-vm.sh diff --git a/mon-projet/src/azure-create-vm.sh b/mon-projet/src/azure-create-vm.sh new file mode 100644 index 0000000..4a30aa5 --- /dev/null +++ b/mon-projet/src/azure-create-vm.sh @@ -0,0 +1,25 @@ +RESOURCE_GROUP="ntesseyreRG" +VM_NAME="vm-nexacloud-tp" +VM_IMAGE="Ubuntu2204" +VM_SIZE="Standard_D2s_v3" + +# Créer une VM avec clé SSH générée automatiquement +az vm create \ + --resource-group "$RESOURCE_GROUP" \ + --name "$VM_NAME" \ + --image "$VM_IMAGE" \ + --size "$VM_SIZE" \ + --location "swedencentral" \ + --admin-username "debian" \ + --generate-ssh-keys \ + --output json + +# Récupérer l'IP publique +IP=$(az vm show \ + --resource-group "$RESOURCE_GROUP" \ + --name "$VM_NAME" \ + --show-details \ + --query "publicIps" \ + --output tsv) + +echo "IP de la VM : $IP" \ No newline at end of file From a0b40f216dbb21323fc92444035d4692f9bc8d99 Mon Sep 17 00:00:00 2001 From: NathanTesseyre Date: Fri, 29 May 2026 16:41:26 +0200 Subject: [PATCH 23/23] Add shebangs --- mon-projet/src/azure-create-vm.sh | 1 + mon-projet/src/azure-key-vault.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/mon-projet/src/azure-create-vm.sh b/mon-projet/src/azure-create-vm.sh index 4a30aa5..1b50ea9 100644 --- a/mon-projet/src/azure-create-vm.sh +++ b/mon-projet/src/azure-create-vm.sh @@ -1,3 +1,4 @@ +#!/bin/bash RESOURCE_GROUP="ntesseyreRG" VM_NAME="vm-nexacloud-tp" VM_IMAGE="Ubuntu2204" diff --git a/mon-projet/src/azure-key-vault.sh b/mon-projet/src/azure-key-vault.sh index 3a91883..99f940f 100644 --- a/mon-projet/src/azure-key-vault.sh +++ b/mon-projet/src/azure-key-vault.sh @@ -1,3 +1,4 @@ +#!/bin/bash KEYVAULT_NAME="kv-nexacloud-$RANDOM" # Créer le Key Vault