forked from codu-code/codu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·29 lines (24 loc) · 1.42 KB
/
setup.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
#!/bin/bash
echo "#################################################"
echo "# #"
echo "# Welcome to Codu Hacktober Fest #"
echo "# #"
echo "#################################################"
echo "Please create an OAuth app on GitHub by following these steps:"
echo "- Go to https://github.com/settings/developers"
echo "- Click on 'New OAuth App'"
echo "- For 'Homepage URL', copy your URL from Gitpod, and after 'https://' and before your username, add '3000-'"
echo "- For 'Authorization callback URL', copy your 'Homepage URL' and add '/api/auth' to the end"
echo "- Click 'Register application'"
echo "- You will be redirected to another screen with app env variables, keep this page open and proceed with the following prompts:"
read -p "Enter your Client Id env variable: " GITHUB_ID
read -p "Click generate a new client secret. Enter your GitHub Secret env variable: " GITHUB_SECRET
read -p "Copy and past your auth callback url here: " URL
echo "- Nice, now open two terminals and run the following commands: "
echo "- Terminal 1) - docker-compose up "
echo "- Terminal 2) - npm db:migrate, npm db:seed, npm run dev "
# Create .env file
echo "DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres" > .env
echo "GITHUB_ID=$GITHUB_ID" >> .env
echo "GITHUB_SECRET=$GITHUB_SECRET" >> .env
echo "NEXTAUTH_URL=$URL" >> .env