-
Notifications
You must be signed in to change notification settings - Fork 5
feat: skip opencloud init — inject all secrets as runtime ENV vars #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,7 +124,7 @@ spec: | |||||||||||||||||||||||||||||
| type: RuntimeDefault | ||||||||||||||||||||||||||||||
| imagePullPolicy: {{ include "opencloud.image.pullPolicy" (dict "pullPolicy" .Values.image.pullPolicy "global" .Values.global) }} | ||||||||||||||||||||||||||||||
| command: ["/bin/sh"] | ||||||||||||||||||||||||||||||
| args: ["-c", "opencloud init || true; opencloud server"] | ||||||||||||||||||||||||||||||
| args: ["-c", "mkdir -p /var/lib/opencloud/.opencloud/config && touch /var/lib/opencloud/.opencloud/config/banned-password-list.txt; opencloud server"] | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| args: ["-c", "mkdir -p /var/lib/opencloud/.opencloud/config && touch /var/lib/opencloud/.opencloud/config/banned-password-list.txt; opencloud server"] | |
| args: ["-c", "mkdir -p /var/lib/opencloud/.opencloud/config && if [ -f /etc/opencloud/banned-password-list.txt ]; then cp /etc/opencloud/banned-password-list.txt /var/lib/opencloud/.opencloud/config/banned-password-list.txt; else touch /var/lib/opencloud/.opencloud/config/banned-password-list.txt; fi; opencloud server"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bernardgut Is that okay?
Copilot
AI
Mar 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OC_ADMIN_USER_ID is defined twice when OIDC is enabled: earlier in this template it is explicitly set to an empty string under the OIDC block, but this new runtime-secrets section always injects it from the init Secret. Duplicate env var names are error-prone and the later entry will override the earlier one, potentially changing OIDC behavior. Consider only injecting OC_ADMIN_USER_ID when OIDC is disabled, or removing the earlier empty assignment if it’s no longer required.
| key: systemUserID | |
| - name: OC_ADMIN_USER_ID | |
| valueFrom: | |
| secretKeyRef: | |
| name: {{ $initSecretName }} | |
| key: adminUserID | |
| key: systemUserID | |
| {{- if not .Values.opencloud.oidc.enabled }} | |
| - name: OC_ADMIN_USER_ID | |
| valueFrom: | |
| secretKeyRef: | |
| name: {{ $initSecretName }} | |
| key: adminUserID | |
| {{- end }} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- if and .Values.opencloud.enabled (not .Values.opencloud.initSecrets.existingSecret) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- /* Stable init secrets — persisted across helm upgrades via lookup */ -}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- $secretName := printf "%s-init" (include "opencloud.opencloud.fullname" .) -}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
bernardgut marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind: Secret | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: {{ $secretName }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "helm.sh/resource-policy": "keep" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- include "opencloud.labels" . | nindent 4 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app.kubernetes.io/component: opencloud | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: Opaque | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- if $existingSecret }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jwtSecret: {{ index $existingSecret.data "jwtSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| machineAuthApiKey: {{ index $existingSecret.data "machineAuthApiKey" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| transferSecret: {{ index $existingSecret.data "transferSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| serviceAccountSecret: {{ index $existingSecret.data "serviceAccountSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idmServicePassword: {{ index $existingSecret.data "idmServicePassword" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idmRevaServicePassword: {{ index $existingSecret.data "idmRevaServicePassword" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| idmIdpServicePassword: {{ index $existingSecret.data "idmIdpServicePassword" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| collaborationWopiSecret: {{ index $existingSecret.data "collaborationWopiSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| systemUserApiKey: {{ index $existingSecret.data "systemUserApiKey" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| urlSigningSecret: {{ index $existingSecret.data "urlSigningSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| thumbnailsTransferSecret: {{ index $existingSecret.data "thumbnailsTransferSecret" | default (randAlphaNum 32 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| systemUserID: {{ index $existingSecret.data "systemUserID" | default (uuidv4 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| adminUserID: {{ index $existingSecret.data "adminUserID" | default (uuidv4 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| serviceAccountID: {{ index $existingSecret.data "serviceAccountID" | default (uuidv4 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| graphApplicationID: {{ index $existingSecret.data "graphApplicationID" | default (uuidv4 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| storageUsersMountID: {{ index $existingSecret.data "storageUsersMountID" | default (uuidv4 | b64enc) }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+32
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jwtSecret: {{ index $existingSecret.data "jwtSecret" | default (randAlphaNum 32 | b64enc) }} | |
| machineAuthApiKey: {{ index $existingSecret.data "machineAuthApiKey" | default (randAlphaNum 32 | b64enc) }} | |
| transferSecret: {{ index $existingSecret.data "transferSecret" | default (randAlphaNum 32 | b64enc) }} | |
| serviceAccountSecret: {{ index $existingSecret.data "serviceAccountSecret" | default (randAlphaNum 32 | b64enc) }} | |
| idmServicePassword: {{ index $existingSecret.data "idmServicePassword" | default (randAlphaNum 32 | b64enc) }} | |
| idmRevaServicePassword: {{ index $existingSecret.data "idmRevaServicePassword" | default (randAlphaNum 32 | b64enc) }} | |
| idmIdpServicePassword: {{ index $existingSecret.data "idmIdpServicePassword" | default (randAlphaNum 32 | b64enc) }} | |
| collaborationWopiSecret: {{ index $existingSecret.data "collaborationWopiSecret" | default (randAlphaNum 32 | b64enc) }} | |
| systemUserApiKey: {{ index $existingSecret.data "systemUserApiKey" | default (randAlphaNum 32 | b64enc) }} | |
| urlSigningSecret: {{ index $existingSecret.data "urlSigningSecret" | default (randAlphaNum 32 | b64enc) }} | |
| thumbnailsTransferSecret: {{ index $existingSecret.data "thumbnailsTransferSecret" | default (randAlphaNum 32 | b64enc) }} | |
| systemUserID: {{ index $existingSecret.data "systemUserID" | default (uuidv4 | b64enc) }} | |
| adminUserID: {{ index $existingSecret.data "adminUserID" | default (uuidv4 | b64enc) }} | |
| serviceAccountID: {{ index $existingSecret.data "serviceAccountID" | default (uuidv4 | b64enc) }} | |
| graphApplicationID: {{ index $existingSecret.data "graphApplicationID" | default (uuidv4 | b64enc) }} | |
| storageUsersMountID: {{ index $existingSecret.data "storageUsersMountID" | default (uuidv4 | b64enc) }} | |
| jwtSecret: {{ index $existingSecret.data "jwtSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| machineAuthApiKey: {{ index $existingSecret.data "machineAuthApiKey" | default (randAlphaNum 32 | b64enc) | quote }} | |
| transferSecret: {{ index $existingSecret.data "transferSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| serviceAccountSecret: {{ index $existingSecret.data "serviceAccountSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| idmServicePassword: {{ index $existingSecret.data "idmServicePassword" | default (randAlphaNum 32 | b64enc) | quote }} | |
| idmRevaServicePassword: {{ index $existingSecret.data "idmRevaServicePassword" | default (randAlphaNum 32 | b64enc) | quote }} | |
| idmIdpServicePassword: {{ index $existingSecret.data "idmIdpServicePassword" | default (randAlphaNum 32 | b64enc) | quote }} | |
| collaborationWopiSecret: {{ index $existingSecret.data "collaborationWopiSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| systemUserApiKey: {{ index $existingSecret.data "systemUserApiKey" | default (randAlphaNum 32 | b64enc) | quote }} | |
| urlSigningSecret: {{ index $existingSecret.data "urlSigningSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| thumbnailsTransferSecret: {{ index $existingSecret.data "thumbnailsTransferSecret" | default (randAlphaNum 32 | b64enc) | quote }} | |
| systemUserID: {{ index $existingSecret.data "systemUserID" | default (uuidv4 | b64enc) | quote }} | |
| adminUserID: {{ index $existingSecret.data "adminUserID" | default (uuidv4 | b64enc) | quote }} | |
| serviceAccountID: {{ index $existingSecret.data "serviceAccountID" | default (uuidv4 | b64enc) | quote }} | |
| graphApplicationID: {{ index $existingSecret.data "graphApplicationID" | default (uuidv4 | b64enc) | quote }} | |
| storageUsersMountID: {{ index $existingSecret.data "storageUsersMountID" | default (uuidv4 | b64enc) | quote }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bernardgut Is that okay?
Uh oh!
There was an error while loading. Please reload this page.