Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 5.86 KB

installation.md

File metadata and controls

76 lines (56 loc) · 5.86 KB

Installation Options

We recommend running JKAN on Netlify, but you can also run it on GitHub Pages, Vercel, or any other static website host.

Running on Netlify

Before you start, make sure you have a GitHub account and a Netlify account. JKAN runs fine on the free tier of both.

  1. Create your own copy of JKAN by clicking fork
  2. Create a new site on Netlify. Click the GitHub button, then select your JKAN copy from the list.
  3. Netlify will pre-fill the basic site settings for you. Click Deploy site.

Netlify will then deploy your site, and generate a random URL for it, e.g. https://genuine-tapioca-7d69fa.netlify.app. You can change the URL or add a custom domain in the Netlify settings.

If you're happy to build your JKAN site by editing YAML files directly, you're finished! If you'd like to use JKAN's Editing UI, you'll need a couple more steps. In order to let your site's users sign in with their GitHub account, you'll need to register an OAuth application with GitHub, and then give Netlify those application credentials.

  1. In a new browser tab, register an OAuth application on GitHub
  • Application name: Whatever your site will be called (e.g. JKAN)
  • Homepage URL: The URL of your site, e.g. https://genuine-tapioca-7d69fa.netlify.app or your custom domain
  • Application description: Whatever you like - users will see this when they sign in to your JKAN site
  • Authorization callback URL: https://api.netlify.com/auth/done (Note: it won't work if this one is wrong)
  1. On the next page, take note of the Client ID, as you'll need that in a moment.
  2. Under the Client secrets header, click Generate a new client secret. You'll need this in a moment as well, but be careful where you copy and paste it because it should be treated like a password.
  3. Back in your Netlify browser tab, go to your Site settings, then select Access control, then OAuth.
  4. Click Install provider, select GitHub as the Provider, and copy your Client ID and Client Secret from your GitHub browser tab, then click Install.

You should now be able to sign in to your JKAN site's Editor UI by going to /editor, e.g. https://genuine-tapioca-7d69fa.netlify.app/editor and signing in with your GitHub account.

Running on GitHub Pages (or self-hosting)

Before you start, make sure you have a GitHub account.

  1. Create your own copy of JKAN by clicking fork

GitHub will automatically deploy your JKAN site. You can find its URL and set a custom domain by going to Settings, then Pages on your forked repository.

If you're happy to build your JKAN site by editing YAML files directly, you're finished! If you'd like to use JKAN's Editing UI, you'll need a couple more steps. In order to let your site's users sign in with their GitHub account, you'll need to register an OAuth application with GitHub, and then run a tiny OAuth server to handle the sign in process. There are plenty of options, but we'll use one that runs on Vercel's free tier, so make sure you have a Vercel account before you start.

  1. Register an OAuth application on GitHub
  • Application name: Whatever your site will be called (e.g. JKAN)
  • Homepage URL: The URL of your site, e.g. https://username.github.io/jkan or your custom domain
  • Application description: Whatever you like - users will see this when they sign in to your JKAN site
  • Authorization callback URL: https://github.com (Note: This is a temporary value - we'll come back and change this)
  1. On the next page, take note of the Client ID, as you'll need that in a moment.
  2. Under the Client secrets header, click Generate a new client secret. You'll need this in a moment as well, but be careful where you copy and paste it because it should be treated like a password.
  3. In a new browser tab, navigate to the OAuth server repository we'll be deploying, ublabs/netlify-cms-auth, and click the big blue Deploy button.
  4. In Vercel's Get Started section, click the GitHub button. Vercel will then want to copy the repository to your GitHub account, and ask you to name the repository. Fill in a name, e.g. netlify-cms-oauth.
  5. In the next section, copy your Client ID from an earlier step into the box next to OAUTH_GITHUB_CLIENT_ID, and copy your Client Secret into OAUTH_GITHUB_CLIENT_SECRET.
  6. The other two boxes are not relevant, but they're required to have a value, so enter any value into them, such as what you had for breakfast this morning, then click Deploy.
  7. Once your server is deployed, click on the image preview of the site to navigate to it, and make a note of the URL.
  8. Back in the tab with your GitHub OAuth application, edit your app and change the Authorization callback URL to your vercel app URL.
  9. In your JKAN repository, edit the file editor/decap-cms.yml to add base_url: <your vercel app url> under the backend section:
backend:
  name: github
  base_url: https://your-netlify-cms-oauth-app.vercel.app
  1. Click Commit changes (directly to the branch)

You should now be able to sign in to your JKAN site's Editor UI by going to /editor, and signing in with your GitHub account.