diff --git a/charts/incubator/meshcentral/Chart.yaml b/charts/incubator/meshcentral/Chart.yaml index a6afecd352d..94ad90bdf75 100644 --- a/charts/incubator/meshcentral/Chart.yaml +++ b/charts/incubator/meshcentral/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 kubeVersion: ">=1.16.0-0" name: meshcentral +version: 5.0.16 appVersion: "1.0.92" -version: 5.0.15 description: MeshCentral is a full computer management web site type: application deprecated: false diff --git a/charts/incubator/meshcentral/docs/installation-instructions.md b/charts/incubator/meshcentral/docs/installation-instructions.md index 44f5a993d3a..f9782e1d7de 100644 --- a/charts/incubator/meshcentral/docs/installation-instructions.md +++ b/charts/incubator/meshcentral/docs/installation-instructions.md @@ -23,3 +23,51 @@ The above will only be applied when installed in TrueNAS Scale as an App Native Helm users won't be affected with the above. In both Native Helm and TrueNAS Scale, keys that start with `_` are **unset**. + +For SCALE users, you can add additional configuration options that are not exposed in the UI +by using the `Additional MeshCentral Configuration` section. + +::: tip + +However, if you think an option would be used by a lot of users, it would be best to ask us to expose it. + +::: + +For example to set this: + +```json +"settings": { + "sms": { + "provider": "twillio" + } +} +``` + +Set like this: + +- Key: `settigns.sms.provider` +- Value: `twillio` + +For lists: + +```json +"domains": { + "": { + "newAccoutnsRights": [ + "item1", + "item2" + ] + } +} +``` + +Set like this: + +- Key: `domains."".newAccountsRights` +- Value: `[ "item1", "item2" ]` + +::: warn + +Please use the exact casing as in the [MeshCentral's json schema](https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json). + +::: diff --git a/charts/incubator/meshcentral/questions.yaml b/charts/incubator/meshcentral/questions.yaml index 2c11f0e86f6..db45c7ba622 100644 --- a/charts/incubator/meshcentral/questions.yaml +++ b/charts/incubator/meshcentral/questions.yaml @@ -381,6 +381,42 @@ questions: schema: type: string default: "" + - variable: _setupXMPP + label: Setup XMPP + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: xmpp + label: xmpp + description: Configure XMPP messaging system + schema: + additional_attrs: true + type: dict + attrs: + - variable: service + label: service + schema: + type: string + default: "" + - variable: credentials + label: credentials + schema: + additional_attrs: true + type: dict + attrs: + - variable: username + label: username + schema: + type: string + default: "" + - variable: password + label: password + schema: + type: string + private: true + default: "" - variable: domains label: Section schema: @@ -567,6 +603,31 @@ questions: schema: type: string default: "" + - variable: additional_meshcentral + group: Container Configuration + label: Additional MeshCentral Configuration + schema: + type: list + default: [] + items: + - variable: entry + label: Key - Value Pair + schema: + additional_attrs: true + type: dict + attrs: + - variable: key + label: Key + schema: + type: string + required: true + default: "" + - variable: value + label: Value + schema: + type: string + required: true + default: "" # Include{containerConfig} # Include{serviceRoot} - variable: main diff --git a/charts/incubator/meshcentral/templates/_secret.tpl b/charts/incubator/meshcentral/templates/_secret.tpl index 17b21de5e61..0659d069889 100644 --- a/charts/incubator/meshcentral/templates/_secret.tpl +++ b/charts/incubator/meshcentral/templates/_secret.tpl @@ -5,6 +5,7 @@ {{- $secretStorageName := printf "%s-storage-secret" (include "tc.common.names.fullname" .) }} {{- $config := .Values.meshcentral }} +{{- $mc_custom := .Values.additional_meshcentral }} {{- $isScale := false }} {{- if hasKey .Values.global "isSCALE" }} @@ -13,6 +14,20 @@ {{- $isScale = false }} {{- end }} +{{- if $isScale }} + {{- if .Values.additional_meshcentral }} + {{- $mc_custom = (include "render.custom.scale.values" $mc_custom) }} + {{- $mc_custom_merged := dict }} + {{/* We created a new unique section# for each key we parsed */}} + {{/* And we merge them here, as without it we would have multiple */}} + {{/* same top level keys */}} + {{- range $section := (fromYaml $mc_custom) }} + {{- $mc_custom_merged = mergeOverwrite $mc_custom_merged $section }} + {{- end }} + {{- $config = mergeOverwrite $config $mc_custom_merged }} + {{- end }} +{{- end }} + {{- $sessionKey := "" }} {{- with (lookup "v1" "Secret" .Release.Namespace $secretStorageName) }} {{- $sessionKey = (index .data "session_key") }} @@ -40,7 +55,7 @@ {{- range $domain := $config.domains }} {{- if not (hasKey $domain "myServer") }} {{- $_ := set $domain "myServer" dict }} - {{- end -}} + {{- end }} {{- $_ := set $domain.myServer "Upgrade" false }} {{- end }} @@ -138,3 +153,20 @@ data: {{- $_ := unset $values.domains "tcdefaultdomain" }} {{- toYaml $values }} {{- end }} + +{{/* Takes a list of dicts with a value and a */}} +{{/* key formatted in dot notaion and converts it to yaml */}} +{{- define "render.custom.scale.values" }} + {{- $values := . }} + {{- $section := 1 }} + {{- range $item := $values }} + {{- $indent := 2 }} + {{- printf "section%v" $section | nindent 0 }}: + {{- $section = (add 1 (int $section)) }} + {{- range (split "." $item.key) }} + {{- . | nindent (int $indent) }}: + {{- $indent = (add 2 (int $indent)) }} + {{- end -}} + {{- printf " %v" $item.value }} + {{- end }} +{{- end }} diff --git a/charts/incubator/meshcentral/values.yaml b/charts/incubator/meshcentral/values.yaml index 01da788cea9..b6704c13576 100644 --- a/charts/incubator/meshcentral/values.yaml +++ b/charts/incubator/meshcentral/values.yaml @@ -18,7 +18,7 @@ podSecurityContext: # - Values with the character _ in-front of them are pruned. Add or remove _ to disable or enable options # - More in-depth info for each options can be found here: https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json # - Check for this chart's specific info in our webpage https://truecharts.org -# - Last sync with upstream config schema: Oct 22, 2022 +# - Last sync with upstream config schema: Oct 29, 2022 # - Any service that uses port other than 443, need to be manually configured. meshcentral: settings: @@ -290,6 +290,12 @@ meshcentral: serverurl: "" # - A Discord bot token that MeshCentral will use to login to Discord. token: "" + # - Configure XMPP messaging system + _xmpp: + service: "" + credentials: + username: "" + password: "" # - Any settings in this section is used as default setting for all domains _domaindefaults: