https://github.com/ublabs/netlify-cms-oauth
Use Netlify CMS for sites hosted on Vercel.
https://github.com/ublabs/netlify-cms-oauth
github jamstack netlify netlify-cms netlifycms oauth2 serverless tailwindcss vercel
Last synced: 9 days ago
JSON representation
Use Netlify CMS for sites hosted on Vercel.
- Host: GitHub
- URL: https://github.com/ublabs/netlify-cms-oauth
- Owner: ublabs
- License: mit
- Created: 2021-02-12T18:30:18.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-28T20:07:11.000Z (about 2 years ago)
- Last Synced: 2024-05-02T02:41:57.124Z (12 months ago)
- Topics: github, jamstack, netlify, netlify-cms, netlifycms, oauth2, serverless, tailwindcss, vercel
- Language: HTML
- Homepage: https://netlify-cms.adrianub.vercel.app
- Size: 43 KB
- Stars: 65
- Watchers: 3
- Forks: 37
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Netlify CMS on Vercel
A simple OAuth2 serverless gateway for Netlify CMS
---
## Why do I need this?
If you would like to use Netlify CMS to manage your site deployed to Vercel.
[GitHub](https://github.com) and [Gitlab](https://gitlab.com) requires a server for authentication and Netlify provides this server only for sites deployed to it. Fortunately, such server is rather small and can work with Vercel's serverless functions.
## Usage
In yours projects modify `config.yml` file:
```yaml
backend:
name: [github | gitlab]
repo: adrian-ub/adrian-ub # Path to your Github/Gitlab repository
branch: main # Branch to update
base_url: https://netlify-cms.adrianub.vercel.app
```## Deploy
- Create Github OAuth App:
- Go to [developer settings](https://github.com/settings/developers)
- Set `Authorization callback URL` to your deployed oauth website's callback URL:
`https://netlify-cms.adrianub.vercel.app/callback`
- Create Gitlab OAuth app:
- Go to [User settings > Applications](https://gitlab.com/-/profile/applications)
- Set `Redirect URI` to your deployed oauth website's callback URL:
`https://netlify-cms.adrianub.vercel.app/callback`
- Set environment variables on `Vercel````shell
OAUTH_GITHUB_CLIENT_ID=
OAUTH_GITHUB_CLIENT_SECRET=OAUTH_GITLAB_CLIENT_ID=
OAUTH_GITLAB_CLIENT_SECRET=
```## Authors
- Adrián UB ([@AdrianUB](https://twitter.com/AdrianUB))