Add MEV hostnames to tunnel helper

This commit is contained in:
defiQUG
2026-04-12 19:02:51 -07:00
parent 075a9c8a3c
commit 614d045842
2 changed files with 26 additions and 1 deletions

View File

@@ -58,6 +58,14 @@ bash scripts/cloudflare/set-mev-defi-oracle-dns.sh
Optional: `MEV_DEFI_ORACLE_EDGE_MODE=tunnel|public_ip|auto`, `MEV_DEFI_ORACLE_PUBLIC_IP=…`.
If `MEV_DEFI_ORACLE_EDGE_MODE=auto` selects the VMID 2400 tunnel but the tunnel is not manageable in the current Cloudflare account, fall back to the public NPMplus edge explicitly:
```bash
MEV_DEFI_ORACLE_EDGE_MODE=public_ip bash scripts/cloudflare/set-mev-defi-oracle-dns.sh
```
If you intentionally carry **MEV** traffic on the same Cloudflare tunnel stack as RPC / `info`, run `scripts/update-vmid2400-tunnel-config.sh` so the tunnel ingress includes `mev.defi-oracle.io` and `www.mev.defi-oracle.io`.
## Configuration reference
| Variable | Default (see `config/ip-addresses.conf`) | Purpose |

View File

@@ -9,8 +9,9 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
ENV_FILE="$PROJECT_ROOT/.env"
# shellcheck source=/dev/null
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Dedicated info SPA LXC (VMID 2410); tunnel connector on 2400 must reach this IP:80
# Dedicated info / MEV SPA LXC (VMID 2410 by default); tunnel connector on 2400 must reach this IP:80
INFO_WEB_UPSTREAM="${INFO_DEFI_ORACLE_TUNNEL_UPSTREAM:-${IP_INFO_DEFI_ORACLE_WEB:-192.168.11.218}}"
MEV_WEB_UPSTREAM="${MEV_DEFI_ORACLE_TUNNEL_UPSTREAM:-${MEV_DEFI_ORACLE_UPSTREAM_IP:-${IP_INFO_DEFI_ORACLE_WEB:-192.168.11.218}}}"
# Colors
RED='\033[0;31m'
@@ -76,6 +77,7 @@ log_info "Building tunnel ingress configuration..."
log_info " HTTP RPC → http://127.0.0.1:${RPC_HTTP_PORT}"
log_info " WebSocket RPC → ws://127.0.0.1:${RPC_WS_PORT}"
log_info " info.defi-oracle.io → http://${INFO_WEB_UPSTREAM}:80 (dedicated web LXC)"
log_info " mev.defi-oracle.io → http://${MEV_WEB_UPSTREAM}:80 (dedicated web LXC)"
# Note: Cloudflare tunnels handle WebSocket upgrades automatically
# We route HTTP to 8545, and WebSocket will also route there initially
@@ -87,6 +89,7 @@ INGRESS_CONFIG=$(jq -n \
--arg http_port "$RPC_HTTP_PORT" \
--arg ws_port "$RPC_WS_PORT" \
--arg info_web "$INFO_WEB_UPSTREAM" \
--arg mev_web "$MEV_WEB_UPSTREAM" \
'{
config: {
ingress: [
@@ -112,6 +115,20 @@ INGRESS_CONFIG=$(jq -n \
httpHostHeader: "www.info.defi-oracle.io"
}
},
{
hostname: "mev.defi-oracle.io",
service: ("http://" + $mev_web + ":80"),
originRequest: {
httpHostHeader: "mev.defi-oracle.io"
}
},
{
hostname: "www.mev.defi-oracle.io",
service: ("http://" + $mev_web + ":80"),
originRequest: {
httpHostHeader: "www.mev.defi-oracle.io"
}
},
{
service: "http_status:404"
}