Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VOLTO_FRONTEND_DOMAIN as env var #139

Merged
merged 4 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/139.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add `VOLTO_FRONTEND_DOMAIN` as env var for `volto.frontend_domain` registry setting
[@sneridagh]
5 changes: 4 additions & 1 deletion src/plone/volto/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from zope.component import getUtility

import logging
import os


LOG = logging.getLogger("Zope.SiteErrorLog")
Expand Down Expand Up @@ -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.get("VOLTO_FRONTEND_DOMAIN") or getattr(
settings, "frontend_domain", None
)
if settings_frontend_domain:
frontend_domain = settings_frontend_domain
if frontend_domain.endswith("/"):
Expand Down
Loading