aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2024-04-11 09:20:04 +0200
committerGitHub <[email protected]>2024-04-11 09:20:04 +0200
commit6b05d1a437a49db98056de7b029923e8aedf1a5a (patch)
treebc70f14cae1760e91369705273904c0de1bfbf75 /src/config.rs
parent907e5cb5bc48899b444f7fedd85af7b5974d9a2e (diff)
parent2476e182f61d209768635e8eca6e75b4acfbd007 (diff)
downloadwebol-6b05d1a437a49db98056de7b029923e8aedf1a5a.tar
webol-6b05d1a437a49db98056de7b029923e8aedf1a5a.tar.gz
webol-6b05d1a437a49db98056de7b029923e8aedf1a5a.zip
Merge pull request #32 from FxQnLr/0.4.0
0.4.0
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs5
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)]
7pub struct Config { 7pub 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()