diff --git a/config/default.toml b/config/default.toml index d67ef49..03e2a22 100644 --- a/config/default.toml +++ b/config/default.toml @@ -1,4 +1,3 @@ -debug = true source_code = "https://github.com/realaravinth/pages" pages = [ @@ -12,7 +11,4 @@ port = 7000 #IP address. Enter 0.0.0.0 to listen on all availale addresses ip= "0.0.0.0" # enter your hostname, eg: example.com -domain = "localhost" -allow_registration = true -proxy_has_tls = false #workers = 2 diff --git a/src/settings.rs b/src/settings.rs index b884c81..eb08d23 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -27,9 +27,7 @@ use crate::page::Page; #[derive(Debug, Clone, Deserialize)] pub struct Server { pub port: u32, - pub domain: String, pub ip: String, - pub proxy_has_tls: bool, pub workers: Option, } @@ -42,8 +40,6 @@ impl Server { #[derive(Debug, Clone, Deserialize)] pub struct Settings { - pub debug: bool, - // pub database: Database, pub server: Server, pub source_code: String, pub pages: Vec, @@ -53,16 +49,10 @@ pub struct Settings { impl Settings { pub fn new() -> Result { let mut s = Config::new(); - - // setting default values - #[cfg(test)] - s.set_default("database.pool", 2.to_string()) - .expect("Couldn't get the number of CPUs"); - const CURRENT_DIR: &str = "./config/default.toml"; const ETC: &str = "/etc/static-pages/config.toml"; - if let Ok(path) = env::var("ATHENA_CONFIG") { + if let Ok(path) = env::var("PAGES__CONFIG") { s.merge(File::with_name(&path))?; } else if Path::new(CURRENT_DIR).exists() { // merging default config from file