1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

server/config: Allow omitting database section entirely

This commit is contained in:
Zhaofeng Li 2024-11-21 13:29:00 -07:00
parent 4775242756
commit 79b0ad0553

View file

@ -105,6 +105,7 @@ pub struct Config {
pub require_proof_of_possession: bool,
/// Database connection.
#[serde(default = "Default::default")]
pub database: DatabaseConfig,
/// Storage.
@ -418,6 +419,15 @@ fn load_database_url_from_env() -> String {
))
}
impl Default for DatabaseConfig {
fn default() -> Self {
Self {
url: load_database_url_from_env(),
heartbeat: default_db_heartbeat(),
}
}
}
impl Default for JWTConfig {
fn default() -> Self {
Self {