diff --git a/config/default.toml b/config/default.toml index 9d2e540..2d3e89c 100644 --- a/config/default.toml +++ b/config/default.toml @@ -19,8 +19,7 @@ cookie_secret = "94b2b2732626fdb7736229a7c777cb451e6304c147c4549f30" [page] base_path = "/tmp/librepages-defualt-config/" - - +base_domain = "librepages.test" # domain where customer pages will be deployed. [database] # This section deals with the database location and how to access it diff --git a/src/settings.rs b/src/settings.rs index d817fd9..d5fb793 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -89,6 +89,7 @@ pub struct Settings { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PageConfig { pub base_path: String, + pub base_domain: String, } #[cfg(not(tarpaulin_include))] @@ -181,31 +182,7 @@ impl Settings { } } - // create_dir_util(Path::new(&page.path)); create_dir_util(Path::new(&self.page.base_path)); - - // for (index, page) in self.pages.iter().enumerate() { - // Url::parse(&page.repo).unwrap(); - // - // for (index2, page2) in self.pages.iter().enumerate() { - // if index2 == index { - // continue; - // } - // if page.secret == page2.secret { - // error!("{}", ServiceError::SecretTaken(page.clone(), page2.clone())); - // } else if page.repo == page2.repo { - // error!( - // "{}", - // ServiceError::DuplicateRepositoryURL(page.clone(), page2.clone(),) - // ); - // } else if page.path == page2.path { - // error!("{}", ServiceError::PathTaken(page.clone(), page2.clone())); - // } - // } - // if let Err(e) = page.update(&page.branch) { - // error!("{e}"); - // } - // } } #[cfg(not(tarpaulin_include))]