Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.42 KB

README.md

File metadata and controls

58 lines (41 loc) · 1.42 KB

links

A secure shortlink server inspired by CS61A's Link Servers (links, shortlinks)

Local Setup

  1. Create a virtualenv
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Developed and tested on Python 3.7.4

  1. 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

  1. Run
python3 app.py

The links app will be listening at http://localhost:5000/

Development

  1. In development, add debug=True as a keyword argument to app.run in app.py. Remove before deploying to production.