adapt configuration for multiple domains and prod odoo

This commit is contained in:
Tobias Brunner 2025-02-28 14:55:03 +01:00
parent 83a11bd354
commit 5915a2a014
No known key found for this signature in database
2 changed files with 16 additions and 7 deletions

View file

@ -26,19 +26,19 @@ spec:
- name: DEBUG
value: "false"
- name: ALLOWED_HOSTS
value: poc.serva.la
value: poc.serva.la,www.serva.la,serva.la
- name: DB_FILE
value: /data/servala.db
- name: ODOO_URL
value: https://test.central.vshn.ch
value: https://central.vshn.ch
- name: ODOO_LEAD_CAMPAIGN_ID
value: "6"
value: "101"
- name: ODOO_LEAD_SOURCE_ID
value: "28"
value: 703"
- name: ODOO_LEAD_MEDIUM_ID
value: "1"
- name: ODOO_LEAD_TAG_ID
value: "6"
value: "43"
envFrom:
- secretRef:
name: servala

View file

@ -41,10 +41,19 @@ SECRET_KEY = env.str("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool("DEBUG", default=False)
# Get all allowed hosts
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS]
WEBSITE_URL = env.str("WEBSITE_URL", default="https://poc.serva.la")
# Flexible CSRF handling - support both HTTP and HTTPS as needed
HTTP_HOSTS = env.list("HTTP_HOSTS", default=[])
HTTPS_HOSTS = env.list("HTTPS_HOSTS", default=ALLOWED_HOSTS)
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in HTTPS_HOSTS] + [
f"http://{h}" for h in HTTP_HOSTS
]
# Primary website URL
WEBSITE_URL = env.str("WEBSITE_URL", default="https://serva.la")
# Application definition