feat: easy proxy doctor — pre-flight config & network diagnostic (#22)#24
Merged
Conversation
A live outage was caused by a hand-written vhost using a static
`upstream {}` block: nginx resolves such hosts at startup and aborts if
one fails — taking down every site. Nothing surfaced the risk before a
container recreate.
Add `easy proxy doctor`, a read-only diagnostic:
- static vhost scan (host-side): flags `upstream {}` blocks and the
deprecated `listen ... http2` directive
- nginx config test (`nginx -t`) when the proxy is running
- lists the proxy's Docker networks
- exits non-zero only when `nginx -t` fails (a definite startup blocker)
- commands/proxy.sh: `doctor` subcommand + help entry
- test/doctor.bats: 7 tests; test_helper: mock_docker_nginx_invalid
- CLAUDE.md, README.md: command tables; CHANGELOG.md: Unreleased entry
`npm run lint` exits 0; the bats suite passes 29/29.
Closes #22
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.
Summary
Adds
easy proxy doctor, a read-only diagnostic — the safety net the recent outage lacked. That outage was caused by a hand-written vhost using a staticupstream {}block: nginx resolves such hosts at startup and aborts if one fails, taking down every site. Nothing surfaced the risk before recreating the container.What
doctorchecksupstream {}blocks → resolved at nginx startup; one bad host blocks all sites. Advises the variable form.listen ... http2directive.nginx -tinside the container, when the proxy is running.nginx -tfails (a definite startup blocker); warnings alone don't fail it.Changes
commands/proxy.sh—doctorsubcommand +__easy_command_proxy_doctor+ help entry.test/doctor.bats— 7 tests;test/test_helper.bash—mock_docker_nginx_invalid.CLAUDE.md,README.md— command tables;CHANGELOG.md—[Unreleased]entry.Test plan
TDD — 7 tests written first, watched fail, then made green.
Notes
EASY_PROXY_NETWORK).Closes #22
🤖 Generated with Claude Code