[control] Domi CA and UI sign-in: intermediate renewal by CSR with manual offline signing, domi host certificates, device requests approved by code, one-time PKCS#12 installs, revocation; Remote-User trusted only with edge's per-boot proof

This commit is contained in:
2026-11-07 23:21:49 +01:00
parent 211b851c3e
commit c18ae154ad
17 changed files with 1300 additions and 54 deletions
+25 -8
View File
@@ -406,6 +406,8 @@ pub struct HostRow {
pub auth: String,
pub websockets: bool,
pub share_links: bool,
/// Visitors need a Domi device certificate.
pub device_certs: bool,
pub added_at: Option<String>,
pub health: HealthView,
pub certificate: CertView,
@@ -439,13 +441,28 @@ pub struct Counts {
#[derive(Debug, Clone, Serialize, ToSchema)]
pub struct EngineView {
/// `pingora` (the Caddy switch waits on Mark, ROADMAP §10 (b)).
/// `pingora` or `caddy`.
pub running: String,
/// `running` or `stopped` (control cannot reach it).
/// `running`, `switching` or `stopped` (control cannot reach it).
pub state: String,
pub since: Option<String>,
#[schema(value_type = Option<Object>)]
pub fallback_ready: Option<serde_json::Value>,
/// The engine a running switch goes to.
pub target: Option<String>,
/// Whether control can switch on this server (`[engine]` in control.toml).
pub switchable: bool,
/// The fallback's config: when it was written and whether it is the current tree's.
pub fallback_ready: Option<FallbackReady>,
/// Why the last switch did not happen.
pub last_error: Option<Reason>,
/// What is different while Caddy serves (`engine.caddy`, `share.engine_caddy`).
pub notes: Vec<Blocked>,
}
#[derive(Debug, Clone, Serialize, ToSchema)]
pub struct FallbackReady {
pub built_at: Option<String>,
/// caddy.json is the compiled current tree.
pub current: bool,
}
#[derive(Debug, Clone, Serialize, ToSchema)]
@@ -507,9 +524,8 @@ pub struct Overview {
pub undo: UndoView,
pub active_apply: Option<ActiveApply>,
pub repo: Option<RepoView>,
/// The Domi intermediate; arrives in phase 3.
#[schema(value_type = Option<Object>)]
pub intermediate: Option<serde_json::Value>,
/// The Domi intermediate; `null` when the Domi CA is not set up (`[pki]`).
pub intermediate: Option<super::pki::IntermediateView>,
pub site: Option<SiteView>,
pub paused: Option<Blocked>,
/// Set when control cannot read health from edge (`health.unavailable`).
@@ -526,7 +542,7 @@ pub fn added_at(c: &Control, hostname: &str) -> Option<String> {
}
pub fn undo_view(c: &Control) -> UndoView {
let blocked = if let Some(p) = c.paused() {
let blocked = if let Some(p) = c.effective_pause() {
Some(Blocked {
code: "undo.paused".into(),
message: message("undo.paused", &messages::Params::new()) + " " + &p.message,
@@ -621,6 +637,7 @@ pub fn host_rows(
auth: spec.as_ref().map(|s| s.auth.clone()).unwrap_or_default(),
websockets: spec.as_ref().is_none_or(|s| s.websockets),
share_links: spec.as_ref().is_some_and(|s| s.share_links),
device_certs: spec.as_ref().is_some_and(|s| s.device_certs),
added_at: added_at(c, &h),
health: health_view(st, spec.as_ref(), since.get(&h).copied()),
certificate: cert_view(st, spec.as_ref()),