ConstantsΒ§
- CLIENT_
CONFIG - Client configuration file
- CLIENT_
INVITE_ CODE_ FILE - Client connection string file
- CONSENSUS_
CONFIG - Server consensus-only configurable file
- DB_FILE
- Database file name
- ENCRYPTED_
EXT π - Legacy encrypted file extension
- JSON_
EXT - LOCAL_
CONFIG - Server locally configurable file
- PLAINTEXT_
PASSWORD - Legacy plain-text stored password
- PRIVATE_
CONFIG - Server private keys file
- SALT_
FILE π - Legacy salt file for combining with the private key
FunctionsΒ§
- encrypted_
json_ πread - Reads an encrypted json file into a struct
- parse_
legacy_ πencrypted_ backup - Parses the legacy encrypted guardian backup format from raw file contents,
decrypting the private config with the provided password. The
saltandprivatebytes come from the backupβsprivate.saltandprivate.encryptentries. - parse_
plaintext_ πbackup - Parses the current plaintext guardian backup format from raw file contents.
- plaintext_
display_ πwrite - plaintext_
json_ πread - Reads a plaintext json file into a struct
- plaintext_
json_ πwrite - Writes struct into a plaintext json file
- read_
server_ config - Reads the server config from plaintext JSON files. Falls back to reading the legacy encrypted format using the password.private file if the plaintext private config does not exist.
- read_
server_ πconfig_ legacy_ encrypted - Reads the server config with the legacy encrypted private config format, using the password from the password.private file.
- read_
server_ πconfig_ plaintext - Reads the server config from plaintext JSON files
- trim_
password π - We definitely donβt want leading/trailing newlines in passwords, and a user editing the file manually will probably get a free newline added by the text editor.
- write_
server_ config - Writes the server into configuration files as plaintext JSON.