From 355ebadd108f51708b692b4d232dd25f010e9829 Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Fri, 14 Feb 2020 12:31:41 +0100 Subject: [PATCH 1/3] Fixed configuration inconsistency for Redis cache In the configuration.py we use database 1 as the default but in the .env file we used 0. This sets both values to 1 as the default. --- env/netbox.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/netbox.env b/env/netbox.env index aaa7482..008196e 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -20,7 +20,7 @@ REDIS_DATABASE=0 REDIS_SSL=false REDIS_CACHE_HOST=redis-cache REDIS_CACHE_PASSWORD=t4Ph722qJ5QHeQ1qfu36 -REDIS_CACHE_DATABASE=0 +REDIS_CACHE_DATABASE=1 REDIS_CACHE_SSL=false SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj SKIP_STARTUP_SCRIPTS=false From b9c44b85ccaac94a8522034634357385c8b9751d Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Fri, 14 Feb 2020 12:33:28 +0100 Subject: [PATCH 2/3] The Redis cache container was using the wrong env Our docker-compose.yml pointed the env file for the Redis cache to the wrong file. Now the Redis cache password between the netbox.env and redis-cache.env match. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3806480..9272b91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,7 +57,7 @@ services: - sh - -c # this is to evaluate the $REDIS_PASSWORD from the env - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose - env_file: env/redis.env + env_file: env/redis-cache.env volumes: netbox-static-files: driver: local From 20c7461c7b3ac84fd4a09b8cd74de7baa2d0df9f Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Fri, 14 Feb 2020 12:35:47 +0100 Subject: [PATCH 3/3] Fixed test failures because of missing cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running tests with ´test.sh´ some errors where logged because now redis-cache instance was running. --- docker-compose.test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 9420617..5ccd92a 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -5,6 +5,7 @@ services: depends_on: - postgres - redis + - redis-cache env_file: env/netbox.env user: '101' volumes: @@ -34,8 +35,15 @@ services: command: - sh - -c # this is to evaluate the $REDIS_PASSWORD from the env - - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose + - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose env_file: env/redis.env + redis-cache: + image: redis:5-alpine + command: + - sh + - -c # this is to evaluate the $REDIS_PASSWORD from the env + - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose + env_file: env/redis-cache.env volumes: netbox-static-files: driver: local