PrivPage

ISC

Serves static sites from a privpage branch, using GitHub's OAuth2.

The server is written in Crystal

Features

Environment variables

| variable | value | |----------------------|-------------| |GITHUB_OAUTH_SECRET_ID|mandatory| |GITHUB_OAUTH_CLIENT_ID|mandatory| |PORT | 3000 |

Usage

First, set the environment variables.

For the test ones: set -a; . ./.env-test; set +a

Build (add --release for release builds)

crystal build src/privpage.cr

Execute

./privpage

Test:

Architecture

This is a high level explanation of how this project works.

For more information of how GitHub OAuth works, see the official documentation.

  1. The client requests a resource
  1. Provider's (e.g. GitHub) OAuth page
  1. The callback request is received from the OAuth provider
  1. A call is performed to the API to get the resource, which is then served to the client.

Serving from a documentation directory

GitHub Pages allows to serve from a /docs directory, which is not supported by PrivPage.

However, it is possible to create a branch which will have the files of the directory at the root.

For a GitHub Actions example to how build a page site from a directory, see this file. Of course, adapt it to your needs.

For any question, add a comment to the related issue, or ask to the Gitter chat.

License

Copyright (c) 2020-2021 Julien Reichardt - ISC License