Skip to content

Commit 3561738

Browse files
authored
fix: existing-secret support; breaking change: license.key is not lisenceKey (#301)
1 parent 31b903a commit 3561738

File tree

5 files changed

+74
-78
lines changed

5 files changed

+74
-78
lines changed

self-host/charts/capacitor-next/README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ helm upgrade -i capacitor-next oci://ghcr.io/gimlet-io/charts/capacitor-next \
2222
--version 2025-11.1 \
2323
--namespace flux-system \
2424
--create-namespace \
25-
--set license.key="your-license-key" \
25+
--set licenseKey="your-license-key" \
2626
--set session.hashKey="base64:$(openssl rand -base64 32)" \
2727
--set session.blockKey="base64:$(openssl rand -base64 32)"
2828
```
@@ -34,7 +34,7 @@ helm upgrade -i capacitor-next ./capacitor-next \
3434
--version 2025-11.1 \
3535
--namespace flux-system \
3636
--create-namespace \
37-
--set license.key="your-license-key" \
37+
--set licenseKey="your-license-key" \
3838
--set session.hashKey="base64:$(openssl rand -base64 32)" \
3939
--set session.blockKey="base64:$(openssl rand -base64 32)"
4040
```
@@ -46,12 +46,14 @@ helm upgrade -i capacitor-next ./capacitor-next \
4646
For local development or testing:
4747

4848
```yaml
49-
license:
50-
key: "contact laszlo@gimlet.io"
49+
licenseKey: "contact laszlo@gimlet.io"
5150

5251
auth:
5352
method: noauth
5453

54+
rbac:
55+
createBuiltinEditorRole: true
56+
5557
authorization:
5658
impersonateSaRules: "noauth=flux-system:capacitor-next-builtin-editor"
5759

@@ -71,8 +73,7 @@ clusters:
7173
### OIDC Authentication
7274
7375
```yaml
74-
license:
75-
key: "your-license-key"
76+
licenseKey: "contact laszlo@gimlet.io"
7677

7778
auth:
7879
method: oidc
@@ -83,7 +84,10 @@ auth:
8384
redirectUrl: "https://capacitor.example.com/auth/callback"
8485
authorizedEmails: "*@yourcompany.com"
8586

86-
authorization:
87+
rbac:
88+
createBuiltinEditorRole: true
89+
90+
authorization: # if you don't have RBAC role defined and need a catch-all
8791
impersonateSaRules: "*@yourcompany.com=flux-system:capacitor-next-builtin-editor"
8892

8993
session:
@@ -107,15 +111,17 @@ ingress:
107111
### Static User Authentication
108112
109113
```yaml
110-
license:
111-
key: "your-license-key"
114+
licenseKey: "contact laszlo@gimlet.io"
112115

113116
auth:
114117
method: static
115118
static:
116119
# Generate with: htpasswd -bnBC 12 x 'mypassword' | cut -d: -f2
117120
users: "admin@example.com:$2y$12$..."
118121

122+
rbac:
123+
createBuiltinEditorRole: true
124+
119125
authorization:
120126
impersonateSaRules: "admin@example.com=flux-system:capacitor-next-builtin-editor"
121127

@@ -154,7 +160,7 @@ You can use an existing Kubernetes secret in addition to the built-in secret cre
154160
- Overriding specific environment variables from the built-in secret
155161
- Adding additional environment variables not managed by the chart
156162
157-
When `existingSecret.name` is specified, both secrets are loaded via `envFrom`. The existing secret is loaded first, allowing it to override values from the built-in secret if they share the same keys.
163+
When `existingSecret.name` is specified, both secrets are loaded via `envFrom`. The existing secret is loaded last, allowing it to override values from the built-in secret if they share the same keys.
158164

159165
**Example: Using External Secrets Operator**
160166

@@ -165,8 +171,7 @@ existingSecret:
165171
name: capacitor-secrets-from-external-secrets-operator
166172
167173
# All other configuration remains the same
168-
license:
169-
key: "your-license-key"
174+
licenseKey: "your-license-key"
170175
auth:
171176
method: oidc
172177
# ... rest of config
@@ -201,10 +206,10 @@ See [values.yaml](./values.yaml) for all available configuration options.
201206
| `image.repository` | Container image repository | `ghcr.io/gimlet-io/capacitor-next` |
202207
| `image.tag` | Container image tag | `v2025-10.1` |
203208
| `replicaCount` | Number of replicas | `1` |
204-
| `license.key` | License key (required) | `""` |
209+
| `licenseKey` | License key | `""` |
205210
| `auth.method` | Authentication method: `oidc`, `noauth`, `static` | `noauth` |
206-
| `session.hashKey` | Session hash key (required) | `""` |
207-
| `session.blockKey` | Session block key (required) | `""` |
211+
| `session.hashKey` | Session hash key | `""` |
212+
| `session.blockKey` | Session block key | `""` |
208213
| `existingSecret.name` | Name of existing secret to use in addition to built-in secret | `""` |
209214
| `ingress.enabled` | Enable ingress | `false` |
210215
| `rbac.create` | Create RBAC resources | `true` |

self-host/charts/capacitor-next/templates/NOTES.txt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,4 @@ Get the application URL by running these commands:
3737
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
3838
{{- end }}
3939

40-
{{- if not .Values.license.key }}
41-
42-
⚠️ WARNING: No license key has been configured!
43-
Please set .Values.license.key or contact laszlo@gimlet.io to obtain a license.
44-
{{- end }}
45-
46-
{{- if not .Values.session.hashKey }}
47-
48-
⚠️ WARNING: No session hash key has been configured!
49-
Please generate one with: openssl rand -base64 32
50-
And set both .Values.session.hashKey and .Values.session.blockKey
51-
{{- end }}
52-
53-
Authentication Method: {{ .Values.auth.method }}
54-
55-
{{- if eq .Values.auth.method "noauth" }}
56-
🔓 Running in no-auth mode. This is suitable for local development only.
57-
{{- else if eq .Values.auth.method "oidc" }}
58-
🔐 OIDC authentication is enabled.
59-
Issuer: {{ .Values.auth.oidc.issuer }}
60-
{{- else if eq .Values.auth.method "static" }}
61-
🔑 Static user authentication is enabled.
62-
{{- end }}
63-
6440
For more information, visit: https://github.com/gimlet-io/capacitor
65-

self-host/charts/capacitor-next/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ spec:
4848
resources:
4949
{{- toYaml .Values.resources | nindent 12 }}
5050
envFrom:
51+
- secretRef:
52+
name: {{ include "capacitor-server.fullname" . }}
5153
{{- if .Values.existingSecret.name }}
5254
- secretRef:
5355
name: {{ .Values.existingSecret.name }}
5456
{{- end }}
55-
- secretRef:
56-
name: {{ include "capacitor-server.fullname" . }}
5757
volumeMounts:
5858
- name: registry
5959
mountPath: /app/backend/registry.yaml

self-host/charts/capacitor-next/templates/secret.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@ metadata:
77
{{- include "capacitor-server.labels" . | nindent 4 }}
88
type: Opaque
99
stringData:
10-
LICENSE_KEY: {{ .Values.license.key | quote }}
10+
{{- if .Values.licenseKey }}
11+
LICENSE_KEY: {{ .Values.licenseKey | quote }}
12+
{{- end }}
13+
{{- if .Values.auth }}
14+
{{- if .Values.auth.method }}
1115
AUTH: {{ .Values.auth.method | quote }}
16+
{{- end }}
1217
{{- if eq .Values.auth.method "oidc" }}
18+
{{- if .Values.auth.oidc.issuer }}
1319
OIDC_ISSUER: {{ .Values.auth.oidc.issuer | quote }}
20+
{{- end }}
21+
{{- if .Values.auth.oidc.clientId }}
1422
OIDC_CLIENT_ID: {{ .Values.auth.oidc.clientId | quote }}
23+
{{- end }}
24+
{{- if .Values.auth.oidc.clientSecret }}
1525
OIDC_CLIENT_SECRET: {{ .Values.auth.oidc.clientSecret | quote }}
26+
{{- end }}
27+
{{- if .Values.auth.oidc.redirectUrl }}
1628
OIDC_REDIRECT_URL: {{ .Values.auth.oidc.redirectUrl | quote }}
29+
{{- end }}
1730
{{- if .Values.auth.oidc.insecureSkipTlsVerify }}
1831
OIDC_INSECURE_SKIP_TLS_VERIFY: "true"
1932
{{- end }}
@@ -30,20 +43,29 @@ stringData:
3043
ENTRA_ID_FEDEREATED_TOKEN_AUTH: "true"
3144
{{- end }}
3245
{{- else if eq .Values.auth.method "static" }}
46+
{{- if .Values.auth.static }}
47+
{{- if .Values.auth.static.users }}
3348
USERS: {{ .Values.auth.static.users | quote }}
3449
{{- end }}
35-
{{- if .Values.auth.oidc.debug }}
50+
{{- end }}
51+
{{- end }}
52+
{{- if .Values.auth.debug }}
3653
OIDC_DEBUG: "true"
3754
{{- end }}
55+
{{- end }}
56+
{{- if .Values.authorization }}
3857
{{- if .Values.authorization.impersonateSaRules }}
3958
IMPERSONATE_SA_RULES: {{ .Values.authorization.impersonateSaRules | quote }}
4059
{{- end }}
60+
{{- end }}
61+
{{- if .Values.session }}
4162
{{- if .Values.session.hashKey }}
4263
SESSION_HASH_KEY: {{ .Values.session.hashKey | quote }}
4364
{{- end }}
4465
{{- if .Values.session.blockKey }}
4566
SESSION_BLOCK_KEY: {{ .Values.session.blockKey | quote }}
4667
{{- end }}
68+
{{- end }}
4769
registry.yaml: |
4870
clusters:
4971
{{- range .Values.clusters }}
@@ -65,4 +87,3 @@ stringData:
6587
{{- end }}
6688
{{- end }}
6789
{{- end }}
68-

self-host/charts/capacitor-next/values.yaml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,52 +52,47 @@ azureWorkloadIdentity:
5252
rbac:
5353
create: true
5454
createImpersonatorRole: true
55-
createBuiltinEditorRole: true
56-
57-
# License configuration
58-
license:
59-
key: "" # Required: Contact laszlo@gimlet.io for a license key
6055

6156
# Authentication configuration
62-
auth:
57+
# auth:
6358
# Authentication method: oidc, noauth, or static
64-
method: noauth
59+
# method: noauth
60+
# debug: false
6561

6662
# OIDC configuration (used when auth.method=oidc)
67-
oidc:
68-
issuer: ""
69-
clientId: ""
70-
clientSecret: ""
71-
redirectUrl: ""
72-
insecureSkipTlsVerify: false
73-
scopes: "openid,profile,email"
74-
groupsClaim: "groups"
75-
authorizedEmails: ""
76-
# Azure Entra ID specific
77-
entraIdFederatedTokenAuth: false
78-
# Debug flag: when set to true, logs impersonation headers for namespace listing (useful for OIDC debugging)
79-
debug: false
63+
# oidc:
64+
# issuer: ""
65+
# clientId: ""
66+
# clientSecret: ""
67+
# redirectUrl: ""
68+
# insecureSkipTlsVerify: false
69+
# scopes: "openid,profile,email"
70+
# groupsClaim: "groups"
71+
# authorizedEmails: ""
72+
# # Azure Entra ID specific
73+
# entraIdFederatedTokenAuth: false
74+
# # Debug flag: when set to true, logs impersonation headers for namespace listing (useful for OIDC debugging)
8075

8176
# Static user configuration (used when auth.method=static)
82-
static:
77+
# static:
8378
# Format: "email:bcrypt_password[,email2:bcrypt_password]"
8479
# Generate password with: htpasswd -bnBC 12 x 'mypassword' | cut -d: -f2
85-
users: ""
80+
# users: ""
8681

8782
# Authorization configuration
88-
authorization:
89-
# Impersonation rules to map users to service accounts
90-
# Format: "user=namespace:serviceaccount[,user2=namespace:serviceaccount]"
91-
# Example: "noauth=flux-system:capacitor-next-builtin-editor"
92-
# Wildcards supported: "*@company.com=flux-system:capacitor-next-builtin-editor"
93-
impersonateSaRules: "noauth=flux-system:capacitor-next-builtin-editor"
83+
# authorization:
84+
# # Impersonation rules to map users to service accounts
85+
# # Format: "user=namespace:serviceaccount[,user2=namespace:serviceaccount]"
86+
# # Example: "noauth=flux-system:capacitor-next-builtin-editor"
87+
# # Wildcards supported: "*@company.com=flux-system:capacitor-next-builtin-editor"
88+
# impersonateSaRules: "noauth=flux-system:capacitor-next-builtin-editor"
9489

9590
# Session configuration
96-
session:
97-
# Base64 encoded session keys
98-
# Generate with: openssl rand -base64 32
99-
hashKey: "" # Required
100-
blockKey: "" # Required
91+
# session:
92+
# # Base64 encoded session keys
93+
# # Generate with: openssl rand -base64 32
94+
# hashKey: "" # Required
95+
# blockKey: "" # Required
10196

10297
# Cluster registry configuration
10398
clusters:

0 commit comments

Comments
 (0)