From c8f2033220ef0343850143b5a1326ec11de39a43 Mon Sep 17 00:00:00 2001 From: crabbey Date: Mon, 30 Mar 2020 12:38:23 +0100 Subject: [PATCH] Renamed cache_mem_size to cache_index_size --- Dockerfile | 2 +- overlay/etc/nginx/conf.d/20_proxy_cache_path.conf | 2 +- overlay/hooks/entrypoint-pre.d/10_setup.sh | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7927ea1..0c5c1b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ MAINTAINER LanCache.Net Team ENV GENERICCACHE_VERSION=2 \ WEBUSER=www-data \ CACHE_MODE=generic \ - CACHE_MEM_SIZE=500m \ + CACHE_INDEX_SIZE=500m \ CACHE_DISK_SIZE=1000000m \ CACHE_MAX_AGE=3560d \ CACHE_SLICE_SIZE=1m \ diff --git a/overlay/etc/nginx/conf.d/20_proxy_cache_path.conf b/overlay/etc/nginx/conf.d/20_proxy_cache_path.conf index 8b43a8f..d66bdfa 100644 --- a/overlay/etc/nginx/conf.d/20_proxy_cache_path.conf +++ b/overlay/etc/nginx/conf.d/20_proxy_cache_path.conf @@ -1 +1 @@ -proxy_cache_path /data/cache/cache levels=2:2 keys_zone=generic:CACHE_MEM_SIZE inactive=200d max_size=CACHE_DISK_SIZE loader_files=1000 loader_sleep=50ms loader_threshold=300ms use_temp_path=off; +proxy_cache_path /data/cache/cache levels=2:2 keys_zone=generic:CACHE_INDEX_SIZE inactive=200d max_size=CACHE_DISK_SIZE loader_files=1000 loader_sleep=50ms loader_threshold=300ms use_temp_path=off; diff --git a/overlay/hooks/entrypoint-pre.d/10_setup.sh b/overlay/hooks/entrypoint-pre.d/10_setup.sh index 47a45c1..60d80b3 100644 --- a/overlay/hooks/entrypoint-pre.d/10_setup.sh +++ b/overlay/hooks/entrypoint-pre.d/10_setup.sh @@ -4,9 +4,16 @@ set -e # Preprocess UPSTREAM_DNS to allow for multiple resolvers using the same syntax as lancache-dns UPSTREAM_DNS="$(echo -n "${UPSTREAM_DNS}" | sed 's/[;]/ /g')" +if [ ! -z ${CACHE_MEM_SIZE} ]; then + echo " *** CACHE_MEM_SIZE has been deprecated in place of CACHE_INDEX_SIZE" + echo " *** Using CACHE_MEM_SIZE as the value" + echo " *** Please update your configuration at your earliest convenience" + CACHE_INDEX_SIZE=$CACHE_MEM_SIZE +fi + echo "worker_processes ${NGINX_WORKER_PROCESSES};" > /etc/nginx/workers.conf sed -i "s/^user .*/user ${WEBUSER};/" /etc/nginx/nginx.conf -sed -i "s/CACHE_MEM_SIZE/${CACHE_MEM_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf +sed -i "s/CACHE_INDEX_SIZE/${CACHE_INDEX_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf sed -i "s/CACHE_DISK_SIZE/${CACHE_DISK_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/sites-available/generic.conf.d/root/20_cache.conf sed -i "s/slice 1m;/slice ${CACHE_SLICE_SIZE};/" /etc/nginx/sites-available/generic.conf.d/root/20_cache.conf