-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.env.example
More file actions
182 lines (144 loc) · 4.33 KB
/
.env.example
File metadata and controls
182 lines (144 loc) · 4.33 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
# Application Configuration
NODE_ENV=development
PORT=3000
# Database Configuration (update in config/database.js or use CLI: npm run cli -- setup-db)
DB_DIALECT=mysql
DB_HOST=localhost
DB_PORT=3306
DB_NAME=greycode_db
DB_USER=root
DB_PASSWORD=
DB_SYNC=false
# ORM Configuration
ACTIVE_ORM=sequelize
# JWT Authentication
# IMPORTANT: Generate a strong secret for production!
# You can use: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
JWT_SECRET=your_jwt_secret_change_this_in_production
JWT_REFRESH_SECRET=your_jwt_refresh_secret_change_this_in_production
JWT_EXPIRES_IN=1h
JWT_REFRESH_EXPIRES_IN=7d
# Password Hashing
BCRYPT_ROUNDS=10
# CORS Configuration
# For development: CORS_ORIGIN=http://localhost:3000,http://localhost:5173
# For production: CORS_ORIGIN=https://yourdomain.com
CORS_ORIGIN=http://localhost:3000
CORS_METHODS=GET,HEAD,PUT,PATCH,POST,DELETE
CORS_CREDENTIALS=true
# Logging
LOG_LEVEL=info
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
# Security
# Request body size limits
JSON_LIMIT=10mb
URL_ENCODED_LIMIT=10mb
# IP Filtering (Optional - comma-separated)
# IP_WHITELIST=127.0.0.1,::1
# IP_BLACKLIST=
# Content Security Policy
# CSP_REPORT_URI=/api/csp-report
# ============================================
# EMAIL CONFIGURATION
# ============================================
# Setup with: npm run cli -- setup-email
# Email Provider (smtp, sendgrid, ses, mailgun)
EMAIL_PROVIDER=smtp
# Default Sender
EMAIL_FROM=noreply@yourapp.com
EMAIL_FROM_NAME=GreyCodeJS App
# ---------- SMTP Configuration ----------
# Works with Gmail, Outlook, Mailtrap, etc.
SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=587
SMTP_USER=your_smtp_username
SMTP_PASSWORD=your_smtp_password
SMTP_SECURE=false
# Gmail Example:
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USER=your-email@gmail.com
# SMTP_PASSWORD=your-app-password (not your Gmail password!)
# SMTP_SECURE=false
# ---------- SendGrid Configuration ----------
# SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxx
# ---------- AWS SES Configuration ----------
# AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXXXXXX
# AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# AWS_REGION=us-east-1
# ---------- Mailgun Configuration ----------
# MAILGUN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# MAILGUN_DOMAIN=mg.yourdomain.com
# Email Queue (Optional - requires Redis)
EMAIL_QUEUE_ENABLED=false
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# Email Development/Testing
EMAIL_LOG_ONLY=false
EMAIL_OVERRIDE_RECIPIENT=
# Email Tracking (Optional)
EMAIL_TRACKING=false
EMAIL_UNSUBSCRIBE=true
# ==============================================================================
# FILE UPLOAD CONFIGURATION
# ==============================================================================
# Upload Provider: 'local', 's3', 'cloudinary'
UPLOAD_PROVIDER=local
# Local Storage Configuration
UPLOAD_DIR=./public/uploads
UPLOAD_PUBLIC_PATH=/uploads
UPLOAD_SUBDIRS=true
UPLOAD_PRESERVE_FILENAME=false
# File Size Limits (in bytes)
UPLOAD_MAX_FILE_SIZE=10485760
UPLOAD_MAX_FILES=10
# Temporary Upload Directory
UPLOAD_TEMP_DIR=./tmp/uploads
# File Validation
UPLOAD_CHECK_FILE_HEADER=true
UPLOAD_REJECT_DOUBLE_EXT=true
UPLOAD_SANITIZE_FILENAMES=true
# Image Processing
IMAGE_PROCESSING_ENABLED=true
IMAGE_MAX_WIDTH=2000
IMAGE_MAX_HEIGHT=2000
IMAGE_QUALITY=85
IMAGE_CONVERT=false
IMAGE_FORMAT=webp
GENERATE_THUMBNAILS=true
# AWS S3 Configuration (if UPLOAD_PROVIDER=s3)
AWS_S3_BUCKET=your-bucket-name
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_S3_ACL=public-read
AWS_CLOUDFRONT_URL=
AWS_S3_PREFIX=uploads/
# Cloudinary Configuration (if UPLOAD_PROVIDER=cloudinary)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
CLOUDINARY_FOLDER=uploads
CLOUDINARY_UPLOAD_PRESET=
# Virus Scanning (Optional)
VIRUS_SCAN_ENABLED=false
VIRUS_SCAN_PROVIDER=clamav
CLAMAV_HOST=localhost
CLAMAV_PORT=3310
VIRUSTOTAL_API_KEY=
# File Cleanup
UPLOAD_CLEANUP_ENABLED=false
UPLOAD_CLEANUP_MAX_AGE=30
UPLOAD_CLEANUP_ORPHANED=false
# URL Signing (for private files)
UPLOAD_URL_SIGNING=false
UPLOAD_URL_SIGNING_SECRET=your-signing-secret
UPLOAD_URL_EXPIRY=3600
# Logging
UPLOAD_LOG_DOWNLOADS=false
# Session (if using sessions alongside JWT)
# SESSION_SECRET=your_session_secret_change_this
# SESSION_COOKIE_MAX_AGE=86400000