[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:
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user