codr

module
v0.0.0-...-bd25097 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: AGPL-3.0

README

Codr

Codr

CI Latest release

Your code, on your own machine. · Kod anda, di mesin anda.
codr.my · live example · design · AGPL-3.0-or-later · Built in Malaysia by Aiman Malib · Sasa Teguh

Codr is a self-hosted git forge in one Go binary. Your repositories stay plain bare git repositories on disk next to one SQLite file, so you can always clone straight from the data folder, even with the server stopped. The interface is in English and Malay, in light and dark, and works on a phone.

Bahasa Melayu ↓

Why Codr

  • One binary, one folder. No Postgres, Redis or queue. Back up the data folder, or let codr backup take a consistent snapshot while it runs.
  • Real git. Every transport operation runs the git binary itself. Nothing parses packs by hand.
  • Rules on the server. Protected branches, size limits, required checks and read-only mirrors are enforced for SSH and HTTPS alike.
  • Small enough to read. One permission function decides who can see what, everywhere. Every decision is written down with its reason and its way back.

What it does

Code File tree with the last commit on each row, syntax highlighting, history, blame, in-repository search, READMEs with their images, Git LFS, a wiki kept in git
Collaboration Issues with labels and assignees, pull requests with reviews and line comments, merge, squash or rebase, fixes #12 closing issues, owner/repo#12 links, forks
Teams Organisations with teams and roles, collaborators, notifications by bell and email, a dashboard feed and profiles filtered by what the viewer may read
CI codr-runner runs .codr/ci.toml jobs on every push in containers with no network; results show as checks, and a protected branch can wait for them (guide)
Integrations REST API with an OpenAPI description, signed webhooks that refuse private addresses, commit statuses, mirrors from GitHub or any URL with their issues and pull requests
Accounts SSH keys and scoped tokens, two-step sign-in with recovery codes, signed-in browser list, optional OpenID Connect sign-in
Your data codr backup takes a consistent snapshot while the server runs and codr restore rebuilds an identical install (schedule it with cron or a systemd timer); optional scheduled, encrypted copies in your own S3, R2 or B2 bucket, each downloaded again and verified; a data report and a personal export for every user
AI, if you want it Pull request summaries and review notes from a model endpoint you choose. Off until you turn it on, per repository

Quick start

You need Linux (amd64 or arm64) and git 2.40 or newer. Docker only if you run CI.

# 1. the binary: from the latest release (check it against SHA256SUMS on the release page)
curl -fLO https://github.com/sasateguh/codr/releases/latest/download/codr-linux-amd64
sudo install codr-linux-amd64 /usr/local/bin/codr
# 2. a data folder you own
sudo mkdir -p /srv/codr && sudo chown "$USER" /srv/codr
codr init --dir /srv/codr && cd /srv/codr
# 3. an admin, then the servers
printf 'a-long-password\n' | codr admin user add you --admin
codr serve                       # SSH 127.0.0.1:2222 + HTTP 127.0.0.1:3000

Then open http://localhost:3000, sign in, and add an SSH key or a token under your account. Addresses live in config.toml under [server]: http_addr / http_host and ssh_addr / ssh_host. codr doctor checks the config, database, git version, hooks, keys and disk space, one line per check. CI is optional: take codr-runner from the same release and follow docs/ci.md.

From source (Go 1.27 or newer): git clone https://github.com/sasateguh/codr && cd codr && go build -o codr ./cmd/codr, or go install codr.my/codr/cmd/codr@latest. scripts/build-release.sh vX.Y.Z builds the release binaries byte for byte.

Codr and other forges

Codr is for one person or a small team who want a forge they can read end to end. Gitea and Forgejo do much more, and are the better choice if you need it.

Codr Gitea / Forgejo
Install one Go binary + git one Go binary + git
Database SQLite only SQLite, MySQL, PostgreSQL and others
CI codr-runner, jobs with no network by default Actions-compatible runner and a large catalogue of actions
Packages, registries no yes
Federation no in progress (Forgejo)
Interface languages English and Malay, both complete many languages
Licence AGPL-3.0-or-later MIT (Gitea), GPL-3.0-or-later (Forgejo)

How it is built

Go and html/template rendered on the server, one CSS file, no JavaScript framework, a strict CSP with no inline code. Every user-facing string lives in locale/*.json; every tunable value lives in config.toml or the settings table. The gate (scripts/gate.sh) runs gofmt, vet, staticcheck, gosec, govulncheck, the race-enabled tests and a browser pass in Chromium and WebKit (iPhone 13) with axe accessibility checks in both themes. A release is only deployed from a tree that passed the whole gate.

Read more: design in one page · CI guide · changelog · contributing · security · licence

Bahasa Melayu

Codr ialah forge git swa-hos dalam satu binari Go. Repo kekal bare repo git biasa di cakera, bersebelahan satu fail SQLite, jadi anda sentiasa boleh klon terus dari folder data walaupun pelayan berhenti. Antara muka dalam Bahasa Melayu dan Inggeris, tema cerah dan gelap, dan selesa di telefon.

  • Satu binari, satu folder. Tiada Postgres, Redis atau baris gilir. Backup folder data, atau codr backup untuk snapshot ketika berjalan.
  • Git sebenar. Setiap operasi git menjalankan binari git itu sendiri.
  • Peraturan di pelayan. Cawangan dilindungi, had saiz, semakan wajib dan cermin baca sahaja dikuatkuasakan untuk SSH dan HTTPS.
  • Cukup kecil untuk dibaca. Satu fungsi kebenaran menentukan siapa nampak apa. Setiap keputusan direkod dengan sebab dan jalan undurnya.

Ciri: kod (sejarah, jejak baris, carian, LFS, wiki), isu dan pull request (penerima, semakan, ulasan baris, gabung/squash/rebase, fixes #12), organisasi dan pasukan, fork, pemberitahuan loceng dan emel, CI codr-runner dalam kontena tanpa rangkaian (panduan), API REST + OpenAPI, webhook bertandatangan, cermin GitHub, log masuk dua langkah dan OpenID Connect, codr backup dan codr restore, salinan awan bersulit berjadual, laporan data dan eksport peribadi, serta AI pilihan yang mati secara lalai. Reka bentuk dalam satu halaman: docs/reka-bentuk.md.

Licence

Codr is free software under the GNU Affero General Public License v3.0 or later. You may use, change and host it, including for your company. If you change the server and let other people use it over a network, share your changes with them under the same licence. For other terms, write to admin@sasateguh.com.

Made by Aiman Malib at Sasa Teguh, Malaysia. Codr was developed in a private repository from October 2026 and has hosted its author's own code since then; this public repository starts at v2.29.0 with one squashed commit, so the history before that is not here. See the changelog.

Work with Sasa Teguh

This project is built and maintained by Sasa Teguh, a studio in Malaysia. We build websites that are found on Google and in AI answers, and we set up systems like this one for businesses.

Book a call · hello@sasateguh.com · More from Sasa Teguh

Directories

Path Synopsis
cmd
codr command
Command codr is the single binary of the Codr git forge.
Command codr is the single binary of the Codr git forge.
codr-runner command
Command codr-runner is the CI runner of Codr (D89): a separate binary that receives push webhooks, runs the jobs of .codr/ci.toml in locked-down containers and reports them as commit statuses.
Command codr-runner is the CI runner of Codr (D89): a separate binary that receives push webhooks, runs the jobs of .codr/ci.toml in locked-down containers and reports them as commit statuses.
Package docs carries the design write-up (D90) so the landing page can serve it: docs/design.md (English) and docs/reka-bentuk.md (Malay).
Package docs carries the design write-up (D90) so the landing page can serve it: docs/design.md (English) and docs/reka-bentuk.md (Malay).
internal
ai
Package ai calls a chat-completions endpoint that speaks the OpenAI wire format (OpenAI, a gateway such as 9router or LiteLLM, Ollama, vLLM, …) — the endpoint, model and key are the owner's choice (D71).
Package ai calls a chat-completions endpoint that speaks the OpenAI wire format (OpenAI, a gateway such as 9router or LiteLLM, Ollama, vLLM, …) — the endpoint, model and key are the owner's choice (D71).
auth
Package auth hashes and verifies web passwords with argon2id (D8: passwords are for the web only; git over SSH uses keys and git over HTTPS uses tokens).
Package auth hashes and verifies web passwords with argon2id (D8: passwords are for the web only; git over SSH uses keys and git over HTTPS uses tokens).
backup
Package backup writes a consistent snapshot of an install (D41, D54): the DB via VACUUM INTO (WAL-safe), config.toml, one git bundle per repository and a manifest with every HEAD.
Package backup writes a consistent snapshot of an install (D41, D54): the DB via VACUUM INTO (WAL-safe), config.toml, one git bundle per repository and a manifest with every HEAD.
cloud
Package cloud keeps an encrypted copy of a backup in an S3-compatible bucket the owner controls (D70): AWS S3, Cloudflare R2, Backblaze B2, Wasabi, MinIO.
Package cloud keeps an encrypted copy of a backup in an S3-compatible bucket the owner controls (D70): AWS S3, Cloudflare R2, Backblaze B2, Wasabi, MinIO.
config
Package config loads config.toml — the infrastructure layer of settings (D14): paths, listen addresses, process limits, hashing cost.
Package config loads config.toml — the infrastructure layer of settings (D14): paths, listen addresses, process limits, hashing cost.
ghimport
Package ghimport brings a GitHub repository's issues, pull requests and comments into Codr (D72), from either the GitHub REST API (a mirror imported from github.com with its token) or the JSON Lines files the host's GitHub mirror keeps (issues.jsonl, pulls.jsonl, issue_comments.jsonl).
Package ghimport brings a GitHub repository's issues, pull requests and comments into Codr (D72), from either the GitHub REST API (a mirror imported from github.com with its token) or the JSON Lines files the host's GitHub mirror keeps (issues.jsonl, pulls.jsonl, issue_comments.jsonl).
gitcmd
Package gitcmd runs the two git transport services (D2: exec the git binary, never parse packs ourselves).
Package gitcmd runs the two git transport services (D2: exec the git binary, never parse packs ourselves).
gitread
Package gitread answers the web UI's read-only questions about a bare repository by running the git binary (D2).
Package gitread answers the web UI's read-only questions about a bare repository by running the git binary (D2).
hooks
Package hooks is the git hook door of Codr (D9): git runs `codr hook pre-receive` (a three-line script written by Codr), the hook forwards the ref updates over a Unix socket in data/, and the serve process decides.
Package hooks is the git hook door of Codr (D9): git runs `codr hook pre-receive` (a three-line script written by Codr), the hook forwards the ref updates over a Unix socket in data/, and the serve process decides.
i18n
Package i18n resolves message keys to text in the requested language.
Package i18n resolves message keys to text in the requested language.
lfs
Package lfs stores Git LFS objects (D82): content-addressed files per repository under data/lfs, written only after their sha256 and size are checked.
Package lfs stores Git LFS objects (D82): content-addressed files per repository under data/lfs, written only after their sha256 and size are checked.
mirror
Package mirror pulls a repository from a URL into a bare repo on disk and keeps it fresh (FR-08).
Package mirror pulls a repository from a URL into a bare repo on disk and keeps it fresh (FR-08).
names
Package names is the single place that decides what a user or repository name may be.
Package names is the single place that decides what a user or repository name may be.
notify
Package notify turns outbox events into notifications in the app and by email (D79).
Package notify turns outbox events into notifications in the app and by email (D79).
oidc
Package oidc is a small OpenID Connect relying party (D91): discovery, the authorization code flow with PKCE, and ID token verification (RS256 / ES256 against the provider's JWKS).
Package oidc is a small OpenID Connect relying party (D91): discovery, the authorization code flow with PKCE, and ID token verification (RS256 / ES256 against the provider's JWKS).
repos
Package repos manages bare repositories on disk.
Package repos manages bare repositories on disk.
runner
Package runner is codr-runner (D89): a small CI runner outside the forge.
Package runner is codr-runner (D89): a small CI runner outside the forge.
secret
Package secret seals small values (mirror tokens) with AES-256-GCM under the key in config.toml (auth.secret_key, PRD §9): a copy of the database alone never yields a token.
Package secret seals small values (mirror tokens) with AES-256-GCM under the key in config.toml (auth.secret_key, PRD §9): a copy of the database alone never yields a token.
sshd
Package sshd is the SSH door of Codr: public-key auth only, no shell, no pty, no forwarding, and exactly one of two git commands per session (PRD §9).
Package sshd is the SSH door of Codr: public-key auth only, no shell, no pty, no forwarding, and exactly one of two git commands per session (PRD §9).
store
Package store is the only package that speaks SQL.
Package store is the only package that speaks SQL.
version
Package version holds the build identity of the binary.
Package version holds the build identity of the binary.
web
Package web is the HTTPS door of Codr: /healthz and smart HTTP git under /<owner>/<repo>.git.
Package web is the HTTPS door of Codr: /healthz and smart HTTP git under /<owner>/<repo>.git.
webhook
Package webhook delivers repository events to outside URLs, signed with HMAC-SHA256 (D78).
Package webhook delivers repository events to outside URLs, signed with HMAC-SHA256 (D78).
wiki
Package wiki keeps a repository's wiki as its own bare git repository (<id>.wiki.git, D83): one Markdown file per page at the root of branch main.
Package wiki keeps a repository's wiki as its own bare git repository (<id>.wiki.git, D83): one Markdown file per page at the root of branch main.
xref
Package xref finds references between issues, commits and pull requests (D87, FR-21): "owner/repo#n" links, and "fixes #n" style keywords that close an issue once the commit reaches the default branch or the pull request merges.
Package xref finds references between issues, commits and pull requests (D87, FR-21): "owner/repo#n" links, and "fixes #n" style keywords that close an issue once the commit reaches the default branch or the pull request merges.
Package locale embeds the translation files.
Package locale embeds the translation files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL