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:
parent
4775242756
commit
79b0ad0553
1 changed files with 10 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue