From a66fa44e1aee45f16a5c0f8660effc5692509a6b Mon Sep 17 00:00:00 2001 From: Dominik Kaminski Date: Wed, 24 Apr 2024 21:27:51 +0200 Subject: [PATCH] feat(helmfile): Introduce additional variables for mailDomain and synapseDomain --- docs/ci.md | 3 ++- docs/getting-started.md | 15 ++++++++++++--- .../values-matrix-neodatefix-widget.yaml.gotmpl | 2 +- helmfile/apps/element/values-synapse.yaml.gotmpl | 2 +- helmfile/apps/services/values-postfix.yaml.gotmpl | 4 ++-- .../values-umbrella.yaml.gotmpl | 5 ++--- helmfile/environments/default/global.gotmpl | 6 +++++- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index dd911b12..5e557c68 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -20,7 +20,8 @@ When starting the pipeline through the GitLab UI, you will be queried for some v When starting the pipeline through the GitLab UI, you will be queried for some variables plus the following ones: - `DOMAIN` = The domain to deploy to. -- `MAIL_DOMAIN` = The mail domain to use. +- `MAIL_DOMAIN` = (optional) Specify domain (f.e. root FQDN) for Mail, defaults to `DOMAIN`. +- `SYNAPSE_DOMAIN` = (optional) Specify domain (f.e. root FQDN) for Synapse, defaults to `DOMAIN`. - `NAMESPACE`: Defines into which namespace of your K8s cluster openDesk will be installed - `MASTER_PASSWORD_WEB_VAR`: Overwrites value of `MASTER_PASSWORD` diff --git a/docs/getting-started.md b/docs/getting-started.md index 39e7eb2f..427f36f9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -92,18 +92,27 @@ or via environment variable export DOMAIN=domain.tld ``` -If the mail domain differs from the domain, the mail -domain has to be set either via `dev` environment +Additionally, you can announce/specify an alternative Domain for mail and chat. + +As example, your domain is `acme.tld` and you want to send mails with this domain, then you can deploy openDesk to +`*.opendesk.acme.tld` and send mail as `default.user@acme.tld`. +Webmail will be accessed via `mail.opendesk.acme.tld` in this scenario. +The required routing have to be implemented by yourself. +Users + +The alternative domains have to be set either via `dev` environment ```yaml global: - mail_domain: "open.desk" + mailDomain: "open.desk" + synapseDomain: "open.desk" ``` or via environment variable ```shell export MAIL_DOMAIN=open.desk +export SYNAPSE_DOMAIN=open.desk ``` ### Apps diff --git a/helmfile/apps/element/values-matrix-neodatefix-widget.yaml.gotmpl b/helmfile/apps/element/values-matrix-neodatefix-widget.yaml.gotmpl index 2c1e6a04..2d8964f4 100644 --- a/helmfile/apps/element/values-matrix-neodatefix-widget.yaml.gotmpl +++ b/helmfile/apps/element/values-matrix-neodatefix-widget.yaml.gotmpl @@ -4,7 +4,7 @@ configuration: bot: username: "meetings-bot" - homeserver: {{ .Values.global.matrixDomain | default .Values.global.domain }} + homeserver: {{ .Values.global.synapseDomain | default .Values.global.domain }} containerSecurityContext: allowPrivilegeEscalation: false diff --git a/helmfile/apps/element/values-synapse.yaml.gotmpl b/helmfile/apps/element/values-synapse.yaml.gotmpl index 39c3fff4..2fc978bd 100644 --- a/helmfile/apps/element/values-synapse.yaml.gotmpl +++ b/helmfile/apps/element/values-synapse.yaml.gotmpl @@ -29,7 +29,7 @@ configuration: password: {{ .Values.databases.synapse.password | default .Values.secrets.postgresql.matrixUser | quote }} homeserver: - serverName: {{ .Values.global.matrixDomain | default .Values.global.domain }} + serverName: {{ .Values.global.synapseDomain | default .Values.global.domain }} appServiceConfigs: - as_token: {{ .Values.secrets.intercom.synapseAsToken | quote }} hs_token: {{ .Values.secrets.intercom.synapseAsToken | quote }} diff --git a/helmfile/apps/services/values-postfix.yaml.gotmpl b/helmfile/apps/services/values-postfix.yaml.gotmpl index 64b90492..56eacd4e 100644 --- a/helmfile/apps/services/values-postfix.yaml.gotmpl +++ b/helmfile/apps/services/values-postfix.yaml.gotmpl @@ -41,7 +41,7 @@ podSecurityContext: postfix: amavisHost: "" amavisPortIn: "" - domain: {{ .Values.global.mailDomain | quote }} + domain: {{ .Values.global.mailDomain | default .Values.global.domain }} hostname: "postfix" inetProtocols: "ipv4" milterDefaultAction: "accept" @@ -67,7 +67,7 @@ postfix: {{- else if .Values.clamavSimple.enabled }} smtpdMilters: "inet:clamav-simple:7357" {{- end }} - virtualMailboxDomains: {{ .Values.global.mailDomain | quote }} + virtualMailboxDomains: {{ .Values.global.mailDomain | default .Values.global.domain }} virtualTransport: "lmtps:dovecot:24" replicaCount: {{ .Values.replicas.postfix }} diff --git a/helmfile/apps/univention-management-stack/values-umbrella.yaml.gotmpl b/helmfile/apps/univention-management-stack/values-umbrella.yaml.gotmpl index 26d5611a..279ad69b 100644 --- a/helmfile/apps/univention-management-stack/values-umbrella.yaml.gotmpl +++ b/helmfile/apps/univention-management-stack/values-umbrella.yaml.gotmpl @@ -6,7 +6,6 @@ global: configMapUcr: "ums-stack-data-swp-ucr" configMapUcrForced: null domain: {{ .Values.global.domain | quote }} - mailDomain: {{ .Values.global.mailDomain | quote }} imagePullSecrets: {{ .Values.global.imagePullSecrets | toYaml | nindent 4 }} @@ -610,7 +609,7 @@ stack-data-ums: # The openDesk configuration brings its own UMC policies. installUmcPolicies: false domainname: {{ .Values.global.domain | quote }} - externalMailDomain: {{ .Values.global.mailDomain | quote }} + externalMailDomain: {{ .Values.global.mailDomain | default .Values.global.domain }} hostname: {{ .Values.global.hosts.univentionManagementStack | quote }} ldapHost: {{ .Values.ldap.host | quote }} ldapBase: {{ .Values.ldap.baseDn | quote }} @@ -651,7 +650,7 @@ stack-data-swp: {{- end }} externalDomainName: {{ .Values.global.domain | quote }} - externalMailDomain: {{ .Values.global.mailDomain | quote }} + externalMailDomain: {{ .Values.global.mailDomain | default .Values.global.domain }} portalGroupwareLinkBase: {{ printf "https://%s.%s" .Values.global.hosts.openxchange .Values.global.domain | quote }} portalFileshareLinkBase: {{ printf "https://%s.%s" .Values.global.hosts.nextcloud .Values.global.domain | quote }} diff --git a/helmfile/environments/default/global.gotmpl b/helmfile/environments/default/global.gotmpl index 101a7e36..cb9951f7 100644 --- a/helmfile/environments/default/global.gotmpl +++ b/helmfile/environments/default/global.gotmpl @@ -13,7 +13,11 @@ global: ## Define mail host # - mailDomain: {{ env "MAIL_DOMAIN" | default "souvap.cloud" | quote }} + mailDomain: {{ env "MAIL_DOMAIN" | quote }} + + ## Define synapse host + # + synapseDomain: {{ env "SYNAPSE_DOMAIN" | quote }} ## Define docker registry address. #