diff options
author | Dave Z <dzaikos@users.noreply.github.com> | 2018-07-12 20:41:09 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-07-12 17:41:09 -0700 |
commit | c926498d3d12f4e59c5fe0cd40a77c42d15c30b9 (patch) | |
tree | 2bf52c7baa69ff8a7f1223826405147fbe615f94 /config | |
parent | 6fd6f79daf8a55eb97345f377d136cc320637580 (diff) |
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
Diffstat (limited to 'config')
-rw-r--r-- | config/config.go | 6 |
1 files changed, 6 insertions, 0 deletions
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{ |