Skip to content

Commit df4e5c6

Browse files
docs: add secret generation guidance to .env.example and README (#207) (#254)
1 parent 464db62 commit df4e5c6

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.env.example

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# ─── Database ───
2-
DATABASE_URL=postgresql://devcard:devcard@localhost:5433/devcard?schema=public
2+
DATABASE_URL=postgresql://devcard:devcard@localhost:5432/devcard?schema=public
33

44
# ─── Redis ───
55
REDIS_URL=redis://localhost:6379
66

77
# ─── JWT ───
8+
# JWT_SECRET: any long random string, minimum 32 characters
9+
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
810
JWT_SECRET=your-super-secret-jwt-key-change-in-production
911

1012
# ─── Encryption (for OAuth tokens) ───
13+
# ENCRYPTION_KEY: must be exactly 32 bytes = 64 hex characters
14+
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
1115
ENCRYPTION_KEY=your-32-byte-hex-encryption-key-here
1216

1317
# ─── GitHub OAuth ───
@@ -19,10 +23,10 @@ GOOGLE_CLIENT_ID=your-google-client-id
1923
GOOGLE_CLIENT_SECRET=your-google-client-secret
2024

2125
# ─── App URLs ───
22-
PUBLIC_APP_URL=http://YOUR_COMPUTER_LAN_IP:5173
23-
BACKEND_URL=http://YOUR_COMPUTER_LAN_IP:3000
26+
PUBLIC_APP_URL=http://localhost:5173
27+
BACKEND_URL=http://localhost:3000
2428
MOBILE_REDIRECT_URI=devcard://oauth/callback
2529

2630
# ─── Server ───
2731
PORT=3000
28-
NODE_ENV=development
32+
NODE_ENV=development

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ docker compose up -d
7373
# Copy environment config
7474
cp .env.example .env
7575

76+
# ⚠️ Replace secret placeholders before starting the server:
77+
# JWT_SECRET → node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
78+
# ENCRYPTION_KEY → node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
79+
# Paste the generated values into your .env file. Never use placeholders in production.
80+
7681
# Run database migrations
7782
pnpm db:migrate
7883

0 commit comments

Comments
 (0)