Skip to content

feat: EASY_PROXY_NETWORK — declarative edge network for the proxy (#23)#25

Merged
montoyaedu merged 1 commit into
masterfrom
feat/issue-23-edge-network
May 18, 2026
Merged

feat: EASY_PROXY_NETWORK — declarative edge network for the proxy (#23)#25
montoyaedu merged 1 commit into
masterfrom
feat/issue-23-edge-network

Conversation

@montoyaedu
Copy link
Copy Markdown
Member

Problem

easy proxy create ran docker run with no --network — the proxy landed on the default bridge. Reaching backends in other Docker networks required a manual docker network connect, a state invisible to easy and 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 create does docker 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; prune disconnects it from every network other than the edge one (cleans up the post-outage "joined to everything" state).

Changes

  • commands/proxy.sh — network logic in create; attach/detach/networks subcommands + help.
  • test/network.bats — 9 tests; test_helper.bashmock_docker_record, mock_docker_multinet; easy_setup unsets EASY_PROXY_NETWORK for isolation.
  • CLAUDE.md, README.md, CHANGELOG.md updated.

Test plan

TDD — 9 tests written first, watched fail, then made green.

npm run lint   # exits 0
bats test/     # 38/38 (29 + 9 new)

Closes #23

🤖 Generated with Claude Code

`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>
@montoyaedu montoyaedu merged commit eb25e64 into master May 18, 2026
2 checks passed
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.

EASY_PROXY_NETWORK — declarative edge network for the proxy

1 participant