veza/config/incus/expose-ports.sh
senke 023b8a89c6 fix: Corriger URL Swagger et finaliser implémentation DeveloperPage
- Ajouter fallback pour Swagger UI si doc.json ne fonctionne pas
- Améliorer message d'erreur avec bouton pour ouvrir Swagger UI directement
- Les fonctionnalités API Keys et Usage Stats sont maintenant complètes et fonctionnelles
- Tous les onglets de DeveloperPage sont maintenant implémentés
2026-01-18 13:55:28 +01:00

35 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# Expose HAProxy ports to host
set -euo pipefail
echo "🌐 Exposing HAProxy ports..."
# Expose HAProxy main (port 80) → localhost:8080
incus config device remove veza-haproxy http-proxy 2>/dev/null || true
incus config device add veza-haproxy http-proxy proxy \
listen=tcp:0.0.0.0:8080 \
connect=tcp:10.10.10.6:80 2>/dev/null && \
echo "✅ HAProxy exposed on http://localhost:8080" || \
echo "⚠️ Proxy already exists"
# Expose HAProxy stats (port 8404) → localhost:8404
incus config device remove veza-haproxy stats-proxy 2>/dev/null || true
incus config device add veza-haproxy stats-proxy proxy \
listen=tcp:0.0.0.0:8404 \
connect=tcp:10.10.10.6:8404 2>/dev/null && \
echo "✅ HAProxy Stats exposed on http://localhost:8404/stats" || \
echo "⚠️ Stats proxy already exists"
# Expose HAProxy secure (port 443) → localhost:8443
incus config device remove veza-haproxy https-proxy 2>/dev/null || true
incus config device add veza-haproxy https-proxy proxy \
listen=tcp:0.0.0.0:8443 \
connect=tcp:10.10.10.6:443 2>/dev/null && \
echo "✅ HAProxy HTTPS exposed on https://localhost:8443" || \
echo "⚠️ HTTPS proxy already exists"
echo ""
echo "Access URLs:"
echo " 🌐 Application (HTTP): http://localhost:8080"
echo " 🔒 Application (HTTPS): https://localhost:8443"
echo " 📊 HAProxy Stats: http://localhost:8404/stats"