mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 10:20:32 +00:00
feat: configurable body limit + Docker delete API
- Add body_limit_mb to ServerConfig (default 2048MB, env NORA_BODY_LIMIT_MB)
- Replace hardcoded 100MB DefaultBodyLimit with config value
- Add DELETE /v2/{name}/manifests/{reference} endpoint (Docker Registry V2 spec)
- Add DELETE /v2/{name}/blobs/{digest} endpoint
- Add namespace-qualified variants for both DELETE endpoints
- Return 202 Accepted on success, 404 with MANIFEST_UNKNOWN/BLOB_UNKNOWN errors
- Audit log integration for delete operations
Fixes: 413 Payload Too Large on Docker push >100MB
This commit is contained in:
@@ -347,7 +347,9 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
let app = Router::new()
|
||||
.merge(public_routes)
|
||||
.merge(app_routes)
|
||||
.layer(DefaultBodyLimit::max(100 * 1024 * 1024)) // 100MB default body limit
|
||||
.layer(DefaultBodyLimit::max(
|
||||
state.config.server.body_limit_mb * 1024 * 1024,
|
||||
))
|
||||
.layer(middleware::from_fn(request_id::request_id_middleware))
|
||||
.layer(middleware::from_fn(metrics::metrics_middleware))
|
||||
.layer(middleware::from_fn_with_state(
|
||||
@@ -366,6 +368,7 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
version = env!("CARGO_PKG_VERSION"),
|
||||
storage = state.storage.backend_name(),
|
||||
auth_enabled = state.auth.is_some(),
|
||||
body_limit_mb = state.config.server.body_limit_mb,
|
||||
"Nora started"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user