Skip to content

Build and serve a mkdocs website on heroku with Github Authentication

Notifications You must be signed in to change notification settings

brianjking/protect-static-site

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Password Protected Static Site

This node app build and serve a mkdocs website on heroku with Github Authentication

Setup

  1. Add a webhook to the repo that includes the mkdocs. The webhook address is http://example.com/github/callback
  2. Register an application with Github to use the Github OAuth service.

Config

Heroku

On Heroku set the following paramaters using heroku config:set VARIABLE=VALUE

GITHUB_CLIENT_ID=client_id
GITHUB_CLIENT_SECRET=client_secret
SITE_URL=https://example.com
DIST_FOLDER=site
REPO=developmentseed/example

If the repo is private you also need to add the username and password of a github account that has access to the repo:

GITHUB_USER=username
GITHUB_PASS=password

User Limt

To limit access to specific set of github users, add usernames separated by comma to as environemt variables:

USER_LIST=user1,user2,user3

Development

Add above configurations to .env file.

Launch

$ node index.js

About

Build and serve a mkdocs website on heroku with Github Authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.7%
  • HTML 4.3%