migrate(midarr) migrate midarr to new common **BREAKING CHANGES** (#10382)

**Description**
- Migrated app to new common and updated to the latest available
version.
- Added basic installation notes.

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [X] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] 🔃 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
- [X] 👀 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._
This commit is contained in:
Xstar97TheNoob
2023-07-14 04:51:58 -04:00
committed by GitHub
parent 36b5d9bfe3
commit d349af1a67
10 changed files with 144 additions and 125 deletions

View File

@@ -12,6 +12,7 @@ chart-dirs:
excluded-charts:
- charts/dependency/subchart
- charts/incubator/twingate-connector
- charts/incubator/midarr
- charts/incubator/orbital-sync
- charts/incubator/plex-meta-manager
- charts/incubator/tauticord
@@ -23,7 +24,6 @@ excluded-charts:
- charts/stable/discordgsm
- charts/stable/facebox
- charts/stable/foundryvtt
- charts/stable/foundryvtt
- charts/stable/heimdall
- charts/stable/mc-router
- charts/stable/multus

View File

@@ -1,18 +1,15 @@
apiVersion: v2
appVersion: "1.16.1"
appVersion: "3.1.0"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
- condition: postgresql.enabled
name: postgresql
repository: https://deps.truecharts.org/
version: 11.0.31
version: 12.14.6
description: Midarr is a minimal lightweight media server for enjoying your media
home: https://truecharts.org/charts/incubator/midarr
icon: https://truecharts.org/img/hotlink-ok/chart-icons/midarr.png
keywords:
- midarr
- media
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
@@ -22,7 +19,7 @@ name: midarr
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/midarr
- https://github.com/midarrlabs/midarr-server
version: 3.0.22
version: 4.0.0
annotations:
truecharts.org/catagories: |
- media

View File

@@ -0,0 +1,5 @@
# Installation Notes
Midarr requires a sonarr and radarr instance to be setup prior for the app to function.
Its recommended all apps share the same internal path like /media when mounting your media libraries to these apps.

View File

@@ -10,9 +10,9 @@ questions:
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
- variable: midarr
group: App Configuration
label: Midarr Configuration
@@ -30,17 +30,20 @@ questions:
label: Admin Mail
schema:
type: string
required: true
default: ""
- variable: name
label: Admin Name
schema:
type: string
required: true
default: ""
- variable: pass
label: Admin Password
schema:
type: string
private: true
required: true
default: ""
- variable: general
label: General Configuration
@@ -59,7 +62,7 @@ questions:
label: Mailer From
schema:
type: string
default: ""
default: "midarr@example.com"
- variable: sendgrid_api_key
label: SendGrid API Key
schema:
@@ -76,12 +79,14 @@ questions:
label: Base URL
schema:
type: string
required: true
default: ""
- variable: api_key
label: API Key
schema:
type: string
private: true
required: true
default: ""
- variable: sonarr
label: Sonarr Configuration
@@ -93,14 +98,17 @@ questions:
label: Base URL
schema:
type: string
required: true
default: ""
- variable: api_key
label: API Key
schema:
type: string
private: true
required: true
default: ""
# Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot}
- variable: main
label: Main Service
@@ -141,28 +149,28 @@ questions:
# Include{ingressAdvanced}
# Include{ingressList}
# 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{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{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

@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@@ -1,36 +0,0 @@
{{/* Define the configmap */}}
{{- define "midarr.config" -}}
{{- $configName := printf "%s-config" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $configName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
DB_USERNAME: {{ .Values.postgresql.postgresqlUsername }}
DB_DATABASE: {{ .Values.postgresql.postgresqlDatabase }}
DB_HOSTNAME: {{ printf "%v-%v" .Release.Name "postgresql" }}
{{- with .Values.midarr.admin.mail }}
SETUP_ADMIN_EMAIL: {{ . }}
{{- end }}
{{- with .Values.midarr.admin.name }}
SETUP_ADMIN_NAME: {{ . }}
{{- end }}
{{- with .Values.midarr.radarr.base_url }}
RADARR_BASE_URL: {{ . }}
{{- end }}
{{- with .Values.midarr.sonarr.base_url }}
SONARR_BASE_URL: {{ . }}
{{- end }}
{{- with .Values.midarr.general.app_url }}
APP_URL: http://localhost:4000
{{- end }}
{{- with .Values.midarr.general.app_mailer_from }}
APP_MAILER_FROM: example@email.com
{{- end }}
{{- end -}}

View File

@@ -1,29 +0,0 @@
{{/* Define the secret */}}
{{- define "midarr.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
DB_PASSWORD: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" | b64enc }}
{{- with .Values.midarr.admin.pass }}
SETUP_ADMIN_PASSWORD: {{ . | b64enc }}
{{- end }}
{{- with .Values.midarr.radarr.api_key }}
RADARR_API_KEY: {{ . | b64enc }}
{{- end }}
{{- with .Values.midarr.sonarr.api_key }}
SONARR_API_KEY: {{ . | b64enc }}
{{- end }}
{{- with .Values.midarr.general.sendgrid_api_key }}
SENDGRID_API_KEY: {{ . | b64enc }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,67 @@
{{/* Define the secrets */}}
{{- define "midarr.secrets" -}}
{{- $secretName := (printf "%s-midarr-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) -}}
{{- $midarr := .Values.midarr -}}
{{- $admin := $midarr.admin -}}
{{- $general := $midarr.general -}}
{{- $radarr := $midarr.radarr -}}
{{- $sonarr := $midarr.sonarr -}}
{{- $host := printf "%v-cnpg-main-rw" (include "tc.v1.common.lib.chart.names.fullname" $) }}
{{- $password := .Values.cnpg.main.creds.password | trimAll "\"" }}
enabled: true
data:
{{/* DB */}}
DB_USERNAME: {{ .Values.cnpg.main.user }}
DB_DATABASE: {{ .Values.cnpg.main.database }}
DB_HOSTNAME: {{ $host }}
DB_PASSWORD: {{ $password }}
{{/* MIDARR */}}
{{- with $admin.mail }}
SETUP_ADMIN_EMAIL: {{ . }}
{{- end }}
{{- with $admin.name }}
SETUP_ADMIN_NAME: {{ . }}
{{- end }}
{{- with $admin.pass }}
SETUP_ADMIN_PASSWORD: {{ . | b64enc }}
{{- end }}
{{/* GENERAL */}}
{{- with $general.app_url }}
APP_URL: http://localhost:4000
{{- end }}
{{- with $general.app_mailer_from }}
APP_MAILER_FROM: {{ . }}
{{- end }}
{{- with $general.sendgrid_api_key }}
SENDGRID_API_KEY: {{ . | b64enc }}
{{- end }}
{{/* RADARR */}}
{{- with $radarr.base_url }}
RADARR_BASE_URL: {{ . }}
{{- end }}
{{- with $radarr.api_key }}
RADARR_API_KEY: {{ . | b64enc }}
{{- end }}
{{/* SONARR */}}
{{- with $sonarr.base_url }}
SONARR_BASE_URL: {{ . }}
{{- end }}
{{- with $sonarr.api_key }}
SONARR_API_KEY: {{ . | b64enc }}
{{- end }}
{{- end -}}

View File

@@ -1,11 +1,11 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{- include "tc.v1.common.loader.init" . }}
{{/* Render config */}}
{{- include "midarr.config" . }}
{{/* Render secret */}}
{{- include "midarr.secret" . }}
{{/* Render secrets for midarr */}}
{{- $secrets := include "midarr.secrets" . | fromYaml -}}
{{- if $secrets -}}
{{- $_ := set .Values.secret "midarr-secrets" $secrets -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
{{ include "tc.v1.common.loader.apply" . }}

View File

@@ -1,15 +1,21 @@
image:
repository: tccr.io/truecharts/midarr-server
tag: 1.16.1@sha256:5c0d69dbef7500b95aa11b9b51b8875a6355cfccc9cc57e9de202f574cf10b4f
tag: v3.1.0@sha256:5d85789b1a43cd6f7b133ae129d9f1dae4b97773e6c9f54b48094b1c86b47422
pullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: false
runAsNonRoot: false
container:
runAsNonRoot: false
readOnlyRootFilesystem: false
runAsUser: 0
runAsGroup: 0
podSecurityContext:
runAsUser: 0
runAsGroup: 0
service:
main:
ports:
main:
port: 10347
targetPort: 4000
midarr:
admin:
@@ -27,25 +33,25 @@ midarr:
base_url: ""
api_key: ""
envFrom:
- secretRef:
name: '{{ include "tc.common.names.fullname" . }}-secret'
- configMapRef:
name: '{{ include "tc.common.names.fullname" . }}-config'
service:
workload:
main:
ports:
main:
port: 10347
protocol: HTTP
targetPort: 4000
podSpec:
containers:
main:
command:
- sh
- -c
- chmod u+x entry-local.sh && ./entry-local.sh
envFrom:
- secretRef:
name: "midarr-secrets"
postgresql:
enabled: true
existingSecret: dbcreds
postgresqlUsername: midarr
postgresqlDatabase: midarr
cnpg:
main:
enabled: true
user: midarr
database: midarr
portal:
enabled: true
open:
enabled: true