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:
@@ -106,8 +106,10 @@ bakashrot-cert show kitchen.crt
|
||||
|
||||
`--ca` (the folder of `ca.crt` / `ca.key`, `.` by default), `--out` (where
|
||||
to write), `--days`, `--file` (the files' name when it isn't the node's:
|
||||
another certificate of the same name, `--file server-1b`). Files are PEM. Nothing is ever written over an
|
||||
existing certificate or key; keys are readable by their owner only on
|
||||
another certificate of the same name, `--file server-1b`). Files are
|
||||
PEM. Nothing is ever written over an existing certificate or key, and a
|
||||
certificate and its key are written both or neither (one of them there
|
||||
already: nothing written); keys are readable by their owner only on
|
||||
Unix. `revoke` only takes certificates the CA issued.
|
||||
|
||||
## Tests
|
||||
|
||||
+19
-10
@@ -58,14 +58,20 @@ Reproduce one before fixing it, and move it up (or drop it) once known.
|
||||
- **`sync_interval` over 5 min.** The server dialed closes the idle link
|
||||
(`IDLE_TIMEOUT`), so every check-in fails once ("closed the link",
|
||||
warned), then the link is dialed again after `retry_delay`. Nothing
|
||||
in the config caps `sync_interval`. Fix: cap it under the idle
|
||||
timeout, or have an idle link ask its `SyncState` more often.
|
||||
in the config caps `sync_interval`. Left as it is (the owner,
|
||||
2026-11-16): replicating every 5 min or more isn't a real use, the
|
||||
example config says to keep it under. Fix if needed: cap it under the
|
||||
idle timeout, or have an idle link ask its `SyncState` more often.
|
||||
- **Resuming a big replicated attachment.** Before answering `Continue`,
|
||||
the receiver reads back and hashes every part it already has
|
||||
(`accept_from.rs`, `replicate_attachment`, `hash_parts`), while the
|
||||
sender waits 30 s for that answer (`push_to.rs`, `ANSWER_TIMEOUT`). On
|
||||
a slow disk, hundreds of parts may take longer: the link drops, and
|
||||
the same happens at every retry. Fix: a longer wait for that answer,
|
||||
sender waits 30 s for that answer (`push_to.rs`, `ANSWER_TIMEOUT`).
|
||||
Past what the disk reads and hashes in 30 s (estimated: about 4 GB
|
||||
on a hard disk, 15 GB on a SATA SSD, 30-60 GB on NVMe), the link
|
||||
drops, and the same happens at every retry. Left as it is (the
|
||||
owner, 2026-11-16): attachments over a few GB are excessive for this;
|
||||
the example config says so by `max_attachment_size` (1 GiB by
|
||||
default). Fix if needed: a wait scaled to the parts already received,
|
||||
or the hash's state kept with the attachment.
|
||||
- **Two peers sending the same attachment at once.** Both can be
|
||||
answered `Continue` for the same `from_part` (the check and the first
|
||||
@@ -127,11 +133,14 @@ Reproduce one before fixing it, and move it up (or drop it) once known.
|
||||
its buffers), any amount pushed: an allowed client can fill the disk
|
||||
or the server's memory. Fine for the threat model; first thing to
|
||||
add if it changes (a cap on connections, a quota per node).
|
||||
- **Small ones:** the client's connect timeout is per socket
|
||||
operation, not for the whole connection; `bakashrot-cert ca` writes
|
||||
`ca.crt` before failing when only `ca.key` is there already; a
|
||||
server whose clock is before 1970 stamps `pushed_at` 0, which
|
||||
readers refuse when decoding.
|
||||
- **A clock set before 1970 while running.** The server refuses to
|
||||
start with one (`check_clock`, `bakashrot-server/src/lib.rs`), but
|
||||
isn't checked again: set back that far afterwards, pushes are stamped
|
||||
`pushed_at` 0 (`now()`), which readers refuse when decoding. Fix if
|
||||
ever needed: refuse pushes (`ServerError`) while the clock is before
|
||||
1970.
|
||||
- **A small one:** the client's connect timeout is per socket
|
||||
operation, not for the whole connection.
|
||||
|
||||
## Ideas for later
|
||||
|
||||
|
||||
+3
-2
@@ -16,8 +16,9 @@ bakashrot-server server.toml
|
||||
```
|
||||
|
||||
The config (`config.md`) gives where to listen, the certificates, the CRL,
|
||||
the database, the topics and the roles. Decided 2026-11-14
|
||||
(`../revamp.md`, "Operations"):
|
||||
the database, the topics and the roles. A system clock before 1970
|
||||
is refused at start (messages are stamped with it, `pushed_at`).
|
||||
Decided 2026-11-14 (`../revamp.md`, "Operations"):
|
||||
|
||||
- **Stopping:** SIGTERM or SIGINT on Linux; Ctrl+C, Ctrl+Break or its
|
||||
console closed on Windows. It stops taking connections and writes
|
||||
|
||||
Reference in New Issue
Block a user