From c926498d3d12f4e59c5fe0cd40a77c42d15c30b9 Mon Sep 17 00:00:00 2001 From: Dave Z Date: Thu, 12 Jul 2018 20:41:09 -0400 Subject: Make image proxy configurable Adds IMAGE_PROXY configuration setting to change image proxy filter behaviour: - none = No proxy - http-only = Proxy only non-HTTPS images (default) - all = Proxy everything --- config/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config') diff --git a/config/config.go b/config/config.go index 3cb2ef2..4cba789 100644 --- a/config/config.go +++ b/config/config.go @@ -26,6 +26,7 @@ const ( defaultCertDomain = "" defaultCertCache = "/tmp/cert_cache" defaultCleanupFrequency = 24 + defaultProxyImages = "http-only" ) // Config manages configuration parameters. @@ -217,6 +218,11 @@ func (c *Config) PocketConsumerKey(defaultValue string) string { return c.get("POCKET_CONSUMER_KEY", defaultValue) } +// ProxyImages returns "none" to never proxy, "http-only" to proxy non-HTTPS, "all" to always proxy. +func (c *Config) ProxyImages() string { + return c.get("PROXY_IMAGES", defaultProxyImages) +} + // NewConfig returns a new Config. func NewConfig() *Config { cfg := &Config{ -- cgit v1.2.3