From 98d9d7958817bddc71d2085942c10fe1209e39f5 Mon Sep 17 00:00:00 2001 From: jessebot Date: Sun, 29 Dec 2024 23:26:24 +0100 Subject: [PATCH] update env vars and how they render again --- charts/pixelfed/README.md | 1 + charts/pixelfed/templates/configmap.yaml | 10 +-- charts/pixelfed/templates/deployment.yaml | 89 +++++++++++++++++------ charts/pixelfed/values.yaml | 3 + 4 files changed, 77 insertions(+), 26 deletions(-) diff --git a/charts/pixelfed/README.md b/charts/pixelfed/README.md index dec06df..440fc6c 100644 --- a/charts/pixelfed/README.md +++ b/charts/pixelfed/README.md @@ -76,6 +76,7 @@ A Helm chart for deploying Pixelfed on Kubernetes | pixelfed.app.name | string | `"Pixelfed"` | The name of your server/instance | | pixelfed.app.url | string | `"https://localhost"` | change this to the domain of your pixelfed instance | | pixelfed.atom_feeds | string | `"true"` | https://docs.pixelfed.org/technical-documentation/config/#atom_feeds | +| pixelfed.db_apply_new_migrations_automatically | bool | `false` | | | pixelfed.enable_config_cache | bool | `true` | Enable the config cache to allow you to manage settings via the admin dashboard | | pixelfed.enforce_email_verification | bool | `true` | Enforce email verification | | pixelfed.exp_emc | bool | `true` | Experimental Configuration | diff --git a/charts/pixelfed/templates/configmap.yaml b/charts/pixelfed/templates/configmap.yaml index ef70150..43f1948 100644 --- a/charts/pixelfed/templates/configmap.yaml +++ b/charts/pixelfed/templates/configmap.yaml @@ -78,11 +78,11 @@ data: HORIZON_PREFIX="horizon-" # activity pub - ACTIVITY_PUB="true" - AP_REMOTE_FOLLOW="true" - AP_SHAREDINBOX="true" - AP_INBOX="true" - AP_OUTBOX="true" + ACTIVITY_PUB={{ .Values.pixelfed.activity_pub.enabled | quote }} + AP_REMOTE_FOLLOW={{ .Values.pixelfed.activity_pub.remote_follow | quote }} + AP_SHAREDINBOX={{ .Values.pixelfed.activity_pub.sharedinbox | quote }} + AP_INBOX={{ .Values.pixelfed.activity_pub.inbox | quote }} + AP_OUTBOX={{ .Values.pixelfed.activity_pub.outbox | quote }} # redis {{- with .Values.externalValkey.host }} diff --git a/charts/pixelfed/templates/deployment.yaml b/charts/pixelfed/templates/deployment.yaml index 2105b9f..d09e968 100644 --- a/charts/pixelfed/templates/deployment.yaml +++ b/charts/pixelfed/templates/deployment.yaml @@ -167,15 +167,15 @@ spec: # activity pub - name: ACTIVITY_PUB - value: "true" + value: {{ .Values.pixelfed.activity_pub.enabled | quote }} - name: AP_REMOTE_FOLLOW - value: "true" + value: {{ .Values.pixelfed.activity_pub.remote_follow | quote }} - name: AP_SHAREDINBOX - value: "true" + value: {{ .Values.pixelfed.activity_pub.sharedinbox | quote }} - name: AP_INBOX - value: "true" + value: {{ .Values.pixelfed.activity_pub.inbox | quote }} - name: AP_OUTBOX - value: "true" + value: {{ .Values.pixelfed.activity_pub.outbox | quote }} # redis {{- with .Values.externalValkey.host }} @@ -193,37 +193,84 @@ spec: # mail - name: MAIL_DRIVER - value: "smtp" + value: "{{ .Values.pixelfed.mail.driver }}" - name: MAIL_HOST - value: "smtp.mailgun.org" + valueFrom: + secretKeyRef: + {{- if .Values.pixelfed.mail.existingSecret }} + name: {{ .Values.pixelfed.mail.existingSecret }} + key: {{ .Values.pixelfed.mail.existingSecretKeys.host }} + {{- else }} + name: mail-secret + key: host + {{- end }} - name: MAIL_PORT - value: "587" + valueFrom: + secretKeyRef: + {{- if .Values.pixelfed.mail.existingSecret }} + name: {{ .Values.pixelfed.mail.existingSecret }} + key: {{ .Values.pixelfed.mail.existingSecretKeys.port }} + {{- else }} + name: mail-secret + key: port + {{- end }} - name: MAIL_FROM_ADDRESS - value: "__CHANGE_ME__" + value: "{{ .Values.pixelfed.mail.from_address }}" - name: MAIL_FROM_NAME - value: "${APP_NAME}" + value: "{{ .Values.pixelfed.mail.from_name }}" - name: MAIL_USERNAME - value: "" + valueFrom: + secretKeyRef: + {{- if .Values.pixelfed.mail.existingSecret }} + name: {{ .Values.pixelfed.mail.existingSecret }} + key: {{ .Values.pixelfed.mail.existingSecretKeys.username }} + {{- else }} + name: mail-secret + key: username + {{- end }} - name: MAIL_PASSWORD - value: "" + valueFrom: + secretKeyRef: + {{- if .Values.pixelfed.mail.existingSecret }} + name: {{ .Values.pixelfed.mail.existingSecret }} + key: {{ .Values.pixelfed.mail.existingSecretKeys.password }} + {{- else }} + name: mail-secret + key: password + {{- end }} - name: MAIL_ENCRYPTION - value: "tls" + value: "{{ .Values.pixelfed.mail.encryption }}" - # db + # database configuration - name: DB_CONNECTION - value: "pgsql" + value: {{ .Values.externalDatabase.connection }} - name: DB_HOST - value: "db" + valueFrom: + secretKeyRef: + name: {{ .Values.externalDatabase.existingSecret }} + key: {{ .Values.externalDatabase.existingSecretKeys.host }} - name: DB_USERNAME - value: "pixelfed" + valueFrom: + secretKeyRef: + name: {{ .Values.externalDatabase.existingSecret }} + key: {{ .Values.externalDatabase.existingSecretKeys.username }} - name: DB_PASSWORD - value: "" + valueFrom: + secretKeyRef: + name: {{ .Values.externalDatabase.existingSecret }} + key: {{ .Values.externalDatabase.existingSecretKeys.password }} - name: DB_DATABASE - value: "pixelfed_prod" + valueFrom: + secretKeyRef: + name: {{ .Values.externalDatabase.existingSecret }} + key: {{ .Values.externalDatabase.existingSecretKeys.database }} - name: DB_PORT - value: "3306" + valueFrom: + secretKeyRef: + name: {{ .Values.externalDatabase.existingSecret }} + key: {{ .Values.externalDatabase.existingSecretKeys.port }} - name: DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY - value: "false" + value: "{{ .Values.pixelfed.db_apply_new_migrations_automatically }}" livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} diff --git a/charts/pixelfed/values.yaml b/charts/pixelfed/values.yaml index e4232ce..1f5f99e 100644 --- a/charts/pixelfed/values.yaml +++ b/charts/pixelfed/values.yaml @@ -222,6 +222,9 @@ postgresql: fullnameOverride: "postgresql" pixelfed: + # -- Automatically run [artisan migrate --force] if new migrations are detected. + db_apply_new_migrations_automatically: false + # -- timezone for docker container timezone: "europe/amsterdam"