-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
204 lines (167 loc) · 7.07 KB
/
.env.example
File metadata and controls
204 lines (167 loc) · 7.07 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
# ============================================
# Papers2Code - Environment Variables Template
# ============================================
# Copy this file to .env and fill in your values
# NEVER commit .env files with real credentials to version control
# ============================================
# ---------------------------------------------
# Application Environment
# ---------------------------------------------
# Options: DEV, DEVELOPMENT, PROD_TEST, PRODUCTION
ENV_TYPE=DEV
# Application logging level
# Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
APP_LOG_LEVEL=DEBUG
# ---------------------------------------------
# Database Configuration
# ---------------------------------------------
# Set both dev and prod URIs - ENV_TYPE automatically selects which one to use
# Just change ENV_TYPE to switch between environments!
# Development database (used when ENV_TYPE=DEV or ENV_TYPE=DEVELOPMENT)
MONGO_URI_DEV=mongodb://localhost:27017/papers2code_dev
# Or use MongoDB Atlas for dev:
# MONGO_URI_DEV=mongodb+srv://user:pass@test-cluster.mongodb.net/papers2code_test?retryWrites=true&w=majority
MONGO_DB_NAME_DEV=papers2codedev
# Production database (used when ENV_TYPE=PRODUCTION)
MONGO_URI_PROD=mongodb+srv://user:pass@prod-cluster.mongodb.net/papers2code?retryWrites=true&w=majority
# Optional override (falls back to the database portion of URI if omitted)
# MONGO_DB_NAME_PROD=papers2code
# Production test database (used when ENV_TYPE=PROD_TEST)
MONGO_URI_PROD_TEST=mongodb+srv://user:pass@test-cluster.mongodb.net/papers2code_test?retryWrites=true&w=majority
# Optional override
# MONGO_DB_NAME_PROD_TEST=papers2code_test
# MongoDB connection pool settings
MONGO_MAX_POOL_SIZE=50
MONGO_MIN_POOL_SIZE=5
# MongoDB query optimization
ENABLE_QUERY_HINTS=True
OPTIMIZE_COUNT_QUERIES=True
# ---------------------------------------------
# Authentication & Security
# ---------------------------------------------
# Generate a strong secret key for JWT token signing
# Example: python -c "import secrets; print(secrets.token_hex(32))"
FLASK_SECRET_KEY=your-secret-key-here-generate-with-secrets-module
# JWT algorithm (default: HS256)
ALGORITHM=HS256
# Token expiration times (in minutes)
ACCESS_TOKEN_EXPIRE_MINUTES=1440 # 24 hours (dev) or 30 (prod)
REFRESH_TOKEN_EXPIRE_MINUTES=10080 # 7 days
# Token encryption (REQUIRED for security)
TOKEN_ENCRYPTION_KEY=your-token-encryption-key-here-generate-with-secrets-module
# ---------------------------------------------
# OAuth Configuration - Auto-Detection
# ---------------------------------------------
# NOTE: USE_DEX_OAUTH is auto-configured based on ENV_TYPE:
# DEV/DEVELOPMENT → USE_DEX_OAUTH=true (uses Dex mock OAuth)
# PROD_TEST/PRODUCTION → USE_DEX_OAUTH=false (uses real GitHub/Google)
# To override, explicitly set: USE_DEX_OAUTH=true or USE_DEX_OAUTH=false
# Dex OpenID Connect (Mock OAuth for Development)
DEX_ISSUER_URL=http://localhost:5556/dex
DEX_CLIENT_ID=papers2code-backend
DEX_CLIENT_SECRET=dev-client-secret-change-in-production
# ---------------------------------------------
# GitHub OAuth Configuration
# ---------------------------------------------
# Development credentials (used when ENV_TYPE=DEV/DEVELOPMENT)
# These are automatically used in development mode
GITHUB_CLIENT_ID_DEV=
GITHUB_CLIENT_SECRET_DEV=
# Production credentials (used when ENV_TYPE=PROD_TEST/PRODUCTION)
# Leave empty to use Dex mock OAuth (recommended for dev)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# GitHub owner username
OWNER_GITHUB_USERNAME=your-github-username
# Optional: Override default GitHub OAuth URLs (rarely needed)
# GITHUB_AUTHORIZE_URL=https://github.com/login/oauth/authorize
# GITHUB_ACCESS_TOKEN_URL=https://github.com/login/oauth/access_token
# GITHUB_USER_API_URL=https://api.github.com/user
# ---------------------------------------------
# Google OAuth Configuration
# ---------------------------------------------
# Leave empty to use Dex mock OAuth (recommended for dev)
# Fill in for production or to test real Google OAuth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Optional: Override default Google OAuth URLs (rarely needed)
# GOOGLE_AUTHORIZE_URL=https://accounts.google.com/o/oauth2/v2/auth
# GOOGLE_TOKEN_URL=https://oauth2.googleapis.com/token
# GOOGLE_USER_INFO_URL=https://www.googleapis.com/oauth2/v2/userinfo
# ---------------------------------------------
# Frontend & Backend URLs
# ---------------------------------------------
FRONTEND_URL=http://localhost:5173
BACKEND_URL=http://localhost:5001
# API_URL is used for OAuth redirect_uri construction in production
# CRITICAL: Set this to your actual production backend URL (with https://)
# Example: API_URL=https://papers2code.onrender.com
# If not set, defaults to http://localhost:5001
API_URL=http://localhost:5001
# ---------------------------------------------
# Email Configuration
# ---------------------------------------------
# SendGrid API key for email delivery
SENDGRID_API_KEY=
# Email sender address
EMAIL_FROM=noreply@papers2code.com
# Enable/disable email sending (false in dev, true in prod)
EMAIL_ENABLED=false
# Email rate limiting
EMAIL_RATE_LIMIT_PER_HOUR=10
EMAIL_RATE_LIMIT_PER_DAY=50
# ---------------------------------------------
# External APIs
# ---------------------------------------------
# arXiv API endpoint
ARXIV_API_URL=https://your-endpoint.free.beeceptor.com/arxiv
# ---------------------------------------------
# Redis Cache Configuration (Optional)
# ---------------------------------------------
# Leave empty to use in-memory caching
# Example formats:
# Local: redis://localhost:6379/0
# Cloud: redis://username:password@host:port/db
# SSL: rediss://username:password@host:port/db
REDIS_URL=
ENABLE_CACHE=True
CACHE_TTL=300
CACHE_KEY_PREFIX=papers2code_dev
REDIS_MAX_CONNECTIONS=20
REDIS_SOCKET_KEEPALIVE=True
# Paper transformation settings
PAPER_TRANSFORM_BATCH_SIZE=20
# ---------------------------------------------
# Atlas Search Settings (Optional - for MongoDB Atlas)
# ---------------------------------------------
ATLAS_SEARCH_INDEX_NAME=papers_index
ATLAS_SEARCH_SCORE_THRESHOLD=0.5
ATLAS_SEARCH_OVERALL_LIMIT=2400
ATLAS_SEARCH_TITLE_BOOST=3.0
# ---------------------------------------------
# Feature Flags
# ---------------------------------------------
ENABLE_RATE_LIMITING=false
ENABLE_CSRF_PROTECTION=true
ENABLE_CORS=true
# ---------------------------------------------
# CORS Settings
# ---------------------------------------------
# Comma-separated list of allowed origins
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5001,http://localhost:3000
# ---------------------------------------------
# Logging & Monitoring (Optional)
# ---------------------------------------------
# Sentry DSN for error tracking (leave empty in dev)
SENTRY_DSN=
# Log file location (optional)
# LOG_FILE=/var/log/papers2code/app.log
# ---------------------------------------------
# Development-Specific Settings
# ---------------------------------------------
# Enable debug endpoints (DO NOT enable in production)
DEBUG_ENDPOINTS_ENABLED=false
# Hot reload for development
HOT_RELOAD=false
# Detailed error messages (DO NOT enable in production)
SHOW_ERROR_DETAILS=false