-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
env.sh
32 lines (28 loc) · 1.21 KB
/
env.sh
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
#!/bin/bash
echo "If you are not sure what each environmental variable means, please refer to the link below!"
echo -e 'GitHub MD : \e]8;;https://github.com/AgainIoT/Open-Set-Go/blob/main/EnvironmentVariable.md\aEnvironmentVariable.md\e]8;;\a'
echo -e 'Documentations : \e]8;;https://docs.open-set-go.com\aDocumentation(Open-Set-Go.io)\e]8;;\a'
echo
read -p "Enter your GitHub OAuth App's Client ID : " clientID
read -p "Enter your GitHub OAuth App's Client Secret : " clientSecret
read -p "Enter your MongoDB(or atlas) URI(ex.[mongodb:// or mongodb+srv://]) : " mongodbURI
read -p "Enter your any JWT_SECRET you want : " jwtToken
read -p "Enter your any JWT_EXPIRATION_TIME(ms) you want : " jwtExpirationTime
read -p "Enter your mail address : " mailUser
read -p "Enter your mail app password : " mailPass
cat <<EOF >./client/.env
REACT_APP_CLIENT_ID=$clientID
REACT_APP_REDIRECT_URL=http://localhost:3000/login
REACT_APP_SERVER_URL=http://localhost:8080
RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=false
EOF
cat <<EOF >./server/.env
MONGODB_URI=$mongodbURI
CLIENT_ID=$clientID
CLIENT_SECRET=$clientSecret
JWT_SECRET=$jwtToken
JWT_EXPIRATION_TIME=$jwtExpirationTime
MAIL_USER=$mailUser
MAIL_PASS=$mailPass
ORIGIN=http://localhost:3000
EOF