From 98bd80d432c9c4bba487f530885a1b97ceb98415 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Thu, 18 May 2023 03:35:43 -0400 Subject: [PATCH] fix(dashy): Move to new common (#8975) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** This one will need a bit more work and help from @stavros-k but I'm interested in testing it since it works expect for missing persistence so might as well do what I can ⚒️ Fixes # **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [X] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [X] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [X] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/dashy/Chart.yaml | 4 +- charts/incubator/dashy/questions.yaml | 39 +++++----- .../incubator/dashy/templates/_configmap.tpl | 19 ++--- charts/incubator/dashy/templates/common.yaml | 30 ++++---- charts/incubator/dashy/values.yaml | 77 ++++++++++--------- 5 files changed, 84 insertions(+), 85 deletions(-) diff --git a/charts/incubator/dashy/Chart.yaml b/charts/incubator/dashy/Chart.yaml index 7ae21e9e2db..adc353e7e10 100644 --- a/charts/incubator/dashy/Chart.yaml +++ b/charts/incubator/dashy/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "2.1.1" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 12.6.8 description: Dashy helps you organize your self-hosted services by making them accessible from a single place home: https://truecharts.org/charts/incubator/dashy icon: https://truecharts.org/img/hotlink-ok/chart-icons/dashy.png @@ -18,7 +18,7 @@ name: dashy sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/dashy - https://github.com/airsonic/airsonic -version: 2.0.20 +version: 3.0.0 annotations: truecharts.org/catagories: | - dashboard diff --git a/charts/incubator/dashy/questions.yaml b/charts/incubator/dashy/questions.yaml index 2ddbb22d9e1..2498cf39c38 100644 --- a/charts/incubator/dashy/questions.yaml +++ b/charts/incubator/dashy/questions.yaml @@ -41,6 +41,7 @@ questions: type: boolean default: true # Include{containerConfig} +# Include{podOptions} # Include{serviceRoot} - variable: main label: Main Service @@ -89,29 +90,29 @@ questions: # Include{ingressTLS} # Include{ingressTraefik} # Include{ingressList} +# Include{securityContextRoot} + - variable: runAsUser + label: runAsUser + description: The UserID of the user running the application + schema: + type: int + default: 0 + - variable: runAsGroup + label: runAsGroup + description: The groupID of the user running the application + schema: + type: int + default: 0 -# Include{podSecurityContextRoot} - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 0 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 0 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} - - variable: fsGroup - label: fsGroup - description: The group that should own ALL storage. - schema: - type: int - default: 568 + - variable: fsGroup + label: fsGroup + description: The group that should own ALL storage. + schema: + type: int + default: 568 # Include{resources} # Include{advanced} diff --git a/charts/incubator/dashy/templates/_configmap.tpl b/charts/incubator/dashy/templates/_configmap.tpl index e7ec4446865..a9ec4b66aa2 100644 --- a/charts/incubator/dashy/templates/_configmap.tpl +++ b/charts/incubator/dashy/templates/_configmap.tpl @@ -1,16 +1,9 @@ {{/* Define the secrets */}} {{- define "dashy.config" -}} -{{- $configName := printf "%s-dashy-config" (include "tc.common.names.fullname" .) }} - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ $configName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -data: - conf.yml: | -{{- .Values.dashyConfig | toYaml | nindent 4 }} +configmap: + dashy-config: + enabled: true + data: + conf.yml: | + {{- .Values.dashyConfig | toYaml | nindent 8 }} {{- end -}} diff --git a/charts/incubator/dashy/templates/common.yaml b/charts/incubator/dashy/templates/common.yaml index d68783ef277..eaeaf9b0afc 100644 --- a/charts/incubator/dashy/templates/common.yaml +++ b/charts/incubator/dashy/templates/common.yaml @@ -1,17 +1,16 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} {{- define "dashy.configvolume" -}} enabled: true -mountPath: /app/public -type: custom +type: configmap +objectName: dashy-config readOnly: true -volumeSpec: - configMap: - name: {{ include "tc.common.names.fullname" . }}-dashy-config - items: - - key: conf.yml - path: conf.yml +defaultMode: "0755" +mountPath: /app/public +items: +- key: conf.yml + path: conf.yml {{- end -}} {{- define "dashy.confighostpath" -}} @@ -24,12 +23,15 @@ mountPath: /app/public/conf.yml {{- end -}} {{- if .Values.dashyConfig -}} -{{/* Render config for dashy */}} -{{- include "dashy.config" . -}} -{{- $_ := set .Values.persistence "dashy-config" (include "dashy.configvolume" . | fromYaml) -}} + {{/* Render config for dashy */}} + {{- $config := include "dashy.config" . | fromYaml -}} + {{- if $config -}} + {{- $_ := mustMergeOverwrite .Values $config -}} + {{- end -}} + {{- $_ := set .Values.persistence "dashy-config" (include "dashy.configvolume" . | fromYaml) -}} {{- else if .Values.dashy.enabled -}} -{{- $_ := set .Values.persistence "dashy-config" (include "dashy.confighostpath" . | fromYaml) -}} + {{- $_ := set .Values.persistence "dashy-config" (include "dashy.confighostpath" . | fromYaml) -}} {{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/dashy/values.yaml b/charts/incubator/dashy/values.yaml index 26c6cb019e1..a5264415d96 100644 --- a/charts/incubator/dashy/values.yaml +++ b/charts/incubator/dashy/values.yaml @@ -4,12 +4,11 @@ image: pullPolicy: IfNotPresent securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false - -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 + container: + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + runAsGroup: 0 dashy: # Enable config file mount from host path @@ -23,41 +22,44 @@ dashyConfig: # pageInfo: # title: Home Lab -env: - NODE_ENV: production - -probes: - liveness: - enabled: true - custom: true - spec: - exec: - command: - - node - - /app/services/healthcheck - readiness: - enabled: true - custom: true - spec: - exec: - command: - - node - - /app/services/healthcheck - startup: - enabled: true - custom: true - spec: - exec: - command: - - node - - /app/services/healthcheck - +workload: + main: + podSpec: + containers: + main: + env: + NODE_ENV: production + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - node + - /app/services/healthcheck + readiness: + enabled: true + custom: true + spec: + exec: + command: + - node + - /app/services/healthcheck + startup: + enabled: true + custom: true + spec: + exec: + command: + - node + - /app/services/healthcheck service: main: ports: main: port: 10310 - protocol: HTTP + protocol: http targetPort: 80 persistence: @@ -66,4 +68,5 @@ persistence: mountPath: /app/public/item-icons portal: - enabled: true + open: + enabled: true