Documentation
¶
Overview ¶
Package keyfile writes a newly generated key to disk so it survives a crash.
The secrets key and the API token key are each created once, on first start, and everything encrypted or digested afterwards depends on them. A key that was linked into place but never flushed can come back from a power loss as an empty file, while the secrets encrypted under it are already committed to Postgres and can no longer be read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create writes key to path, 0600, and flushes it and its directory entry to disk before returning.
The key is written beside path and linked into place, which fails with an error matching os.ErrExist if a file is already there. Several replicas sharing one volume start at once, and two that each wrote their own key would each use one the other cannot; the one that loses the link reads the winner's instead (issue #72).
Types ¶
This section is empty.