From 1eaba016440befa40b5e89f84443a3568389a4cf Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 2 Jan 2026 14:50:16 +0100 Subject: [PATCH] fix for immich db password --- apps/charts/immich/templates/db-config-job.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/charts/immich/templates/db-config-job.yaml b/apps/charts/immich/templates/db-config-job.yaml index d674358..5bde1b1 100644 --- a/apps/charts/immich/templates/db-config-job.yaml +++ b/apps/charts/immich/templates/db-config-job.yaml @@ -27,8 +27,10 @@ spec: curl -sSL "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o /tmp/kubectl && \ chmod +x /tmp/kubectl && mv /tmp/kubectl /usr/local/bin/kubectl - PASSWORD=$(cat /secrets/password) - # URL encode the password to handle special characters using Python + PASSWORD_B64=$(cat /secrets/password) + # Decode the password (secret is double base64-encoded, Kubernetes auto-decodes first level) + # Then URL encode the password to handle special characters using Python + PASSWORD=$(python3 -c "import base64; import sys; print(base64.b64decode(sys.stdin.read().strip()).decode('utf-8'))" <<< "$PASSWORD_B64") ENCODED_PASSWORD=$(python3 -c "import urllib.parse; import sys; print(urllib.parse.quote(sys.stdin.read().strip(), safe=''))" <<< "$PASSWORD") DB_URL="postgresql://immich:${ENCODED_PASSWORD}@{{ .Release.Name }}-postgres.{{ .Release.Namespace }}.svc.cluster.local:5432/immich" # Create or update the ConfigMap