Problem or use case
extenddb serve --foreground (PR #126) currently must be set on the command line. For container deployments where command: is templated by the orchestrator, or where users prefer config files over flags, an env var (EXTENDDB_FOREGROUND=1) and/or a [server] config key would be more ergonomic.
The reviewer on #126 noted CLI-only is acceptable for v1, and asked that this be tracked as a follow-up rather than blocking the PR.
Proposed solution
Two ergonomic surfaces, either or both:
-
Env var. Honor EXTENDDB__SERVER__FOREGROUND=1 via the existing EXTENDDB__<SECTION>__<KEY> override mechanism. This reuses the established override chain (CLI > env > file > default) and requires no new code beyond a config field.
-
Config file. Add [server] foreground = false to extenddb.toml and extenddb.sample.toml. This makes the choice declarative for self-hosted deployments and Dockerfile-baked configs.
Precedence should be CLI flag > env var > config file > default (false), matching the project's existing convention.
Open questions
- Should the config key live under
[server] (deployment shape) or [logging] (it does flip log destination)? [server] is probably the right home — daemonize is a runtime mode, not just a logging concern.
- Should there be a startup warning if
foreground = true is set in the file but a daemon-style run is implied (e.g., the user passes no flag and just runs extenddb serve)? Probably not — the config is the source of truth.
Acceptance criteria
Context
Checklist
Problem or use case
extenddb serve --foreground(PR #126) currently must be set on the command line. For container deployments wherecommand:is templated by the orchestrator, or where users prefer config files over flags, an env var (EXTENDDB_FOREGROUND=1) and/or a[server]config key would be more ergonomic.The reviewer on #126 noted CLI-only is acceptable for v1, and asked that this be tracked as a follow-up rather than blocking the PR.
Proposed solution
Two ergonomic surfaces, either or both:
Env var. Honor
EXTENDDB__SERVER__FOREGROUND=1via the existingEXTENDDB__<SECTION>__<KEY>override mechanism. This reuses the established override chain (CLI > env > file > default) and requires no new code beyond a config field.Config file. Add
[server] foreground = falsetoextenddb.tomlandextenddb.sample.toml. This makes the choice declarative for self-hosted deployments and Dockerfile-baked configs.Precedence should be CLI flag > env var > config file > default (
false), matching the project's existing convention.Open questions
[server](deployment shape) or[logging](it does flip log destination)?[server]is probably the right home — daemonize is a runtime mode, not just a logging concern.foreground = trueis set in the file but a daemon-style run is implied (e.g., the user passes no flag and just runsextenddb serve)? Probably not — the config is the source of truth.Acceptance criteria
EXTENDDB__SERVER__FOREGROUND=1 extenddb serveruns in foreground.[server] foreground = trueinextenddb.tomlruns in foreground.--foregroundstill wins over both.--no-foreground(or absence of the flag) does not silently override env/config — i.e., the CLI default needs to be tri-state (flag set, flag explicitly false, flag absent) or only consume the flag when present.extenddb.sample.tomldocuments the new option.Context
servecommand #126 review comment bypdf-amzn, item 5.crates/bin/src/cmd_serve.rs::ServeArgs::foreground.Checklist