Skip to content

Identify the accounts whose installations are used by ID - #142

Merged
tricknotes merged 2 commits into
mainfrom
installation-account-ids
Nov 23, 2026
Merged

tricknotes merged 2 commits into
mainfrom
installation-account-ids

Conversation

@tricknotes

Copy link
Copy Markdown
Owner

Summary

koroku only uses the GitHub App's installations on accounts it trusts. The owner's account is matched by numeric ID, but the accounts in [github] installation_accounts were matched by login. A login is not a stable identity: when an organization is renamed, its old name becomes free, and whoever takes it and installs the App would have their installation accepted.

  • [github] installation_account_ids: a list of numeric account IDs.
  • installation_accounts keeps working, so an existing host does not lose its installations on upgrade. While it is set, koroku serve logs a warning at startup and koroku check warns. With both set, an installation is used when either matches.
  • Finding the IDs: koroku check prints each installation's account with its ID and the line to write; the system screen shows the ID next to each account, with a copy button, and the line for config.toml.

SETUP recommends the ID form.

Screenshots

Light
Dark
390px
Matched by login only, light
Matched by login only, dark
Matched by login only, 390px

Test plan

  • go vet ./..., go vet -tags integration ./..., go test ./...
  • pnpm lint, pnpm test
  • Tests: configuration (IDs of 0 or less are refused), the filter (ID, login, an account that took over a listed login), koroku check output, the API
  • koroku serve started by hand with a throwaway configuration: the warning appears with installation_accounts and not with IDs only
  • Screenshots from the mock API, checked in light, dark and at 390px
  • A real GitHub App on a real organization

🤖 Generated with Claude Code

tricknotes and others added 2 commits November 24, 2026 04:04
koroku uses the GitHub App's installations only on accounts it trusts:
the owner's, matched by ID, and those in [github] installation_accounts,
matched by login. A login is not a stable identity. When an organization
is renamed its old name becomes free, and since the App has to be
installable on any account to be installed on an organization at all,
whoever registers that name and installs the App would have their
installation, and their repositories, accepted.

Add [github] installation_account_ids, a list of numeric account IDs
(values <= 0 are rejected when the configuration is loaded).
installation_accounts keeps working so that a host does not lose its
installations on upgrade: an account in either list is used. Because the
login list keeps the weakness for as long as it is there, koroku serve
warns at startup when it is set.

So that the operator finds the IDs without the GitHub API:

- koroku check prints every installation's account with its ID. For an
  account matched by login only it prints the installation_account_ids
  line to write (the configured IDs included), and it warns about a
  login list that no used installation needs. The warning about
  installations on accounts koroku ignores now names their IDs.
- GET /api/system/github returns account_id and login_only for each
  installation and installation_account_ids next to
  installation_accounts.

The decision lives in config.GitHub.InstallationAccess, which the
client's filter, the check and the API share, so that "used through the
login alone" means the same thing in all three.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
The accounts whose installations koroku uses are listed in config.toml
by numeric ID, and the operator should not need the GitHub API to find
one. The GitHub App panel shows each installation's account ID under its
login with a copy button, and the line it suggests for config.toml is
installation_account_ids: the configured IDs, the installations that are
not used yet, and the ones used through their login alone.

An installation that is used only because its login is listed says so on
its row, and the guide then tells the operator to remove the
installation_accounts line: a login given up in a rename can be taken by
another account. With nothing to list, the suggested line is a pattern
and has no copy button, so that nobody pastes a line that does not
parse.

The mock API answers with account IDs, and its warnings scenario has an
org matched by login, which the system-github-login screenshots show.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Base automatically changed from deploy-reachable-commits to main November 23, 2026 19:24
@tricknotes
tricknotes merged commit 3e2a7b5 into main Nov 23, 2026
5 checks passed
@tricknotes
tricknotes deleted the installation-account-ids branch November 23, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant