Mendloop Docs Request access

GitHub cloud mode

Own one Mendloop GitHub App that every organization on your install connects by installing it.

By default every organization that connects GitHub creates its own GitHub App: Mendloop builds the app manifest, GitHub creates the app in one click, and Mendloop collects its credentials. Nobody fills in a GitHub form, and a self-hosted install needs nothing but its own server.

If you run Mendloop as a hosted service, you probably want the other shape: you own one Mendloop GitHub App, and a customer connects by installing it. No app to create, no keys, nothing pasted.

Both modes work on the same install, chosen per connection. Setting this up doesn't change any connection that already exists.

Note:

This page is for operators of a Mendloop server. If you only connect your own organization, use GitHub.

1. Create the app, once#

On GitHub: Settings → Developer settings → GitHub Apps → New GitHub App.

Field Value
Homepage URL your Mendloop URL
Webhook URL https://<your ingest host>/hooks/github/app (on the ingest host, not under /api/v1)
Webhook secret a long random string; you need it below
Where can this be installed Any account

Repository permissions, matching Mendloop's read-by-default rule:

  • Contents: Read, and Read & write only if you want fix pull requests
  • Metadata: Read
  • Pull requests: Read, or Read & write for fix pull requests
  • Checks: Read, for fix verification

Subscribe to push, pull_request, check_run and check_suite. installation and installation_repositories don't need to be in that list: GitHub sends them to every app, which is how Mendloop learns that a customer uninstalled it or changed which repositories it can see.

Then generate a private key (.pem) and note the App ID and the app's slug (the last part of github.com/apps/<slug>).

2. Configure your server#

Four settings in .env.production. They go together: set all four or none.

.env.productionConfig
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n…\n-----END RSA PRIVATE KEY-----"
# the \n are literal backslash-n: an env file holds one line, and Mendloop unescapes them
GITHUB_APP_WEBHOOK_SECRET=the-secret-you-generated
GITHUB_APP_SLUG=your-app-slug

These are not GITHUB_OAUTH_CLIENT_ID / GITHUB_OAUTH_CLIENT_SECRET, which are for "Sign in with GitHub".

Restart, then run mendloop doctor:

doctor says Meaning
github app ok instance App <slug>; orgs can install it Ready
github app ok none (orgs create their own App — the self-host default) Not configured, which is the default
github app WARN missing … A partial set. Treated as not configured, so orgs fall back to creating their own app. Set the rest or clear them all.

3. What a customer does#

  1. Integrations → GitHub → Install.
  2. GitHub shows its own screen: which account, and which repositories.
  3. They approve.
  4. Mendloop stores the installation id and nothing else (there are no credentials to store), then runs the connection checks, as it must before any connection is complete.

To read their code, Mendloop mints an installation token from your private key and their installation id. Tokens last an hour and are scoped to the repositories they chose. Write tokens are still minted only after a recorded owner approval.

A customer revokes access by uninstalling the app on GitHub. Mendloop acts on the installation event and marks the connection accordingly.

How deliveries are routed#

With one app there is one webhook URL, the one you set in step 1. Mendloop checks the signature against GITHUB_APP_WEBHOOK_SECRET before reading the body, takes the installation id from the authenticated payload, and finds the connection with that installation id. An unknown installation is answered 202, not 404, so GitHub doesn't keep retrying deliveries for an app that was just uninstalled.

Things worth knowing#

Warning:

One app concentrates risk. If its private key leaks, every installation is exposed, where a per-org app would expose one. Keep the key in instance configuration, never in the database, and treat it like the master key.

  • Rotating the webhook secret affects every customer at once, because they share it. Rotate during a quiet period; GitHub retries rejected deliveries.
  • Self-host is unaffected. With these settings empty, the per-org app is the only path.