]> Untitled Git - lemmy.git/blobdiff - crates/utils/src/settings/structs.rs
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
[lemmy.git] / crates / utils / src / settings / structs.rs
index b703e0322c7c09ec83b0ccc7a573441fda476919..d6846f18551b8ef3d8688d55c5c1965ef881f035 100644 (file)
@@ -14,6 +14,9 @@ pub struct Settings {
   /// Settings related to activitypub federation
   #[default(FederationConfig::default())]
   pub federation: FederationConfig,
+  /// Pictrs image server configuration.
+  #[default(None)]
+  pub(crate) pictrs_config: Option<PictrsConfig>,
   #[default(CaptchaConfig::default())]
   pub captcha: CaptchaConfig,
   /// Email sending configuration. All options except login/password are mandatory
@@ -36,12 +39,9 @@ pub struct Settings {
   /// Whether the site is available over TLS. Needs to be true for federation to work.
   #[default(true)]
   pub tls_enabled: bool,
-  /// Address where pictrs is available (for image hosting)
-  #[default(None)]
-  #[doku(example = "http://localhost:8080")]
-  pub pictrs_url: Option<String>,
   #[default(None)]
   #[doku(example = "(\\bThis\\b)|(\\bis\\b)|(\\bsample\\b)")]
+  /// A regex list of slurs to block / hide
   pub slur_filter: Option<String>,
   /// Maximum length of local community and user names
   #[default(20)]
@@ -56,6 +56,18 @@ pub struct Settings {
   pub opentelemetry_url: Option<String>,
 }
 
+#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
+#[serde(default)]
+pub struct PictrsConfig {
+  /// Address where pictrs is available (for image hosting)
+  #[default("http://pictrs:8080")]
+  pub url: String,
+
+  /// Set a custom pictrs API key. ( Required for deleting images )
+  #[default("API_KEY")]
+  pub api_key: String,
+}
+
 #[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
 #[serde(default)]
 pub struct CaptchaConfig {