mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
Made bakashrot-cert write a certificate and its key both or neither, Refused a clock before 1970 at start, Noted the replication limits in the example config
- bakashrot-cert ca and issue write nothing when either file of the pair is there already, and remove the certificate again when its key can't be written. - The server refuses to start with a clock before 1970 (pushed_at 0); set back that far while running isn't checked, noted in known-issues.md. - The example config says to keep sync_interval under 5 min (idle links are closed) and what a replicated attachment can be resumed past (read back and hashed in 30 s). Both left as they are, why in known-issues.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -121,6 +121,20 @@ fn nothing_is_overwritten_or_mixed_up() {
|
||||
assert!(!ok, "{text}");
|
||||
assert_eq!(read(&folder, "ca.key"), key, "the CA's key is still there");
|
||||
|
||||
// Half of a pair there already: refused, the other half not written.
|
||||
let half = folder.join("half");
|
||||
fs::create_dir_all(&half).unwrap();
|
||||
fs::write(half.join("ca.key"), "kept").unwrap();
|
||||
let (ok, text) = cert(&half, &["ca", "--name", "Half"]);
|
||||
assert!(!ok && text.contains("nothing written"), "{text}");
|
||||
assert!(!half.join("ca.crt").exists());
|
||||
assert_eq!(read(&half, "ca.key"), "kept");
|
||||
fs::write(folder.join("porch.key"), "kept").unwrap();
|
||||
let (ok, text) = cert(&folder, &["issue", "--name", "porch"]);
|
||||
assert!(!ok && text.contains("nothing written"), "{text}");
|
||||
assert!(!folder.join("porch.crt").exists());
|
||||
assert_eq!(read(&folder, "porch.key"), "kept");
|
||||
|
||||
assert!(cert(&folder, &["issue", "--name", "kitchen"]).0);
|
||||
assert!(
|
||||
!cert(&folder, &["issue", "--name", "kitchen"]).0,
|
||||
|
||||
Reference in New Issue
Block a user