Expand description
Certificate and ACME account-key storage in the data directory.
An ACME account key is a credential in the same sense a signing key is:
whoever holds it can request certificates in this server’s name against
its account. It gets the same treatment crates/didbot-pds/src/wal/mod.rs
gives the write-ahead log: 0600 files inside a 0700 directory, and the
directory’s mode is set unconditionally rather than only on creation — a
mkdir’d-by-hand data directory or a mounted volume gets the same
tightening a freshly created one always did. See that module’s
create_dir for the fuller argument; this is the same fix, independently
applied, because this crate cannot reach into didbot-pds’s
pub(crate) copy.
Structs§
- CaStore
- The local certificate authority’s own certificate and key, in a directory of their own.
- Cert
Meta - The metadata kept beside the certificate: which directory issued it and
when it was written. The certificate’s own
notAfteris not duplicated here —cert.rs::leaf_expiryreads that from the DER, which cannot drift from what the certificate actually says. - Cert
Store - Where this crate’s own state lives inside a PDS data directory: a
tls/subdirectory, so it sits beside the write-ahead log and blob store rather than mixed into either. - Staged 🔒
- A file’s next contents, written and synced beside its final path but not yet renamed over it.
- Stored
Account - An ACME account read back off disk, and which directory registered it.
Enums§
- Storage
Error - Why the on-disk certificate state could not be read or written.
Constants§
- ACCOUNT_
FILE 🔒 - CA_FILE 🔒
- CA_
KEY_ 🔒FILE - CERT_
FILE 🔒 - DIR_
MODE 🔒 - FILE_
MODE 🔒 - KEY_
FILE 🔒 - META_
FILE 🔒
Functions§
- create_
dir 🔒 - Creates
dir0700if absent, and tightens it to0700if it was already there — the fixdidbot-pds’s write-ahead log made for the same reason, applied here because this crate cannot call that one. - io_
error 🔒 - read_
string_ 🔒at - Reads a file this crate wrote, naming it if it cannot be read.
- scratch_
path 🔒 - Where
path’s replacement is built:<name>.tmpin the same directory, so the rename that finishes it never crosses a filesystem. - sync_
dir 🔒 - Syncs a directory entry, so a rename cannot be undone by a power cut.
- write_
json_ 🔒at - Serialises
valueand writes it0600atpath, replacing whatever was there in one step. - zone_
directory_ 🔒component - The single path component
zone’s certificate directory is named after: the hostname, lowercased, with nothing that could escape the directory it is joined onto.