-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_env.py
More file actions
53 lines (47 loc) · 1.96 KB
/
Copy pathcreate_env.py
File metadata and controls
53 lines (47 loc) · 1.96 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
#!/usr/bin/env python3
"""
Script to create .env file with placeholder environment variables.
Replace the placeholder values with your actual API keys before running.
"""
import os
from pathlib import Path
# Get the backend directory
backend_dir = Path(__file__).parent / "backend"
env_file = backend_dir / ".env"
# Environment variables template (replace with your actual keys)
env_content = """# Google Gemini Service Account Credentials
# Get credentials from Google Cloud Console: https://console.cloud.google.com/
GEMINI_PROJECT_ID=your-project-id
GEMINI_PRIVATE_KEY_ID=your-private-key-id
GEMINI_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\\nYOUR_PRIVATE_KEY_HERE\\n-----END PRIVATE KEY-----"
GEMINI_CLIENT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com
GEMINI_CLIENT_ID=your-client-id
GEMINI_AUTH_URI=https://accounts.google.com/o/oauth2/auth
GEMINI_TOKEN_URI=https://oauth2.googleapis.com/token
GEMINI_AUTH_PROVIDER_X509_CERT_URL=https://www.googleapis.com/oauth2/v1/certs
GEMINI_CLIENT_X509_CERT_URL=https://www.googleapis.com/robot/v1/metadata/x509/your-service-account%40your-project.iam.gserviceaccount.com
GEMINI_UNIVERSE_DOMAIN=googleapis.com
# SerpAPI Configuration
# Get your key from: https://serpapi.com/
SERPAPI_API_KEY=your-serpapi-api-key
# NewsAPI Configuration
# Get your key from: https://newsapi.org/
NEWSAPI_API_KEY=your-newsapi-api-key
# Additional APIs Configuration (Optional)
# RapidAPI: https://rapidapi.com/
RAPIDAPI_KEY=your-rapidapi-key
# MediaStack: https://mediastack.com/
MEDIASTACK_KEY=your-mediastack-key
# NewsData: https://newsdata.io/
NEWSDATA_KEY=your-newsdata-key
# GNews: https://gnews.io/
GNEWS_KEY=your-gnews-key
"""
# Write the .env file
try:
with open(env_file, 'w', encoding='utf-8') as f:
f.write(env_content)
print(f"✅ Created .env file at {env_file}")
print("⚠️ Don't forget to replace placeholder values with your actual API keys!")
except Exception as e:
print(f"❌ Error creating .env file: {e}")