[control] Fix round 1: changes apply while Caddy serves (admin socket, watch through Caddy), revocations that fail are errors and catch up, proof only on the forward-auth UI host, root keys found by content, intermediates checked before install, stale SNI cleared before each handshake
This commit is contained in:
@@ -15,7 +15,7 @@ use crate::error::{ValidationError as E, ValidationErrors, reason as r};
|
||||
use crate::model::{
|
||||
AUTHELIA_COPY_HEADERS, AccessLog, Acme, AuthMode, ForwardAuth, HeaderRule, HeaderValue,
|
||||
HealthCheck, Host, Hostname, LETSENCRYPT_PRODUCTION, MAX_FILE_BYTES, MAX_UPSTREAMS, Model,
|
||||
Scheme, SecretName, Site, TlsMode, Upstream, UpstreamHost,
|
||||
Scheme, SecretName, Site, TlsMode, UI_PROOF_SECRET, Upstream, UpstreamHost,
|
||||
};
|
||||
|
||||
/// One route file handed in by the caller (core does no I/O).
|
||||
@@ -502,6 +502,15 @@ fn check_host(file: &str, raw: RawHost, site: Option<&Site>, errors: &mut Vec<E>
|
||||
}
|
||||
});
|
||||
|
||||
// The web UI's per-boot proof (docs/api.md, "Sign-in") may only ride on a host whose
|
||||
// visitors were checked by forward-auth: edge strips client `Remote-*` headers only there.
|
||||
let sends_proof = request_headers.iter().any(|r| {
|
||||
matches!(r, HeaderRule::Set { value: HeaderValue::Secret(s), .. } if s.as_str() == UI_PROOF_SECRET)
|
||||
});
|
||||
if sends_proof && auth != AuthMode::ForwardAuth {
|
||||
errors.push(E::ProofWithoutSignIn { file: f() });
|
||||
}
|
||||
|
||||
if errors.len() != before {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user