GitHub sign-in
How MausBot signs in to GitHub for its own git and GitHub actions, what GitHub shows, and how to revoke it.
MausBot can sign in to GitHub once, so the server can clone, push and open pull requests for your bots. Nothing has to be registered first: MausBot uses GitHub's own command line tool, GitHub CLI, and its device-code sign-in.
How the sign-in works
- You start the sign-in. Where GitHub CLI is not installed, as on a MausBot Cloud or a computer without it, the first sign-in first downloads it (about 15 MB). MausBot checks the download against the release it pins before anything runs.
- MausBot shows a one-time code, such as
ABCD-1234, and the address https://github.com/login/device. - Open that address, sign in to GitHub if asked, type the code and approve the request.
- MausBot shows Signed in as your GitHub username.
The code is good for 15 minutes. If it expires or you cancel, start again for a new code.
What GitHub shows
GitHub lists the grant as GitHub CLI under your account's authorized OAuth apps. It asks for the same scopes GitHub CLI always asks for:
repo: your repositories, including private onesread:org: which organizations and teams you belong togist: your gists
MausBot asks GitHub for a sign-in that does not expire, and GitHub normally gives one. If GitHub gives a sign-in that expires instead, GitHub CLI renews it whenever MausBot uses it. Either way it works until you revoke it on GitHub or sign out in MausBot.
Where the sign-in is kept
- MausBot Cloud and self-hosted servers. Each sign-in has its own private folder in the server's data folder. Where bots run in their sandbox, as on every MausBot Cloud, that folder is never inside it. The folder is never part of a backup, so a Cloud restored from a backup or moved to another server starts without the sign-in: sign in again there. The server uses the token for git and GitHub actions on the bots' behalf and never hands it to a bot.
- Team Cloud. Each member signs in with their own GitHub account. Nobody can use another member's sign-in.
- This computer. If you already signed in with GitHub CLI yourself (
gh auth login), MausBot shows signed in via GitHub CLI and asks nothing more. MausBot reads that sign-in and never changes it. To sign out of it, rungh auth logoutin your own terminal.
On Windows, GitHub CLI keeps sign-ins in Windows Credential Manager, which MausBot cannot keep separate. So on Windows MausBot starts its own sign-in only when your own GitHub CLI says it is signed out, or when Credential Manager holds no GitHub CLI entry at all. Otherwise it asks you to paste a token instead.
Using a token instead
You can paste a fine-grained personal access token instead of using the code. Create one at https://github.com/settings/personal-access-tokens, give it access to the repositories your bots should work on, then paste it into MausBot. MausBot checks the token with GitHub once and keeps it in its encrypted Vault on this server. Like a GitHub CLI sign-in, the token is never shown back and never reaches a bot.
Signing out and revoking
Signing out in MausBot deletes the sign-in from the server. It does not revoke the sign-in on GitHub. To cut off access completely:
- Open https://github.com/settings/applications and choose Authorized OAuth Apps.
- Select GitHub CLI, then Revoke.
Revoking also signs out every other copy of GitHub CLI you signed in with that account, on any computer. For a pasted token, delete it at https://github.com/settings/personal-access-tokens.