1
0

auto-install.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # WaouW v2.0 - Installation 100% Automatique
  3. set -e
  4. echo "=== WaouW v2.0 - Installation Automatique ==="
  5. # 1. Installer Docker si nécessaire
  6. if ! command -v docker &> /dev/null; then
  7. echo "Installation de Docker..."
  8. curl -fsSL https://get.docker.com | sh
  9. systemctl enable docker
  10. systemctl start docker
  11. fi
  12. # 2. Créer utilisateur waouw
  13. echo "Configuration utilisateur..."
  14. useradd -m -s /bin/bash waouw 2>/dev/null || true
  15. echo "waouw:waouw" | chpasswd
  16. usermod -aG docker waouw
  17. # 3. Préparer les répertoires
  18. echo "Préparation des répertoires..."
  19. mkdir -p /opt/waouw/data/postgres
  20. mkdir -p /opt/waouw/data/redis
  21. mkdir -p /opt/waouw/logs
  22. chown -R waouw:waouw /opt/waouw
  23. # 4. Configuration .env
  24. echo "Configuration .env..."
  25. cat > /opt/waouw/.env << 'EOF'
  26. # WaouW v2.0 - Configuration Automatique
  27. WAOUW_DOMAIN=waouw.local
  28. ACME_EMAIL=ssl-agent@waouw.tech
  29. # Database
  30. POSTGRES_PASSWORD=waouw123
  31. DATABASE_URL=postgresql://waouw:waouw123@postgres:5432/waouw
  32. # Security
  33. JWT_SECRET_KEY=auto-secret-key-2024
  34. DEVICE_HMAC_SECRET=auto-device-secret-2024
  35. # Cache
  36. REDIS_URL=redis://redis:6379/0
  37. # Email (optional services)
  38. MAIL_MYSQL_ROOT_PASSWORD=mailroot2024
  39. MAIL_MYSQL_PASSWORD=mailpass2024
  40. SMTP_PASSWORD=smtppass2024
  41. # Nextcloud (optional)
  42. NEXTCLOUD_MYSQL_ROOT_PASSWORD=nextroot2024
  43. NEXTCLOUD_MYSQL_PASSWORD=nextpass2024
  44. NEXTCLOUD_ADMIN_PASSWORD=nextadmin2024
  45. # System
  46. PHPMYADMIN_PASSWORD=phpmyadmin2024
  47. WEBMIN_ROOT_PASSWORD=webmin2024
  48. # Monitoring (optional)
  49. GRAYLOG_PASSWORD_SECRET=graylogsecret2024
  50. GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
  51. GRAFANA_ADMIN_PASSWORD=grafana2024
  52. # Services
  53. PROMETHEUS_ENABLED=true
  54. GRAFANA_ENABLED=true
  55. TZ=Europe/Paris
  56. EOF
  57. chown waouw:waouw /opt/waouw/.env
  58. # 5. Démarrer les services
  59. echo "Démarrage des services..."
  60. cd /opt/waouw/DEPLOY
  61. # Démarrer PostgreSQL en premier
  62. docker compose up -d postgres
  63. echo "Attente PostgreSQL..."
  64. sleep 10
  65. # Démarrer Redis
  66. docker compose up -d redis
  67. echo "Attente Redis..."
  68. sleep 5
  69. # Démarrer les services principaux
  70. docker compose up -d traefik backend frontend
  71. echo ""
  72. echo "=== INSTALLATION TERMINÉE ==="
  73. echo "🌐 Interface Web : http://waouw.local"
  74. echo "👤 Utilisateur : admin"
  75. echo "🔑 Mot de passe : admin"
  76. echo ""
  77. echo "Services actifs :"
  78. docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"