You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of epic #40. Independent — can land any time.
Goal
A bundled single-binary deploy needs to be configurable purely via
environment variables (the 12-factor app contract). Close two known
gaps so FLAPI_CONFIG and FLAPI_LOG_LEVEL work as documented (and,
in FLAPI_CONFIG's case, they're already documented but not
wired).
Scope
In src/main.cpp:269-304, add env-var fallback for two flags. Precedence: CLI flag > env var > config file > built-in default.
FLAPI_CONFIG
Read as a fallback for --config / -c.
Default remains flapi.yaml.
When a bundle is present, the embedded flapi.yaml is the implicit
default; FLAPI_CONFIG can still point at a sidecar file outside
the bundle (useful for ops overrides — bundled defaults + sidecar
prod overrides).
FLAPI_LOG_LEVEL
Read as a fallback for --log-level.
Same precedence rule.
Invalid value → error message + non-zero exit (no silent fallback).
Red tests
test/cpp/main_env_var_test.cpp (a small helper module + Catch2
tests):
CLI flag wins over env var.
Env var wins over default when no CLI flag is given.
Invalid FLAPI_LOG_LEVEL → error + non-zero exit.
FLAPI_CONFIG pointing at a missing file → error message names
the path.
Plus a small integration assertion in test_self_packaging.py that FLAPI_LOG_LEVEL=debug ./flapi-prod produces debug-level log output.
Green criteria
All red tests pass.
make integration-test still green.
docs/CLI_REFERENCE.md documents the precedence.
docs/CONFIG_REFERENCE.md gets a "12-factor checklist" section
noting which env vars are read at startup vs. by DuckDB at query
time (the AWS_/GOOGLE_/AZURE_* family already documented
elsewhere).
Activity
feat: 12-factor env vars FLAPI_CONFIG + FLAPI_LOG_LEVEL
feat: 12-factor env vars FLAPI_PORT + FLAPI_HOST (#63) (#67)