[control] Overview for the UI: who is looking (viewer) and the underlying pause reason, so the UI offers the right action

This commit is contained in:
2026-11-07 23:44:25 +01:00
parent f9dd2247f8
commit aed5fbfcff
3 changed files with 30 additions and 4 deletions
+4 -3
View File
@@ -22,11 +22,12 @@ use ianitor_control::util::{hex, random, write_atomic};
/// on the offline machine), and the PKI password credential. Control then works like
/// production: it issues server certificates for every `tls = "domi"` host.
fn dev_pki(dir: &Path) -> Result<(String, ianitor_core::pki::KeyPair), String> {
let (root, key) =
ianitor_core::pki::create_root(ianitor_control::util::now() as i64).map_err(|e| e.to_string())?;
let (root, key) = ianitor_core::pki::create_root(ianitor_control::util::now() as i64)
.map_err(|e| e.to_string())?;
std::fs::write(dir.join("offline-root/domi-root.crt"), &root).map_err(|e| e.to_string())?;
let pass = hex(&random::<24>().map_err(|e| e.to_string())?);
write_atomic(&dir.join("creds/pki-password"), pass.as_bytes(), 0o600).map_err(|e| e.to_string())?;
write_atomic(&dir.join("creds/pki-password"), pass.as_bytes(), 0o600)
.map_err(|e| e.to_string())?;
Ok((root, key))
}