tangle


git clone https://radroots.dev/git/tangle.git
Log | Files | Refs | README | LICENSE

commit 8d434ef71f5d39cd0b8700b54c4ab824ea456d22
parent 840b1f792e58382d8f1f3327cc029728ec756d3a
Author: triesap <tyson@radroots.org>
Date:   Sat,  6 Jun 2026 13:16:55 -0700

ops: add production config example

- add placeholder production runtime config under ops
- model server-mode SurrealDB with synthetic credentials
- enable write auth, tracing, and durable write limits
- cover the example with runtime config loader assertions

Diffstat:
Mcrates/tangle_runtime/src/lib.rs | 33+++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+), 0 deletions(-)

diff --git a/crates/tangle_runtime/src/lib.rs b/crates/tangle_runtime/src/lib.rs @@ -5331,6 +5331,39 @@ mod tests { } #[test] + fn runtime_config_loader_parses_production_config_example() { + let config = parse_runtime_config_json(include_str!( + "../../../ops/production/tangle-runtime.example.json" + )) + .expect("production example config"); + + assert_eq!(config.listen_addr().to_string(), "0.0.0.0:7000"); + assert_eq!( + config.database_config().mode(), + &SurrealConnectionMode::Http { + endpoint: "http://surrealdb:8000".to_owned() + } + ); + let credentials = config + .database_config() + .root_credentials() + .expect("root credentials"); + assert_eq!(credentials.username(), "replace_with_surreal_root_user"); + assert_eq!(credentials.password(), "replace_with_surreal_root_password"); + assert_eq!(config.database_config().namespace(), "tangle"); + assert_eq!(config.database_config().database(), "relay"); + assert_eq!(config.tracing_config().format(), RuntimeTracingFormat::Json); + assert_eq!( + config.durable_write_rate_limit(), + Some(RateLimitConfig::new(300, 60).expect("write limit")) + ); + assert!(config.admission_policy().require_write_auth()); + assert!(config.admin_pubkeys().contains( + &PublicKeyHex::new(&"a".repeat(PublicKeyHex::HEX_LENGTH)).expect("admin pubkey") + )); + } + + #[test] fn runtime_config_loader_parses_observability_tracing_config() { let config = parse_runtime_config_json( r#"{