bxnet-ops/org-ops-cli/src/main.rs
Tyler J King c68456d745 refactor(org-ops): neutralize BXNet identity from framework core
Move all BXNet-specific defaults out of org-ops-core into the example
CLI binary (org-ops-cli/src/main.rs). The framework is now fork-ready
for any consortium without string-replacing org-specific values.

Changes:
- OrgOpsConfig: neutral defaults (my-org, example.com), added
  infra_namespace, bridge_daemonset, ssh_user fields
- AuthConfig: config_dir_name field replaces hardcoded bxnet-ops
  path; config_dir() now a method using config value
- GitConfig: neutral default (git.example.com)
- auth_commands: DID_BRIDGE_PATH env replaces hardcoded dev path
- lib.rs (connect): namespace, daemonset, SSH user, cert paths all
  read from OrgOpsConfig instead of hardcoded strings
- score_fetcher: neutral corpus entry name
- playbook_commands: neutral Keycloak service name and temp dir
- org-ops-cli/main.rs: explicit BXNet example with "replace these"
  comment, all org-specific values passed via config
- .gitignore: added target/

Zero BXNet references remain in org-ops-core source (verified by grep).

Signed-off-by: Tyler King <tking@guildhouse.dev>
Signed-off-by: Tyler J King <tking727@gmail.com>
2026-04-15 16:32:13 -04:00

46 lines
1.8 KiB
Rust

//! Example org-ops CLI — BXNet consortium.
//!
//! This binary demonstrates how to build a governed CLI for your
//! consortium using the org-ops-core framework. Fork this file and
//! replace the config values with your org's identity.
use org_ops_core::{
AuthCommands, AuthConfig, GitConfig, GovernedGitCommands, OrgOps, OrgOpsConfig,
PlaybookCommands,
};
fn main() -> anyhow::Result<()> {
let forgejo_token = std::env::var("FORGEJO_TOKEN").ok();
OrgOps::builder()
.with_config(OrgOpsConfig {
// ── Replace these with your consortium's values ──
org_name: "BXNet".into(),
trust_domain: "bxnet.io".into(),
bascule_endpoint: "bascule.bxnet.io:443".into(),
chronicle_endpoint: "chronicle.bxnet.io:8080".into(),
binary_name: "bxnet-ops".into(),
description: "BXNet governed operations CLI".into(),
version: env!("CARGO_PKG_VERSION").into(),
infra_namespace: "guildhouse-infra".into(),
bridge_daemonset: "substrate-bridge".into(),
ssh_user: "tking".into(),
})
.with_commands(AuthCommands::new(AuthConfig {
oidc_issuer: "https://auth.bxnet.io/realms/guildhouse".into(),
client_id: "bxnet-ops".into(),
config_dir_name: "bxnet-ops".into(),
..Default::default()
}))
.with_commands(GovernedGitCommands::new(GitConfig {
forgejo_url: "https://git.bxnet.io".into(),
forgejo_token,
chronicle_webhook: "http://localhost:8090/webhook/forgejo".into(),
}))
.with_commands(PlaybookCommands::new(
"./playbooks",
"http://localhost:8090/webhook/forgejo",
))
.build()
.run()
}