-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
285 lines (220 loc) · 9.52 KB
/
Copy path.env.example
File metadata and controls
285 lines (220 loc) · 9.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
################################################################################
# STRAPI V5 ENVIRONMENT CONFIGURATION
################################################################################
# IMPORTANT: This is a template file. Copy to .env and fill with actual values.
# NEVER commit .env files to version control!
#
# Quick Setup:
# 1. Copy this file: cp .env.example .env
# 2. Generate secrets: ./scripts/generate-secrets.sh
# 3. Update database credentials
# 4. Set your domain/subdomain
#
# For specific environments, see:
# - .env.local.example (local development)
# - .env.production.example (production deployment)
################################################################################
################################################################################
# APPLICATION ENVIRONMENT
################################################################################
# Application environment: development | staging | production
# - development: Debug mode, detailed errors, auto-reload
# - production: Optimized, minimal logging, no auto-reload
NODE_ENV=production
# Server host binding (0.0.0.0 allows external connections)
HOST=0.0.0.0
# Server port (default: 1337)
PORT=1337
################################################################################
# PUBLIC URL & DOMAIN CONFIGURATION
################################################################################
# Full public URL where Strapi will be accessible
# For Cloudflare subdomain: https://api.yourdomain.com
# Used for: CORS, webhooks, email links, media URLs
PUBLIC_URL=https://api.yourdomain.com
# Alternative: Use subdomain
# SUBDOMAIN=api
# DOMAIN=yourdomain.com
# PUBLIC_URL=https://${SUBDOMAIN}.${DOMAIN}
# Admin panel custom path (default: /admin)
# Change this for additional security through obscurity
ADMIN_PATH=/admin
################################################################################
# DATABASE CONFIGURATION
################################################################################
# Database client: postgres | mysql | better-sqlite3
# Recommended: postgres for production, better-sqlite3 for Cloudflare D1
DATABASE_CLIENT=postgres
# PostgreSQL Configuration
DATABASE_HOST=postgres
DATABASE_PORT=5432
DATABASE_NAME=strapi
DATABASE_USERNAME=strapi
DATABASE_PASSWORD=CHANGE_THIS_SECURE_PASSWORD_IN_PRODUCTION
# SSL/TLS for database connections
# Set to true for managed databases (RDS, Cloud SQL, Neon, etc.)
DATABASE_SSL=false
# Connection pool settings (optional, for production)
# DATABASE_POOL_MIN=2
# DATABASE_POOL_MAX=10
# For Cloudflare D1 or local SQLite:
# DATABASE_CLIENT=better-sqlite3
# DATABASE_FILENAME=.tmp/data.db
################################################################################
# SECURITY SECRETS
################################################################################
# CRITICAL: Generate unique, random values for production!
# Use: ./scripts/generate-secrets.sh
# Or manually: openssl rand -base64 32
################################################################################
# JWT secret for API authentication tokens
# Min length: 32 characters
JWT_SECRET=GENERATE_RANDOM_32_CHAR_SECRET_HERE
# Admin panel JWT secret
# Min length: 32 characters
ADMIN_JWT_SECRET=GENERATE_RANDOM_32_CHAR_SECRET_HERE
# Salt for API tokens
# Min length: 32 characters
API_TOKEN_SALT=GENERATE_RANDOM_32_CHAR_SECRET_HERE
# Salt for transfer tokens
# Min length: 32 characters
TRANSFER_TOKEN_SALT=GENERATE_RANDOM_32_CHAR_SECRET_HERE
# App keys for session cookies (comma-separated, minimum 4 keys)
# Generate 4 separate secrets and comma-separate them
# Format: key1,key2,key3,key4
APP_KEYS=GENERATE_KEY1,GENERATE_KEY2,GENERATE_KEY3,GENERATE_KEY4
################################################################################
# CLOUDFLARE CONFIGURATION
################################################################################
# Cloudflare Account ID
# Find at: https://dash.cloudflare.com/
CF_ACCOUNT_ID=your_cloudflare_account_id
# Cloudflare Zone ID (for your domain)
# Find in domain overview: https://dash.cloudflare.com/
CF_ZONE_ID=your_cloudflare_zone_id
# Cloudflare API Token (for DNS/Workers management)
# Create at: https://dash.cloudflare.com/profile/api-tokens
# Required permissions: Workers, DNS
CF_API_TOKEN=your_cloudflare_api_token
# Cloudflare R2 Configuration (for file uploads)
# R2_ACCOUNT_ID=your_account_id
# R2_ACCESS_KEY_ID=your_access_key
# R2_SECRET_ACCESS_KEY=your_secret_key
# R2_BUCKET_NAME=strapi-uploads
# R2_PUBLIC_URL=https://uploads.yourdomain.com
# Cloudflare KV Namespace (for caching)
# KV_NAMESPACE_ID=your_kv_namespace_id
################################################################################
# CORS & SECURITY
################################################################################
# Allowed origins for CORS (comma-separated)
# Include your frontend domains and subdomains
# Example: https://yourdomain.com,https://www.yourdomain.com,https://app.yourdomain.com
CORS_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
# Alternatively, allow all origins (NOT recommended for production)
# CORS_ORIGINS=*
################################################################################
# RATE LIMITING
################################################################################
# Enable rate limiting (recommended for production)
RATE_LIMIT_ENABLED=true
# Max requests per time window
RATE_LIMIT_MAX_REQUESTS=100
# Time window in milliseconds (default: 60000 = 1 minute)
RATE_LIMIT_DURATION=60000
################################################################################
# FILE UPLOADS & STORAGE
################################################################################
# Maximum file upload size in bytes (default: 200MB)
# Cloudflare free tier limit: 100MB
MAX_FILE_SIZE=104857600
# Upload provider: local | cloudflare-r2 | aws-s3 | cloudinary
UPLOAD_PROVIDER=local
# For local development/testing (not recommended for production)
# UPLOAD_PATH=./public/uploads
################################################################################
# EMAIL CONFIGURATION
################################################################################
# Email provider: sendmail | nodemailer | sendgrid | mailgun | amazon-ses
# EMAIL_PROVIDER=sendgrid
# SMTP Configuration (if using nodemailer)
# EMAIL_SMTP_HOST=smtp.example.com
# EMAIL_SMTP_PORT=587
# EMAIL_SMTP_USERNAME=your_username
# EMAIL_SMTP_PASSWORD=your_password
# EMAIL_FROM=noreply@yourdomain.com
# EMAIL_REPLY_TO=support@yourdomain.com
# SendGrid
# SENDGRID_API_KEY=your_sendgrid_api_key
# Mailgun
# MAILGUN_API_KEY=your_mailgun_api_key
# MAILGUN_DOMAIN=mg.yourdomain.com
################################################################################
# LOGGING & MONITORING
################################################################################
# Log level: fatal | error | warn | info | debug | trace
LOG_LEVEL=info
# Enable query logging (useful for debugging, disable in production)
LOG_QUERIES=false
# Sentry DSN for error tracking
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
################################################################################
# CACHING
################################################################################
# Cache provider: memory | redis
# CACHE_PROVIDER=memory
# Redis Configuration (if using Redis)
# REDIS_HOST=localhost
# REDIS_PORT=6379
# REDIS_PASSWORD=
# REDIS_DB=0
################################################################################
# WEBHOOKS & INTEGRATIONS
################################################################################
# Webhook signing secret (for verifying incoming webhooks)
# WEBHOOK_SECRET=GENERATE_RANDOM_SECRET
# External service API keys
# STRIPE_API_KEY=
# PAYPAL_CLIENT_ID=
# GOOGLE_MAPS_API_KEY=
################################################################################
# DEVELOPMENT & DEBUGGING
################################################################################
# Enable GraphQL Playground (disable in production)
# GRAPHQL_PLAYGROUND=false
# Enable API documentation (disable in production)
# API_DOCS_ENABLED=false
# Debug mode
# DEBUG=false
################################################################################
# PERFORMANCE
################################################################################
# Enable compression
COMPRESSION_ENABLED=true
# Response cache time in seconds
# RESPONSE_CACHE_TIME=3600
################################################################################
# BACKUP & MAINTENANCE
################################################################################
# Backup schedule (cron format)
# BACKUP_SCHEDULE=0 2 * * *
# Backup retention days
# BACKUP_RETENTION_DAYS=30
################################################################################
# FEATURE FLAGS
################################################################################
# Enable/disable specific features
# FEATURE_REGISTRATION_ENABLED=true
# FEATURE_FORGOT_PASSWORD_ENABLED=true
# FEATURE_EMAIL_CONFIRMATION_ENABLED=true
################################################################################
# NOTES
################################################################################
# - Strings with special characters should be wrapped in quotes
# - Boolean values: true or false (lowercase, no quotes)
# - Numbers: no quotes
# - Arrays/Objects: Use JSON format if needed
# - Never use spaces around = sign
# - Comments start with #
# - Empty values can be left blank or commented out
################################################################################