Expand description
This file includes everything for server configuration setup and hashing.
It includes functions for encrypting and decrypting the server configuration using AES-256-GCM, as well as functions for saving and loading the encrypted configuration from a file. It also provides a setup process that prompts the user for necessary configurations and generates secure defaults.
Constantsยง
Functionsยง
- decrypt ๐
- Decrypts the given encrypted data using AES-256-GCM with a key derived from the provided passphrase.
- derive_
key ๐ - Derives a key from the given passphrase and salt using Argon2id.
- encrypt ๐
- Encrypts the given data using AES-256-GCM with a key derived from the provided passphrase.
- generate_
random_ ๐bytes - load_
encrypted_ config - Loads and decrypts the configuration from the encrypted file using the provided passphrase.
- map_
dialoguer_ ๐error - Helper function that maps a
dialoguer::Errorto aStringfor easier error handling. - prompt_
passphrase - Prompts the user for a passphrase to encrypt/decrypt the server configuration.
- prompt_
passphrase_ new - run_
setup - Runs setup process
- save_
encrypted_ config - Saves the given configuration to an encrypted file using the provided passphrase.
- secrets_
exist - Checks if the encrypted secrets file exists.
- validate_
passphrase - verify_
admin_ credentials