8c39dc3fad
NODES.md advertised dev's CDP on 9460, but the fleet-facing path is the relay netvm-cdp-relay.py 10.201.36.2:9455 -> 127.0.0.1:9455, and netvm-names.sh never pinned dev (hash default = 9455). The watchdog kept relaunching dev's browser on 9460 while the relay sat orphaned on 9455. - NODES.md: dev cdp_port 9460 -> 9455 (registry is the watchdog's source) - bin/netvm-names.sh: pin def=9450, dev=9455 (was hash-default only) Reported by 646 as xop-e09 partition; verified hop-by-hop before fix. Session: sidechat/dev-cdp-partition
30 lines
1.2 KiB
Bash
Executable File
30 lines
1.2 KiB
Bash
Executable File
# netvm-names.sh — source this. Sets NETNS WG VETH VPEER SUB GW PEER_IP from NODE.
|
|
# 1:1 mapping: profile name = node name. Interface names must fit 15 chars,
|
|
# so wg/veth use a deterministic hash tag; the netns keeps the full name.
|
|
netvm_names() {
|
|
NODE="$1"
|
|
NETNS="warp-${NODE}"
|
|
_tag=$(echo -n "$NODE" | sha256sum | cut -c1-8)
|
|
WG="wb-${_tag}"
|
|
VETH="ve-${_tag}"
|
|
VPEER="vp-${_tag}"
|
|
_idx=$(( 0x${_tag:0:3} % 200 + 10 ))
|
|
# CDP_PORT_OVERRIDE lets provisioners assign clean sequential ports
|
|
# (9410, 9420, ...) instead of the hash-derived default.
|
|
# Unset = previous behavior.
|
|
CDP_PORT=${CDP_PORT_OVERRIDE:-$(( 9222 + 0x${_tag:4:3} % 2000 ))}
|
|
# Pinned registry ports: single source of truth for the fleet.
|
|
# (Was previously duplicated in cdp-relay-watchdog.sh relay_target();
|
|
# moved here 2026-10-04 so netvm-node-up.sh stops spawning wrong-port
|
|
# zombie relays on every browser relaunch.)
|
|
case "$NODE" in
|
|
muse) CDP_PORT=9410 ;;
|
|
pip) CDP_PORT=9420 ;;
|
|
646) CDP_PORT=9430 ;;
|
|
opm) CDP_PORT=9440 ;;
|
|
def) CDP_PORT=9450 ;;
|
|
dev) CDP_PORT=9455 ;;
|
|
esac
|
|
GW="10.201.${_idx}.1"; PEER_IP="10.201.${_idx}.2"; SUB="10.201.${_idx}.0/30"
|
|
}
|