Git Product home page Git Product logo

jekyll-auth's Introduction

Jekyll Auth

A simple way to use GitHub OAuth to serve a protected Jekyll site to your GitHub organization

Gem Version Build Status PRs Welcome

The problem

Jekyll and GitHub Pages are awesome, right? Static site, lightning fast, everything versioned in Git. What else could you ask for?

But what if you only want to share that site with a select number of people? Before, you were SOL. Now, simply host the site on a free, Heroku Dyno, and whenever someone tries to access it, it will Oauth them against GitHub, and make sure they're a member of your Organization. Pretty cool, huh?

Requirements

  1. A GitHub account (one per user)
  2. A GitHub Organization (of which members will have access to the Jekyll site)
  3. A GitHub Application (you can register one for free)
  4. A Heroku account (you can technically use this elsewhere, but the instructions are for Heroku)

Under the hood

Every time you push to Heroku, we take advantage of the fact that Heroku automatically runs the rake assets:precompile command (normally used for Rails sites) to build our Jekyll site and store it statically, just like GitHub pages would.

Anytime a request comes in for a page, we run it through Sinatra (using the _site folder as the static file folder, just as public would be normally), and authenticate it using sinatra_auth_github.

If they're in the org, they get the page. Otherwise, all they ever get is the bouncer.

Further reading

jekyll-auth's People

Contributors

ablelincoln avatar adelevie avatar alexandru-calinoiu avatar asanger avatar atmos avatar barberj avatar bbarker avatar benbalter avatar chrisguzman avatar danrye avatar dependabot-preview[bot] avatar ebramanti avatar fkostadinov avatar gjtorikian avatar gnclmorais avatar ktheory avatar parkr avatar patmaddox avatar paulfitz avatar pborreli avatar sankage avatar shreve avatar splittingred avatar ssaunier avatar tnm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.