mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-03 22:01:50 +00:00
feat(config): connection_uri_file added to config
This commit is contained in:
1 parent
ffcf152016
commit
89e07ae239
4 files changed
+45
-12
No files matched your search
@@ -1,4 +1,4 @@
|
||||
use std::env::consts::OS;
|
||||
use std::{env::consts::OS, path::PathBuf};
|
||||
|
||||
use either::Either;
|
||||
use figment::Figment;
|
||||
@@ -263,6 +263,18 @@ pub fn check(config: &Config) -> Result {
|
||||
));
|
||||
}
|
||||
|
||||
if config.smtp.as_ref().is_some_and(|f| {
|
||||
f.connection_uri.is_none() && f.connection_uri_file.is_none()
|
||||
|| (f.connection_uri == Some(String::new())
|
||||
&& f.connection_uri_file == Some(PathBuf::new()))
|
||||
}) {
|
||||
return Err!(Config(
|
||||
"connection_uri",
|
||||
"If smtp is enabled, either connection_uri or connection_uri_file have to be \
|
||||
defined."
|
||||
));
|
||||
}
|
||||
|
||||
match (&config.default_room_acl_allow, &config.default_room_acl_deny) {
|
||||
| (Some(_), Some(_)) => {
|
||||
return Err!(Config(
|
||||
|
||||
Reference in new issue
Block a user