From 2c506a437734c080b1109f412c622b5e1c3fd2a7 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 22 Jan 2024 14:10:47 +0100 Subject: [PATCH 1/3] Add VOLTO_FRONTEND_DOMAIN as env var --- src/plone/volto/patches.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plone/volto/patches.py b/src/plone/volto/patches.py index 86128ad9..f70d12ba 100644 --- a/src/plone/volto/patches.py +++ b/src/plone/volto/patches.py @@ -11,6 +11,7 @@ from zope.component import getUtility import logging +import os LOG = logging.getLogger("Zope.SiteErrorLog") @@ -52,7 +53,9 @@ def construct_url(self, randomstring): registry = getUtility(IRegistry) settings = registry.forInterface(IVoltoSettings, prefix="volto", check=False) - settings_frontend_domain = getattr(settings, "frontend_domain", None) + settings_frontend_domain = os.environ["VOLTO_FRONTEND_DOMAIN"] or getattr( + settings, "frontend_domain", None + ) if settings_frontend_domain: frontend_domain = settings_frontend_domain if frontend_domain.endswith("/"): From 2070b78f964018ec511bdb23d758516755306a15 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 22 Jan 2024 14:13:31 +0100 Subject: [PATCH 2/3] Changelog --- news/139.feature | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/139.feature diff --git a/news/139.feature b/news/139.feature new file mode 100644 index 00000000..d85ddfa3 --- /dev/null +++ b/news/139.feature @@ -0,0 +1,2 @@ +Add `VOLTO_FRONTEND_DOMAIN` as env var for `volto.frontend_domain` registry setting +[@sneridagh] From ffa2651ea3050e830731961caa6cc275761d6e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Mon, 29 Jan 2024 12:39:18 +0100 Subject: [PATCH 3/3] Update src/plone/volto/patches.py Co-authored-by: David Glick --- src/plone/volto/patches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/volto/patches.py b/src/plone/volto/patches.py index f70d12ba..589eecd7 100644 --- a/src/plone/volto/patches.py +++ b/src/plone/volto/patches.py @@ -53,7 +53,7 @@ def construct_url(self, randomstring): registry = getUtility(IRegistry) settings = registry.forInterface(IVoltoSettings, prefix="volto", check=False) - settings_frontend_domain = os.environ["VOLTO_FRONTEND_DOMAIN"] or getattr( + settings_frontend_domain = os.environ.get("VOLTO_FRONTEND_DOMAIN") or getattr( settings, "frontend_domain", None ) if settings_frontend_domain: