|
1 | | -# BiblioDrift Environment Configuration |
2 | | - |
3 | | -# JWT Configuration |
4 | | -JWT_SECRET_KEY=your-super-secret-jwt-key-here |
5 | | - |
6 | | -# Database Configuration |
7 | | -DATABASE_URL=sqlite:///biblio.db |
8 | | - |
9 | 1 | # BiblioDrift Environment Configuration Example |
10 | 2 | # Copy this file to .env and customize for your environment |
11 | 3 |
|
12 | | -# Application Environment (development, production, testing) |
13 | | -APP_ENV=development |
14 | 4 | # ============================================================================= |
15 | | -# SECURITY: Credential Encryption (Recommended for Production) |
| 5 | +# APPLICATION ENVIRONMENT |
16 | 6 | # ============================================================================= |
17 | | -# To encrypt sensitive API keys, use the security_utils module: |
18 | | -# from security_utils import encrypt_credential |
19 | | -# encrypted_key = encrypt_credential("your-actual-api-key") |
20 | | -# |
21 | | -# Then set CREDENTIAL_MASTER_PASSWORD to enable decryption at runtime. |
22 | | -# This prevents storing plain-text credentials in .env files. |
23 | | -# ============================================================================= |
24 | | - |
25 | | -# Master password for encrypting/decrypting credentials (OPTIONAL but RECOMMENDED) |
26 | | -# Generate a secure password using: python -c "from security_utils import CredentialEncryption; print(CredentialEncryption.generate_master_password())" |
27 | | -CREDENTIAL_MASTER_PASSWORD=your_secure_master_password_here |
| 7 | +APP_ENV=development |
28 | 8 |
|
29 | 9 | # ============================================================================= |
30 | | -# SECURITY: Credential Encryption (Recommended for Production) |
31 | | -# ============================================================================= |
32 | | -# To encrypt sensitive API keys, use the security_utils module: |
33 | | -# from security_utils import encrypt_credential |
34 | | -# encrypted_key = encrypt_credential("your-actual-api-key") |
35 | | -# |
36 | | -# Then set CREDENTIAL_MASTER_PASSWORD to enable decryption at runtime. |
37 | | -# This prevents storing plain-text credentials in .env files. |
| 10 | +# REQUIRED: JWT & SECURITY CONFIGURATION |
38 | 11 | # ============================================================================= |
39 | | - |
40 | | -# Master password for encrypting/decrypting credentials (OPTIONAL but RECOMMENDED) |
41 | | -# Generate a secure password using: python -c "from security_utils import CredentialEncryption; print(CredentialEncryption.generate_master_password())" |
42 | | -CREDENTIAL_MASTER_PASSWORD=your_secure_master_password_here |
43 | | - |
44 | | -# Google Books API Key |
45 | | -GOOGLE_BOOKS_API_KEY=your_google_id_here |
46 | | - |
47 | | -# JWT Configuration |
48 | | -JWT_SECRET_KEY=your-super-secret-jwt-key-here |
| 12 | +# CRITICAL: Must be set before app startup. Generate a secure key in production. |
| 13 | +JWT_SECRET_KEY=your-super-secret-jwt-key-here-min-32-chars |
49 | 14 | JWT_ACCESS_TOKEN_EXPIRES_DAYS=7 |
50 | 15 | JWT_ALGORITHM=HS256 |
51 | 16 |
|
52 | | -# Database Configuration |
| 17 | +# ============================================================================= |
| 18 | +# REQUIRED: DATABASE CONFIGURATION |
| 19 | +# ============================================================================= |
| 20 | +# CRITICAL: Must be set before app startup. |
53 | 21 | DATABASE_URL=sqlite:///instance/biblio.db |
54 | 22 | SQLALCHEMY_TRACK_MODIFICATIONS=False |
55 | 23 |
|
56 | | -# Server Configuration |
| 24 | + |
| 25 | +# ============================================================================= |
| 26 | +# SERVER CONFIGURATION |
| 27 | +# ============================================================================= |
57 | 28 | FLASK_HOST=127.0.0.1 |
58 | 29 | PORT=5000 |
59 | | -FLASK_DEBUG=True |
60 | | - |
61 | | -# Rate Limiting Configuration |
62 | | -RATE_LIMIT_ENABLED=True |
63 | | -RATE_LIMIT_WINDOW=60 |
64 | | -RATE_LIMIT_MAX_REQUESTS=30 |
| 30 | +FLASK_DEBUG=False |
65 | 31 |
|
66 | | -# Logging Configuration |
67 | | -LOG_LEVEL=INFO |
68 | | -LOG_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s |
69 | | -# LOG_FILE=logs/bibliodrift.log |
| 32 | +# ============================================================================= |
| 33 | +# REQUIRED: API KEYS & EXTERNAL SERVICES |
| 34 | +# ============================================================================= |
| 35 | +# CRITICAL: GOOGLE_BOOKS_API_KEY must be set before app startup. |
| 36 | +GOOGLE_BOOKS_API_KEY=your-google-books-api-key |
70 | 37 |
|
71 | | -# AI Service Configuration |
| 38 | +# Optional AI Service Keys |
72 | 39 | OPENAI_API_KEY=your-openai-api-key |
73 | 40 | GROQ_API_KEY=your-groq-api-key |
74 | 41 | GEMINI_API_KEY=your-gemini-api-key |
75 | 42 |
|
76 | | -# Google Books API |
77 | | -GOOGLE_BOOKS_API_KEY=your-google-books-api-key |
78 | 43 |
|
79 | | -# Caching Configuration |
80 | | -CACHE_TYPE=simple # Options: simple, redis, null |
| 44 | +# ============================================================================= |
| 45 | +# CACHING CONFIGURATION |
| 46 | +# ============================================================================= |
| 47 | +CACHE_TYPE=simple |
81 | 48 | REDIS_URL=redis://localhost:6379/0 |
82 | 49 |
|
83 | 50 | # Cache TTL Values (in seconds) |
84 | | -CACHE_MOOD_ANALYSIS_TTL=86400 # 24 hours |
85 | | -CACHE_RECOMMENDATIONS_TTL=3600 # 1 hour |
86 | | -CACHE_MOOD_TAGS_TTL=43200 # 12 hours |
87 | | -CACHE_CHAT_RESPONSE_TTL=1800 # 30 minutes |
88 | | -CACHE_GOODREADS_TTL=604800 # 7 days |
89 | | -CACHE_DEFAULT_TIMEOUT=3600 # 1 hour |
90 | | - |
91 | | -# Flask Configuration |
92 | | -FLASK_DEBUG=False |
93 | | -FLASK_HOST=127.0.0.1 |
94 | | -PORT=5000 |
95 | | - |
96 | | -# Logging |
97 | | -LOG_LEVEL=INFO |
98 | | -GOOGLE_BOOKS_API_KEY=your-google-books-api-key |
| 51 | +CACHE_MOOD_ANALYSIS_TTL=86400 |
| 52 | +CACHE_RECOMMENDATIONS_TTL=3600 |
| 53 | +CACHE_MOOD_TAGS_TTL=43200 |
| 54 | +CACHE_CHAT_RESPONSE_TTL=1800 |
| 55 | +CACHE_GOODREADS_TTL=604800 |
| 56 | +CACHE_DEFAULT_TIMEOUT=3600 |
99 | 57 |
|
100 | 58 | # LLM Configuration |
101 | 59 | PREFERRED_LLM=groq |
|
0 commit comments