Overview

Self-hosted code review and repository automations for GitHub, GitLab, Bitbucket (Cloud and Data Center), Forgejo and Gitea. Choose when an automation runs, which model it uses, whether it reviews or writes a fix, and where it posts the result.

Diffrook uses a Rust service, a React web interface, and SQLite. The application runs in one Docker container with a persistent data volume. Connect it to an existing Ollama instance or an OpenAI-compatible or Anthropic endpoint.

The dashboard checks GitHub releases, including pre-releases, every 15 minutes. Choose manual installation, including pre-releases, or automatic in-container updates to stable releases only. Automatic updates are supported on Linux x86-64 and ARM64 Docker deployments. Each release publishes a matching update package; Diffrook verifies GitHub's SHA-256 asset digest, stages the package in /data, and restarts gracefully after active runs have finished. It rolls back to the image version if the updated process fails before the server starts. Back up /data before installing an update. Other platforms can inspect releases and update through their normal container workflow.

This version is the 0.2.0-beta.3 self-hosted preview. Cloud Hosting remains Coming soon and cannot be purchased or activated. See release and upgrade instructions before upgrading an older installation.

Security audit pending. Diffrook has not yet completed an independent security audit. We are waiting for that audit; until it is finished, review the security scope before connecting production repositories.

Run with Docker

docker compose up --build -d
docker compose logs diffrook

Open http://localhost:8080. Use the setup token printed in the logs to create the first administrator. The setup token is not an AI API key. Provider keys and repository tokens are entered in the web interface after setup.

The included Compose file binds to localhost. Copy .env.example to .env to change the address or port. For remote access, put the service behind an HTTPS reverse proxy and set DIFFROOK_SECURE_COOKIES=true. Proxy requests and webhooks to port 8080.

The container runs as UID 10001 without a Docker socket, privileged access, or a separate database service. A bind-mounted data directory must be writable by UID 10001. The named volume in the example handles this automatically.

Configure an automation

For company SSO and Internet access, see SSO and HTTPS deployment. Each installation configures its own hostname and OpenID Connect provider, with an explicit administrator allowlist. SSO defaults to disabling password login.

  1. Create a code host connection with a bot account token and webhook secret. See code hosts.
  2. Create an AI provider and test the connection.
  3. Add reusable destinations in Notifications. Discord, Slack, Teams and generic webhook URLs are encrypted at rest and can be test-sent from this page.
  4. Create an automation. Select repositories, model, trigger, filters, action, limits and notification destinations.
  5. Configure a webhook in the repository that posts to https://YOUR-HOST/api/webhooks/CONNECTION_ID, or use scheduled and manual runs.
  6. Inspect each run in the web interface. Findings include the location, explanation, severity and suggested correction.

Code hosts

TypeURLTokenRepository formatWebhook
GitHubhttps://api.github.com, or https://HOST/api/v3 for Enterprise ServerPersonal access tokenowner/repoContent type application/json, secret set. Events: pull requests, issues, issue comments
GitLabhttps://gitlab.com or the self-managed rootPersonal, project or group token with api scopegroup/repo or group/subgroup/repoSecret token set. Triggers: merge request, issue and comment events
Bitbucket Cloudhttps://api.bitbucket.orgWorkspace or repository access token, or email:API tokenworkspace/repoSecret set. Triggers: pull request created, updated and comment created; issue created, updated and comment created
Bitbucket Data CenterInstance rootHTTP access token with repository writePROJECT/repo or ~user/repoSecret set. Events: pull request opened, source branch updated and comment added
ForgejoInstance rootAccess token with repository and issue scopesowner/repoForgejo webhook, content type application/json, secret set
GiteaInstance rootAccess token with repository and issue scopesowner/repoGitea webhook, content type application/json, secret set

GitLab merge requests and Bitbucket pull requests are handled as pull requests. Bitbucket Data Center has no issue tracker, so issue automations are not available there. Bitbucket Cloud issues have no labels; their kind and component are used as labels for filters. Bitbucket sends one event for both new commits and pull request edits, so a review can also run after an edit.

Comment commands (/diffrook) need an allowed-actors list on every host except GitHub, because only GitHub reports whether the commenter is a repository member.

Typical automations include reviewing a newly opened PR, auditing a branch every Monday at 09:00 in a selected timezone, and creating a fix PR for an issue carrying a selected label.

Each automation has its own model. Models must follow structured-output instructions for findings and file changes. Provider compatibility and review quality depend on the configured model. The application never treats model output as permission to enable a write action.

Reviews and fixes

Reviews use the repository tree and file contents to inspect changes in context. Runs record coverage and skipped content when configured limits are reached. A completed review is not proof that a merge is safe.

Comment-only automations do not write code. Fix automations can create a branch and PR, or update an existing PR branch when explicitly configured. Diffrook does not merge PRs automatically.

The initial execution mode prepares file changes through the platform APIs. It does not run repository scripts, install dependencies, or execute generated code inside the application container. Configure the repository's CI to build and test proposed changes. Run output distinguishes analysis from test verification.

Storage and backups

Configuration, sessions, run history and the encryption key live under /data. Back up the entire volume, including the key. Encrypted credentials cannot be restored without the matching key.

Stop the application before copying the volume so the SQLite database and its write-ahead log stay consistent:

docker compose stop diffrook
docker run --rm -v YOUR_VOLUME_NAME:/data:ro -v "$PWD/backups:/backup" alpine tar czf /backup/diffrook-data.tgz -C /data .
docker compose start diffrook

Use docker volume ls to find the actual Compose volume name. Keep backups private because they include the encryption key. Restore to an empty volume while the application is stopped and preserve file ownership.

Development

Install a current stable Rust toolchain and Node.js 22 or later.

cd web
npm ci
npm run build
cd ..
cargo run

Use DIFFROOK_WEB_DIR=web/dist and DIFFROOK_DATA_DIR=data for a local run if needed. For frontend hot reload, run npm run dev in web while the Rust API is running.

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test

See the architecture and the implementation contract for the service boundaries and API schema.

Project status

This is the first implementation. GitHub, GitLab, Bitbucket Cloud, Bitbucket Data Center, Forgejo and Gitea are supported. An isolated command runner can be added through the existing boundaries.

License

Copyright 2026 Alexandre Ramos and Diffrook contributors.

Diffrook is source-available under the Diffrook Personal and Business License. The free Individual plan permits personal, noncommercial self-hosted use with one user and three saved automations, including disabled automations. Company, team, employment, freelance and other professional use requires a paid plan in stable releases. During beta, Freelancer and Teams are free, with their normal limits and commercial self-hosted use. Enterprise is excluded. Choose your free plan in Settings, without payment or a signed file. The beta offer does not grant a stable paid license or create automatic billing. The following prices are for the official release:

Self-hosted planUsersSaved automationsSSOPrice
Individual13NoFree forever
Freelancer110No€5.99 / month
TeamsUp to 1020 per userYes€9.99 / user / month
Enterprise10+20 per user, pooled across the companyYesContact us

Prices are in EUR and exclude applicable tax. All self-hosted plans bring their own AI and infrastructure; there is no execution-based license charge. Previously issued Business licenses remain supported. New paid sales are disabled until legal and fiscal setup is complete. During beta, Settings activates Individual, Freelancer or Teams for free.

Cloud Hosting: Coming soon. Planned hosted subscriptions use the same limits:

Cloud planUsersSaved automationsSSOPrice
Individual13No€5.99 / month
Freelancer110No€9.99 / month
TeamsUp to 1020 per userYes€14.99 / user / month
Enterprise10+20 per user, pooled across the companyYesContact us

Cloud can use your own AI key or managed Claude Sonnet 5.5 and Claude Opus 5.5, metered per million tokens at twice Anthropic's API list price. Cloud purchase, activation and managed AI billing are unavailable. Hosted subscriptions will have separate service terms. Third-party hosting or resale requires separate written authorization. See plans and license installation.

These terms are not an OSI open-source license. Rights already granted for earlier CC BY-NC 4.0 material remain intact; its original license is retained. Third-party dependencies keep their respective licenses.

This page is README.md from Diffrook v0.2.0-beta.3.