Decap CMS GitHub OAuth Proxy
Decap CMS GitHub OAuth Proxy
This folder contains a Cloudflare Worker that acts as the OAuth proxy for Decap CMS.
Why this exists
ye-rim-oh.github.io is deployed as a static GitHub Pages site. The /admin/ page can render the CMS UI, but GitHub login still needs a small backend service to complete OAuth and return an access token to Decap CMS.
What to create manually
- Create a GitHub OAuth App.
-
Set its authorization callback URL to:
https://YOUR-WORKER-SUBDOMAIN.workers.dev/callback - Save the app’s client ID and client secret.
Cloudflare Worker setup
From this folder:
npm install
npx wrangler login
Create .dev.vars from .dev.vars.example and fill in:
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
Deploy:
npx wrangler deploy
After deploy, note the Worker URL:
https://YOUR-WORKER-SUBDOMAIN.workers.dev
Final repo change after deploy
Update admin/config.yml:
backend:
name: github
repo: ye-rim-oh/ye-rim-oh.github.io
branch: main
base_url: https://YOUR-WORKER-SUBDOMAIN.workers.dev
auth_endpoint: auth
The Worker uses:
SITE_URLto document which site it belongs toOAUTH_SCOPES=public_repofor this public repository
If you later make the repository private, switch the scope to repo.
Health check
Open the Worker root URL after deployment. It should return JSON with ok: true.