-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup_backend.sh
More file actions
executable file
·40 lines (34 loc) · 1.39 KB
/
setup_backend.sh
File metadata and controls
executable file
·40 lines (34 loc) · 1.39 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
#!/usr/bin/env bash
#
# setup_backend.sh
#
# Interactive script to configure your backend environment variables.
# Creates a .env file in the specified path with user-provided keys.
echo "============================================================"
echo " Welcome to the Olaf Backend Setup!"
echo " This script will create a .env file in your backend folder"
echo " with the API keys you provide."
echo "============================================================"
echo
# Prompt user for keys
read -rp "Enter your E2B_API_KEY: " E2B_API_KEY
read -rp "Enter your E2B_TEMPLATE ID (default: vh7kehbtf0t4xbx9ec9u, OpenTechBio's original template): " E2B_TEMPLATE
E2B_TEMPLATE=${E2B_TEMPLATE:-vh7kehbtf0t4xbx9ec9u}
read -rp "Enter your OPENAI_API_KEY (e.g., sk-...): " OPENAI_API_KEY
BACKEND_ENV_PATH="backend/functions"
mkdir -p "$BACKEND_ENV_PATH"
# Write out the .env file
cat <<EOF > "$BACKEND_ENV_PATH/.env"
# This is a template environment file for your backend (Firebase Functions).
# Replace placeholders with your real keys.
E2B_API_KEY=${E2B_API_KEY}
E2B_TEMPLATE=${E2B_TEMPLATE}
OPENAI_API_KEY=${OPENAI_API_KEY}
EOF
echo
echo "============================================================"
echo "Your .env file has been created at:"
echo " $BACKEND_ENV_PATH/.env"
echo "============================================================"
echo "Setup complete! You can now deploy or run your Firebase functions."
echo