Publish the secrets proxy as an image - #44
Merged
Merged
Conversation
The proxy ran from the official mitmproxy image with the addon mounted from a checkout, so a deployment outside this repository had to fetch the addon file first. deploy/proxy now has a Dockerfile that copies the addon into the pinned mitmproxy image. The main-merge workflow publishes it as ghcr.io/czpython/drukbox/proxy with the tags of the API image, and the pull-request workflow builds it. The addon takes the exchange address from SECRETS_EXCHANGE_URL, so a deployment sets one variable instead of the whole command. The deploy doc's example uses the image.
czpython
force-pushed
the
dru-478-proxy-image
branch
from
September 7, 2026 10:59
e601675 to
d91f6cc
Compare
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.
What changes
deploy/proxy/Dockerfile: the pinnedmitmproxy/mitmproxyimage withdeploy/proxy/swap.pycopied in. The default command runsmitmdumpon0.0.0.0:8880with the addon loaded andflow_detailat 1.SECRETS_EXCHANGE_URLwhen--set exchange_urlis not given. A deployment sets one variable and overrides no command.ghcr.io/czpython/drukbox/proxybeside the API image, with the same tags. The pull-request workflow builds the image as a check.docs/deploy.md: the compose example starts the proxy from the image with no bind mount and one environment variable. The intro names the image.docs/architecture.mdandAGENTS.mdname the Dockerfile in the layout.Where this differs from the ticket
mitmdumpcommand in compose to set one address.Names
New:
SECRETS_EXCHANGE_URL, the environment variable the addon reads, named afterSECRETS_EXCHANGE_BIND_HOSTon the exchange side.Gates
uv run ruff check,uv run ruff format --check,uv run pyright, anduv run pytestare green. The image builds locally and starts with the addon loaded. With no exchange reachable it fails closed, as designed: a private destination gets the addon's 403, and a public one is killed with "the exchange has not answered yet".Review
The adversarial review reported no finding. It asked for a container smoke test of three things, done on the built image:
--set exchange_urlwins overSECRETS_EXCHANGE_URL, and the variable applies when the option is absent. A probe addon read the value at run time for both, and for the variable alone.mitmproxyuser, uid 1000, under the official entrypoint./home/mitmproxy/.mitmproxy, the directory the compose example keeps in a volume.