fix(dashy): Move to new common (#8975)

**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  # <!--(issue)-->

**⚙️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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>
This commit is contained in:
StevenMcElligott 2023-05-18 03:35:43 -04:00 committed by GitHub
parent c0952f322b
commit 98bd80d432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 85 deletions

View File

@ -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

View File

@ -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}

View File

@ -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 -}}

View File

@ -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" . }}

View File

@ -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