ch-config
ch-config loads typed runtime configuration from explicit defaults,
environment variables, and optional secret files.
More information is available in the API documentation.
High-level features
- Typed configuration sections with validation
- Direct environment values or mutually exclusive
_FILEcompanions - Explicit dotenv loading with predictable precedence
- Redacted diagnostics for credentials and secret-bearing URLs
- No application discovery or repository-layout assumptions
AppConfig includes optional MariaDB, SpacetimeDB, media-library, CAPTCHA, and
email sections. Applications provide stable defaults in code; deployment values
come from the process environment.
Usage
use Arc;
use ;
Supported environment families include DATABASE_*, Railway's MYSQL*
connection values, SPACETIMEDB_*, MEDIA_LIBRARY_*, CAPTCHA_*, EMAIL_*,
and SMTP_*. Every supported value also accepts an _FILE companion such as
DATABASE_URL_FILE.
Dotenv files
Environment files are opt-in and loaded only from the supplied paths. The base file fills missing process variables; the override file replaces values and is intended for local development.
use EnvFiles;
#
environment::value exposes the same direct-or-file resolution for
application-owned settings. environment::public_url validates and normalizes
the conventional PUBLIC_URL value.
Minimum supported Rust version
ch-config requires Rust 1.96 or newer.
License
Licensed under the Sustainable Use License 1.0. See
LICENSE.md.