From 47c937211366f985707fa6ace7cb3b17b66a9088 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Thu, 22 Aug 2024 14:50:42 +0200 Subject: [PATCH 1/2] :wrench: Move docker required envvars to Required group --- open_api_framework/conf/base.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/open_api_framework/conf/base.py b/open_api_framework/conf/base.py index a44f3e6..935f27b 100644 --- a/open_api_framework/conf/base.py +++ b/open_api_framework/conf/base.py @@ -149,12 +149,17 @@ CACHE_DEFAULT = config( "CACHE_DEFAULT", "localhost:6379/0", - help_text="redis cache address for the default cache", + help_text="redis cache address for the default cache (this **MUST** be set when using Docker)", + group="Required", ) CACHE_AXES = config( "CACHE_AXES", "localhost:6379/0", - help_text="redis cache address for the brute force login protection cache", + help_text=( + "redis cache address for the brute force login protection cache " + "(this **MUST** be set when using Docker)" + ), + group="Required", ) CACHES = { @@ -307,7 +312,8 @@ EMAIL_HOST = config( "EMAIL_HOST", default="localhost", - help_text="hostname for the outgoing e-mail server", + help_text="hostname for the outgoing e-mail server (this **MUST** be set when using Docker)", + group="Required", ) EMAIL_PORT = config( "EMAIL_PORT", @@ -612,7 +618,7 @@ SUBPATH = subpath if "GIT_SHA" in os.environ: - GIT_SHA = config("GIT_SHA", "") + GIT_SHA = config("GIT_SHA", "", add_to_docs=False) # in docker (build) context, there is no .git directory elif (Path(BASE_DIR) / ".git").exists(): try: From 03df90cef02e5a89131226e3c3cca1f135e22aa8 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Thu, 22 Aug 2024 14:57:48 +0200 Subject: [PATCH 2/2] :bug: Fix rendering for envvar defaults quotes were previously escaped, making some envvar default unreadable --- open_api_framework/templates/open_api_framework/env_config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open_api_framework/templates/open_api_framework/env_config.rst b/open_api_framework/templates/open_api_framework/env_config.rst index 31deec4..46b74b4 100644 --- a/open_api_framework/templates/open_api_framework/env_config.rst +++ b/open_api_framework/templates/open_api_framework/env_config.rst @@ -13,7 +13,7 @@ Available environment variables {{group_name}} {{group_name|repeat_char:"-"}} -{% for var in vars %}* ``{{var.name}}``: {% if var.help_text %}{{var.help_text|safe|ensure_endswith:"."}}{% endif %}{% if var.auto_display_default and not var.default|is_undefined %} Defaults to: ``{{var.default|to_str}}``.{% endif %} +{% for var in vars %}* ``{{var.name}}``: {% if var.help_text %}{{var.help_text|safe|ensure_endswith:"."}}{% endif %}{% if var.auto_display_default and not var.default|is_undefined %} Defaults to: ``{{var.default|to_str|safe}}``.{% endif %} {% endfor %} {% endfor %}