Skip to main content

Module config

Module config 

Source
Expand description

§JSS-compatible server config

PRD §F6 / Sprint 4 — bounded context [docs/design/jss-parity/05-config-platform-context.md].

This module provides a layered config loader that mirrors JSS’s three-layer model (CLI > env > file > default; the CLI overlay lives in the consumer binary) so that the same JSS config.json file boots both servers once F7 ships the solid-pod-rs-server binary.

§Layout

§Typical use

use solid_pod_rs::config::ConfigLoader;

let cfg = ConfigLoader::new()
    .with_defaults()                    // lowest precedence
    .with_file("/etc/solid-pod-rs.json")
    .with_env()                         // highest precedence
    .load()
    .await?;

println!("listening on {}:{}", cfg.server.host, cfg.server.port);

§JSS env var parity

See sources for the full mapping table. Headline vars:

  • JSS_HOST, JSS_PORT, JSS_BASE_URL
  • JSS_ROOT, JSS_STORAGE_TYPE, JSS_STORAGE_ROOT
  • JSS_OIDC_ENABLED, JSS_OIDC_ISSUER (+ JSS_IDP, JSS_IDP_ISSUER aliases)
  • JSS_NOTIFICATIONS, JSS_NOTIFICATIONS_{WS2023,WEBHOOK,LEGACY}
  • JSS_SSRF_ALLOW_PRIVATE, JSS_SSRF_{ALLOW,DENY}LIST
  • JSS_DOTFILE_ALLOWLIST, JSS_ACL_ORIGIN_ENABLED

Unknown JSS_* vars are ignored (forward-compat with newer JSS).

Re-exports§

pub use loader::CliArgs;
pub use loader::ConfigLoader;
pub use schema::AuthConfig;
pub use schema::ExtrasConfig;
pub use schema::NotificationsConfig;
pub use schema::SecurityConfig;
pub use schema::ServerConfig;
pub use schema::ServerSection;
pub use schema::StorageBackendConfig;
pub use sources::ConfigSource;

Modules§

loader
Layered config loader.
schema
ServerConfig root + value objects.
sources
Config source precedence + merge logic.