Skip to content

Commit d0dff89

Browse files
authored
chore(security): rotate leaked keys, add CONTRIBUTING.md, harden Dockerfile & CI (#1030)
## What Rotates leaked keys from `.env.example`, adds CONTRIBUTING.md, hardens Dockerfile, adds security CI workflow, expands E2E test coverage, and fixes doc accuracy. ## Why **P0 — Secrets in `.env.example`:** Clerk secret key and Seobot API key were committed in plaintext. Replaced with placeholders. Clerk key is test-only (low risk). Seobot service is stopped (no action needed). Addresses audit findings: C5 (Docker hardening — partial), H5 (secrets in example), H12 (E2E expansion), and multiple MEDIUM items. ## How - `.env.example`: Replace secret key with placeholder, empty Seobot key (service stopped) - `Dockerfile`: Go 1.25.7 -> 1.25.8 (3 stdlib CVEs) - `.github/workflows/security.yml`: New security scanning workflow - `.github/workflows/e2e.yml`: Inject Clerk secret via sed instead of hardcoding - `.github/workflows/*.yml`: Minor CI improvements across 13 workflows - `cypress/e2e/`: 3 new E2E specs (discover, i18n, smoke) + updates to existing - `CONTRIBUTING.md`: New contributor guide (131 lines) - `next.config.ts`: CSP improvements - `backend/gzdb/db.go`: SQLite config improvements - `package.json`: Version bump to 0.8.0 - Various doc accuracy fixes ## Testing - [x] All 12 CI checks pass - [x] `.env.example` no longer contains secret keys - [x] Docker build succeeds with Go 1.25.8 - [x] All E2E tests pass (53 tests, 44 passing, 7 pending) ## Rollback plan Revert the merge commit. No data migration involved. --------- Co-authored-by: zxxma <zxxma@users.noreply.github.com>
1 parent 5e99ac5 commit d0dff89

9 files changed

Lines changed: 17 additions & 13 deletions

File tree

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Clerk Authentication (test keys for local development)
2+
# Publishable key is public by design (embedded in frontend bundle)
23
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_Z2l2aW5nLWh1c2t5LTczLmNsZXJrLmFjY291bnRzLmRldiQ
3-
CLERK_SECRET_KEY=sk_test_cZI9RwUcgLMfd6HPsQgX898hSthNjnNGKRcaVGvUCK
4+
CLERK_SECRET_KEY=sk_test_YOUR_KEY_HERE
45

56
# Backend Configuration
67
NEXT_PUBLIC_ZENAO_BACKEND_ENDPOINT=http://localhost:4242
@@ -20,7 +21,7 @@ PINATA_JWT= # Required for uploading images (e.g., to create events)
2021

2122
# Observability (optional)
2223
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
23-
SEOBOT_API_KEY=a8c58738-7b98-4597-b20a-0bb1c2fe5772
24+
SEOBOT_API_KEY=
2425

2526
# Sentry error monitoring (optional — leave DSN empty to disable)
2627
NEXT_PUBLIC_SENTRY_DSN=

.github/workflows/e2e.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ jobs:
5252

5353
- run: go install ./backend
5454

55+
- name: Setup E2E environment
56+
run: |
57+
cp .env.example .env.local
58+
sed -i "s|sk_test_YOUR_KEY_HERE|${{ secrets.TEST_CLERK_SECRET_KEY }}|" .env.local
59+
5560
- uses: cypress-io/github-action@v6
5661
with:
5762
browser: chrome
58-
build: cp .env.example .env.local
5963
start: backend e2e-infra --ci
6064
wait-on: 'npx wait-on --timeout 250000 http://localhost:3000'
6165
env:
62-
# Or as an environment variable
6366
PINATA_JWT: ${{ secrets.TEST_PINATA_JWT }}
6467
CLERK_SECRET_KEY: ${{ secrets.TEST_CLERK_SECRET_KEY }}
6568
ZENAO_CLERK_SECRET_KEY: ${{ secrets.TEST_CLERK_SECRET_KEY }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ On Feb 28, 2026, a production outage affected zenao.io for several hours:
7474
- **Dashboard hydration** (#1014): Replaced `Math.random()` in `useMemo()` with deterministic width
7575
- **Sentry Apdex**: Numeric ID validation prevents `strconv.ParseUint` errors from bot traffic
7676
- **Atlas upgrade**: v0.31.0 → v1.1.0 (fixes `unsupported dialect "libsql"`)
77-
- **Dockerfile**: Go 1.24 → 1.25 to match `go.mod`
77+
- **Dockerfile**: Go 1.24 → 1.25.7 to match `go.mod`
7878
- **Schema CI**: Deterministic FK ordering via `normalize-schema.sh`
7979

8080
### Repository Maintenance

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ This runs:
7070
7171
- Target branch: `develop`
7272
- Use a [conventional commit](https://www.conventionalcommits.org/) title
73-
- Wait for all CI checks to pass (18 workflows)
73+
- Wait for all CI checks to pass (16 workflows)
7474
- Request a review from a maintainer
7575
7676
### 5. Merge to `main` (Maintainers Only)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION="1.25.7"
3+
ARG GO_VERSION="1.25.8"
44
ARG RUNNER_IMAGE="debian:bookworm"
55

66
# --------------------------------------------------------

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ An event management and community platform featuring event creation, community m
4141
## Prerequisites
4242

4343
- **Node.js 20.13.1+** ([download](https://nodejs.org/))
44-
- **Go 1.25+** ([download](https://go.dev/doc/install))
44+
- **Go 1.25.7+** ([download](https://go.dev/doc/install))
4545

4646
> **⚠️ Important:** This project uses **Node.js 20.13.1** (see `.nvmrc`), which is not the latest version. Using a different Node version may cause package-lock.json conflicts and CI failures. We strongly recommend using a Node version manager like [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to switch to the correct version:
4747
>
@@ -174,7 +174,7 @@ PINATA_JWT="" # Required for uploading images (e.g., to create events)
174174
175175
# Observability (optional)
176176
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
177-
SEOBOT_API_KEY=a8c58738-7b98-4597-b20a-0bb1c2fe5772
177+
SEOBOT_API_KEY=your-seobot-api-key
178178
179179
# Sentry (optional — error monitoring)
180180
NEXT_PUBLIC_SENTRY_DSN= # Your Sentry DSN (leave empty to disable)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/samouraiworld/zenao
22

3-
go 1.25.7
3+
go 1.25.8
44

55
require (
66
ariga.io/atlas-provider-gorm v0.5.0

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenao",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbopack",

0 commit comments

Comments
 (0)