diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 9636af4..bfb28be 100644 --- a/src/config.rs +++ b/src/config.rs | |||
@@ -5,7 +5,6 @@ use crate::auth; | |||
5 | 5 | ||
6 | #[derive(Debug, Clone, Deserialize)] | 6 | #[derive(Debug, Clone, Deserialize)] |
7 | pub struct Config { | 7 | pub struct Config { |
8 | pub database_url: String, | ||
9 | pub serveraddr: String, | 8 | pub serveraddr: String, |
10 | pub pingtimeout: i64, | 9 | pub pingtimeout: i64, |
11 | pub pingthreshold: i64, | 10 | pub pingthreshold: i64, |
@@ -26,9 +25,11 @@ impl Config { | |||
26 | .set_default("pingtimeout", 10)? | 25 | .set_default("pingtimeout", 10)? |
27 | .set_default("pingthreshold", 1)? | 26 | .set_default("pingthreshold", 1)? |
28 | .set_default("timeoffset", 0)? | 27 | .set_default("timeoffset", 0)? |
28 | .set_default("auth.method", "none")? | ||
29 | .set_default("auth.secret", "")? | ||
29 | .add_source(File::with_name("config.toml").required(false)) | 30 | .add_source(File::with_name("config.toml").required(false)) |
30 | .add_source(File::with_name("config.dev.toml").required(false)) | 31 | .add_source(File::with_name("config.dev.toml").required(false)) |
31 | .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_")) | 32 | .add_source(config::Environment::with_prefix("WEBOL").separator("_")) |
32 | .build()?; | 33 | .build()?; |
33 | 34 | ||
34 | config.try_deserialize() | 35 | config.try_deserialize() |