#!/bin/bash # WaouW v2.0 - Installation 100% Automatique set -e echo "=== WaouW v2.0 - Installation Automatique ===" # 1. Installer Docker si nécessaire if ! command -v docker &> /dev/null; then echo "Installation de Docker..." curl -fsSL https://get.docker.com | sh systemctl enable docker systemctl start docker fi # 2. Créer utilisateur waouw echo "Configuration utilisateur..." useradd -m -s /bin/bash waouw 2>/dev/null || true echo "waouw:waouw" | chpasswd usermod -aG docker waouw # 3. Préparer les répertoires echo "Préparation des répertoires..." mkdir -p /opt/waouw/data/postgres mkdir -p /opt/waouw/data/redis mkdir -p /opt/waouw/logs chown -R waouw:waouw /opt/waouw # 4. Configuration .env echo "Configuration .env..." cat > /opt/waouw/.env << 'EOF' # WaouW v2.0 - Configuration Automatique WAOUW_DOMAIN=waouw.local ACME_EMAIL=ssl-agent@waouw.tech # Database POSTGRES_PASSWORD=waouw123 DATABASE_URL=postgresql://waouw:waouw123@postgres:5432/waouw # Security JWT_SECRET_KEY=auto-secret-key-2024 DEVICE_HMAC_SECRET=auto-device-secret-2024 # Cache REDIS_URL=redis://redis:6379/0 # Email (optional services) MAIL_MYSQL_ROOT_PASSWORD=mailroot2024 MAIL_MYSQL_PASSWORD=mailpass2024 SMTP_PASSWORD=smtppass2024 # Nextcloud (optional) NEXTCLOUD_MYSQL_ROOT_PASSWORD=nextroot2024 NEXTCLOUD_MYSQL_PASSWORD=nextpass2024 NEXTCLOUD_ADMIN_PASSWORD=nextadmin2024 # System PHPMYADMIN_PASSWORD=phpmyadmin2024 WEBMIN_ROOT_PASSWORD=webmin2024 # Monitoring (optional) GRAYLOG_PASSWORD_SECRET=graylogsecret2024 GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 GRAFANA_ADMIN_PASSWORD=grafana2024 # Services PROMETHEUS_ENABLED=true GRAFANA_ENABLED=true TZ=Europe/Paris EOF chown waouw:waouw /opt/waouw/.env # 5. Démarrer les services echo "Démarrage des services..." cd /opt/waouw/DEPLOY # Démarrer PostgreSQL en premier docker compose up -d postgres echo "Attente PostgreSQL..." sleep 10 # Démarrer Redis docker compose up -d redis echo "Attente Redis..." sleep 5 # Démarrer les services principaux docker compose up -d traefik backend frontend echo "" echo "=== INSTALLATION TERMINÉE ===" echo "🌐 Interface Web : http://waouw.local" echo "👤 Utilisateur : admin" echo "🔑 Mot de passe : admin" echo "" echo "Services actifs :" docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"