https://github.com/hatappo/netlifycms-oauth-server
Netlify CMS - GitHub Backend OAuth2 server for Firebase Functions. It's written in Clojurescript / Node.js / Express
https://github.com/hatappo/netlifycms-oauth-server
clojurescript firebase-functions netlify-cms netlifycms oauth2 shadow-cljs
Last synced: 4 months ago
JSON representation
Netlify CMS - GitHub Backend OAuth2 server for Firebase Functions. It's written in Clojurescript / Node.js / Express
- Host: GitHub
- URL: https://github.com/hatappo/netlifycms-oauth-server
- Owner: hatappo
- Created: 2021-11-11T10:07:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-16T04:15:46.000Z (almost 3 years ago)
- Last Synced: 2025-07-10T11:08:20.755Z (4 months ago)
- Topics: clojurescript, firebase-functions, netlify-cms, netlifycms, oauth2, shadow-cljs
- Language: Clojure
- Homepage:
- Size: 470 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-decap-cms - netlifycms-oauth-server - OAuth client implementation in Firebase Cloud Function (Clojurescript). (OAuth Client)
- awesome-decap-cms - netlifycms-oauth-server - OAuth client implementation in Firebase Cloud Function (Clojurescript). (OAuth Client)
README
# netlifycms-oauth-server
This is GitHub OAuth2 server for [NetlifyCMS](https://www.netlifycms.org/) , which is intended to deployed to [Firebase Functions](https://firebase.google.com/docs/functions).
## Set up development environment
Fork and clone this repo. Then,
```sh
npm install
```
## Set up GitHub OAuth app
Vist https://github.com/settings/developers (or `https://github.com/organizations//settings/applications`) and register a new OAuth application.
- `Application name` - free
- `Homepage URL` - free
- `Application description` - free
- `Authorization callback URL` - `https://asia-northeast1-.cloudfunctions.net/oauth/callback`
If you don't have Firebase projects yet here, you can change the callback url after created it.
## Configure Netlify CMS
In yours projects modify `config.yml` file:
```yaml
backend:
name: github
repo: /netlifycms-oauth-server
branch: main # Or branch you want to update
base_url: https://asia-northeast1-.cloudfunctions.net
auth_endpoint: /oauth/auth
```
## Set up Firebase Functions
```
npx firebase login
npx firebase use
npx firebase functions:config:set oauth.client_id= oauth.client_secret=
```
## commands
### local development
build
```
npx shadow-cljs watch app
```
run server
```
node out/netlifycms-oauth-server.js
```
connect repl
```
npx shadow-cljs cljs-repl
```
### local Firebase Functions emulator server
```sh
cp package.json functions/
cp .runtimeconfig.json functions/
# or
# npx firebase functions:config:get > functions/.runtimeconfig.json
npx shadow-cljs compile functions
npx firebase login
npx firebase use
npx firebase serve -p 5001
```
### release to Firebase Functions
build release js file
```
npx shadow-cljs release functions
cp package.json functions/
```
deploy to Firebase Function
```
npx firebase use
npx firebase deploy --only functions:oauth
```
### release simple example one for debug
```
npx shadow-cljs release example-functions
cp package.json functions/
npx firebase deploy --only functions:example
```
## TODOS
- [ ] CI/CD. But this type of app is not frequently released.
- [ ] Other Git Service support e.g. GitLab, GitHub Enterprise