#!/bin/bash
# Instructions for updating Cloudflare Tunnel to route to central Nginx
# This script provides the commands and instructions needed

echo "═══════════════════════════════════════════════════════════"
echo "  CLOUDFLARE TUNNEL UPDATE INSTRUCTIONS"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "The Cloudflare tunnel uses token-based configuration managed"
echo "in the Cloudflare dashboard. You need to update it manually."
echo ""
echo "Steps:"
echo "1. Go to: https://one.dash.cloudflare.com/"
echo "2. Navigate to: Zero Trust → Networks → Tunnels"
echo "3. Select tunnel: b02fe1fe-cb7d-484e-909b-7cc41298ebe8"
echo "4. Click 'Configure' → 'Public Hostnames'"
echo "5. Update ALL hostnames to route to: http://192.168.11.21:80"
echo ""
echo "Required Updates:"
echo "  - explorer.d-bis.org → http://192.168.11.21:80"
echo "  - rpc-http-pub.d-bis.org → http://192.168.11.21:80"
echo "  - rpc-ws-pub.d-bis.org → http://192.168.11.21:80"
echo "  - rpc-http-prv.d-bis.org → http://192.168.11.21:80"
echo "  - rpc-ws-prv.d-bis.org → http://192.168.11.21:80"
echo "  - dbis-admin.d-bis.org → http://192.168.11.21:80"
echo "  - dbis-api.d-bis.org → http://192.168.11.21:80"
echo "  - dbis-api-2.d-bis.org → http://192.168.11.21:80"
echo "  - mim4u.org → http://192.168.11.21:80"
echo "  - www.mim4u.org → http://192.168.11.21:80"
echo ""
echo "After updating, the tunnel will automatically reload within 1-2 minutes."
echo ""
echo "Test after update:"
echo "  curl https://explorer.d-bis.org/api/v2/stats"
echo "  curl -X POST https://rpc-http-pub.d-bis.org \\"
echo "    -H 'Content-Type: application/json' \\"
echo "    -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_chainId\",\"params\":[],\"id\":1}'"
echo ""

