Files
proxmox/scripts/cloudflare-tunnels/RUN_ME_AFTER_DOWNLOAD.sh

49 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Run this AFTER downloading credentials from Cloudflare Dashboard
set -e
echo "=== Cloudflare Tunnel Setup ==="
echo ""
# Check for credentials files
MISSING=0
for file in credentials-ml110.json credentials-r630-01.json credentials-r630-02.json; do
if [ ! -f "$file" ]; then
echo "❌ Missing: $file"
MISSING=1
else
echo "✅ Found: $file"
fi
done
echo ""
if [ $MISSING -eq 1 ]; then
echo "Please download credentials from Cloudflare Dashboard first!"
echo "See: DOWNLOAD_CREDENTIALS_NOW.md"
exit 1
fi
echo "Setting up credentials..."
./scripts/setup-credentials-auto.sh
echo ""
echo "Starting services..."
ssh root@${PROXMOX_HOST_ML110:-192.168.11.10} "pct exec 102 -- systemctl start cloudflared-ml110 cloudflared-r630-01 cloudflared-r630-02"
ssh root@${PROXMOX_HOST_ML110:-192.168.11.10} "pct exec 102 -- systemctl enable cloudflared-*"
echo ""
echo "✅ Setup complete!"
echo ""
echo "Check status:"
echo " ssh root@${PROXMOX_HOST_ML110:-192.168.11.10} 'pct exec 102 -- systemctl status cloudflared-*'"