From ec8970a561bb2109de787bc86ca4ba1392c45636 Mon Sep 17 00:00:00 2001 From: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Date: Wed, 10 Jun 2026 04:59:45 -0400 Subject: [PATCH] feat(homebox) add CNPG support **BREAKING CHANGES** (#48964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Adding postgres support, updating env keys, correct probes ⚒️ 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) - [X] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** Tested locally using app-template <3 **📃 Notes:** Users can easily export and import their data from the web gui directly **✔️ 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 changes to the documentation - [ ] 🧪 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 - [X] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ 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> Co-authored-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com> --- charts/stable/homebox/Chart.yaml | 2 +- charts/stable/homebox/templates/_secret.tpl | 24 ------ charts/stable/homebox/templates/common.yaml | 12 +-- charts/stable/homebox/values.yaml | 82 ++++++++++++++++----- 4 files changed, 65 insertions(+), 55 deletions(-) delete mode 100644 charts/stable/homebox/templates/_secret.tpl diff --git a/charts/stable/homebox/Chart.yaml b/charts/stable/homebox/Chart.yaml index 589861114fb..72ef5cf0cdd 100644 --- a/charts/stable/homebox/Chart.yaml +++ b/charts/stable/homebox/Chart.yaml @@ -36,5 +36,5 @@ sources: - https://github.com/sysadminsmedia/homebox - https://github.com/trueforge-org/truecharts/tree/master/charts/stable/homebox type: application -version: 10.4.0 +version: 11.0.0 diff --git a/charts/stable/homebox/templates/_secret.tpl b/charts/stable/homebox/templates/_secret.tpl deleted file mode 100644 index 066bb974bbd..00000000000 --- a/charts/stable/homebox/templates/_secret.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* Define the secret */}} -{{- define "homebox.secret" -}} - -enabled: true -data: - HBOX_MODE: production - HBOX_SWAGGER_SCHEMA: {{ .Values.service.main.ports.main.protocol | lower }} - HBOX_STORAGE_DATA: {{ .Values.persistence.data.mountPath }} - HBOX_WEB_PORT: {{ .Values.service.main.ports.main.port | quote }} - HBOX_SWAGGER_HOST: {{ .Values.service.main.ports.main.port | quote }} - {{/* User Defined */}} - HBOX_OPTIONS_ALLOW_REGISTRATION: {{ .Values.homebox.allow_registration | quote }} - HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID: {{ .Values.homebox.auto_increment_asset_id | quote }} - HBOX_WEB_MAX_UPLOAD_SIZE: {{ (.Values.homebox.max_upload_size | default 10) | quote }} - HBOX_LOG_LEVEL: {{ .Values.homebox.log_level | default "info" }} - HBOX_LOG_FORMAT: {{ .Values.homebox.log_format | default "text" }} - {{- if .Values.homebox.mailer_host }} - HBOX_MAILER_HOST: {{ .Values.homebox.mailer_host | quote }} - HBOX_MAILER_PORT: {{ .Values.homebox.mailer_port | quote }} - HBOX_MAILER_FROM: {{ .Values.homebox.mailer_from | quote }} - HBOX_MAILER_USERNAME: {{ .Values.homebox.mailer_username | quote }} - HBOX_MAILER_PASSWORD: {{ .Values.homebox.mailer_password | quote }} - {{- end }} -{{- end }} diff --git a/charts/stable/homebox/templates/common.yaml b/charts/stable/homebox/templates/common.yaml index 27eeb290243..b51394e00a4 100644 --- a/charts/stable/homebox/templates/common.yaml +++ b/charts/stable/homebox/templates/common.yaml @@ -1,11 +1 @@ -{{/* Make sure all variables are set properly */}} -{{- include "tc.v1.common.loader.init" . }} - -{{/* Render secrets for homebox */}} -{{- $secrets := include "homebox.secret" . | fromYaml -}} -{{- if $secrets -}} - {{- $_ := set .Values.secret "homebox-secret" $secrets -}} -{{- end -}} - -{{/* Render the templates */}} -{{ include "tc.v1.common.loader.apply" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/stable/homebox/values.yaml b/charts/stable/homebox/values.yaml index ccb36f6a646..d25c9ed229a 100644 --- a/charts/stable/homebox/values.yaml +++ b/charts/stable/homebox/values.yaml @@ -3,32 +3,76 @@ image: repository: ghcr.io/sysadminsmedia/homebox pullPolicy: IfNotPresent tag: 0.25.0@sha256:6506480a3dfadd2cc885fa97b32d11b0ee28ec58629fa34a76afdb4ac540c7fc -homebox: - allow_registration: true - auto_increment_asset_id: true - max_upload_size: 10 - log_level: info - log_format: text - mailer_host: "" - mailer_port: 587 - mailer_from: "" - mailer_username: "" - mailer_password: "" -workload: - main: - podSpec: - containers: - main: - envFrom: - - secretRef: - name: homebox-secret + service: main: ports: main: protocol: http port: 10603 + +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + path: /api/v1/status + readiness: + enabled: true + type: http + path: /api/v1/status + startup: + enabled: true + type: tcp + env: + # development application mode used for runtime behavior can be one of: development, production + HBOX_MODE: "production" + HBOX_WEB_PORT: "{{ .Values.service.main.ports.main.port }}" + # Dont change + HBOX_WEB_HOST: "0.0.0.0" + + # Required. Server-side secret HMAC-keyed into stored API key hashes; + # the binary refuses to start if this is shorter than 32 bytes. + # Generate with openssl rand -base64 48. + # Must stay stable across restarts — rotating it invalidates every issued API key. + HBOX_AUTH_API_KEY_PEPPER: "CHANGE_ME-CHANGE_ME-CHANGE_ME-CHANGE_ME-CHANGE_ME-CHANGE_ME" + + # log level to use: trace, debug, info, warn, error, fatal, panic + HBOX_LOG_LEVEL: "info" + # log format to use: text, json + HBOX_LOG_FORMAT: "text" + # required for ingress + HBOX_OPTIONS_TRUST_PROXY: '{{ ( .Values.ingress.main.enabled | default false ) }}' + # database type: sqlite3 or postgres + HBOX_DATABASE_DRIVER: "postgres" + # postgres hostname + HBOX_DATABASE_HOST: + secretKeyRef: + name: cnpg-main-urls + key: host + # postgres port + HBOX_DATABASE_PORT: "5432" + # postgres username + HBOX_DATABASE_USERNAME: "{{ .Values.cnpg.main.user }}" + # postgres password + HBOX_DATABASE_PASSWORD: + secretKeyRef: + name: cnpg-main-user + key: password + # postgres database name + HBOX_DATABASE_DATABASE: "{{ .Values.cnpg.main.database }}" + # postgres ssl mode require or disable + HBOX_DATABASE_SSL_MODE: "disable" + persistence: data: enabled: true mountPath: /data + +cnpg: + main: + enabled: true + user: homebox + database: homebox