From 90970c98a92642ce63366defe72957e851c58f9f Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Fri, 20 May 2016 09:19:50 +1000 Subject: [PATCH] Add DISABLE_CACHE config templating option. --- README.md | 4 ++++ docker-squid/squid.conf.p2 | 2 ++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index c5d7cb4..3829332 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ variables: If set to `yes` then squid configuration templating is disabled entirely, allowing bind mounting the configuration file in manually instead. The certificate and SSL setup still runs normally. + * `DISABLE_CACHE` + Default `` + If set to `yes` then squid configuration templating removes all `cache_dir` + lines, setting squid to memory only cache. # Proxychains By default squid in SSL MITM mode treats `cache_peer` entries quite differently. diff --git a/docker-squid/squid.conf.p2 b/docker-squid/squid.conf.p2 index a9f5537..3e11759 100644 --- a/docker-squid/squid.conf.p2 +++ b/docker-squid/squid.conf.p2 @@ -10,8 +10,10 @@ netdb_filename stdio:/var/cache/squid4/netdb.state # Visible hostname to allow multi-squid visible_hostname {{VISIBLE_HOSTNAME|default:"docker-squid4"}} +{% if DISABLE_CACHE|default:"" != "yes" %} # Cache directory is fixed since we'll bind mount. cache_dir aufs /var/cache/squid4 {{MAX_CACHE_SIZE|default:"40000"}} 16 256 +{% endif %} maximum_object_size {{MAX_OBJECT_SIZE|default:"1536 MB"}} cache_mem {{MEM_CACHE_SIZE|default:"128 MB"}}