8.6 KiB
Doghouse 0.1.2
Patch release on top of 0.1.1 (d01ed0b, tag v0.1.1). It fixes a LiveKit startup crash loop
seen on Justin's server, moves LiveKit's media ports out of Linux's ephemeral range, and makes the
Docker network configurable. There are no database or app
changes. Branch release/0.1.2; no zip or tag yet (QA reviews first).
Upgrading from 0.1.1
Keep your existing deploy/.env and add the two new settings (see .env.example):
LIVEKIT_NODE_IP=<your public IP, from: curl -4 ifconfig.me>
DOGHOUSE_NETWORK=doghouse_net
- If you edited
docker-compose.ymlto use your own network (e.g.homelab), setDOGHOUSE_NETWORK=homelabinstead and use the newdocker-compose.ymlunedited. Never usenetwork_mode:. - Then follow README "Upgrading 0.1.1 -> 0.1.2": back up
./data, replace the source files from the zip, and rundocker compose up -d --buildfromdeploy/. - Router and ufw: voice media moved to UDP 20000-20100. Forward UDP 20000-20100 to the
server and remove the old UDP 50000-50100 forward. For ufw:
sudo ufw allow 20000:20100/udpandsudo ufw delete allow 50000:50100/udp. TCP 7881 and UDP 3478 are unchanged. - Use the new
docker-compose.ymlandlivekit.yaml; they must agree on the range. If you had editedlivekit.yaml, re-apply your edits to the new file.npm-advanced.confis unchanged. - If your home IP is dynamic, update
LIVEKIT_NODE_IPwhen it changes, then rundocker compose up -d livekit.
LiveKit crash loop: "could not resolve external IP"
Seen: on 0.1.1, doghouse-livekit restarts forever with
could not validate RTC config: could not resolve external IP: dial udp: lookup stun1.l.google.com on 127.0.0.53:53: … connection refused and exited with code 0 (restarting). livekit.yaml has
use_external_ip: true, so LiveKit must reach a STUN server at startup, and that container
couldn't resolve DNS. 127.0.0.53 is the host's systemd-resolved, which points to host networking
(network_mode: host) rather than our doghouse_net, where Docker's DNS is 127.0.0.11.
Fix: a new optional .env setting, LIVEKIT_NODE_IP. When it is set, LiveKit advertises that
IP and skips STUN entirely. When it is empty, LiveKit behaves exactly as before. No dns: lines
are hard-coded (decisions log).
How it works in livekit-server v1.13.9 (checked against the source at tag v1.13.9 and its
mediatransportutil dependency f234b534b095, and on the v1.13.9 binary):
--node-ip/ envNODE_IPsetsrtc.node_ip(pkg/config/config.go,updateFromCLI).- A node IP alone is not enough.
RTCConfig.Validateruns STUN whenconf.NodeIP.IsEmpty() || conf.UseExternalIP, so withuse_external_ip: trueSTUN still runs. Binary test withNODE_IP=203.0.113.10and a broken resolver: same error, exit 0. - So when a node IP is set,
use_external_ipmust also be false. Then LiveKit logsusing explicit node IP for NAT1To1Ipsand starts. - Passing
LIVEKIT_RTC_USE_EXTERNAL_IPfrom compose as${LIVEKIT_NODE_IP:+false}doesn't work. When the IP is empty the variable is set but empty, and livekit-server reads that as false. The binary then started with the container's private IP (nodeIP: 172.30.0.2) and no STUN, which would silently break voice for everyone not using the new setting.
Implementation: docker-compose.yml passes NODE_IP: '${LIVEKIT_NODE_IP:-}' and starts the
container (alpine, so /bin/sh exists) with a small sh -c:
- if
NODE_IPis non-empty, it runsexec /livekit-server --config /etc/livekit.yaml --rtc.use_external_ip=falseand logsdoghouse: LIVEKIT_NODE_IP=…, skipping STUN; - otherwise it runs
exec /livekit-server --config /etc/livekit.yamlas before.
The setting lives in .env, so upgrades never overwrite it, and livekit.yaml is unchanged.
Tested with the v1.13.9 binary. The compose command and environment were extracted from
docker-compose.yml and run in a mount namespace whose /etc/resolv.conf is
nameserver 127.0.0.53, so STUN is unreachable, as on Justin's server:
LIVEKIT_NODE_IPempty: exits with code 0 after 1.5 s with the exact error,could not validate RTC config: could not resolve external IP: dial udp: lookup stun1.l.google.com on 127.0.0.53:53: read udp 127.0.0.1:43433->127.0.0.53:53: read: connection refused.LIVEKIT_NODE_IP=203.0.113.10: listening on 7880 after 0.3 s, loggingdoghouse: LIVEKIT_NODE_IP=203.0.113.10, skipping STUN,using explicit node IP for NAT1To1Ipsandstarting LiveKit server … "nodeIP": "203.0.113.10".- With the box's normal resolver, where STUN gets no reply, the old default hangs: still not listening after 30 s.
LiveKit media ports: UDP 20000-20100 (was 50000-50100)
Seen: Justin's docker compose up -d livekit failed with
failed to bind host port [::]:50028/udp: address already in use. 50000-50100 sits inside Linux's
ephemeral port range (32768-60999), which the kernel hands out for outgoing connections, so any
port in it can already be taken.
Fix (decisions log): the default RTC UDP range is now 20000-20100: livekit.yaml
rtc.port_range_start/end, the compose port mapping, README (router table, ufw example,
troubleshooting) and DESIGN/PLAN. The e2e LiveKit config moved from 51000-51100 to 21000-21100 for
the same reason. validate:deploy enforces that the range is valid, below 32768, doesn't overlap
TURN's relay range (turn.relay_range_start/end, default 30000-40000), and matches the published
compose range. Each rule fails when broken: 50000-50100, 29950-30050, and a compose/yaml mismatch.
The README has a troubleshooting entry quoting the exact error. With the new config, the v1.13.9
binary logs "rtc.portICERange": [20000, 20100].
Configurable Docker network
Justin's NPM is on his existing network homelab. The compose network key stays doghouse_net,
but its Docker name is now name: ${DOGHOUSE_NETWORK:-doghouse_net} (still external: true).
DOGHOUSE_NETWORK=doghouse_net is in .env.example, with a comment: set it to a network your proxy
is already on, e.g. homelab. The README explains the option, warns that network_mode: <name>
and network_mode: host are wrong (use networks:), and notes that containers on a user-defined
network show nameserver 127.0.0.11 in /etc/resolv.conf.
Other changes
npm run validate:deploy (part of npm run check) now checks:
LIVEKIT_NODE_IPis in.env.example, empty, and explained withcurl -4 ifconfig.me; andDOGHOUSE_NETWORKis there with defaultdoghouse_net.- Compose with
LIVEKIT_NODE_IPset givesNODE_IP=<ip>and the--rtc.use_external_ip=falsestart; with it empty,NODE_IP=''and the plain start.LIVEKIT_RTC_USE_EXTERNAL_IPmust not be set (the empty-means-false trap). - The network name comes from
${DOGHOUSE_NETWORK:-doghouse_net}, andDOGHOUSE_NETWORK=homelabgives external networkhomelab.doghouse_netis the only network, both services are on it, and no service usesnetwork_mode:ordns:. - The interpolation now handles
${VAR:+alt}and$$like Compose does. - Each new rule was confirmed to fail when broken:
network_mode: homelabadded, network name hard-coded,NODE_IPremoved, the flag removed, and the empty-bool env approach.
README:
- A troubleshooting entry quotes the exact error. It covers setting
LIVEKIT_NODE_IPand runningdocker compose up -d livekit, and checking thatdocker inspect doghouse-livekit --format '{{.HostConfig.NetworkMode}}'saysdoghouse_net, nothost(host mode breaks NPM -> LiveKit and LiveKit -> app webhooks). - A new entry covers dynamic home IPs.
- The old "set
node_ipinlivekit.yaml" advice now points atLIVEKIT_NODE_IP. - Step 4 lists the two new settings, and step 5 covers
DOGHOUSE_NETWORK.
Packaging:
- The zip now includes the repo
.gitignore, which gained explicitdeploy/.envanddeploy/data/lines, plusCHANGES-0.1.2.md. npm run packagerefuses to build if.gitignorelacks those lines orCHANGES-<version>.mdis missing.
Version: 0.1.2 in the root and workspace package.json files and in package-lock.json.
Tests (branch release/0.1.2, 10 Oct 2026, 07:17–07:24 AEDT)
REQUIRE_LIVEKIT=1 npm run check: passed (exit 0). The output includesdeploy/ OK: …, "Skipped tests: 0" and "Server coverage: statements 98.12%, branches 92.35%, functions 99.29%, lines 99.19%". Counts: shared 22, server 187, web 205 passed, 0 failed.REQUIRE_LIVEKIT=1 npm run e2e: passed (exit 0), "12 passed (44.7s)", "4 skipped". The skips are the usual desktop-only two-user specs. The voice spec passed on the new 21000-21100 e2e range.- No zip was built (
npm run packagenot run); QA reviews first.