New option to disable the image proxy's auto-pruning
authorAlexander Ebert <ebert@woltlab.com>
Tue, 10 Jul 2018 07:41:50 +0000 (09:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 10 Jul 2018 07:41:50 +0000 (09:41 +0200)
See #2593

com.woltlab.wcf/option.xml
constants.php
wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 0411cbbbf5e260d9dd328c854748b9741fa8f360..1e2b12c93678719aae776f94cab2cc6120857a79 100644 (file)
@@ -1082,13 +1082,19 @@ Pinterest</defaultvalue>
                                <categoryname>message.general.image</categoryname>
                                <optiontype>boolean</optiontype>
                                <defaultvalue>0</defaultvalue>
-                               <enableoptions>image_proxy_insecure_only,image_proxy_expiration,image_proxy_host_whitelist</enableoptions>
+                               <enableoptions>image_proxy_insecure_only,image_proxy_enable_prune,image_proxy_expiration,image_proxy_host_whitelist</enableoptions>
                        </option>
                        <option name="image_proxy_insecure_only">
                                <categoryname>message.general.image</categoryname>
                                <optiontype>boolean</optiontype>
                                <defaultvalue>0</defaultvalue>
                        </option>
+                       <option name="image_proxy_enable_prune">
+                               <categoryname>message.general.image</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                               <enableoptions>image_proxy_expiration</enableoptions>
+                       </option>
                        <option name="image_proxy_expiration">
                                <categoryname>message.general.image</categoryname>
                                <optiontype>integer</optiontype>
index 986a884210c52c368a6248347036580e45448f25..5c46be95e38b0a5d60aeea1ff50be14075fc09af 100644 (file)
@@ -240,3 +240,4 @@ define('MODULE_USER_COVER_PHOTO', 1);
 define('IMAGE_ALLOW_EXTERNAL_SOURCE', 0);
 define('MESSAGE_ENABLE_TOC', 1);
 define('MESSAGE_SIDEBAR_ENABLE_ARTICLES', 1);
+define('IMAGE_PROXY_ENABLE_PRUNE', 1);
index ff9212fb33d367259a701156bc5a6587813736e4..3cd0179e42c20460d327dc834229ccebc6f2ae34 100644 (file)
@@ -177,7 +177,7 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                }
                
                // clean up proxy images
-               if (MODULE_IMAGE_PROXY) {
+               if (MODULE_IMAGE_PROXY && IMAGE_PROXY_ENABLE_PRUNE) {
                        $it = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(WCF_DIR.'images/proxy/', \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST);
                        foreach ($it as $file) {
                                if ($file->getPathname() === WCF_DIR.'images/proxy/.htaccess') continue;
index 0cc4b527b83a3707f1dc298062b16c7d0e221ca6..df0cf1802f0e0b34691aca978d5dfe445d647c62 100644 (file)
@@ -1396,8 +1396,9 @@ Als Benachrichtigungs-URL in der Konfiguration der sofortigen Zahlungsbestätigu
                <item name="wcf.acp.option.message_force_secure_images"><![CDATA[Nur sichere Bilder in Nachrichten erlauben]]></item>
                <item name="wcf.acp.option.message_force_secure_images.description"><![CDATA[Bilder dürfen nur über das verschlüsselte „https“-Protokoll eingebunden werden. Bereits in bestehenden Nachrichten hinterlegte Bilder werden zwangsweise auf dieses Protokoll umgeschrieben.]]></item>
                <item name="wcf.acp.option.module_image_proxy"><![CDATA[Zwischenspeicherung von externen Bilder aktivieren]]></item>
-               <item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Speicherzeit]]></item>
+               <item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Maximale Speicherzeit]]></item>
                <item name="wcf.acp.option.image_proxy_insecure_only"><![CDATA[Nur Bilder aus unverschlüsselten Quellen zwischenspeichern]]></item>
+               <item name="wcf.acp.option.image_proxy_enable_prune"><![CDATA[Zwischengespeicherte Bilder regelmäßig löschen]]></item>
                <item name="wcf.acp.option.image_proxy_host_whitelist"><![CDATA[Ausnahmen von der Zwischenspeicherung]]></item>
                <item name="wcf.acp.option.image_proxy_host_whitelist.description"><![CDATA[Die aufgeführten Domains werden von der Zwischenspeicherung ausgenommen, die eigene Domain ist implizit enthalten. Der Abgleich erfolgt auf Basis der strikten Übereinstimmung, optional können Subdomains mit einem Platzhalter berücksichtigt werden: <kbd>*.example.com</kbd> umfasst sowohl <kbd>example.com</kbd> als auch Subdomains wie <kbd>foo.example.com</kbd> oder <kbd>www.example.com</kbd>.<br>Bitte nur eine Domain pro Zeile eingeben.]]></item>
                <item name="wcf.acp.option.share_buttons_providers"><![CDATA[Anbieter zum Teilen von Inhalten]]></item>
index 6c66d6e6f4f5cca99d20a1e30a16902e4e048af0..73def6a048b49cded9f1deff7d07879b83b3fed2 100644 (file)
@@ -1389,8 +1389,9 @@ When prompted for the notification URL for the instant payment notifications, pl
                <item name="wcf.acp.option.message_force_secure_images"><![CDATA[Allow secure images only]]></item>
                <item name="wcf.acp.option.message_force_secure_images.description"><![CDATA[Images may only be embedded using the encrypted “https”-protocol. Images in already existing messages will be force-rewritten to use the secure protocol.]]></item>
                <item name="wcf.acp.option.module_image_proxy"><![CDATA[Enable image proxy]]></item>
-               <item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Storage Time Period]]></item>
+               <item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Maximum Storage Time Period]]></item>
                <item name="wcf.acp.option.image_proxy_insecure_only"><![CDATA[Store images from insecure sources only]]></item>
+               <item name="wcf.acp.option.image_proxy_enable_prune"><![CDATA[Remove Cached Images Regularly]]></item>
                <item name="wcf.acp.option.image_proxy_host_whitelist"><![CDATA[Image proxy whitelist]]></item>
                <item name="wcf.acp.option.image_proxy_host_whitelist.description"><![CDATA[The listed domains will not be handled by the image proxy, the current domain is implicitly added. Hostnames are exact matches only, a leading wildcard can be used to exclude an entire domain: <kbd>*.example.com</kbd> matches <kbd>example.com</kbd> and subdomains such as <kbd>foo.example.com</kbd> or <kbd>www.example.com</kbd>.<br>Enter one domain per line only.]]></item>
                <item name="wcf.acp.option.share_buttons_providers"><![CDATA[Share Button Providers]]></item>