From: Nutomic Date: Thu, 14 Jul 2022 18:25:10 +0000 (+0000) Subject: Change config pictrs key name (#2360) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%22https:/hacktivis.me/%7BpictshareAvatarThumbnail%28mod.avatar%29%7D?a=commitdiff_plain;h=16fe149a6dcd3207b0e311a4d32a23f4a68fbd4f;p=lemmy.git Change config pictrs key name (#2360) --- diff --git a/config/defaults.hjson b/config/defaults.hjson index c8565856..9e405407 100644 --- a/config/defaults.hjson +++ b/config/defaults.hjson @@ -73,7 +73,7 @@ debug: false } # Pictrs image server configuration. - pictrs_config: { + pictrs: { # Address where pictrs is available (for image hosting) url: "http://pictrs:8080/" # Set a custom pictrs API key. ( Required for deleting images ) diff --git a/crates/utils/src/settings/mod.rs b/crates/utils/src/settings/mod.rs index f095baf1..50d3fc58 100644 --- a/crates/utils/src/settings/mod.rs +++ b/crates/utils/src/settings/mod.rs @@ -101,7 +101,7 @@ impl Settings { pub fn pictrs_config(&self) -> Result { self - .pictrs_config + .pictrs .to_owned() .ok_or_else(|| anyhow!("images_disabled").into()) } diff --git a/crates/utils/src/settings/structs.rs b/crates/utils/src/settings/structs.rs index 7ee8cf18..ecf19aaf 100644 --- a/crates/utils/src/settings/structs.rs +++ b/crates/utils/src/settings/structs.rs @@ -17,7 +17,7 @@ pub struct Settings { pub federation: FederationConfig, /// Pictrs image server configuration. #[default(Some(Default::default()))] - pub(crate) pictrs_config: Option, + pub(crate) pictrs: Option, #[default(Default::default())] pub captcha: CaptchaConfig, /// Email sending configuration. All options except login/password are mandatory @@ -61,7 +61,7 @@ pub struct Settings { pub struct PictrsConfig { /// Address where pictrs is available (for image hosting) #[default(Url::parse("http://pictrs:8080").expect("parse pictrs url"))] - #[doku(example = "Url::parse(\"http://pictrs:8080\").unwrap()")] + #[doku(example = "http://pictrs:8080")] pub url: Url, /// Set a custom pictrs API key. ( Required for deleting images )