Skip to content

Commit 07277f4

Browse files
chore(oss-prep): replace dev-default secrets with CHANGE_ME, parametrize MONGO_ADMIN_URI (#18)
Per /tmp/oss-plan-2026-05-21/OSS-01-secrets-audit.md + OSS-05-infra-split.md: - k8s/secrets.yaml: PLATFORM_DB_PASSWORD + CUSTOMER_DB_PASSWORD + MINIO_ROOT_USER + MINIO_ROOT_PASSWORD → CHANGE_ME (were 'instant'/'instant_cust'/'minioadmin'/'minioadmin123' — local-dev convenience defaults that operators MUST replace) - k8s/data/minio-secret.yaml: same MinIO defaults → CHANGE_ME, comment notes self-hosted MinIO is retired - k8s/provisioner/deployment.yaml: MONGO_ADMIN_URI inline value 'mongodb://root:root@...' → secretKeyRef pointing at mongodb-admin Secret (matches the pattern every other credential already uses) - k8s/data/mongodb.yaml: append mongodb-admin Secret stub (with CHANGE_ME placeholder) so the secretKeyRef has a target This unlocks the infra repo for OSS publication. Note: git history still contains the dev-default values — operator should run `git filter-repo` before publishing if history-clean is required. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d8b2505 commit 07277f4

5 files changed

Lines changed: 46 additions & 9 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules/
22
k8s/secrets.local.yaml
3+
4+
# Internal Claude Code skills
5+
.claude/

k8s/data/minio-secret.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# MinIO root credentials — local dev only.
1+
# MinIO root credentials — legacy local-dev path (in-cluster MinIO retired
2+
# 2026-05-20). Operators MUST replace placeholders before applying. Local-dev
3+
# convenience values were here historically; OSS publication requires
4+
# placeholders so a fresh clone cannot accidentally come up with the same
5+
# credentials as every other clone.
26
# Apply: kubectl apply -f data/minio-secret.yaml
37
# The API pod reads these same values from instant-secrets (instant namespace).
48
apiVersion: v1
@@ -8,5 +12,5 @@ metadata:
812
namespace: instant-data
913
type: Opaque
1014
stringData:
11-
MINIO_ROOT_USER: "minioadmin"
12-
MINIO_ROOT_PASSWORD: "minioadmin123"
15+
MINIO_ROOT_USER: "CHANGE_ME"
16+
MINIO_ROOT_PASSWORD: "CHANGE_ME"

k8s/data/mongodb.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,21 @@ spec:
7272
ports:
7373
- port: 27017
7474
targetPort: 27017
75+
76+
---
77+
# Secret consumed by provisioner deployment as MONGO_ADMIN_URI (added 2026-05-21
78+
# for OSS prep — was previously inlined in provisioner/deployment.yaml).
79+
# Operators MUST replace placeholders. The URI format is:
80+
# mongodb://<user>:<password>@mongodb.instant-data.svc.cluster.local:27017
81+
# where <user>/<password> match MONGO_INITDB_ROOT_USERNAME/PASSWORD set on
82+
# the mongodb StatefulSet (see the env vars above in this same file once you
83+
# template them).
84+
apiVersion: v1
85+
kind: Secret
86+
metadata:
87+
name: mongodb-admin
88+
namespace: instant-data
89+
type: Opaque
90+
stringData:
91+
MONGO_ADMIN_URI: "CHANGE_ME"
92+

k8s/provisioner/deployment.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,16 @@ spec:
116116
value: "k8s"
117117
- name: REDIS_PROVISION_HOST
118118
value: "redis-provision.instant-data.svc.cluster.local:6379"
119+
# MONGO_ADMIN_URI was historically inlined here as
120+
# `mongodb://root:root@...` for local-dev convenience. For OSS
121+
# publication it is sourced from a Secret so the manifest contains
122+
# no credentials. Operators MUST create the secret before applying;
123+
# see infra/k8s/data/mongodb.yaml for the matching Secret template.
119124
- name: MONGO_ADMIN_URI
120-
value: "mongodb://root:root@mongodb.instant-data.svc.cluster.local:27017"
125+
valueFrom:
126+
secretKeyRef:
127+
name: mongodb-admin
128+
key: MONGO_ADMIN_URI
121129
- name: MONGO_HOST
122130
value: "mongodb.instant-data.svc.cluster.local:27017"
123131
- name: PROVISIONER_SECRET

k8s/secrets.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ metadata:
1313
namespace: instant
1414
type: Opaque
1515
stringData:
16-
PLATFORM_DB_PASSWORD: instant
17-
CUSTOMER_DB_PASSWORD: instant_cust
16+
# Local-dev convenience values were here historically. For OSS publication
17+
# every credential is CHANGE_ME — operators MUST replace before applying.
18+
PLATFORM_DB_PASSWORD: "CHANGE_ME"
19+
CUSTOMER_DB_PASSWORD: "CHANGE_ME"
1820
# New Relic license key — rotate via kubectl patch (see comment at top of file).
1921
# Empty/CHANGE_ME means the Go agent fails open and logs a warning at startup.
2022
NEW_RELIC_LICENSE_KEY: "CHANGE_ME"
@@ -49,9 +51,11 @@ stringData:
4951
R2_API_TOKEN: "CHANGE_ME"
5052
R2_ENDPOINT: "CHANGE_ME"
5153
R2_BUCKET_NAME: "CHANGE_ME"
52-
# MinIO credentials (same values as in infra/k8s/data/minio-secret.yaml)
53-
MINIO_ROOT_USER: "minioadmin"
54-
MINIO_ROOT_PASSWORD: "minioadmin123"
54+
# MinIO credentials (same values as in infra/k8s/data/minio-secret.yaml).
55+
# Used only by the legacy self-hosted MinIO Deployment, which was retired
56+
# 2026-05-20 in favour of DigitalOcean Spaces. Operators MUST replace.
57+
MINIO_ROOT_USER: "CHANGE_ME"
58+
MINIO_ROOT_PASSWORD: "CHANGE_ME"
5559
# Comma-separated list of admin user emails (case-insensitive). Empty
5660
# / unset → admin endpoints reject every caller (closed-by-default).
5761
# Read by api/internal/middleware/admin.go on every request, no app

0 commit comments

Comments
 (0)