4NK_node/scripts/deploy_first_install_no_certs.sh
Debian 3488b497de release: 1.1.2 (latest)
- HSTS activé sur Nginx
- Scripts de déploiement initial (avec/sans certificats)
- Docs installation/configuration enrichies (webroot, renouvellement, déploiement)
2025-08-27 23:38:14 +00:00

41 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
# Déploiement initial A→Z sans certificats (auto-signé local)
# Usage: ./scripts/deploy_first_install_no_certs.sh [--skip-ui]
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
BUILD_UI=1
while [[ $# -gt 0 ]]; do
case "$1" in
--skip-ui) BUILD_UI=0; shift;;
*) echo "Option inconnue: $1" >&2; exit 2;;
esac
done
echo "[1/5] Préparation des dossiers (certs)"
mkdir -p "$ROOT_DIR/certs"
echo "[2/5] Génération de certificats auto-signés (script projet)"
if [[ -x "$ROOT_DIR/scripts/generate_certs.sh" ]]; then
( cd "$ROOT_DIR" && ./scripts/generate_certs.sh )
else
echo "scripts/generate_certs.sh introuvable ou non exécutable. Abandon." >&2
exit 1
fi
echo "[3/5] Optionnel: build UI locale (ihm_client/dist)"
if [[ $BUILD_UI -eq 1 && -x "$ROOT_DIR/scripts/build_ui_local.sh" ]]; then
( cd "$ROOT_DIR" && ./scripts/build_ui_local.sh ) || true
fi
echo "[4/5] Démarrage complet de linfrastructure (build si nécessaire)"
docker compose -f "$ROOT_DIR/docker-compose.yml" up -d --build
echo "[5/5] Vérifications rapides"
curl -skI https://127.0.0.1/signer/health | head -n 1 || true
curl -skI https://127.0.0.1/ | head -n 1 || true
echo "Déploiement initial (auto-signé) terminé. Accès local: https://127.0.0.1/"