This lets you sign in to Gitea with Pocket ID: git.nul.ie gets a login source named id.nul.ie.
Pocket ID side:middleman declares the client gitea in my.pocket-id, with callback https://git.nul.ie/user/oauth2/id.nul.ie/callback. Its secret, gitea/oidc-secret.txt, is encrypted for both middleman and the git VM.
Gitea side: Gitea keeps login sources in its database, so a giteapreStart step runs gitea admin auth add-oauth the first time and update-oauth after that. I tested both against a throwaway SQLite Gitea 28.3; it ends up with exactly one source.
Failures don't stop Gitea: the server only reads login sources at startup, so this has to run before it. If the step fails, it logs a warning and Gitea starts without the source. Every command it runs is a full store path. (The first deploy called a bare awk, which isn't on the unit's PATH; Gitea went into a restart loop and was rolled back.)
Accounts:DISABLE_REGISTRATION stays on, so a Pocket ID sign-in can't create an account. The first sign-in links to an existing account (Gitea's default ACCOUNT_LINKING = login), which takes that account's password once.
No group restriction: Gitea's own accounts are the gate, so I didn't restrict the client to a group. I also didn't map Pocket ID groups to Gitea admin, because Gitea would then take admin away from any admin who isn't in the group.
Secret on the command line: the Gitea CLI only takes the secret as an argument, so it's briefly visible in the git VM's process list while preStart runs.
Deploying
Deploy middleman first, so the client exists before Gitea starts using it, then git.
Later
Once accounts are linked, the password form could be turned off (ENABLE_PASSWORD_SIGNIN_FORM = false). Tokens and SSH keys would keep working.
This lets you sign in to Gitea with Pocket ID: `git.nul.ie` gets a login source named `id.nul.ie`.
- **Pocket ID side:** `middleman` declares the client `gitea` in `my.pocket-id`, with callback `https://git.nul.ie/user/oauth2/id.nul.ie/callback`. Its secret, `gitea/oidc-secret.txt`, is encrypted for both `middleman` and the `git` VM.
- **Gitea side:** Gitea keeps login sources in its database, so a `gitea` `preStart` step runs `gitea admin auth add-oauth` the first time and `update-oauth` after that. I tested both against a throwaway SQLite Gitea 28.3; it ends up with exactly one source.
- **Failures don't stop Gitea:** the server only reads login sources at startup, so this has to run before it. If the step fails, it logs a warning and Gitea starts without the source. Every command it runs is a full store path. (The first deploy called a bare `awk`, which isn't on the unit's `PATH`; Gitea went into a restart loop and was rolled back.)
- **Accounts:** `DISABLE_REGISTRATION` stays on, so a Pocket ID sign-in can't create an account. The first sign-in links to an existing account (Gitea's default `ACCOUNT_LINKING = login`), which takes that account's password once.
- **No group restriction:** Gitea's own accounts are the gate, so I didn't restrict the client to a group. I also didn't map Pocket ID groups to Gitea admin, because Gitea would then take admin away from any admin who isn't in the group.
- **Secret on the command line:** the Gitea CLI only takes the secret as an argument, so it's briefly visible in the `git` VM's process list while `preStart` runs.
## Deploying
Deploy `middleman` first, so the client exists before Gitea starts using it, then `git`.
## Later
Once accounts are linked, the password form could be turned off (`ENABLE_PASSWORD_SIGNIN_FORM = false`). Tokens and SSH keys would keep working.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add an `id.nul.ie` OpenID Connect login source to Gitea, kept up to
date from `preStart` since Gitea stores login sources in its database.
Its client is declared on `middleman` with the secret shared by both.
Registration stays disabled, so a Pocket ID sign-in links to an
existing account.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This lets you sign in to Gitea with Pocket ID:
git.nul.iegets a login source namedid.nul.ie.middlemandeclares the clientgiteainmy.pocket-id, with callbackhttps://git.nul.ie/user/oauth2/id.nul.ie/callback. Its secret,gitea/oidc-secret.txt, is encrypted for bothmiddlemanand thegitVM.giteapreStartstep runsgitea admin auth add-oauththe first time andupdate-oauthafter that. I tested both against a throwaway SQLite Gitea 28.3; it ends up with exactly one source.awk, which isn't on the unit'sPATH; Gitea went into a restart loop and was rolled back.)DISABLE_REGISTRATIONstays on, so a Pocket ID sign-in can't create an account. The first sign-in links to an existing account (Gitea's defaultACCOUNT_LINKING = login), which takes that account's password once.gitVM's process list whilepreStartruns.Deploying
Deploy
middlemanfirst, so the client exists before Gitea starts using it, thengit.Later
Once accounts are linked, the password form could be turned off (
ENABLE_PASSWORD_SIGNIN_FORM = false). Tokens and SSH keys would keep working.🤖 Generated with Claude Code
540366abacto712fabcb62