feat(romm) add redis and auth support (#11923)

**Description**
Add redis and auth to enable user control panel
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ 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._

---------

Signed-off-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com>
This commit is contained in:
Xstar97TheNoob 2023-08-29 13:13:31 -04:00 committed by GitHub
parent 98d442673d
commit d8a29b7679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 11 deletions

View File

@ -8,6 +8,10 @@ dependencies:
name: mariadb
repository: https://deps.truecharts.org/
version: 7.0.70
- condition: redis.enabled
name: redis
repository: https://deps.truecharts.org
version: 7.0.6
deprecated: false
description: game library manager focused in retro gaming
home: https://truecharts.org/charts/stable/romm
@ -25,7 +29,7 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/stable/romm
- https://github.com/zurdi15/romm
type: application
version: 2.0.2
version: 2.0.3
annotations:
truecharts.org/catagories: |
- media

View File

@ -42,6 +42,31 @@ questions:
# Include{containerBasic}
# Include{containerAdvanced}
- variable: romm
group: App Configuration
label: Romm
schema:
additional_attrs: true
type: dict
attrs:
- variable: auth
label: Auth Credentials
schema:
additional_attrs: true
type: dict
attrs:
- variable: user
label: Auth User
schema:
type: string
default: ""
- variable: pass
label: Auth Password
schema:
type: string
private: true
default: ""
# Include{containerConfig}
# Include{serviceRoot}
# Include{serviceMain}
@ -79,6 +104,14 @@ questions:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
- variable: logs
label: App Logs Storage
description: Stores the Application Logs.
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{ingressRoot}

View File

@ -0,0 +1,13 @@
{{/* Define the secrets */}}
{{- define "romm.secrets" -}}
{{- $secretName := (printf "%s-romm-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
{{- $authKey := randAlphaNum 64 -}}
{{- with lookup "v1" "Secret" .Release.Namespace $secretName -}}
{{- $authKey = index .data "ROMM_AUTH_SECRET_KEY" | b64dec -}}
{{- end }}
enabled: true
data:
ROMM_AUTH_SECRET_KEY: {{ $authKey }}
{{- end -}}

View File

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

View File

@ -10,6 +10,18 @@ securityContext:
runAsUser: 0
runAsGroup: 0
service:
main:
ports:
main:
protocol: http
port: 10680
romm:
auth:
user: "admin"
pass: "admin"
workload:
main:
podSpec:
@ -23,12 +35,13 @@ workload:
startup:
type: http
env:
VITE_BACKEND_DEV_PORT: "{{ .Values.service.main.ports.main.port }}"
ROMM_BASE_PATH: /romm
ROMM_DB_DRIVER: mariadb
# IGDB client id
CLIENT_ID: ""
# IGDB client secret
CLIENT_SECRET: ""
# WIP
STEAMGRIDDB_API_KEY: ""
DB_PORT: 3306
DB_NAME: "{{ .Values.mariadb.mariadbDatabase }}"
@ -43,14 +56,20 @@ workload:
expandObjectName: false
name: '{{ printf "%s-%s" .Release.Name "mariadbcreds" }}'
key: mariadb-password
service:
main:
ports:
main:
protocol: http
targetPort: 80
port: 10680
REDIS_HOST:
secretKeyRef:
expandObjectName: false
name: '{{ printf "%s-%s" .Release.Name "rediscreds" }}'
key: plainhost
REDIS_PORT: 6379
ROMM_AUTH_SECRET_KEY:
secretKeyRef:
name: romm-secrets
key: ROMM_AUTH_SECRET_KEY
ROMM_AUTH_ENABLED: true
ENABLE_EXPERIMENTAL_REDIS: true
ROMM_AUTH_USERNAME: "{{ .Values.romm.auth.user}}"
ROMM_AUTH_PASSWORD: "{{ .Values.romm.auth.pass}}"
persistence:
library:
@ -59,12 +78,18 @@ persistence:
resources:
enabled: true
mountPath: /romm/resources
logs:
enabled: true
mountPath: /romm/logs
mariadb:
enabled: true
mariadbUsername: romm
mariadbDatabase: romm
redis:
enabled: true
portal:
open:
enabled: true