| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This example Worker sits in front of ripgit, handles GitHub OAuth, issues browser session cookies, mints long-lived tokens, and forwards trusted X-Ripgit-Actor-* headers to the main ripgit Worker through a Service Binding.
Everything else is forwarded to ripgit.
Set these in cloudflare.config.ts or as Worker secrets:
workers-oauth-provider also injects the OAUTH_PROVIDER helper at runtime.
Create a GitHub OAuth App at https://github.com/settings/applications/new.
From the repo root:
cd examples/github-oauth
npm install
npm run dev:fullThat runs two cf dev servers that find each other through Wrangler's local dev registry, so the RIPGIT Service Binding declared in cloudflare.config.ts resolves:
Then:
Example push:
git remote add origin http://USERNAME:TOKEN@localhost:8787/USERNAME/my-project
git push origin mainCreate the KV namespace and fill the ID into examples/github-oauth/cloudflare.config.ts:
cf kv namespaces create --title OAUTH_KVSet the secrets:
cf workers secrets update GITHUB_CLIENT_SECRET --worker ripgit-auth
cf workers secrets update SESSION_SECRET --worker ripgit-authDeploy ripgit first, then the auth worker:
cf deploy
cd examples/github-oauth
cf deployMake sure the RIPGIT binding in examples/github-oauth/cloudflare.config.ts points at the deployed ripgit Worker name.
After deployment, update the GitHub OAuth App callback URL to your deployed auth worker URL.
The auth worker landing page and /settings support the same text-mode negotiation as ripgit repo pages:
curl -H 'Accept: text/markdown' https://your-auth-worker.example/
curl -H 'Accept: text/plain' https://your-auth-worker.example/settings
curl 'https://your-auth-worker.example/settings?format=md'The text pages explain what the auth worker does, which paths are available, and which POST actions require an authenticated session.
| Back | FazBrowse Home | New Git URL |