Repository navigation
fix: make server bind address configurable - #33
Merged
Merged
Conversation
The Dockerfile pinned the bind address in its CMD (`uvicorn --host 0.0.0.0`), bypassing the CLI entirely, so there was no way to change it at run time. `app.server.run()` had the opposite problem: 127.0.0.1 and reload=True hardcoded for dev. Host and port now come from SERVER_HOST/SERVER_PORT (defaults 127.0.0.1:8000), overridable by `--host`/`--port` on `s3player server`. The image sets SERVER_HOST=0.0.0.0 as an env default and runs the CLI, so the container still listens on all interfaces but the value can be overridden. Reload is now an opt-in `--reload` flag rather than always-on. Also replaces docker-build.yml with a manual release workflow adapted from s3browser: version comes from pyproject.toml, draft release first, multi-arch images to ghcr, publish last (which creates the tag). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRfdTTUtJsAqqAnUs94oVY
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
The container image hardcoded its bind address in the Dockerfile
CMD:That bypassed the
s3playerCLI entirely, so the address could only be changed by overriding the whole CMD.app.server.run()had the mirror-image problem —host="127.0.0.1",port=8000andreload=Trueall hardcoded for local dev.Change
SERVER_HOST/SERVER_PORTsettings (defaults127.0.0.1/8000), with empty values treated as unset so a copied.env.examplecan't yield a blank host or crash onint("").s3player servergained--host,--port,--reload. Precedence: flags > env > defaults.ENV SERVER_HOST=0.0.0.0and runsCMD ["s3player", "server"]. It still listens on all interfaces out of the box, but that's now an overridable default rather than baked-in argv, and the container and local dev share one code path.--reload) — it had to, since the container now goes through the same entrypoint.Release workflow
Replaces
docker-build.ymlwithbuild.yml, adapted from s3browser's: a manualworkflow_dispatchthat reads the version frompyproject.toml, opens a draft release, builds and pushes multi-arch images to ghcr, then publishes the release — which is what creates the tag, so a failed build leaves no published tag behind. Dispatching from a non-mainbranch marks it a prerelease and skips thelatesttags. No wheel/sdist jobs: s3player's wheel doesn't bundle the frontend, so it isn't a useful artifact today.pyproject.tomlversion bumped0.0.0→0.0.1so the first dispatch cutsv0.0.1.Validation
ruff check,ruff format --check,basedpyrightclean; 95 tests pass. Host/port resolution verified by patchinguvicorn— env yields0.0.0.0:9001, flags override to127.0.0.1:1234. Frontend is untouched and its deps aren't installed locally, so CI covers biome/tsc. The image itself was not built locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01BRfdTTUtJsAqqAnUs94oVY