admin: add service seam builder

This commit is contained in:
github-ops
2026-05-14 19:06:23 +00:00
parent 5926206e67
commit 82deaeec63
3 changed files with 135 additions and 18 deletions
+4 -3
View File
@@ -18,7 +18,7 @@ use tracing::info;
use crate::{
app::build_app,
auth::{AuthSettings, BootstrapAdminConfig},
service::AdminService,
service::AdminServiceBuilder,
state::AppState,
};
use crank_runtime::{
@@ -70,13 +70,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_limits(runtime_limits)
.with_response_cache(cache_stores.response.clone())
.build();
let service = AdminService::new_with_runtime(
let service = AdminServiceBuilder::new(
registry,
storage_root,
auth_settings,
secret_crypto,
runtime,
);
)
.build();
service.bootstrap_admin_user().await?;
if env_flag("CRANK_DEMO_SEED") {
service.seed_demo_assets().await?;