Skip to content

fix(extensions): bind community extension ports via ${BIND_ADDRESS}#1027

Open
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/community-extensions-bind-address
Open

fix(extensions): bind community extension ports via ${BIND_ADDRESS}#1027
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/community-extensions-bind-address

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

What

Replace hardcoded 127.0.0.1: port bindings in 29 community extension compose files with ${BIND_ADDRESS:-127.0.0.1}:, matching the pattern established for core services. Wire a new regression test into make test.

Why

Community extensions in resources/dev/extensions-library/services/ hardcoded 127.0.0.1: on every ports: entry. When users opted into LAN exposure via --lan, the dashboard network-mode toggle, or BIND_ADDRESS=0.0.0.0 in .env, only core services responded to the setting. All 29 community extensions remained loopback-only, silently ignoring user intent.

How

  • Rewrote 35 port-binding lines across 29 compose files:
    "127.0.0.1:${EXT_PORT:-NNNN}:NNNN""${BIND_ADDRESS:-127.0.0.1}:${EXT_PORT:-NNNN}:NNNN"
  • Healthcheck test: URLs (container-internal loopback) intentionally preserved — they are not host-exposed bindings.
  • Added dream-server/tests/test-bind-address-sweep.sh: greps all community extension compose files for bare 127.0.0.1: port-line entries (bidirectional-verified: passes clean, fails clearly on revert).
  • Wired the new test into dream-server/Makefile test: target; inherited by gate: via gate: lint test bats smoke simulate.

Testing

  • Automated: YAML parse validated; docker compose -f <sample> config verified port-string substitution is correct; regression test (test-bind-address-sweep.sh) passes clean and fails with a clear message when a file is reverted; make -n test confirms the new test is invoked by the target.
  • Manual: Set BIND_ADDRESS=0.0.0.0 in .env, run docker compose config | grep "published" for a community extension (e.g. ollama) — confirm binding shows 0.0.0.0 not 127.0.0.1. With BIND_ADDRESS unset, confirm binding defaults back to 127.0.0.1.

Platform Impact

  • macOS: not affected (community extensions run on Docker runtime; port-string substitution is identical across platforms)
  • Linux: not affected (same Docker runtime behaviour)
  • Windows (WSL2): not affected (same)

Known Considerations

Three services exposed on sensitive ports are worth user awareness when opting into LAN mode — default-loopback is preserved; these are user opt-in only:

  • privacy-shield (PII proxy) — LAN exposure makes the scrubbing proxy reachable by other machines on the network.
  • gitea SSH port 2222 — SSH exposed to LAN on opt-in.
  • frigate RTSP (8554) and WebRTC (8555) — camera stream ports exposed to LAN on opt-in.

No change to default behaviour; all three remain loopback-only unless the user explicitly sets BIND_ADDRESS=0.0.0.0.

@Lightheartdevs
Copy link
Copy Markdown
Collaborator

Audit follow-up after today's merge wave: the original ordering blocker for this PR is now resolved, because #1044 has landed and the compose scanner accepts ${BIND_ADDRESS:-127.0.0.1} syntax.

Current status: GitHub now reports this PR as conflicting (DIRTY/CONFLICTING). Please rebase on current main before it can be reconsidered. After rebase, rerun the bind-address sweep/scanner coverage, because the main risk is still keeping the dashboard install scanner and the community compose fragments in sync.

Twenty-nine community extensions in resources/dev/extensions-library/
hardcoded `127.0.0.1:` on `ports:` entries, so setting BIND_ADDRESS=0.0.0.0
(via --lan flag, dashboard network-mode toggle, or .env) only exposed
core services to the LAN. Community extensions remained loopback-only
regardless of user intent.

Rewrite 35 port-lines across 29 files to use the established pattern
from PR Light-Heart-Labs#964:
  before: "127.0.0.1:${EXT_PORT:-NNNN}:NNNN"
  after:  "${BIND_ADDRESS:-127.0.0.1}:${EXT_PORT:-NNNN}:NNNN"

Default behaviour unchanged (loopback by default; user opt-in via
BIND_ADDRESS=0.0.0.0 now works correctly). Healthcheck URLs inside
`healthcheck:` blocks are intentionally preserved — those are
container-internal loopback and should stay literal.

Add tests/test-bind-address-sweep.sh to prevent regression, wired
into the `test:` target of dream-server/Makefile (and inherited by
`gate:` via `gate: lint test bats smoke simulate`).
@yasinBursali yasinBursali force-pushed the fix/community-extensions-bind-address branch from 8ca37c8 to 185f11e Compare April 28, 2026 19:52
@yasinBursali
Copy link
Copy Markdown
Contributor Author

Rebased on current main (#1044 has landed, scanner now accepts the \${BIND_ADDRESS:-127.0.0.1} syntax). Two conflicts resolved:

tests/test-bind-address-sweep.sh passes; sweep verified — no bare 127.0.0.1: port bindings remain in community extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants