From d8633602960a471d822b9fea178e0e5d0266b21d Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Mon, 28 Nov 2022 09:54:14 +0200 Subject: [PATCH] fix(magicmirror2): add some default config (#4437) * chore(magicmirror2): add some options * add ui * pre-com * some changes * no defaultMode * ports --- charts/incubator/magicmirror2/questions.yaml | 28 ------------------- .../magicmirror2/templates/_config.tpl | 27 +++++++++--------- charts/incubator/magicmirror2/values.yaml | 15 ++++------ 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/charts/incubator/magicmirror2/questions.yaml b/charts/incubator/magicmirror2/questions.yaml index a6a798c8548..faf0e768ec7 100644 --- a/charts/incubator/magicmirror2/questions.yaml +++ b/charts/incubator/magicmirror2/questions.yaml @@ -28,34 +28,6 @@ questions: schema: type: boolean default: false - - variable: language - label: Language - description: The language of the interface. - schema: - type: string - default: en - - variable: time_format - label: Time Format - description: The form of time notation that will be used - schema: - type: string - default: "24" - enum: - - value: "24" - description: "24" - - value: "12" - description: "12" - - variable: units - label: Units - description: The units that will be used in the default weather modules. - schema: - type: string - default: metrics - enum: - - value: metrics - description: metrics - - value: imperial - description: imperial # Include{serviceRoot} - variable: main label: Main Service diff --git a/charts/incubator/magicmirror2/templates/_config.tpl b/charts/incubator/magicmirror2/templates/_config.tpl index 30e93a215df..9485556ea91 100644 --- a/charts/incubator/magicmirror2/templates/_config.tpl +++ b/charts/incubator/magicmirror2/templates/_config.tpl @@ -25,20 +25,22 @@ data: */ var config = { + /*************** DO NOT CHANGE FOLLOWING VALUES ***************/ address: "0.0.0.0", - port: {{ .Values.service.main.ports.main.port }}, - ipWhitelist: [], // Set [] to allow all IP addresses - // or add a specific IPv4 of 192.168.1.5 : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], - // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], - - useHttps: false, // Support HTTPS or not, default "false" will use HTTP - - language: {{ .Values.magicmirror.language | quote }}, - timeFormat: {{ .Values.magicmirror.time_format | trimAll "\"" }}, - units: {{ .Values.magicmirror.units | quote }}, + port: {{ .Values.service.main.ports.main.targetPort }}, + useHttps: false, serverOnly: "true", + /*************** EDIT THE BELOW THIS LINE ONLY ***************/ + + ipWhitelist: [], // Set [] to allow all IP addresses + // or add a specific IPv4 of 192.168.1.5 : + // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], + // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : + // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], + + language: "en", + timeFormat: 24, + units: "metric", modules: [ { @@ -105,7 +107,6 @@ data: } }, ] - }; /*************** DO NOT EDIT THE LINE BELOW ***************/ diff --git a/charts/incubator/magicmirror2/values.yaml b/charts/incubator/magicmirror2/values.yaml index a924f8f1fc9..2a8514d40f3 100644 --- a/charts/incubator/magicmirror2/values.yaml +++ b/charts/incubator/magicmirror2/values.yaml @@ -14,9 +14,6 @@ podSecurityContext: magicmirror: force_update: false force_update_modules: false - language: en - time_format: "24" - units: metrics envFrom: - configMapRef: @@ -39,20 +36,20 @@ service: main: port: 10590 protocol: HTTP + targetPort: 10000 persistence: config: enabled: true mountPath: /magicmirror2 + # Mounts a modified default config file to a "tmp" which the entrypoint, + # copies to the config location if it does not exist. configfile: enabled: true - type: custom - mountPath: /magicmirror2/config/config.js + type: configMap + mountPath: /tmp/config.js subPath: config.js - defaultMode: "0770" - volumeSpec: - configMap: - name: '{{ printf "%s-magicmirror-config" (include "tc.common.names.fullname" .) }}' + objectName: '{{ printf "%s-magicmirror-config" (include "tc.common.names.fullname" .) }}' portal: enabled: true