Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 3.74 KB

README.md

File metadata and controls

66 lines (40 loc) · 3.74 KB

IDRC CMS Authenticator

BSD 3-Clause license Latest release codecov

A simple Express application which allows Sveltia CMS or Decap CMS to authenticate with GitHub or GitLab.

Based on netlify-cms-github-oauth-provider and sveltia-cms-auth.

Usage

Configuration

  1. Create an OAuth application on GitHub or GitLab. Make sure to set the authorization callback URL to the callback route of the deployed application. For example, if you were going to deploy the IDRC CMS Authenticator to https://auth.example.com, the authorization callback URL would be https://auth.example.com/callback.
  2. Configure environment variables for the application in a .env file:
# Domain patterns for CMS installations using the IDRC CMS Authenticator
ALLOWED_DOMAINS=example.com,*.example.com
# GitHub or GitLab OAuth application client ID
OAUTH_CLIENT_ID=""
# GitHub or GitLab OAuth application client secret
OAUTH_CLIENT_SECRET=""

If you are using GitHub Enterprise Server or a self-hosted instance of GitLab you'll also need to set GIT_HOSTNAME to the hostname of your server.

Serving locally

  1. Install the required packages: npm install
  2. Run the application: npm start

The application will be available at http://localhost:3000.

Note: that the authorization callback cannot redirect to a localhost URL, but you will be able to test the authorization flow.

Serving locally using Docker

You can also build and serve the application locally from a Docker container.

With Docker installed, run the following commands to build a Docker image and start a container:

  1. Build the image: docker build -t idrc-cms-authenticator .
  2. Run the container: docker run --name idrc-cms-authenticator -p 3000:3000 idrc-cms-authenticator

The server will be available at http://localhost:3000.

Note: the authorization callback cannot redirect to a localhost URL, but you will be able to test the authorization flow.

Deployment using Docker Compose

The project contains an example Docker Compose file which can be used as a basis for deploying the application with Docker Compose. For more information on how to modify the file for this purpose, see "Use Compose in production".

License

IDRC CMS Authenticator is available under the New BSD License.

Third Party Software in IDRC CMS Authenticator

IDRC CMS Authenticator is based on other publicly available software, categorized by license:

MIT License