From b4bd4805658672b31c2bc4257242cff32da54a50 Mon Sep 17 00:00:00 2001 From: Robin Sonnabend Date: Mon, 22 Feb 2021 21:20:38 +0100 Subject: [PATCH 1/3] Allow configuring PERMITTED_METADATA_DOMAINS in proto3 --- uwsgi-python/templates/apps/protokollsystem.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uwsgi-python/templates/apps/protokollsystem.j2 b/uwsgi-python/templates/apps/protokollsystem.j2 index 63a9cbc..e15d159 100644 --- a/uwsgi-python/templates/apps/protokollsystem.j2 +++ b/uwsgi-python/templates/apps/protokollsystem.j2 @@ -39,6 +39,9 @@ URL_PARAMS = "" {% if cdn_url is defined %} CDN_URL = "{{cdn_url}}" {% endif %} +{% if protokolle_metadata_domain_whitelist is defined %} +PERMITTED_METADATA_DOMAINS = [ {% for domain in protokolle_metadata_domain_whitelist %} "{{domain}}", {% endfor %} ] +{% endif %} PRINTING_ACTIVE = {{ protokolle_printing }} PRINTING_SERVER = "{{ protokolle_printing_server }}" -- GitLab From 257b78436fb6e4521696396e976b9cbff90ca42e Mon Sep 17 00:00:00 2001 From: Robin Sonnabend Date: Thu, 25 Feb 2021 20:40:22 +0100 Subject: [PATCH 2/3] Simplify jinja code --- uwsgi-python/templates/apps/protokollsystem.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uwsgi-python/templates/apps/protokollsystem.j2 b/uwsgi-python/templates/apps/protokollsystem.j2 index e15d159..ed9024a 100644 --- a/uwsgi-python/templates/apps/protokollsystem.j2 +++ b/uwsgi-python/templates/apps/protokollsystem.j2 @@ -40,7 +40,7 @@ URL_PARAMS = "" CDN_URL = "{{cdn_url}}" {% endif %} {% if protokolle_metadata_domain_whitelist is defined %} -PERMITTED_METADATA_DOMAINS = [ {% for domain in protokolle_metadata_domain_whitelist %} "{{domain}}", {% endfor %} ] +PERMITTED_METADATA_DOMAINS = [ {{protokolle_metadata_domain_whitelist|map('quote')|join(', ')}} ] {% endif %} PRINTING_ACTIVE = {{ protokolle_printing }} -- GitLab From 26c2b1a903f099cdf53165401c41545fbe3135a9 Mon Sep 17 00:00:00 2001 From: Robin Sonnabend Date: Thu, 25 Feb 2021 21:03:32 +0100 Subject: [PATCH 3/3] Simplify (and fix) list of strings --- uwsgi-python/templates/apps/protokollsystem.j2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/uwsgi-python/templates/apps/protokollsystem.j2 b/uwsgi-python/templates/apps/protokollsystem.j2 index ed9024a..2255bbe 100644 --- a/uwsgi-python/templates/apps/protokollsystem.j2 +++ b/uwsgi-python/templates/apps/protokollsystem.j2 @@ -39,9 +39,7 @@ URL_PARAMS = "" {% if cdn_url is defined %} CDN_URL = "{{cdn_url}}" {% endif %} -{% if protokolle_metadata_domain_whitelist is defined %} -PERMITTED_METADATA_DOMAINS = [ {{protokolle_metadata_domain_whitelist|map('quote')|join(', ')}} ] -{% endif %} +PERMITTED_METADATA_DOMAINS = {{protokolle_metadata_domain_whitelist|default([])}} PRINTING_ACTIVE = {{ protokolle_printing }} PRINTING_SERVER = "{{ protokolle_printing_server }}" -- GitLab