Skip to content
Snippets Groups Projects
Commit 2131fa9c authored by Martin Bergemann's avatar Martin Bergemann :speech_balloon:
Browse files

Merge branch 'bug_fix' into 'master'

Add project website to trusted cfrs origin

See merge request !37
parents 1974e0ba 89076f5b
No related branches found
No related tags found
1 merge request!37Add project website to trusted cfrs origin
Pipeline #20190 passed
......@@ -216,16 +216,18 @@ class DeployFactory:
if web_host == "127.0.0.1":
web_host = "localhost"
self.cfg["web"]["config"]["host"] = web_host
# _webserver_items["INSTITUTION_LOGO"] = "/path/to/your/logo"
trusted_origin = urlparse(server_name)
if trusted_origin.scheme:
_webserver_items["CSRF_TRUSTED_ORIGINS"] = [
f"https://{urlparse(server_name).netloc}"
]
else:
_webserver_items["CSRF_TRUSTED_ORIGINS"] = [
f"https://{urlparse(server_name).path}"
]
_webserver_items["CSRF_TRUSTED_ORIGINS"] = []
for url in (server_name, self.cfg["web"]["config"]["project_website"]):
trusted_origin = urlparse(url)
if trusted_origin.scheme:
_webserver_items["CSRF_TRUSTED_ORIGINS"].append(
f"https://{trusted_origin.netloc}"
)
else:
_webserver_items["CSRF_TRUSTED_ORIGINS"].append(
f"https://{trusted_origin.path}"
)
_webserver_items["FREVA_BIN"] = os.path.join(
self.cfg["core"]["config"]["install_dir"], "bin"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment