|
1 | | -# Database Configuration |
| 1 | +# ============================================================================= |
| 2 | +# RECRUITMENT BACKEND - ENVIRONMENT CONFIGURATION |
| 3 | +# ============================================================================= |
| 4 | +# Copy this file to .env and fill in the appropriate values for your environment |
| 5 | +# For production, consider using environment-specific files like .env.production |
| 6 | + |
| 7 | +# ============================================================================= |
| 8 | +# ENVIRONMENT SETTINGS |
| 9 | +# ============================================================================= |
| 10 | +# Current environment: development, testing, production |
| 11 | +ENV=development |
| 12 | + |
| 13 | +# ============================================================================= |
| 14 | +# SERVER CONFIGURATION |
| 15 | +# ============================================================================= |
| 16 | +# Port for the HTTP server to listen on |
| 17 | +PORT=8080 |
| 18 | + |
| 19 | +# ============================================================================= |
| 20 | +# DATABASE CONFIGURATION |
| 21 | +# ============================================================================= |
| 22 | +# PostgreSQL database connection settings |
2 | 23 | DB_HOST=localhost |
3 | 24 | DB_PORT=5432 |
4 | 25 | DB_USER=postgres |
5 | | -DB_PASSWORD=password |
| 26 | +DB_PASSWORD=your_secure_password_here |
6 | 27 | DB_NAME=recruitment_db |
| 28 | + |
| 29 | +# Connection pool settings |
| 30 | +# Maximum number of open connections to the database |
7 | 31 | DB_MAX_CONNS=10 |
| 32 | +# Minimum number of idle connections in the pool |
8 | 33 | DB_MIN_CONNS=2 |
9 | 34 |
|
10 | | -# Server Configuration |
11 | | -PORT=8080 |
12 | | -GIN_MODE=debug |
| 35 | +# ============================================================================= |
| 36 | +# SECURITY CONFIGURATION |
| 37 | +# ============================================================================= |
| 38 | +# JWT Secret key - MUST be changed in production |
| 39 | +# Generate a secure random string of at least 32 characters |
| 40 | +# You can use: openssl rand -base64 32 |
| 41 | +JWT_SECRET=your-super-secure-jwt-secret-key-change-in-production-minimum-32-chars |
13 | 42 |
|
14 | | -# JWT Configuration (Generate a secure secret using: make jwt-secret) |
15 | | -JWT_SECRET=your-secret-key-change-in-production |
| 43 | +# JWT Token expiry duration (examples: 1h, 24h, 7d, 30d) |
16 | 44 | JWT_EXPIRY_DURATION=24h |
17 | 45 |
|
18 | | -# Environment |
19 | | -ENV=development |
| 46 | +# OTP Configuration |
| 47 | +# Email verification OTP duration (examples: 5m, 10m, 15m, 30m) |
| 48 | +EMAIL_VERIFICATION_OTP_DURATION=10m |
| 49 | + |
| 50 | +# Password reset OTP duration (examples: 15m, 30m, 1h) |
| 51 | +PASSWORD_RESET_OTP_DURATION=30m |
| 52 | + |
| 53 | +# ============================================================================= |
| 54 | +# ADMIN USER CONFIGURATION |
| 55 | +# ============================================================================= |
| 56 | +# Admin user auto-creation settings |
| 57 | +# If both ADMIN_EMAIL and ADMIN_PASSWORD are provided, an admin user will be created |
| 58 | +# automatically during server startup if it doesn't already exist |
| 59 | + |
| 60 | +# Admin user email address |
| 61 | + |
| 62 | + |
| 63 | +# Admin user password (minimum 6 characters recommended) |
| 64 | +ADMIN_PASSWORD=secure_admin_password_123 |
| 65 | + |
| 66 | +# Optional: Admin user full name (defaults to "System Administrator") |
| 67 | +ADMIN_NAME='System Administrator' |
| 68 | + |
| 69 | +# Optional: Admin user phone number (defaults to "0000000000") |
| 70 | +ADMIN_PHONE=+919876543210 |
| 71 | + |
| 72 | +# ============================================================================= |
| 73 | +# NETWORK SECURITY CONFIGURATION |
| 74 | +# ============================================================================= |
| 75 | +# Comma-separated list of trusted proxy IP addresses/ranges |
| 76 | +# Used by Gin to determine real client IP addresses behind proxies |
| 77 | +# Common private network ranges are included by default |
| 78 | +# Example: 127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,your.proxy.ip |
| 79 | +TRUSTED_PROXIES=127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 |
20 | 80 |
|
21 | | -# SMTP Configuration |
| 81 | +# Comma-separated list of allowed CORS origins |
| 82 | +# For development: * allows all origins |
| 83 | +# For production: specify exact domains (https://yourfrontend.com,https://app.yourcompany.com) |
| 84 | +# SECURITY WARNING: Never use * in production! |
| 85 | +CORS_ALLOWED_ORIGINS=* |
| 86 | + |
| 87 | +# ============================================================================= |
| 88 | +# EMAIL CONFIGURATION |
| 89 | +# ============================================================================= |
| 90 | +# SMTP server settings for sending emails |
22 | 91 | SMTP_HOST=smtp.example.com |
23 | | - |
24 | | - |
25 | 92 | SMTP_PORT=587 |
26 | | -SMTP_PASSWORD=smtp-password |
27 | | - |
28 | | -# Development Notes: |
29 | | -# - Copy this file to .env and update the values as needed |
30 | | -# - Generate a secure JWT_SECRET using: make jwt-secret |
31 | | -# - Change DB_PASSWORD to a secure password in production |
32 | | -# - Set GIN_MODE to 'release' in production |
33 | | -# - The default super admin credentials are: |
34 | | - |
35 | | -# Password: password123 |
36 | | -# (Change these immediately in production!) |
| 93 | +SMTP_USER=your_smtp_username |
| 94 | +SMTP_PASSWORD=your_smtp_password |
| 95 | + |
| 96 | +# OTP durations (examples: 5m, 10m, 15m, 30m) |
| 97 | +EMAIL_VERIFICATION_OTP_DURATION=10m |
| 98 | +PASSWORD_RESET_OTP_DURATION=30m |
| 99 | + |
| 100 | +# From email address for outgoing emails |
| 101 | + |
| 102 | + |
| 103 | +# Email Templates Configuration |
| 104 | +# Use {{.OTP}}, {{.TOKEN}}, {{.DURATION}} as placeholders in email bodies |
| 105 | +# Email Verification Templates |
| 106 | +EMAIL_VERIFICATION_SUBJECT=Thank you for applying to IEEE Computer Society VITC. Please verify your email address |
| 107 | +EMAIL_VERIFICATION_BODY=Your OTP is: <strong>{{.OTP}}</strong>. It is valid for {{.DURATION}}. |
| 108 | + |
| 109 | +# Resend Verification Templates |
| 110 | +EMAIL_RESEND_VERIFICATION_SUBJECT=IEEE Computer Society VITC - New Verification Code |
| 111 | +EMAIL_RESEND_VERIFICATION_BODY=Your new OTP is: <strong>{{.OTP}}</strong>. It is valid for {{.DURATION}}. |
| 112 | + |
| 113 | +# Password Reset Templates |
| 114 | +EMAIL_PASSWORD_RESET_SUBJECT=IEEE Computer Society VITC - Password Reset Request |
| 115 | +EMAIL_PASSWORD_RESET_BODY=You have requested to reset your password. Your reset token is: <strong>{{.TOKEN}}</strong>. This token is valid for {{.DURATION}}. If you did not request this reset, please ignore this email. |
| 116 | + |
| 117 | +# Password Reset Success Templates |
| 118 | +EMAIL_PASSWORD_RESET_SUCCESS_SUBJECT=IEEE Computer Society VITC - Password Reset Successful |
| 119 | +EMAIL_PASSWORD_RESET_SUCCESS_BODY=Your password has been successfully reset. If you did not perform this action, please contact support immediately. |
| 120 | + |
| 121 | +# ============================================================================= |
| 122 | +# BUSINESS LOGIC CONFIGURATION |
| 123 | +# ============================================================================= |
| 124 | +# Comma-separated list of allowed email domains for registration |
| 125 | +# Example: company.com,university.edu |
| 126 | +ALLOWED_EMAIL_DOMAINS=vit.ac.in,vitstudent.ac.in |
| 127 | + |
| 128 | +# Maximum number of applications a user can create |
| 129 | +MAXIMUM_APPLICATIONS_PER_USER=2 |
| 130 | + |
| 131 | +# ============================================================================= |
| 132 | +# DEVELOPMENT/TESTING SPECIFIC SETTINGS |
| 133 | +# ============================================================================= |
| 134 | +# These settings are typically only used in development/testing environments |
| 135 | + |
| 136 | +# Set to true to enable additional debugging features |
| 137 | +# DEBUG=false |
| 138 | + |
| 139 | +# Set to true to enable SQL query logging |
| 140 | +# DB_LOG_QUERIES=false |
| 141 | + |
| 142 | +# ============================================================================= |
| 143 | +# PRODUCTION NOTES |
| 144 | +# ============================================================================= |
| 145 | +# For production deployment: |
| 146 | +# 1. Set ENV=production |
| 147 | +# 2. Generate a secure JWT_SECRET (minimum 32 characters) |
| 148 | +# 3. Use strong database passwords |
| 149 | +# 4. Configure proper SMTP settings |
| 150 | +# 5. Review and set appropriate ALLOWED_EMAIL_DOMAINS |
| 151 | +# 6. Consider using environment-specific files (.env.production) |
| 152 | +# 7. Never commit actual .env files to version control |
| 153 | +# 8. Use secrets management services for sensitive data in cloud deployments |
| 154 | + |
| 155 | +# ============================================================================= |
| 156 | +# EXAMPLE PRODUCTION VALUES |
| 157 | +# ============================================================================= |
| 158 | +# ENV=production |
| 159 | +# PORT=8080 |
| 160 | +# JWT_SECRET=super-secure-random-string-generated-with-openssl-rand-base64-32 |
| 161 | +# DB_PASSWORD=very-secure-database-password |
| 162 | +# SMTP_HOST=smtp.yourmailprovider.com |
| 163 | +# SMTP_USER=apikey |
| 164 | +# SMTP_PASSWORD=your-api-key-or-password |
0 commit comments