Skip to content

Commit 47c18f6

Browse files
authored
feat: wire Zoho and Google OAuth + grant CNPG app role superuser privileges
## Changes - Wire Zoho OAuth env vars (`ZOHO_OAUTH_CLIENT_ID`, `ZOHO_OAUTH_CLIENT_SECRET`) — guarded by `oauth.zohoClientIdKey` - Wire Google OAuth env vars (`GOOGLE_OAUTH_CLIENT_ID`, `GOOGLE_OAUTH_CLIENT_SECRET`) — guarded by `oauth.googleClientIdKey` - Guard GitHub OAuth injection on non-empty `githubClientIdKey` (allows Zoho/Google-only deployments) - Add `postInitApplicationSQL` to CNPG Cluster to grant `SUPERUSER CREATEROLE CREATEDB REPLICATION` to the app role, required for remote server migrations that manage `electric_sync` role ## Usage Set `oauth.name`, `oauth.zohoClientIdKey`/`oauth.zohoClientSecretKey` (and/or `googleClientIdKey`/`googleClientSecretKey`) in your values to enable the respective OAuth provider.
1 parent 621b89d commit 47c18f6

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

helm/vibe-kanban-team/templates/_helpers.tpl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ Trimmed to 59 chars so CNPG-generated suffixes (-app, -rw, -superuser) stay with
259259
{{- end }}
260260
{{- $oauth := .Values.config.existingSecrets.oauth -}}
261261
{{- if $oauth.name }}
262+
{{- if $oauth.githubClientIdKey }}
262263
- name: GITHUB_OAUTH_CLIENT_ID
263264
valueFrom:
264265
secretKeyRef:
@@ -270,6 +271,31 @@ Trimmed to 59 chars so CNPG-generated suffixes (-app, -rw, -superuser) stay with
270271
name: {{ $oauth.name }}
271272
key: {{ $oauth.githubClientSecretKey }}
272273
{{- end }}
274+
{{- if $oauth.googleClientIdKey }}
275+
- name: GOOGLE_OAUTH_CLIENT_ID
276+
valueFrom:
277+
secretKeyRef:
278+
name: {{ $oauth.name }}
279+
key: {{ $oauth.googleClientIdKey }}
280+
- name: GOOGLE_OAUTH_CLIENT_SECRET
281+
valueFrom:
282+
secretKeyRef:
283+
name: {{ $oauth.name }}
284+
key: {{ $oauth.googleClientSecretKey }}
285+
{{- end }}
286+
{{- if $oauth.zohoClientIdKey }}
287+
- name: ZOHO_OAUTH_CLIENT_ID
288+
valueFrom:
289+
secretKeyRef:
290+
name: {{ $oauth.name }}
291+
key: {{ $oauth.zohoClientIdKey }}
292+
- name: ZOHO_OAUTH_CLIENT_SECRET
293+
valueFrom:
294+
secretKeyRef:
295+
name: {{ $oauth.name }}
296+
key: {{ $oauth.zohoClientSecretKey }}
297+
{{- end }}
298+
{{- end }}
273299
{{- end }}
274300

275301
{{- define "vibe-kanban-team.relay.structuredEnv" -}}

helm/vibe-kanban-team/templates/postgresql-cluster.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- if .Values.postgres.enabled }}
2+
{{- $dbName := .Values.postgres.database | default "vibe_kanban" }}
23
apiVersion: postgresql.cnpg.io/v1
34
kind: Cluster
45
metadata:
@@ -18,8 +19,12 @@ spec:
1819
wal_level: "logical"
1920
bootstrap:
2021
initdb:
21-
database: {{ .Values.postgres.database | default "vibe_kanban" }}
22-
owner: {{ .Values.postgres.database | default "vibe_kanban" }}
22+
database: {{ $dbName }}
23+
owner: {{ $dbName }}
24+
postInitApplicationSQL:
25+
# Grant the app role full privileges so remote can manage roles/passwords
26+
# during migrations (including electric_sync role creation).
27+
- {{ printf "ALTER ROLE %s WITH SUPERUSER CREATEROLE CREATEDB REPLICATION;" $dbName | quote }}
2328
managed:
2429
roles:
2530
- name: electric_sync

helm/vibe-kanban-team/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ config:
130130
name: ""
131131
githubClientIdKey: github-client-id
132132
githubClientSecretKey: github-client-secret
133+
# Google OAuth — set googleClientIdKey to activate (leave empty to disable)
134+
googleClientIdKey: ""
135+
googleClientSecretKey: google-client-secret
136+
# Zoho OAuth — set zohoClientIdKey to activate (leave empty to disable)
137+
zohoClientIdKey: ""
138+
zohoClientSecretKey: zoho-client-secret
139+
# Optional: override Zoho accounts URL (e.g. https://accounts.zoho.eu)
140+
# Set via extraEnv: [{name: ZOHO_ACCOUNTS_URL, value: "..."}]
133141

134142
# =============================================================================
135143
# Environment Variables

vibe-kanban

Submodule vibe-kanban updated 556 files

0 commit comments

Comments
 (0)