Skip to content
Draft
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
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ Docker Compose provides the full local development stack. All services include h
| Postgres | `postgres:17-alpine` | 5432 | Primary event store — events, channels, tokens, workflows, audit; full-text search (`search_tsv` GIN) |
| Redis | `redis:7-alpine` | 6379 | Pub/sub fan-out, presence (SET EX), typing (sorted sets) |
| Adminer | `adminer` | 8082 | DB web UI (dev only) |
| MinIO | `cgr.dev/chainguard/minio` (dev/CI) | 9000 (API), 9001 (console) | S3-compatible object storage (media) |
| MinIO | `cgr.dev/chainguard/minio:latest-dev` (digest-pinned in `deploy/compose` and the chart quickstart; dev and CI compose files track `latest-dev`) | 9000 (API), 9001 (console) | S3-compatible object storage (media) |
| Prometheus | `prom/prometheus` | 9090 | Metrics collection |

### Postgres Schema (key tables)
Expand Down
38 changes: 38 additions & 0 deletions deploy/charts/buzz/templates/quickstart-minio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,44 @@ spec:
{{- include "buzz.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: minio
spec:
{{- with .Values.minio.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.minio.fixDataOwnership }}
initContainers:
# Volumes written by the old root-run minio/minio image are root-owned,
# and fsGroup does not fix hostPath-backed PVCs. Hand them over to the
# nonroot uid. The walk is skipped once nothing is left to change, so a
# reschedule costs one find; files that vanish mid-walk are tolerated
# and only ownership still wrong afterwards fails the pod.
- name: data-ownership
image: {{ .Values.minio.image | quote }}
command:
- /bin/sh
- -c
- |
# Vanished entries ("No such file") are expected while MinIO serves;
# any other find error means /data could not be checked.
scan() {
out="$(find /data -xdev ! -user 65532 -print -quit 2>&1)"
bad="$(printf '%s\n' "$out" | grep '^find: ' | grep -v 'No such file or directory')"
[ -z "$bad" ] || { echo "data-ownership: cannot scan /data: $bad" >&2; exit 1; }
printf '%s\n' "$out" | grep '^/' | head -n 1
}
first="$(scan)" || exit 1
[ -z "$first" ] && exit 0
chown -Rh 65532:65532 /data || true
left="$(scan)" || exit 1
[ -z "$left" ] && exit 0
echo "data-ownership: $left is not owned by 65532 (set minio.fixDataOwnership=false if the storage rejects root chown)" >&2
exit 1
securityContext:
runAsUser: 0
runAsNonRoot: false
volumeMounts:
- { name: data, mountPath: /data }
{{- end }}
containers:
- name: minio
image: {{ .Values.minio.image | quote }}
Expand Down
47 changes: 47 additions & 0 deletions deploy/charts/buzz/tests/quickstart_bundled_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,50 @@ tests:
path: spec.selector["app.kubernetes.io/component"]
value: relay
template: templates/service.yaml

# The Chainguard image runs as uid 65532; volumes from the old root-run
# minio/minio image need a root ownership hand-over, which some storage
# (NFS root_squash) and namespaces (PSA restricted) refuse.
- it: hands a root-owned MinIO volume to uid 65532 by default
release:
name: rel
set:
relayUrl: wss://buzz.example.com
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
postgresql.enabled: true
redis.enabled: true
minio.enabled: true
template: templates/quickstart-minio.yaml
documentIndex: 0
asserts:
- equal:
path: spec.template.spec.securityContext
value: { fsGroup: 65532, fsGroupChangePolicy: OnRootMismatch }
- equal:
path: spec.template.spec.initContainers[0].name
value: data-ownership
- equal:
path: spec.template.spec.initContainers[0].securityContext.runAsUser
value: 0
- matchRegex:
path: spec.template.spec.initContainers[0].command[2]
pattern: "chown -Rh 65532:65532 /data"

- it: drops the root init container when minio.fixDataOwnership=false
release:
name: rel
set:
relayUrl: wss://buzz.example.com
ownerPubkey: "0000000000000000000000000000000000000000000000000000000000000000"
postgresql.enabled: true
redis.enabled: true
minio.enabled: true
minio.fixDataOwnership: false
minio.podSecurityContext: null
template: templates/quickstart-minio.yaml
documentIndex: 0
asserts:
- notExists:
path: spec.template.spec.initContainers
- notExists:
path: spec.template.spec.securityContext
2 changes: 2 additions & 0 deletions deploy/charts/buzz/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@
"enabled": { "type": "boolean" },
"image": { "type": "string", "minLength": 1 },
"mcImage": { "type": "string", "minLength": 1 },
"fixDataOwnership": { "type": "boolean" },
"podSecurityContext": { "type": ["object", "null"] },
"persistence": {
"type": "object",
"additionalProperties": false,
Expand Down
22 changes: 20 additions & 2 deletions deploy/charts/buzz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,26 @@ s3:
# this disabled and use s3.* (or secrets.existingSecret) against managed S3.
minio:
enabled: false # quickstart: set true for bundled in-cluster MinIO
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
mcImage: minio/mc:RELEASE.2025-08-13T08-35-41Z
# minio/minio and minio/mc left Docker Hub and Quay. Chainguard's free images
# (latest tags only) are pinned by digest; -dev variants carry the /bin/sh the
# init job needs. They run as uid 65532 (see quickstart-minio fsGroup).
# These digests were minio RELEASE.2026-09-22T19-25-18Z (the old pin was
# RELEASE.2025-09-07T16-13-09Z); check `minio --version` when bumping them.
image: cgr.dev/chainguard/minio:latest-dev@sha256:1f74aba71eff94011dbcb62947354f19d6e6efda5facd023fa3f4560d2a088d4
mcImage: cgr.dev/chainguard/minio-client:latest-dev@sha256:2d11d09801b035510cb0c2ff0c64aa016fc94f0c4e7055a31ec17cf41dd154cb
# Root initContainer that hands a root-owned volume (written by the old
# minio/minio image) to uid 65532 before MinIO starts; it skips the chown
# (not the ownership scan) once ownership is right. Set false when the storage
# rejects root chown (NFS root_squash) or the namespace forbids root init
# containers; the volume must then already be writable by uid 65532. This
# quickstart sets no container securityContext, so false alone does not make
# it pass PSA restricted or OpenShift restricted-v2.
fixDataOwnership: true
# Pod securityContext for MinIO. OpenShift restricted-v2 assigns its own
# fsGroup range: set this to null there ({} merges with the defaults).
podSecurityContext:
fsGroup: 65532
fsGroupChangePolicy: OnRootMismatch
persistence:
enabled: true
size: 10Gi
Expand Down
21 changes: 21 additions & 0 deletions deploy/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ keypair.

Run `./run.sh backup-hint` for the backup checklist.

### Moving off the Docker Hub MinIO image

`minio/minio` and `minio/mc` are gone from Docker Hub. The stack now runs
Chainguard's MinIO (uid 65532, a newer MinIO release, so the on-disk format may
change one way). The `minio-perms` step hands an old root-owned `buzz-minio-data`
volume to uid 65532, but it must not run while the old root-run container is
still writing. Move over once, in this order:

```bash
cd deploy/compose
docker compose stop relay minio # quiesce writers first
docker run --rm -v buzz-prod_buzz-minio-data:/data -v /var/backups:/backup alpine \
tar czf /backup/minio-data-$(date +%F).tgz -C /data . # back up the volume
./run.sh pull
./run.sh start # runs minio-perms, then minio, then relay
```

Check the volume name with `docker volume ls | grep minio` (the project name is
`buzz-prod`). To roll the data back, restore the archive into the volume; the old
image is no longer pullable, so keep any local copy of it on the host.

## Validation

Before sharing an install link publicly, verify a fresh install with:
Expand Down
48 changes: 45 additions & 3 deletions deploy/compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,58 @@ services:
networks:
- buzz-net

# The Chainguard MinIO image runs as uid 65532; volumes written by the old
# root-run minio/minio image are root-owned. Hand them over before start.
# `up` reruns this while MinIO may be serving, so the walk is skipped once
# nothing is left to change, files that vanish mid-walk are tolerated, and
# only ownership still wrong afterwards fails the step.
# First move off the old root-run image: stop relay and minio BEFORE `up`
# (see README, "Moving off the Docker Hub MinIO image"), or the old container
# can write root-owned files after this step has finished.
minio-perms:
image: cgr.dev/chainguard/minio:latest-dev@sha256:1f74aba71eff94011dbcb62947354f19d6e6efda5facd023fa3f4560d2a088d4
user: "0:0"
entrypoint:
- /bin/sh
- -c
- |
# Vanished entries ("No such file") are expected while MinIO serves;
# any other find error means /data could not be checked.
scan() {
out="$$(find /data -xdev ! -user 65532 -print -quit 2>&1)"
bad="$$(printf '%s\n' "$$out" | grep '^find: ' | grep -v 'No such file or directory')"
[ -z "$$bad" ] || { echo "minio-perms: cannot scan /data: $$bad" >&2; exit 1; }
printf '%s\n' "$$out" | grep '^/' | head -n 1
}
first="$$(scan)" || exit 1
[ -z "$$first" ] && exit 0
chown -Rh 65532:65532 /data || true
left="$$(scan)" || exit 1
[ -z "$$left" ] && exit 0
echo "minio-perms: $$left is not owned by 65532" >&2
exit 1
volumes:
- buzz-minio-data:/data
network_mode: none
labels:
com.buzz.role: minio-ownership-migration
restart: "no"

minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
# minio/minio left Docker Hub; -dev adds sh and wget. This digest is minio
# RELEASE.2026-09-22T19-25-18Z (the old pin was RELEASE.2025-09-07T16-13-09Z).
image: cgr.dev/chainguard/minio:latest-dev@sha256:1f74aba71eff94011dbcb62947354f19d6e6efda5facd023fa3f4560d2a088d4
command: server /data --console-address ":9001"
depends_on:
minio-perms:
condition: service_completed_successfully
environment:
MINIO_ROOT_USER: ${BUZZ_S3_ACCESS_KEY:?set BUZZ_S3_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${BUZZ_S3_SECRET_KEY:?set BUZZ_S3_SECRET_KEY}
volumes:
- buzz-minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/live"]
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 12
Expand All @@ -103,7 +145,7 @@ services:
- buzz-net

minio-init:
image: minio/mc:RELEASE.2025-08-13T08-35-41Z
image: cgr.dev/chainguard/minio-client:latest-dev@sha256:2d11d09801b035510cb0c2ff0c64aa016fc94f0c4e7055a31ec17cf41dd154cb
depends_on:
minio:
condition: service_healthy
Expand Down
17 changes: 17 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"recreateWhen": "always",
"separateMinorPatch": true,
"postUpdateOptions": ["cargo:updateLockfile"],
"customManagers": [
{
"description": "Renovate's helm-values manager only reads keys named image; minio.mcImage needs its own rule so its digest is refreshed with the minio image.",
"customType": "regex",
"managerFilePatterns": ["/^deploy/charts/buzz/values\\.yaml$/"],
"matchStrings": ["mcImage: (?<depName>[^:\\s]+):(?<currentValue>[^@\\s]+)@(?<currentDigest>sha256:[a-f0-9]{64})"],
"datasourceTemplate": "docker"
}
],
"packageRules": [
{
"description": "Major version bumps often require code changes — require human review.",
Expand Down Expand Up @@ -46,6 +55,14 @@
"matchManagers": ["cargo"],
"allowedVersions": "<1.2.0"
},
{
"description": "MinIO runs from Chainguard's free latest-dev tags pinned by digest; superseded digests are not retained, so refresh them weekly. A digest bump can carry a new MinIO release with a one-way on-disk migration: never automerge. Digests carry no release timestamp, so the global timestamp-required release-age gate is lifted here.",
"matchPackageNames": ["cgr.dev/chainguard/**"],
"groupName": "chainguard minio images",
"schedule": ["before 6am on monday"],
"minimumReleaseAge": null,
"automerge": false
},
{
"description": "tiptap 3.23.x breaks editor lifecycle under real relay latency — pin until upstream stabilizes.",
"matchPackageNames": ["@tiptap/{/,}**"],
Expand Down
Loading