[control] Fix round 2: Caddy rereads its files on every load and the served certificate is checked, Caddy trials get a deadline outside control (caddy-guard, caddy-revert), the watch under Caddy judges upstreams as edge does, a reload of Caddy during the watch is noticed and device changes wait for the apply, stricter root key scan, IPv4-mapped trusted proxies

This commit is contained in:
2026-11-08 12:04:13 +01:00
parent ba3a060b2e
commit 23a283ece9
12 changed files with 884 additions and 159 deletions
+11 -5
View File
@@ -1541,8 +1541,9 @@ impl Control {
remove_if_exists(&p).map_err(|e| e.to_string())?;
}
if caddy {
// Caddy must run caddy.json again, the last good config.
// Caddy must run caddy.json again, the last good config; no trial is out any more.
self.caddy_reload().await?;
crate::caddy_guard::disarm(&self.cfg.state_dir);
return Ok(rev);
}
// Edge must now run edge.json, the last good config. If it confirmed the trial after
@@ -1703,10 +1704,15 @@ impl Control {
self.unpause();
self.sync_files().await;
}
if self.engine_running() == "caddy"
&& let Err(e) = self.caddy_reload().await
{
log::warn!(target: "ianitor::control", "Caddy did not load caddy.json at start: {e}");
if self.engine_running() == "caddy" {
match self.caddy_reload().await {
Ok(()) => crate::caddy_guard::disarm(&self.cfg.state_dir),
Err(e) => {
log::warn!(target: "ianitor::control", "Caddy did not load caddy.json at start: {e}")
}
}
} else {
crate::caddy_guard::disarm(&self.cfg.state_dir);
}
if let Err(e) = self.shares.ensure_revocation_file() {
log::error!(target: "ianitor::share", "{e}");