-
Notifications
You must be signed in to change notification settings - Fork 1
Frontend
AOrps edited this page Apr 27, 2022
·
7 revisions
src/front-end
- Google oauth2 credentials { CLIENT_ID + CLIENT_SECRET }
-
.env
file -
valid-sigs.json
file
# To create .env file
touch .env
-
.env
must have the following5
environment variables-
GOOGLE_CLIENT_ID
- This is provided to the developer via Google.
-
GOOGLE_CLIENT_SECRET
- This is provided to the developer via Google.
-
SESSION_KEY
- For the developer to choose. (At the time of writing this it is some random characters but there is definitely a better (and more secure) way of doing this and may be omitted in the future)
-
BENDPOINT
- This should be the endpoint (server, area, etc.) where the
src/api
portion of the code is being run - Be sure to take special note of which protocol that the api server runs. i.e
http
vshttps
- This should be the endpoint (server, area, etc.) where the
-
TYPE
- Helps maintainers / testers
- Option between
"test"
or"prod"
-
"test"
: tests onlocalhost/oauth2/callback
i.e. for testing -
"prod"
: tests onsig-track.xyz/oauth2/callback
endpoint i.e. for production
-
- Default is "test" functionality
-
GOOGLE_CLIENT_ID
- The following is an example. (I would be really surprised and impressed with myself if it somehow works in production using this)
GOOGLE_CLIENT_ID="984389xxx-2jn3nxxx.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-nasdjfn4xxxxxxx"
SESSION_KEY="nfknrkfnf5igi455tgkndg5id"
BENDPOINT="ec2-yeehaw.aws.com"
TYPE="prod"
- File should be a valid json list.
[ "ai", "minecraft", "swe", "sig•mal", "playas-but-better-faster-harder-stronger", "cloud" ]
# Change to src/front-end directory
cd src/front-end
# .env file
cat <<EOF > .env
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
SESSION_KEY=""
BENDPOINT=""
TYPE=""
EOF
# valid-sigs.json file
cat <<EOF > valid-sigs.json
[ "", ""]
EOF