Forge Config will be a Free & Open Source (Apache 2.0) configuration loading and layering library aimed at predictable, explicit environment‑aware application setup.
Provide a small, composable abstraction for merging configuration from:
- Defaults (embedded or code struct)
- One or more config files (YAML / JSON / TOML—format priority TBD)
- Environment variables (prefix + mapping)
- CLI flags / runtime overrides (future)
- Secret file injections (optional future hook)
Output: a strongly typed struct (in the target language implementation) with validation applied.
- Deterministic layering (documented resolution order)
- No hidden magic (explicit mapping > implicit reflection when possible)
- Schema validation first (fail fast)
- Clear error reporting (which key, which layer, why invalid)
- Extensible adapters (custom sources or serializers)
- Load sequence with per-layer provenance tracking
- Environment variable mapping with optional coercion
- Profile support (e.g.,
--profile staging=> mergesconfig.staging.yaml) - Strict schema validation (required fields, type checks, enum constraints)
- Redaction helper for safe logging (mask secrets)
- Hot reload hook (optional, opt-in)
- Diff utility to show effective overrides
- Pluggable decoder interface for alternative formats
- Optional “freeze” step to lock after finalization
Configuration file (config.yaml):
server:
host: 0.0.0.0
port: 8080
database:
url: postgres://user:pass@localhost/db
max_connections: 10Environment overlay:
FORGE_SERVER_PORT=9090
FORGE_DATABASE_MAX_CONNECTIONS=20
Effective (pseudo):
{
"server": { "host": "0.0.0.0", "port": 9090 },
"database": { "url": "...", "max_connections": 20 }
}- Core file loader + base struct mapping
- Environment overlay layer
- Schema validation module
- Profiles / layered includes
- Redaction + diff printing
- Hot reload watch (optional)
- Plug-in format decoders
- CLI inspect tool (maybe integrated later with Bloom CLI)
- Full-featured secret manager integration (may expose a hook later)
- Distributed configuration sync
- Dynamic remote KV backends (e.g., Consul, etcd) in first iterations
Concept stage only. No implementation exists yet; this repo is a placeholder for future development.
Intended license: Apache License 2.0 (added prior to first code commit).
- Used by
bloom-cliand future orchestration tools. - Shared config story across the sakuraforge ecosystem.
“Configuration should converge—layer by layer—into clarity, not confusion.”