diff --git a/apps/matrix/README.md b/apps/matrix/README.md index 3285049..a0130ab 100644 --- a/apps/matrix/README.md +++ b/apps/matrix/README.md @@ -147,3 +147,11 @@ docker exec -it synapse register_new_matrix_user http://localhost:8008 -c /data/ * Another FQDN * If set, another nginx instance + +## Usage + +### Element-Web + +* Includes config.json that is being populated by values.yaml +* Includes nginx on port localhost:8080 (http) +* Includes nginx proxy on port 80+443 (http redirect, https) diff --git a/apps/matrix/element-web/config.json b/apps/matrix/element-web/config.json index 44e3b17..aeeb614 100644 --- a/apps/matrix/element-web/config.json +++ b/apps/matrix/element-web/config.json @@ -1,8 +1,8 @@ { "default_server_config": { "m.homeserver": { - "base_url": "https://{{ .Values.synapseFQDN }}", - "server_name": "{{ .Values.homeServerFQDN }}" + "base_url": "https://{{ tpl .Values.synapseFQDN . }}", + "server_name": "{{ tpl .Values.homeServerFQDN . }}" }, "m.identity_server": { "base_url": "https://vector.im" @@ -30,7 +30,7 @@ "default_theme": "light", "roomDirectory": { "servers": [ - "matrix.org" + "{{ tpl .Values.homeServerFQDN . }}" ] }, "piwik": { diff --git a/apps/matrix/templates/element-web-conf.yaml b/apps/matrix/templates/element-web-conf.yaml new file mode 100644 index 0000000..8fe0f05 --- /dev/null +++ b/apps/matrix/templates/element-web-conf.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-element-web + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web +data: +{{ tpl (.Files.Glob "element-web/*").AsConfig . | indent 2 }} diff --git a/apps/matrix/templates/element-web.yaml b/apps/matrix/templates/element-web.yaml index 46874a9..1b400b8 100644 --- a/apps/matrix/templates/element-web.yaml +++ b/apps/matrix/templates/element-web.yaml @@ -43,13 +43,16 @@ spec: - name: etcletsencrypt mountPath: "/etc/letsencrypt" - name: element-web + command: ["nginx", "-g", "daemon off;" ] image: vectorim/element-web:{{ .Values.elementWebVersion }} ports: - containerPort: 8080 volumeMounts: - name: nginx-config mountPath: "/etc/nginx/conf.d/" - command: ["nginx", "-g", "daemon off;" ] + - name: elementwebconfig + mountPath: "/usr/share/nginx/html/config.json" + subPath: config.json volumes: - name: nginx-config configMap: @@ -57,6 +60,9 @@ spec: - name: nginx-config-proxy configMap: name: {{ .Release.Name }}-element-web-nginx-proxy + - name: elementwebconfig + configMap: + name: {{ .Release.Name }}-element-web - name: etcletsencrypt persistentVolumeClaim: claimName: {{ .Release.Name }}-element-web-letsencrypt-certs