Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,41 @@ Rules:
template against this contract (run it before committing; it is also the
tool that performed the catalog-wide rewrite).

## Generated secrets (`{{KUBERO_GEN_*}}`)

kubero-server replaces these tokens once, when the app is created. It
replaces them in `envVars` and in the add-ons' `resourceDefinitions`, and the
values are never regenerated afterwards:

| Token | Value |
|---|---|
| `{{KUBERO_GEN_ALNUM:N}}` | N random letters/digits |
| `{{KUBERO_GEN_HEX:N}}` | N random hex chars (e.g. a 64-hex `ENCRYPTION_KEY`) |
| `{{KUBERO_GEN_SHARED:KEY:ALNUM\|HEX:N}}` | one value per `KEY` across the app's env **and** its add-on CRs |
| `{{KUBERO_GEN_BCRYPT_SALT}}`, `{{KUBERO_GEN_X25519_SK}}` / `_PK}}` | bcrypt salt, matched x25519 keypair |

- Never put a literal password in an add-on CR or in `envVars`. A CNPG
superuser/app Secret takes `'{{KUBERO_GEN_ALNUM:32}}'`; the app reads it
through the injected `$(PGPASSWORD)`.
- When the add-on CR and the app env must hold the **same** secret (for
example ClickHouse keeps its users inline in the CR), use
`KUBERO_GEN_SHARED` with the same `KEY` in both places. The first
occurrence sets the value:

```yaml
admin/password: '{{KUBERO_GEN_SHARED:CLICKHOUSE_PASSWORD:ALNUM:32}}' # CR
- name: CLICKHOUSE_PASSWORD
value: '{{KUBERO_GEN_SHARED:CLICKHOUSE_PASSWORD:ALNUM:32}}' # env
```

- Across a template group (primary + `templateServices`), an env var with
the same **name** gets one value for every GEN kind, so a companion that
repeats `NAME: '{{KUBERO_GEN_HEX:64}}'` gets the primary's value. API/CLI
creates opt in with the same `genGroup` on each app.
- The server derives ClickHouse `CLICKHOUSE_USER` / `CLICKHOUSE_PASSWORD`
from the CR. At create time, those injected credentials win over a literal
the template sets (kubero-server#1668).

## Email contract (Email add-on)

Apps that send mail get it from the platform's **Email add-on** (kind `Smtp`):
Expand Down
4 changes: 2 additions & 2 deletions services/affine/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: afffine
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -74,7 +74,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: affine
password: afffine
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/airflow/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: airflow
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -80,7 +80,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: airflow
password: airflow
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: AIRFLOW__CORE__EXECUTOR
value: LocalExecutor
Expand Down
4 changes: 2 additions & 2 deletions services/anythingllm/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: anythingllm
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -80,7 +80,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: anythingllm
password: anythingllm
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: STORAGE_DIR
value: /app/server/storage
Expand Down
4 changes: 2 additions & 2 deletions services/atuin/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: atuin
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -80,7 +80,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: atuin
password: atuin
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: ATUIN_HOST
value: 0.0.0.0
Expand Down
4 changes: 2 additions & 2 deletions services/authelia/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: authelia
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -92,7 +92,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: authelia
password: authelia
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/authentik/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: authentik
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -79,7 +79,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: authentik
password: authentik
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/authorizer/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: authorizer
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: authorizer
password: authorizer
password: '{{KUBERO_GEN_ALNUM:32}}'
cronjobs: []
deploymentstrategy: docker
envVars:
Expand Down
4 changes: 2 additions & 2 deletions services/automatisch/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: automatisch
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -84,7 +84,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: automatisch
password: automatisch
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/azzimut/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: azimutt
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -76,7 +76,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: azimutt
password: azimutt
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: PHX_SERVER
value: 'true'
Expand Down
4 changes: 2 additions & 2 deletions services/baserow/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: baserow
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -80,7 +80,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: baserow
password: baserow
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/btcpay/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: btcpay
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -94,7 +94,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: btcpay
password: btcpay
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: DOTNET_USE_POLLING_FILE_WATCHER
value: '1'
Expand Down
4 changes: 2 additions & 2 deletions services/calcom/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: calcom
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -70,7 +70,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: calcom
password: calcom
password: '{{KUBERO_GEN_ALNUM:32}}'
# Platform email (see README "Email contract"). Cal.com nodemailer SMTP.
- displayName: Email
icon: /img/addons/email.svg
Expand Down
4 changes: 2 additions & 2 deletions services/chatwoot/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: chatwoot
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -80,7 +80,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: chatwoot
password: chatwoot
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
4 changes: 2 additions & 2 deletions services/chiefonboarding/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: chiefonboarding
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -82,7 +82,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: chiefonboarding
password: chiefonboarding
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: SECRET_KEY
value: replace-with-openssl-rand-hex-32
Expand Down
4 changes: 2 additions & 2 deletions services/claper/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: claper
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -107,7 +107,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: claper
password: claper
password: '{{KUBERO_GEN_ALNUM:32}}'
web:
replicaCount: 1
worker:
Expand Down
4 changes: 2 additions & 2 deletions services/convex/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: convex
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -92,7 +92,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: convex
password: convex
password: '{{KUBERO_GEN_ALNUM:32}}'
envVars:
- name: INSTANCE_NAME
value: convex
Expand Down
4 changes: 2 additions & 2 deletions services/corteza/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: corteza
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -83,7 +83,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: corteza
password: corteza
password: '{{KUBERO_GEN_ALNUM:32}}'
web:
replicaCount: 1
worker:
Expand Down
4 changes: 2 additions & 2 deletions services/directus/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: postgres
password: directus
password: '{{KUBERO_GEN_ALNUM:32}}'
appUserSecret:
apiVersion: v1
kind: Secret
Expand All @@ -128,7 +128,7 @@ spec:
type: kubernetes.io/basic-auth
stringData:
username: directus
password: directus
password: '{{KUBERO_GEN_ALNUM:32}}'
- displayName: Valkey
env: []
icon: /img/addons/redis.svg
Expand Down
Loading