feat: EASY_PROXY_NETWORK — declarative edge network for the proxy (#23)#25
Merged
Conversation
`easy proxy create` ran `docker run` with no `--network`; the proxy's
connectivity to backends was manual `docker network connect` state,
invisible to `easy` and lost on recreate — the root cause of a live
outage.
Make the proxy's network declarative — a single dedicated edge network.
- commands/proxy.sh:
- `easy proxy create` joins `EASY_PROXY_NETWORK` when set (creating
the network if missing); unchanged on the default bridge when unset
- `easy proxy attach|detach <container>` — connect/disconnect a site
container to/from the edge network
- `easy proxy networks [prune]` — audit the proxy's networks; `prune`
disconnects it from every network other than the edge one
- test/network.bats: 9 tests; test_helper: mock_docker_record,
mock_docker_multinet; easy_setup unsets EASY_PROXY_NETWORK
- CLAUDE.md, README.md, CHANGELOG.md updated
`npm run lint` exits 0; the bats suite passes 38/38.
Closes #23
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
easy proxy createrandocker runwith no--network— the proxy landed on the default bridge. Reaching backends in other Docker networks required a manualdocker network connect, a state invisible toeasyand lost when the container is recreated — the root cause of the recent outage.Fix
Make the proxy's network declarative — a single dedicated edge network (chosen over multi-network: the proxy on one network is the security boundary).
EASY_PROXY_NETWORK— when set,easy proxy createdoesdocker run --network "$EASY_PROXY_NETWORK", creating the network if missing. Unset → default bridge, backward compatible. Recreating the proxy now keeps its connectivity.easy proxy attach|detach <container>— connect/disconnect a site container to/from the edge network (onboard existing "zombie" sites).easy proxy networks [prune]— audit the networks the proxy is joined to;prunedisconnects it from every network other than the edge one (cleans up the post-outage "joined to everything" state).Changes
commands/proxy.sh— network logic increate;attach/detach/networkssubcommands + help.test/network.bats— 9 tests;test_helper.bash—mock_docker_record,mock_docker_multinet;easy_setupunsetsEASY_PROXY_NETWORKfor isolation.CLAUDE.md,README.md,CHANGELOG.mdupdated.Test plan
TDD — 9 tests written first, watched fail, then made green.
Closes #23
🤖 Generated with Claude Code