Skip to content
forgust-devPublic

About

Forged in Rust, built for Git

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Forgust

A fast, self-hosted code forge written in Rust: Git hosting, code review, issues, CI/CD, a container registry and Pages in a single binary next to Postgres. Bring your existing pipelines and runners, import your projects, and keep your team's whole workflow on your own servers.

CI Rust 1.94+ PostgreSQL 17+ License: MIT

Screenshots

Repository
Repository
Merge request
Merge request
Code review
Code review
Pipeline
Pipeline
Sign in
Sign in
Security findings
Security findings
More screenshots
Job log
Job log
Home
Home
Source file
Source file
Commits
Commits
Merge requests
Merge requests
Issues
Issues
Environments
Environments
Releases
Releases
Container registry
Container registry
Group
Group
User profile
User profile
Project settings
Project settings
Password, 2FA and passkeys
Password, 2FA and passkeys
Admin overview
Admin overview
Admin users
Admin users
Admin runners
Admin runners
Admin storage
Admin storage
Admin health
Admin health

Quick start

git clone https://github.com/forgust-dev/forgust && cd forgust

# Your machine's address, not localhost: CI jobs run in containers and must reach it
export FORGUST_HOST=192.0.2.10

# Start Forgust with Postgres, S3 storage, a mail catcher and a runner
docker compose up -d --build

# Fill it with users, projects, merge requests and pipelines (prints the accounts)
python3 deploy/seed.py

The app is available at http://$FORGUST_HOST:8080, and the emails it sends at http://$FORGUST_HOST:8027.

Production

Run the published image (amd64 and arm64) next to Postgres, or build your own with docker build -t forgust .:

services:
  forgust:
    image: ghcr.io/forgust-dev/forgust:0.7
    restart: unless-stopped
    read_only: true
    tmpfs: [/tmp]
    cap_drop: [ALL]
    security_opt: ["no-new-privileges:true"]
    ports: ["8080:8080", "2222:2222"]
    environment:
      FORGUST_DATABASE__URL: postgres://forgust:change-me@db:5432/forgust
      FORGUST_SERVER__EXTERNAL_URL: https://git.example.com
      FORGUST_SERVER__SSH_EXTERNAL: git.example.com:2222
    volumes: [forgust-data:/var/lib/forgust]
    depends_on:
      db: { condition: service_healthy }
  db:
    image: postgres:17
    restart: unless-stopped
    environment: { POSTGRES_USER: forgust, POSTGRES_PASSWORD: change-me, POSTGRES_DB: forgust }
    healthcheck: { test: ["CMD-SHELL", "pg_isready -U forgust"], interval: 5s }
    volumes: [db-data:/var/lib/postgresql/data]
volumes: { forgust-data: {}, db-data: {} }
  • Verify the image: releases are signed and carry an SBOM, see SECURITY.md.
  • First administrator: the log prints a one-time link on first start (docker compose logs forgust | grep setup).
  • Configuration: every key in forgust.example.toml can be set as FORGUST_<SECTION>__<KEY>; OIDC providers go in [oidc.<name>].
  • Security keys and passkeys are bound to the host of server.external_url, which must be served over https (or be localhost); they are off otherwise. On a move to another host they stop working: people sign in with their password and a recovery code (or an administrator resets their two-factor authentication), then add them again. See SECURITY.md.
  • Backups: forgust backup --output DIR and forgust restore --input DIR cover the database and the repositories. Also keep /var/lib/forgust/secret.key, the SSH host key next to it, and the S3 bucket if you use one.

Features

πŸ“¦ Code

  • Git over HTTP and SSH, Git LFS with file locking
  • Fast code browsing: tree, blame, history, compare, syntax highlighting
  • Smart View: the code as blocks (packages, images, services, database schemas, Helm charts, Kubernetes, Ansible, Terraform and Pulumi, the CI), what each needs and who to ask about it, found from the manifests and the history by assay: turned on per project, a job on the instance's runners maps each new commit of the default branch and of open merge requests with the assay image, which maps any repository in CI
  • Code search across projects: exact text or regular expressions, filters by path, file name and language, only in code you can read
  • Markdown with diagrams (Mermaid), math, alerts and emoji shortcodes
  • Edit files, create branches and tags from the browser
  • Protected branches and tags, push rules, signed-commit verification (GPG and SSH)
  • Releases with notes and attached files

πŸ” Code review

  • Merge requests with threaded line and multi-line comments
  • Suggestions the author applies in one click
  • Approvals, CODEOWNERS, and merge checks (pipeline, approvals, threads, security)
  • Stacked merge requests, merge trains, auto-merge when every check passes
  • Keyboard-driven review: j/k to move, c to comment
  • AI review on request, with any OpenAI-compatible endpoint (a local model works): comments from a bot that never approves, each checked against the diff before it is posted, some with a change to apply in one click. The review runs in CI with the reviewer image, released with Forgust. Off until an administrator sets the endpoint the code is sent to

πŸ—‚οΈ Planning

  • Issues with labels, milestones, due dates, assignees and templates
  • Confidential issues (only Reporters and up, the author and the assignees see them) and internal comments on issues and merge requests (only Reporters and up)
  • Mentions, #12 and !45 references, to-dos and a Home page of what is waiting for you
  • Emoji reactions, watching projects, per-project notification levels
  • A live notification inbox in the app, with a switch per kind of notification for the app and for email

βš™οΈ CI/CD

  • Pipelines with stages and needs graphs, live logs, artifacts, JUnit test reports
  • Runs on GitLab Runner (any executor; Docker is tested): .gitlab-ci.yml files work unchanged within a documented subset, and anything outside it fails with a clear error
  • Schedules, manual and delayed jobs, child pipelines, resource_group, id_tokens
  • Environments and deployments, Pages, a built-in container registry
  • Built-in dependency updates (Renovate), no bot account or token to set up

πŸ” Security

  • Built-in scanners (code, secrets, dependencies, containers, infrastructure as code) with a Security tab, merge request checks and alerts; their vulnerability databases can live on the server, for installs without internet access
  • An SBOM (CycloneDX and SPDX) of each new tag, attached to its release
  • OIDC sign-in, passkeys, two-factor authentication (an authenticator app or security keys, with recovery codes), personal, project and deploy tokens
  • Strict CSP, an image proxy for Markdown images, rate limits

πŸ› οΈ Administration

  • Overview with activity and CI statistics
  • Users: block, reset two-factor, impersonate (audited)
  • Storage by kind and by project, quotas per group and project
  • Runners, background jobs, health checks and backups from the UI
  • An instance banner, and a notice to administrators when a new release is out (can be turned off)

πŸ”Œ Integrations

  • Import from GitLab, GitHub, Gitea and Forgejo, one project or a whole user or organization: repositories, merge requests, issues (confidential ones stay confidential, internal notes internal), labels, CI/CD variables, members; a dry run first, resumable; optionally kept in sync afterwards
  • Repository mirrors, to or from any forge over http(s): pulled on a schedule (the repository is then read-only here), or pushed after every change
  • Webhooks, also formatted for Slack, Discord, Matrix, Mattermost and Teams; confidential issues and internal comments only go to hooks that ask for their own events
  • A GitLab-compatible /api/v4 subset, so Renovate and glab work
  • An MCP server for AI assistants, with OAuth sign-in

Importing projects

From Self-hosted, oldest version Access token
GitLab (gitlab.com or self-managed) 12.10 read_api, read_repository
GitHub (github.com or Enterprise Server) Enterprise Server 3.9 classic repo, or fine-grained read access to contents, issues, pull requests and metadata
Gitea (gitea.com or self-hosted) 1.22 read:repository, read:issue, read:user, read:organization
Forgejo (Codeberg or self-hosted) 8.0 the same as Gitea

A server that says an older version is refused before anything is read. These are the oldest versions with every API the importer uses; run a version the forge still maintains. Public projects import without a token. What each source cannot hand over (Actions secrets, GitHub's resolved threads, wikis, releases, packages) is listed by the dry run.

A project's repository can also be mirrored (Settings > Repository > Mirroring): pulled from another repository every 15 minutes to once a day, its branches and tags replacing the project's (nobody can push, commit or merge there while it is a mirror), or pushed to up to ten others after every change, forced, with branches deleted here deleted there unless only protected branches are pushed. Issues, merge requests and LFS objects are not mirrored. Addresses on a private network are refused unless features.imports_allow_local is on.

Performance

Measured on a 12-vCPU development machine, p95 with one client, release build:

Repository tree, highlighted 2,000-line file, commit diff, blame 1–4 ms
Merge request page and first diff page of a 1,000-file merge request 1–5 ms
Issue list and issue page in a project with 2,000 issues 3–8 ms
Search of projects, issues and merge requests by title, 2,000 issues 12–24 ms
ls-refs with a prefix on a repository with 1M refs 3 ms
Code search in a 2,000-file repository (text one file has, text every file has) 9–20 ms
Code search in the Linux kernel, 97,000 files (plain text, a regular expression) 30–150 ms
Pipeline created β†’ job picked up by a runner 24–40 ms

Pushing one branch to a 1M-ref repository is the one speed target still missed (3.1 s against 300 ms).

Status

Forgust is young (0.7) and built for private teams first. Not there yet: forks and merge requests from forks, wikis, snippets, package registries, issue boards, system hooks, and SAML or LDAP sign-in. Code search covers each project's default branch, not other branches or tags.

Tech stack

Layer Technology
Backend Rust + axum + tokio + sqlx
Git git (writes and transfer) + gitoxide (hot reads), russh for SSH
Frontend React 19 + TypeScript + Vite + TanStack Query
Database PostgreSQL 17+
Job queue graphile_worker (on PostgreSQL)
Storage Local disk or S3-compatible object storage

Development

Contributions are welcome: see CONTRIBUTING.md (commits are signed off under the DCO). Report security problems privately, as SECURITY.md explains.

AI transparency disclosure

AI-assisted contributions are accepted, but must be disclosed on the PR. The same quality and security bar applies regardless of how the code was written.

License

MIT. GitLab is a trademark of GitLab Inc.; Forgust is not affiliated with GitLab.

About

Forged in Rust, built for Git

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages