Rust implementation of OCI Distribution Spec with granular access control

fix: set server status to Ready after successful bind

+10 -1
+10 -1
src/main.rs
··· 38 38 39 39 // Shared app state 40 40 let shared_state = Arc::new(state::new_app(&args)); 41 + let state_clone = shared_state.clone(); 41 42 42 43 let app = Router::new() 43 44 .route("/", get(meta::index)) // Index, info ··· 109 110 .route("/{*path}", put(meta::catch_all_put)) 110 111 .route("/{*path}", patch(meta::catch_all_patch)) 111 112 .route("/{*path}", delete(meta::catch_all_delete)) 112 - .with_state(shared_state) 113 + .with_state(state_clone) 113 114 .layer(DefaultBodyLimit::disable()) // Allow unlimited body size for blob uploads 114 115 .layer(axum::middleware::from_fn(middleware::track_metrics)) 115 116 .layer(CorsLayer::permissive()) ··· 120 121 121 122 log::info!("Listening on: {}", &args.host); 122 123 let listener = tokio::net::TcpListener::bind(&args.host).await.unwrap(); 124 + 125 + // Mark server as ready after successful bind 126 + { 127 + let mut status = shared_state.server_status.lock().await; 128 + *status = state::ServerStatus::Ready; 129 + log::info!("Server status: Ready"); 130 + } 131 + 123 132 axum::serve(listener, app).await.unwrap(); 124 133 }