docs: update password generation to use hex encoding
Change openssl rand commands from base64 to hex encoding to avoid special characters that break URL parsing in database connection strings. - JWT_SECRET: openssl rand -hex 32 - DBPASS: openssl rand -hex 16 Updated in: - .env.example - README.md - docs/contributing/DEVELOPMENT.md - docs/operations/troubleshooting.md
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
# Only secrets are required - all other settings have defaults in docker-compose.yml
|
||||
|
||||
# JWT Secret for authentication (generate a secure random string)
|
||||
# Generate with: openssl rand -hex 32
|
||||
JWT_SECRET=your-secure-jwt-secret-key-here
|
||||
|
||||
# PostgreSQL database password
|
||||
# Generate with: openssl rand -hex 16
|
||||
DBPASS=your-secure-database-password-here
|
||||
|
||||
# Optional: Override Defaults (defaults are set in docker-compose.yml)
|
||||
|
||||
@@ -29,7 +29,10 @@ cd bookhoard
|
||||
|
||||
# 2. Set up environment
|
||||
cp .env.example .env
|
||||
# Edit .env with your secure JWT_SECRET and DBPASS
|
||||
# Generate secure passwords (no special characters):
|
||||
# JWT_SECRET: openssl rand -hex 32
|
||||
# DBPASS: openssl rand -hex 16
|
||||
# Edit .env with your generated values
|
||||
|
||||
# 3. Start the server
|
||||
podman-compose up --build -d # or: docker-compose up --build -d
|
||||
|
||||
@@ -190,6 +190,9 @@ go test ./... -v
|
||||
podman-compose up --build
|
||||
|
||||
# Option 2: Direct Go run (requires local PostgreSQL)
|
||||
# Generate secure passwords (no special characters):
|
||||
# JWT_SECRET: openssl rand -hex 32
|
||||
# DBPASS: openssl rand -hex 16
|
||||
export JWT_SECRET="your-dev-secret"
|
||||
export DBPASS="your-db-password"
|
||||
go run cmd/server/main.go
|
||||
@@ -345,8 +348,8 @@ podman-compose build --no-cache
|
||||
### Environment Variables
|
||||
|
||||
Required for production:
|
||||
- `JWT_SECRET` - 64-byte random string
|
||||
- `DBPASS` - Strong database password
|
||||
- `JWT_SECRET` - 64-byte random string (generate: `openssl rand -hex 32`)
|
||||
- `DBPASS` - Strong database password (generate: `openssl rand -hex 16`)
|
||||
- `BASE_URL` - Public URL (e.g., https://bookhoard.example.com)
|
||||
|
||||
Optional:
|
||||
|
||||
@@ -17,6 +17,9 @@ cp .env.example .env
|
||||
nano .env
|
||||
|
||||
# Required variables:
|
||||
# Generate secure passwords (no special characters):
|
||||
# JWT_SECRET: openssl rand -hex 32
|
||||
# DBPASS: openssl rand -hex 16
|
||||
JWT_SECRET="your-secure-jwt-secret-key-here" # 64+ char random string
|
||||
DBPASS="your-secure-database-password" # Strong password
|
||||
|
||||
|
||||
Reference in New Issue
Block a user