From 0497b61b1a7719b78c2d6557aab7207107ac8e17 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Sat, 25 Aug 2018 14:09:32 -0400 Subject: [PATCH 1/4] feat(controller): set CONN_MAX_AGE from env var --- rootfs/api/settings/production.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rootfs/api/settings/production.py b/rootfs/api/settings/production.py index fd745752e..00a62e45b 100644 --- a/rootfs/api/settings/production.py +++ b/rootfs/api/settings/production.py @@ -27,8 +27,6 @@ 'security.W008' ] -CONN_MAX_AGE = 60 * 3 - # SECURITY: change this to allowed fqdn's to prevent host poisioning attacks # https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts ALLOWED_HOSTS = ['*'] @@ -368,7 +366,7 @@ 'HOST': os.environ.get('DEIS_DATABASE_SERVICE_HOST', ''), 'PORT': os.environ.get('DEIS_DATABASE_SERVICE_PORT', 5432), # https://docs.djangoproject.com/en/1.11/ref/databases/#persistent-connections - 'CONN_MAX_AGE': 600, + 'CONN_MAX_AGE': os.environ.get('CONN_MAX_AGE', 600), } } From e1ccd500a826ca4f9872b24f4d198effd4a560d0 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Tue, 30 Oct 2018 21:53:57 -0400 Subject: [PATCH 2/4] noop (rerun the tests) --- charts/controller/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/controller/values.yaml b/charts/controller/values.yaml index 595be7e1a..3701bac2a 100644 --- a/charts/controller/values.yaml +++ b/charts/controller/values.yaml @@ -60,7 +60,7 @@ global: # # Valid values are a number of seconds, or 0 to disable persistent connections. # Setting the value to "None" will ensure that connections are never timed out. - # - 0 + # - 0 # - 600 # - "None" # conn_max_age: 600 From 3f45071fcd1cbece272cc920d236b9de17c03f05 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Fri, 27 Nov 2020 08:27:56 -0500 Subject: [PATCH 3/4] fixup (squash): put back CONN_MAX_AGE https://github.com/teamhephy/controller/pull/75#pullrequestreview-512946425 > I think this is a different CONN_MAX_AGE env variable? I don't see where else this variable is used, but no other change is present which could have caused the tests to fail ? --- rootfs/api/settings/production.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rootfs/api/settings/production.py b/rootfs/api/settings/production.py index 00a62e45b..989775e99 100644 --- a/rootfs/api/settings/production.py +++ b/rootfs/api/settings/production.py @@ -27,6 +27,8 @@ 'security.W008' ] +CONN_MAX_AGE = 60 * 3 + # SECURITY: change this to allowed fqdn's to prevent host poisioning attacks # https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts ALLOWED_HOSTS = ['*'] From 81b2182302f894e2a9d316d2078cedc5f98d7eb9 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Fri, 27 Nov 2020 09:02:39 -0500 Subject: [PATCH 4/4] fixup: maybe? Maybe this needs to be translated into an int --- rootfs/api/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/api/settings/production.py b/rootfs/api/settings/production.py index 989775e99..1a3a0a006 100644 --- a/rootfs/api/settings/production.py +++ b/rootfs/api/settings/production.py @@ -368,7 +368,7 @@ 'HOST': os.environ.get('DEIS_DATABASE_SERVICE_HOST', ''), 'PORT': os.environ.get('DEIS_DATABASE_SERVICE_PORT', 5432), # https://docs.djangoproject.com/en/1.11/ref/databases/#persistent-connections - 'CONN_MAX_AGE': os.environ.get('CONN_MAX_AGE', 600), + 'CONN_MAX_AGE': int(os.environ.get('CONN_MAX_AGE', 600)), } }