-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-render-env-azure.sh
More file actions
108 lines (93 loc) · 3.62 KB
/
setup-render-env-azure.sh
File metadata and controls
108 lines (93 loc) · 3.62 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
#!/bin/bash
# LogSolver Render Environment Setup Script
# This script helps you set up environment variables for Render deployment
echo "🚀 LogSolver Render Environment Setup"
echo "======================================"
echo ""
echo "This script will help you prepare the environment variables needed for Render deployment."
echo "You'll need your Azure PostgreSQL and Azure Blob Storage credentials."
echo ""
# Create environment file
ENV_FILE=".env.render"
echo "# LogSolver Render Environment Variables" > $ENV_FILE
echo "# Generated on $(date)" >> $ENV_FILE
echo "" >> $ENV_FILE
# Application settings
echo "APP_ENV=production" >> $ENV_FILE
echo "SERVER_PORT=8080" >> $ENV_FILE
echo "LOG_LEVEL=info" >> $ENV_FILE
echo "" >> $ENV_FILE
# Database configuration
echo "📊 Database Configuration (Azure PostgreSQL)"
echo "--------------------------------------------"
read -p "Enter your Azure PostgreSQL host (e.g., myserver.postgres.database.azure.com): " DB_HOST
read -p "Enter your PostgreSQL username: " DB_USER
read -s -p "Enter your PostgreSQL password: " DB_PASSWORD
echo ""
read -p "Enter your database name [default: logsolver]: " DB_NAME
DB_NAME=${DB_NAME:-logsolver}
echo "# Database Configuration" >> $ENV_FILE
echo "DB_HOST=$DB_HOST" >> $ENV_FILE
echo "DB_PORT=5432" >> $ENV_FILE
echo "DB_USER=$DB_USER" >> $ENV_FILE
echo "DB_PASSWORD=$DB_PASSWORD" >> $ENV_FILE
echo "DB_NAME=$DB_NAME" >> $ENV_FILE
echo "DB_SSLMODE=require" >> $ENV_FILE
echo "" >> $ENV_FILE
# JWT Configuration
echo ""
echo "🔐 JWT Configuration"
echo "-------------------"
read -p "Enter JWT secret (leave empty to auto-generate in Render): " JWT_SECRET
if [ -n "$JWT_SECRET" ]; then
echo "JWT_SECRET=$JWT_SECRET" >> $ENV_FILE
else
echo "# JWT_SECRET=auto-generated-in-render" >> $ENV_FILE
fi
echo "JWT_EXPIRATION_HOURS=24" >> $ENV_FILE
echo "" >> $ENV_FILE
# AI Configuration
echo ""
echo "🤖 AI Service Configuration"
echo "--------------------------"
read -p "Enter your Gemini API key (or leave empty): " GEMINI_API_KEY
read -p "Enter your OpenAI API key (or leave empty): " OPENAI_API_KEY
echo "# AI Configuration" >> $ENV_FILE
if [ -n "$GEMINI_API_KEY" ]; then
echo "GEMINI_API_KEY=$GEMINI_API_KEY" >> $ENV_FILE
fi
if [ -n "$OPENAI_API_KEY" ]; then
echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> $ENV_FILE
fi
echo "" >> $ENV_FILE
# Azure Storage Configuration
echo ""
echo "☁️ Azure Blob Storage Configuration"
echo "-----------------------------------"
read -p "Enter your Azure Storage account name: " AZURE_STORAGE_ACCOUNT
read -s -p "Enter your Azure Storage account key: " AZURE_STORAGE_KEY
echo ""
read -p "Enter your blob container name [default: logsolver-files]: " AZURE_BLOB_CONTAINER
AZURE_BLOB_CONTAINER=${AZURE_BLOB_CONTAINER:-logsolver-files}
echo "# Azure Storage Configuration" >> $ENV_FILE
echo "AZURE_STORAGE_ACCOUNT=$AZURE_STORAGE_ACCOUNT" >> $ENV_FILE
echo "AZURE_STORAGE_KEY=$AZURE_STORAGE_KEY" >> $ENV_FILE
echo "AZURE_BLOB_CONTAINER=$AZURE_BLOB_CONTAINER" >> $ENV_FILE
echo "" >> $ENV_FILE
# Other settings
echo "# Other Settings" >> $ENV_FILE
echo "MAX_UPLOAD_SIZE_MB=50" >> $ENV_FILE
echo "ALLOWED_ORIGINS=*" >> $ENV_FILE
echo "TRUSTED_PROXIES=0.0.0.0/0" >> $ENV_FILE
echo ""
echo "✅ Environment file created: $ENV_FILE"
echo ""
echo "📝 Next Steps:"
echo "1. Review the generated $ENV_FILE file"
echo "2. Copy these values to your Render service environment variables"
echo "3. Deploy your service on Render"
echo ""
echo "🔗 Deployment Guide: See RENDER_DEPLOYMENT.md for detailed instructions"
echo ""
echo "⚠️ Security Note: Do not commit the $ENV_FILE file to version control!"
echo " Add it to .gitignore if not already present."