hero_embedderd: bind on HERO_EMBEDDERD_ADDRESS in addition to loopback #35

Merged
omarz merged 1 commit from development_embedderd_mycelium_bind into development 2026-05-03 16:01:49 +00:00
Member

The shell wrapper (service_embedder.nu) already injects the host's
mycelium IPv6 address as HERO_EMBEDDERD_ADDRESS, but the daemon
hardcoded 127.0.0.1, so cross-node access never worked. Now read the
env var, validate it as an IpAddr, and dual-bind: loopback (always, so
in-host tenants and the userspace HERO_EMBEDDERD_URL keep working) +
the resolved address. Wildcard (0.0.0.0 / ::) replaces loopback since
it already covers it; an explicit loopback in the env var is a no-op.

Both the early health-only phase and the real serve phase open one
listener per address. The early phase keeps a oneshot per task so all
listeners release their ports before the real binds. The real phase
shares a single tokio Notify woken by the SIGINT/SIGTERM handler so
all listeners drain gracefully on shutdown. The startup info line now
prints the comma-joined listen list instead of a single bind.

The shell wrapper (service_embedder.nu) already injects the host's mycelium IPv6 address as HERO_EMBEDDERD_ADDRESS, but the daemon hardcoded 127.0.0.1, so cross-node access never worked. Now read the env var, validate it as an IpAddr, and dual-bind: loopback (always, so in-host tenants and the userspace HERO_EMBEDDERD_URL keep working) + the resolved address. Wildcard (0.0.0.0 / ::) replaces loopback since it already covers it; an explicit loopback in the env var is a no-op. Both the early health-only phase and the real serve phase open one listener per address. The early phase keeps a oneshot per task so all listeners release their ports before the real binds. The real phase shares a single tokio Notify woken by the SIGINT/SIGTERM handler so all listeners drain gracefully on shutdown. The startup info line now prints the comma-joined listen list instead of a single bind.
hero_embedderd: bind on HERO_EMBEDDERD_ADDRESS in addition to loopback
Some checks failed
Test / test (pull_request) Failing after 1m24s
Test / test (push) Has been cancelled
851a27089a
The shell wrapper (service_embedder.nu) already injects the host's
mycelium IPv6 address as HERO_EMBEDDERD_ADDRESS, but the daemon
hardcoded 127.0.0.1, so cross-node access never worked. Now read the
env var, validate it as an IpAddr, and dual-bind: loopback (always, so
in-host tenants and the userspace HERO_EMBEDDERD_URL keep working) +
the resolved address. Wildcard (0.0.0.0 / ::) replaces loopback since
it already covers it; an explicit loopback in the env var is a no-op.

Both the early health-only phase and the real serve phase open one
listener per address. The early phase keeps a oneshot per task so all
listeners release their ports before the real binds. The real phase
shares a single tokio Notify woken by the SIGINT/SIGTERM handler so
all listeners drain gracefully on shutdown. The startup info line now
prints the comma-joined listen list instead of a single bind.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
omarz merged commit 851a27089a into development 2026-05-03 16:01:49 +00:00
omarz deleted branch development_embedderd_mycelium_bind 2026-05-03 16:01:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_embedder!35
No description provided.