A secure shortlink server inspired by CS61A's Link Servers (links, shortlinks)
- Create a virtualenv
python3 -m venv env
source env/bin/activate
pip install -r requirements.txtDeveloped and tested on Python 3.7.4
- Environment variables
Google Oauth & Flask App
FN_AUTH_REDIRET_URIFN_BASE_URIFN_CLIENT_IDFN_CLIENT_SECRETFN_FLASK_SECRET_KEY
See this guide
Google Sheets API (can be substitude with credentials.json)
CRED_TYPEPROJ_IDKEY_IDKEYSERVICE_EMAILSERVICE_IDAUTH_URITOKEN_URIAUTH_PROVIDERCLIENT_CERT
Enable Google Sheets API and download credentials.json from GCP
Private Link Spreadsheet
SHEET_NAMESHEET_ID
Create Google Spreadsheet from the following template
- Run
python3 app.pyThe links app will be listening at http://localhost:5000/
- In development, add
debug=Trueas a keyword argument toapp.runinapp.py. Remove before deploying to production.