From d6b3d8230053abac050a31f2016d4f06dcc4401e Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 6 Nov 2023 12:54:42 +0100 Subject: [PATCH] change setting again --- config/defaults.hjson | 15 +++++++++------ crates/utils/src/settings/structs.rs | 17 ++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/config/defaults.hjson b/config/defaults.hjson index c200bdd36..9eacb4f68 100644 --- a/config/defaults.hjson +++ b/config/defaults.hjson @@ -49,13 +49,16 @@ # # Requires pict-rs 0.5 image_proxy: false - # Don't store preview images for external links in pict-rs. Enabling this setting reduces - # storage usage. It may also be necessary in certain countries which don't allow copying images - # from newspaper articles, but only allow hotlinking. + # By default the thumbnails for external links are stored in pict-rs. This ensures that they + # can be reliably retrieved and can be resized using pict-rs APIs. However it also increases + # storage usage. In case this is disabled, the Opengraph image is directly returned as + # thumbnail.Note that it still gets proxied through the local instance if `image_proxy` is + # enabled. # - # If this setting is enabled, the Opengraph image is directly returned as thumbnail. Note that - # it still gets proxied through the local instance if `image_proxy` is enabled. - disable_external_link_previews: false + # In some countries it is forbidden to copy preview images from newspaper articles and only + # hotlinking is allowed. If that is the case for your instance, make sure that `image_proxy` and + # `cache_external_link_previews` are both disabled. + cache_external_link_previews: true } # Email sending configuration. All options except login/password are mandatory email: { diff --git a/crates/utils/src/settings/structs.rs b/crates/utils/src/settings/structs.rs index a7d60f9ba..5e4423d87 100644 --- a/crates/utils/src/settings/structs.rs +++ b/crates/utils/src/settings/structs.rs @@ -87,14 +87,17 @@ pub struct PictrsConfig { #[default(false)] pub image_proxy: bool, - /// Don't store preview images for external links in pict-rs. Enabling this setting reduces - /// storage usage. It may also be necessary in certain countries which don't allow copying images - /// from newspaper articles, but only allow hotlinking. + /// By default the thumbnails for external links are stored in pict-rs. This ensures that they + /// can be reliably retrieved and can be resized using pict-rs APIs. However it also increases + /// storage usage. In case this is disabled, the Opengraph image is directly returned as + /// thumbnail.Note that it still gets proxied through the local instance if `image_proxy` is + /// enabled. /// - /// If this setting is enabled, the Opengraph image is directly returned as thumbnail. Note that - /// it still gets proxied through the local instance if `image_proxy` is enabled. - #[default(false)] - pub disable_external_link_previews: bool, + /// In some countries it is forbidden to copy preview images from newspaper articles and only + /// hotlinking is allowed. If that is the case for your instance, make sure that `image_proxy` and + /// `cache_external_link_previews` are both disabled. + #[default(true)] + pub cache_external_link_previews: bool, } #[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]