Skip to content

Publish the secrets proxy as an image - #44

Merged
czpython merged 1 commit into
mainfrom
dru-478-proxy-image
Sep 7, 2026
Merged

Publish the secrets proxy as an image#44
czpython merged 1 commit into
mainfrom
dru-478-proxy-image

Conversation

@czpython

@czpython czpython commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What changes

  • deploy/proxy/Dockerfile: the pinned mitmproxy/mitmproxy image with deploy/proxy/swap.py copied in. The default command runs mitmdump on 0.0.0.0:8880 with the addon loaded and flow_detail at 1.
  • The addon reads the exchange address from SECRETS_EXCHANGE_URL when --set exchange_url is not given. A deployment sets one variable and overrides no command.
  • The main-merge workflow publishes ghcr.io/czpython/drukbox/proxy beside 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.md and AGENTS.md name the Dockerfile in the layout.

Where this differs from the ticket

  • The ticket says nothing changes in the addon. It gained the environment default for the exchange address, five lines. Without it a consumer would repeat the whole mitmdump command in compose to set one address.

Names

New: SECRETS_EXCHANGE_URL, the environment variable the addon reads, named after SECRETS_EXCHANGE_BIND_HOST on the exchange side.

Gates

uv run ruff check, uv run ruff format --check, uv run pyright, and uv run pytest are 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_url wins over SECRETS_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.
  • The process runs as the mitmproxy user, uid 1000, under the official entrypoint.
  • The CA is created in /home/mitmproxy/.mitmproxy, the directory the compose example keeps in a volume.

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
czpython force-pushed the dru-478-proxy-image branch from e601675 to d91f6cc Compare September 7, 2026 10:59
@czpython
czpython merged commit d2163ab into main Sep 7, 2026
6 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.

1 participant