Add automated setup script for tunnel management
Some checks failed
deploy-tunnel / deploy (push) Failing after 1s

- setup.sh: Script interactivo que verifica/crea el tunnel automáticamente
- Detecta si ya existe el tunnel nucleorio-tunnel
- Instala cloudflared si no está presente
- Genera credentials.json y .env automáticamente
- Configura DNS opcionalmente
- Actualizado README con instrucciones de setup rápido
- Workflow actualizado con mejores mensajes de error
This commit is contained in:
2025-10-05 02:22:23 -06:00
parent 8351ee1e86
commit 2c245ea531
3 changed files with 272 additions and 77 deletions

View File

@@ -11,24 +11,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Verify credentials.json exists
- name: Setup tunnel if needed
run: |
if [ ! -f credentials.json ]; then
echo "⚠️ credentials.json not found!"
echo " Make sure to copy it to the repo root before deploying"
echo " cp ~/.cloudflared/<TUNNEL_ID>.json ./credentials.json"
if [ ! -f credentials.json ] || [ ! -f .env ]; then
echo "⚠️ credentials.json o .env no encontrados"
echo " Ejecuta './setup.sh' manualmente en el servidor para configurar el tunnel"
echo ""
echo " O copia manualmente:"
echo " - credentials.json desde ~/.cloudflared/<TUNNEL_ID>.json"
echo " - .env con TUNNEL_ID configurado"
exit 1
fi
echo "✓ credentials.json found"
- name: Verify .env exists
run: |
if [ ! -f .env ]; then
echo "⚠️ .env file not found!"
echo " Copy .env.example to .env and configure TUNNEL_ID"
exit 1
fi
echo "✓ .env file found"
echo "✓ credentials.json y .env encontrados"
- name: Pull fresh cloudflared image
run: docker compose pull