[control] QC minors: device install links open a page and download on POST (never listed), approve and install failures show on the request and the CLI waits, PBKDF2 floor, private pki dirs or an error, trusted_proxies for a proxy in front, a placeholder keeps the device allow list from being empty (Caddy refuses that)

This commit is contained in:
2026-11-08 11:02:50 +01:00
parent bc336d1188
commit 3bf5fa0e1a
27 changed files with 548 additions and 46 deletions
+10 -8
View File
@@ -28,18 +28,20 @@ pub async fn front(State(st): State<Arc<AppState>>, req: Request, next: Next) ->
return ApiError::new(StatusCode::FORBIDDEN, "request.host", Params::new())
.into_response();
}
if req.method() != axum::http::Method::GET {
return ApiError::new(
let token = token.to_owned();
// GET shows the page; only its button (POST) uses the link up.
return match req.method().as_str() {
"GET" | "HEAD" => super::pki::bundle_page(st, token).await,
"POST" => super::pki::download_bundle(State(st), AxPath(token))
.await
.unwrap_or_else(IntoResponse::into_response),
_ => ApiError::new(
StatusCode::METHOD_NOT_ALLOWED,
"request.method",
Params::new(),
)
.into_response();
}
let token = token.to_owned();
return super::pki::download_bundle(State(st), AxPath(token))
.await
.unwrap_or_else(IntoResponse::into_response);
.into_response(),
};
}
if path.starts_with("/api/") || path == "/api" {
return next.run(req).await;