Skip to content

Commit 7af6391

Browse files
committed
docs: improve contributing and environment setup guidance
1 parent e3fe7ee commit 7af6391

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

.env.local.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ NEXTAUTH_URL=http://localhost:3000
1212
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/postgres
1313
POSTGRES_CONNECT_TIMEOUT=10000
1414
POSTGRES_MAX_QUERY_TIME=20000
15+
# Callback token secret (generate: openssl rand -base64 32)
16+
CALLBACK_TOKEN_SECRET=changeme
17+
# BYOK encryption key (generate: openssl rand -base64 32)
18+
# Used for Bring-Your-Own-Key encryption of sensitive app data.
19+
BYOK_ENCRYPTION_KEY=
1520
# ============================================================================
1621
# REQUIRED - Security & Turnstile
1722
# ============================================================================
@@ -131,7 +136,6 @@ SENTRY_ORG=
131136
SENTRY_PROJECT=
132137
NEXT_PUBLIC_SENTRY_DSN=
133138
# Encryption keys (generate if needed)
134-
BYOK_ENCRYPTION_KEY=
135139
CREDIT_CATEGORIES_ENCRYPTION_KEY=
136140
# Connected GitHub user token envelope encryption (dedicated RSA public key only in Web)
137141
USER_GITHUB_APP_TOKEN_ACTIVE_KEY_ID=

CONTRIBUTING.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,35 @@ pnpm install
3535

3636
### 2. Set up environment variables
3737

38-
If you do not have Vercel access, copy `.env.local.example` to `.env.local` and set at least:
38+
Copy `.env.local.example` to `.env.local` and adjust URLs as needed:
3939

40-
- `NEXTAUTH_SECRET`: `openssl rand -base64 32`
41-
- `INTERNAL_API_SECRET`: `openssl rand -base64 32`
40+
- `NEXTAUTH_URL` — auth redirect URL (defaults to `http://localhost:3000`)
41+
- `POSTGRES_URL` — database connection (defaults to `postgres://postgres:postgres@localhost:5432/postgres`)
42+
43+
Then generate secrets and add Stripe test keys:
44+
45+
```bash
46+
openssl rand -base64 32 # NEXTAUTH_SECRET
47+
openssl rand -base64 32 # INTERNAL_API_SECRET
48+
openssl rand -base64 32 # CALLBACK_TOKEN_SECRET
49+
openssl rand -base64 32 # BYOK_ENCRYPTION_KEY
50+
```
51+
52+
Get Stripe test keys from https://dashboard.stripe.com/test/apikeys.
53+
54+
Required in `.env.local`:
55+
56+
- `NEXTAUTH_SECRET`
57+
- `INTERNAL_API_SECRET`
58+
- `CALLBACK_TOKEN_SECRET`
59+
- `BYOK_ENCRYPTION_KEY`
60+
- `STRIPE_SECRET_KEY`
61+
- `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY`
4262

4363
Then run `pnpm dev:env` to derive worker `.dev.vars` files from `.env.local`.
4464

65+
For the full list of environment variables, see [ENVIRONMENT.md](./ENVIRONMENT.md).
66+
4567
### 3. Start the database
4668

4769
```bash

ENVIRONMENT.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ This document lists all environment variables used in the Kilo Code cloud monore
6565
- `STYTCH_PROJECT_SECRET` - Stytch project secret. `[SECRET]`
6666
- `STYTCH_PUBLIC_TOKEN` - Stytch legacy public token alias used in some test fixtures. [PUBLIC]
6767
- `INTERNAL_API_SECRET` - Shared secret for internal API calls between services; used in `apps/web/src/lib/kiloclaw/cli-runs.test.ts`, `kiloclaw-router.test.ts`, dev seed scripts, and other service routers. `[SECRET]`
68+
- `CALLBACK_TOKEN_SECRET` - Secret for signing callback tokens. Required for local development. `[SECRET]`
6869
- `INTERNAL_SECRET` - Alias/fallback for `INTERNAL_API_SECRET`; used in KiloClaw E2E scripts (`services/kiloclaw/e2e/`). `[SECRET]`
6970

7071
### Social OAuth Clients
@@ -342,7 +343,6 @@ This document lists all environment variables used in the Kilo Code cloud monore
342343

343344
- `DOCKER_SOCKET` - Path or URL for the Docker daemon socket; used by `services/cloud-agent-next/scripts/docker-privileged-proxy.mjs`. [SERVER]
344345
- `DOCKER_PROXY_SOCKET` - Path to the Docker privileged proxy socket. [SERVER]
345-
- `CALLBACK_TOKEN_SECRET` - Secret for signing callback tokens. `[SECRET]`
346346
- `SECRET` - Generic secret env var used in `services/kiloclaw/src/auth/sandbox-id-adversarial.test.ts` for sandbox auth tests. `[SECRET]`
347347

348348
## Mobile
@@ -376,5 +376,3 @@ This document lists all environment variables used in the Kilo Code cloud monore
376376
- `E2E_MODEL` - Model identifier string for E2E inference tests (e.g. a fake/small model name). [SERVER]
377377
- `KILOCLAW_USER_LOCATION` - User location parameter for lifecycle tests of the morning briefing plugin. [SERVER]
378378
- `KILOCLAW_USER_TIMEZONE` - User timezone parameter for lifecycle tests of the morning briefing plugin. [SERVER]
379-
380-

0 commit comments

Comments
 (0)