Files
proxmox/scripts/archive/consolidated/deploy/setup-cloudflare-tunnel-mim.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

63 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# Setup Cloudflare Tunnel for Miracles In Motion
# Usage: ./setup-cloudflare-tunnel-mim.sh <tunnel-token>
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
TUNNEL_TOKEN="${1:-}"
if [[ -z "$TUNNEL_TOKEN" ]]; then
echo "Usage: $0 <tunnel-token>"
echo ""
echo "To get the tunnel token:"
echo "1. Go to https://one.dash.cloudflare.com"
echo "2. Navigate to Zero Trust > Networks > Tunnels"
echo "3. Create a tunnel named 'mim4u-tunnel'"
echo "4. Copy the tunnel token"
exit 1
fi
PROXMOX_HOST="${PROXMOX_HOST_R630_02}"
CONTAINER_ID="7810"
echo "Setting up Cloudflare Tunnel for Miracles In Motion..."
echo ""
# Update service with tunnel token
ssh -o StrictHostKeyChecking=no root@"$PROXMOX_HOST" "pct exec $CONTAINER_ID -- bash" <<SERVICESCRIPT
cat > /etc/systemd/system/cloudflared-mim.service <<EOF
[Unit]
Description=Cloudflare Tunnel for Miracles In Motion
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/cloudflared tunnel --config /etc/cloudflared/config.yml run
Restart=always
RestartSec=10
Environment="TUNNEL_TOKEN=$TUNNEL_TOKEN"
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable cloudflared-mim
systemctl start cloudflared-mim
systemctl status cloudflared-mim --no-pager | head -10
SERVICESCRIPT
echo ""
echo "✅ Cloudflare Tunnel configured and started!"
echo ""
echo "Next steps:"
echo "1. Verify tunnel is running: ssh root@$PROXMOX_HOST 'pct exec $CONTAINER_ID -- systemctl status cloudflared-mim'"
echo "2. Check tunnel logs: ssh root@$PROXMOX_HOST 'pct exec $CONTAINER_ID -- journalctl -u cloudflared-mim -f'"
echo "3. Test domain: curl -I https://mim4u.org"