Skip to content

fix(compose): confine dynamic addresses to 10.10.10.128/26 - #972

Merged
cameri merged 1 commit into
mainfrom
fix/compose-ip-range
Oct 24, 2026
Merged

cameri merged 1 commit into
mainfrom
fix/compose-ip-range

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator

What was wrong

nostream, nostream-db and nostream-cache are pinned to 10.10.10.2–.4, but the network let Docker allocate dynamic addresses from the bottom of the same 10.10.10.0/24. otel-collector has no dependency that orders it after nostream, so it could be handed .2 first and the relay then failed to start:

Error response from daemon: failed to set up container networking: Address already in use

Whichever container is created first wins the address, which makes this order-dependent and reliable after a host reboot.

The fix

An ip_range on the default network confines dynamic allocation to 10.10.10.128/26:

- subnet: 10.10.10.0/24
  gateway: 10.10.10.1
  ip_range: 10.10.10.128/26

The subnet and gateway are unchanged, so 10.10.10.1 stays in the default trustedProxies (resources/default-settings.yaml), and the overlay pins — .5 (local), .252 (i2p), .253 (tor) — remain outside the pool. After the change the observability stack takes .128 onward.

Why a test rather than a comment

The failure mode returns the moment someone pins .130. test/unit/ci/compose-network.spec.ts reads every docker-compose*.yml, collects each ipv4_address, and asserts:

  • an ip_range is declared at all;
  • the dynamic range sits inside the subnet;
  • the gateway is inside the subnet and outside the dynamic range;
  • no static address in any compose file falls inside the dynamic pool, so a future pin fails a test instead of a deployment.

Mutation-checked: removing ip_range fails two of the four; pinning 10.10.10.130 fails the fourth.

Verification

$ docker compose -f docker-compose.yml config --format json | jq -c '.networks.default.ipam.config[0]'
{"subnet":"10.10.10.0/24","gateway":"10.10.10.1","ip_range":"10.10.10.128/26"}

$ npx mocha test/unit/ci/compose-network.spec.ts
  4 passing

Full unit suite: 2630 passing.

Not verified here: creating the network on a daemon. The development environment this was written in denies docker network create by policy, so the end-to-end check is docker network inspect nostream showing otel-collector at .128 or above — which is what the reporter saw in production with this exact config.

Closes #929.

The network let Docker allocate dynamic addresses from the bottom of
10.10.10.0/24 while nostream, nostream-db and nostream-cache were pinned to
.2-.4. otel-collector has no dependency that orders it after nostream, so it
could be given .2 first and nostream then failed to start with "Address
already in use" - most reliably after a host reboot, when the daemon starts
containers in arbitrary order.

An ip_range keeps the subnet and gateway as they were, so 10.10.10.1 remains
the trusted proxy and the overlay pins (.5, .252, .253) stay outside the pool.
A unit test holds every static address outside the dynamic pool in every
compose file, so a future pin cannot silently land inside it.

Closes #929
@changeset-bot

changeset-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ecf69c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Confines Docker’s dynamic addresses to 10.10.10.128/26, away from the relay’s static addresses.

  • Dynamic container addresses stay clear of fixed service addresses.

Reviews (1) · Last reviewed commit: "fix(compose): confine dynamic addresses ..." · Reviewed by Greptile

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 40108860717

Coverage increased (+0.006%) to 76.385%

Details

  • Coverage increased (+0.006%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11578
Covered Lines: 9250
Line Coverage: 79.89%
Relevant Branches: 5983
Covered Branches: 4164
Branch Coverage: 69.6%
Branches in Coverage %: Yes
Coverage Strength: 785.13 hits per line

💛 - Coveralls

@cameri
cameri merged commit a46ae06 into main Oct 24, 2026
17 checks passed
@cameri
cameri deleted the fix/compose-ip-range branch October 24, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants