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.txt
Developed and tested on Python 3.7.4
- Environment variables
Google Oauth & Flask App
FN_AUTH_REDIRET_URI
FN_BASE_URI
FN_CLIENT_ID
FN_CLIENT_SECRET
FN_FLASK_SECRET_KEY
See this guide
Google Sheets API (can be substitude with credentials.json
)
CRED_TYPE
PROJ_ID
KEY_ID
KEY
SERVICE_EMAIL
SERVICE_ID
AUTH_URI
TOKEN_URI
AUTH_PROVIDER
CLIENT_CERT
Enable Google Sheets API and download credentials.json
from GCP
Private Link Spreadsheet
SHEET_NAME
SHEET_ID
Create Google Spreadsheet from the following template
- Run
python3 app.py
The links
app will be listening at http://localhost:5000/
- In development, add
debug=True
as a keyword argument toapp.run
inapp.py
. Remove before deploying to production.