-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-secrets.sh
More file actions
executable file
Β·40 lines (32 loc) Β· 1.13 KB
/
setup-secrets.sh
File metadata and controls
executable file
Β·40 lines (32 loc) Β· 1.13 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
#!/bin/bash
# Script to generate secure secrets for .env file
set -e
echo "π Setting up secure secrets for .env file..."
# Create .env file from template if it doesn't exist
if [ ! -f ".env" ]; then
echo "π Creating .env file from template..."
cp .env.example .env
# Generate secure passwords
echo "π Generating secure passwords..."
POSTGRES_PASSWORD=$(openssl rand -base64 32)
JWT_SECRET=$(openssl rand -base64 64)
# Replace placeholders in .env file
sed -i.bak "s/your_secure_database_password_here/$POSTGRES_PASSWORD/g" .env
sed -i.bak "s/your_super_secret_jwt_key_here/$JWT_SECRET/g" .env
rm .env.bak
echo "β
.env file created with generated secure passwords"
else
echo "β οΈ .env file already exists"
fi
echo ""
echo "π Setup complete!"
echo ""
echo "π Next steps:"
echo " 1. Add your API keys to .env file:"
echo " - OPENAI_API_KEY=your_actual_openai_key"
echo " - ANTHROPIC_API_KEY=your_actual_anthropic_key"
echo ""
echo " 2. Run your application:"
echo " docker-compose up"
echo ""
echo "β οΈ Important: Never commit the .env file to version control!"