feat: add CLI configuration flags

Add clap-powered --bind, --static-dir, and --data-dir flags for human-run
server configuration. The merge order is now explicit: command-line arguments
win over UPL_* environment variables, which still fall back to the existing
repository-local defaults.

Document the new flags and allow just run to forward arguments to cargo so the
help text can be checked through the normal task runner.

Test Plan:
- just check
- cargo run -- --help

Refs: none
This commit is contained in:
2026-05-30 17:52:00 +02:00
parent 8d81b436e5
commit 996ad5c4c8
6 changed files with 266 additions and 14 deletions
+7 -5
View File
@@ -35,11 +35,13 @@ upl
## Configuration
- `UPL_BIND` sets the listen address. It defaults to `127.0.0.1:3000`.
- `UPL_STATIC_DIR` sets the static asset directory. It defaults to `static/`
inside this repository.
- `UPL_DATA_DIR` sets the upload data directory. It defaults to `data/` inside
this repository.
- `--bind` sets the listen address. It overrides `UPL_BIND` and defaults to
`127.0.0.1:3000`.
- `--static-dir` sets the static asset directory. It overrides `UPL_STATIC_DIR`
and defaults to `static/` inside this repository.
- `--data-dir` sets the upload data directory. It overrides `UPL_DATA_DIR` and
defaults to `data/` inside this repository.
- `upl --help` prints the full argument help text.
- The server accepts request bodies up to 64 MiB, which leaves room for the
planned 16 MiB upload chunks and matches the nginx example in `PLAN.md`.