shithub
A 1:1 reverse-engineering of GitHub. AGPLv3. Without Copilot.
Status: v0.1.0 launched — early days. Honest about WIP areas.
shithub is an attempt to recreate GitHub — the platform, the UI, the workflows — as faithfully as we can, as a self-hostable open-source forge. The goal is "you should barely notice you switched." We are not there yet. The core forge loop works end-to-end (see "What works today"); large surfaces (SSH transport, Actions/CI, GraphQL, Packages) are explicitly not shipped at v0.1.0.
The hosted instance is at shithub.sh. The project's own source has migrated here from GitHub; this GitHub repo is a one-way mirror for the first 90 days post-launch as a recovery surface.
If you came here expecting drop-in parity with everything GitHub does, you'll find specific gaps. If you came here for an honest, AI-free, self-hostable forge, this is for you.
What works today
The core forge loop works end-to-end against the codebase you're reading:
- Identity — email/password signup, email verification, password reset, TOTP 2FA + recovery codes, SSH keys, personal access tokens (scoped), sessions.
- Repositories — create, fork, archive, transfer, soft-delete with grace, rename with redirects, visibility toggles, branch protection (force-push / deletion / required reviews / required status checks), default-branch swap, topics, README/license/.gitignore templates.
- Git — bare repos on disk; HTTPS smart-HTTP push/pull (SSH service is planned but not shipped yet); pre/post-receive hook integration for size accounting and event emission.
- Code browsing — tree, blob (chroma syntax highlighting with light/dark themes), raw, blame, commit history, individual commit views, branch/tag listings, compare views, file finder.
- Issues & PRs — full CRUD on issues + comments + labels + milestones + assignees; pull requests with diff rendering, file-by-file review, line comments, reviews (approve/request-changes/comment), required-reviewer enforcement, status-check gates, three merge methods (merge / squash / rebase), conflict detection.
- Social — stars, watches with notification level, forks (clone-on-create),
/explore, stargazer/watcher lists. - Search — code search (path + content, tantivy-equivalent indexing in Postgres), repo search, user search, quick-search.
- Notifications — per-user inbox, email fan-out, watch-level routing, one-click HMAC-signed unsubscribe links, auto-subscribe on participation.
- Organizations & teams — create, member roles (member/owner), invitations, one-level team nesting, team grants on repos with max-of-sources policy aggregation.
- Repo settings — General (description, topics, features, merge methods), Access (collaborators + team grants), Branches (protection rules), Danger (rename/transfer/archive/visibility/delete).
- Webhooks — outbound delivery with HMAC-SHA256 signing, exponential backoff with jitter, auto-disable on persistent failure, SSRF defense (DNS resolve + IP block-list + dial-the-IP transport, no redirect-following), redelivery UI, ping events.
What doesn't work yet
Pulled directly from the sprint plan we're working through:
- SSH git service — HTTPS works; the SSH front-end is planned. Use HTTPS clone URLs for now.
- Actions / CI — there is no CI runner. Status checks are wired into PR gates so a future runner can publish into them.
- Packages, Pages, Projects, Releases, Gists — none of these surfaces exist yet.
- GraphQL API — only the internal HTTP surface exists. There is no public REST or GraphQL API.
- Activity feed — domain events are recorded but the activity-feed view isn't built.
- Admin / site-admin surface — there is no
/adminUI. Operator tooling is viashithubdsubcommands and SQL. - Visual polish — most pages render correctly but do not look like GitHub yet. Spacing, typography, header/footer chrome, color tokens, octicon coverage, empty-state illustrations, focus states — all still drifting from Primer. Closing this gap is ongoing; expect rough edges page-to-page.
- Mobile / responsive — the current CSS is desktop-first. Small viewports work but aren't tuned.
- Deferred from completed sprints — every sprint spec lists "inbound deferrals" that landed and "outbound deferrals" that were pushed forward. See
.docs/sprints/for the running list.
Why
GitHub is a well-built platform. Microsoft's Copilot push has changed the product's character — particularly around how user code is treated as training data. shithub aims to recreate the parts that worked, on terms that make a self-hosted instance an honest equal to the SaaS experience, with AGPLv3 keeping any hosted variant open.
The "1:1" goal is intentional. There are plenty of git forges with their own UX vision; shithub deliberately doesn't try to be one of them. The closer the muscle-memory match, the lower the cost of switching.
Quickstart (development)
make dev # hot-reload server on http://localhost:8080
make test # run tests
make build # build bin/shithubd
make ci # full CI pipeline locally (mirrors GitHub Actions)
make dev-migrate # apply DB migrations against $SHITHUB_DATABASE_URL
Requires:
- Go 1.22+ (developed against 1.26)
- PostgreSQL 13+
- A local MinIO (or any S3-compatible store) for the storage tests —
make storage-upbrings one up via docker-compose. golangci-lint,gofumpt,goimports,air,sqlc,goose(installed viago installper the Makefile or your package manager).
Copy .env.example to .env and fill in the database URL, session keys, and TOTP/webhook AEAD key.
Layout
cmd/shithubd/ # main entry: web, ssh, worker, migrate, storage, version
internal/auth/ # password, sessions, TOTP, PATs, SSH keys, policy/RBAC
internal/repos/ # repo lifecycle, git ops, branches, tags, diffs, forks
internal/issues/ # issues + comments + labels + milestones
internal/pulls/ # pull requests + reviews + merge orchestration
internal/orgs/ # orgs + teams + member roles + principals
internal/webhook/ # outbound delivery + SSRF defense + signing
internal/notif/ # inbox + email fan-out + watch-level routing
internal/search/ # code/repo/user search
internal/markdown/ # rendering + reference resolution (#N, @user, @org/team)
internal/web/ # HTTP handlers + html/template + middleware
internal/worker/ # Postgres-backed job queue + handlers
internal/migrationsfs/migrations/ # numbered SQL migrations (goose)
.docs/sprints/ # sprint specifications (S00–S49 + SR1)
Roadmap
The work is structured as 50 sprints (S00–S49, plus SR1 audit remediation). Roughly:
- S00–S04 — scaffolding, DB baseline, web shell, observability, storage abstractions ✅
- S05–S09 — identity (auth, 2FA, SSH keys, PATs, profiles) ✅
- S10–S20 — repos, git protocols, code browsing, branches/tags, hooks ✅ (SSH service deferred)
- S21–S25 — issues, pulls, reviews, status checks, markdown ✅
- S26–S29 — social, forks, search, notifications ✅
- S30–S33 — orgs, teams, repo settings, webhooks ✅ (current)
- S34–S40 — site admin, security hardening, federation, polish, accessibility, i18n
- S41–S49 — actions/CI, social feed, advanced search, GraphQL API, packages, pages, projects, releases, gists
See .docs/sprints/ for the per-sprint spec.
Contributing
See CONTRIBUTING.md. The project is in active rapid development — substantial PRs are best discussed in an issue first so we don't both write the same code. Small fixes, doc improvements, and bug reports are welcome any time.
Security
To report a security issue, see SECURITY.md. Please do not open a public issue for security reports.
License
AGPLv3. If you run a modified version as a network service, your users are entitled to the source.
View source
| 1 | <p align="center"> |
| 2 | <img src="internal/web/static/logo/shithub-mark.svg" alt="" width="120"> |
| 3 | </p> |
| 4 | |
| 5 | <h1 align="center">shithub</h1> |
| 6 | |
| 7 | <p align="center"> |
| 8 | A 1:1 reverse-engineering of GitHub. AGPLv3. Without Copilot. |
| 9 | </p> |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | **Status: v0.1.0 launched — early days. Honest about WIP areas.** |
| 14 | |
| 15 | shithub is an attempt to recreate GitHub — the platform, the UI, the workflows — as faithfully as we can, as a self-hostable open-source forge. The goal is "you should barely notice you switched." We are not there yet. The core forge loop works end-to-end (see "What works today"); large surfaces (SSH transport, Actions/CI, GraphQL, Packages) are explicitly not shipped at v0.1.0. |
| 16 | |
| 17 | The hosted instance is at **[shithub.sh](https://shithub.sh)**. The project's own source has migrated here from GitHub; this GitHub repo is a one-way mirror for the first 90 days post-launch as a recovery surface. |
| 18 | |
| 19 | If you came here expecting drop-in parity with everything GitHub does, you'll find specific gaps. If you came here for an honest, AI-free, self-hostable forge, this is for you. |
| 20 | |
| 21 | ## What works today |
| 22 | |
| 23 | The core forge loop works end-to-end against the codebase you're reading: |
| 24 | |
| 25 | - **Identity** — email/password signup, email verification, password reset, TOTP 2FA + recovery codes, SSH keys, personal access tokens (scoped), sessions. |
| 26 | - **Repositories** — create, fork, archive, transfer, soft-delete with grace, rename with redirects, visibility toggles, branch protection (force-push / deletion / required reviews / required status checks), default-branch swap, topics, README/license/.gitignore templates. |
| 27 | - **Git** — bare repos on disk; HTTPS smart-HTTP push/pull (SSH service is planned but not shipped yet); pre/post-receive hook integration for size accounting and event emission. |
| 28 | - **Code browsing** — tree, blob (chroma syntax highlighting with light/dark themes), raw, blame, commit history, individual commit views, branch/tag listings, compare views, file finder. |
| 29 | - **Issues & PRs** — full CRUD on issues + comments + labels + milestones + assignees; pull requests with diff rendering, file-by-file review, line comments, reviews (approve/request-changes/comment), required-reviewer enforcement, status-check gates, three merge methods (merge / squash / rebase), conflict detection. |
| 30 | - **Social** — stars, watches with notification level, forks (clone-on-create), `/explore`, stargazer/watcher lists. |
| 31 | - **Search** — code search (path + content, tantivy-equivalent indexing in Postgres), repo search, user search, quick-search. |
| 32 | - **Notifications** — per-user inbox, email fan-out, watch-level routing, one-click HMAC-signed unsubscribe links, auto-subscribe on participation. |
| 33 | - **Organizations & teams** — create, member roles (member/owner), invitations, one-level team nesting, team grants on repos with max-of-sources policy aggregation. |
| 34 | - **Repo settings** — General (description, topics, features, merge methods), Access (collaborators + team grants), Branches (protection rules), Danger (rename/transfer/archive/visibility/delete). |
| 35 | - **Webhooks** — outbound delivery with HMAC-SHA256 signing, exponential backoff with jitter, auto-disable on persistent failure, SSRF defense (DNS resolve + IP block-list + dial-the-IP transport, no redirect-following), redelivery UI, ping events. |
| 36 | |
| 37 | ## What doesn't work yet |
| 38 | |
| 39 | Pulled directly from the sprint plan we're working through: |
| 40 | |
| 41 | - **SSH git service** — HTTPS works; the SSH front-end is planned. Use HTTPS clone URLs for now. |
| 42 | - **Actions / CI** — there is no CI runner. Status checks are wired into PR gates so a future runner can publish into them. |
| 43 | - **Packages, Pages, Projects, Releases, Gists** — none of these surfaces exist yet. |
| 44 | - **GraphQL API** — only the internal HTTP surface exists. There is no public REST or GraphQL API. |
| 45 | - **Activity feed** — domain events are recorded but the activity-feed view isn't built. |
| 46 | - **Admin / site-admin surface** — there is no `/admin` UI. Operator tooling is via `shithubd` subcommands and SQL. |
| 47 | - **Visual polish** — most pages render correctly but do not look like GitHub yet. Spacing, typography, header/footer chrome, color tokens, octicon coverage, empty-state illustrations, focus states — all still drifting from Primer. Closing this gap is ongoing; expect rough edges page-to-page. |
| 48 | - **Mobile / responsive** — the current CSS is desktop-first. Small viewports work but aren't tuned. |
| 49 | - **Deferred from completed sprints** — every sprint spec lists "inbound deferrals" that landed and "outbound deferrals" that were pushed forward. See `.docs/sprints/` for the running list. |
| 50 | |
| 51 | ## Why |
| 52 | |
| 53 | GitHub is a well-built platform. Microsoft's Copilot push has changed the product's character — particularly around how user code is treated as training data. shithub aims to recreate the parts that worked, on terms that make a self-hosted instance an honest equal to the SaaS experience, with AGPLv3 keeping any hosted variant open. |
| 54 | |
| 55 | The "1:1" goal is intentional. There are plenty of git forges with their own UX vision; shithub deliberately doesn't try to be one of them. The closer the muscle-memory match, the lower the cost of switching. |
| 56 | |
| 57 | ## Quickstart (development) |
| 58 | |
| 59 | ```sh |
| 60 | make dev # hot-reload server on http://localhost:8080 |
| 61 | make test # run tests |
| 62 | make build # build bin/shithubd |
| 63 | make ci # full CI pipeline locally (mirrors GitHub Actions) |
| 64 | make dev-migrate # apply DB migrations against $SHITHUB_DATABASE_URL |
| 65 | ``` |
| 66 | |
| 67 | Requires: |
| 68 | - Go 1.22+ (developed against 1.26) |
| 69 | - PostgreSQL 13+ |
| 70 | - A local MinIO (or any S3-compatible store) for the storage tests — `make storage-up` brings one up via docker-compose. |
| 71 | - `golangci-lint`, `gofumpt`, `goimports`, `air`, `sqlc`, `goose` (installed via `go install` per the Makefile or your package manager). |
| 72 | |
| 73 | Copy `.env.example` to `.env` and fill in the database URL, session keys, and TOTP/webhook AEAD key. |
| 74 | |
| 75 | ## Layout |
| 76 | |
| 77 | ``` |
| 78 | cmd/shithubd/ # main entry: web, ssh, worker, migrate, storage, version |
| 79 | internal/auth/ # password, sessions, TOTP, PATs, SSH keys, policy/RBAC |
| 80 | internal/repos/ # repo lifecycle, git ops, branches, tags, diffs, forks |
| 81 | internal/issues/ # issues + comments + labels + milestones |
| 82 | internal/pulls/ # pull requests + reviews + merge orchestration |
| 83 | internal/orgs/ # orgs + teams + member roles + principals |
| 84 | internal/webhook/ # outbound delivery + SSRF defense + signing |
| 85 | internal/notif/ # inbox + email fan-out + watch-level routing |
| 86 | internal/search/ # code/repo/user search |
| 87 | internal/markdown/ # rendering + reference resolution (#N, @user, @org/team) |
| 88 | internal/web/ # HTTP handlers + html/template + middleware |
| 89 | internal/worker/ # Postgres-backed job queue + handlers |
| 90 | internal/migrationsfs/migrations/ # numbered SQL migrations (goose) |
| 91 | .docs/sprints/ # sprint specifications (S00–S49 + SR1) |
| 92 | ``` |
| 93 | |
| 94 | ## Roadmap |
| 95 | |
| 96 | The work is structured as 50 sprints (S00–S49, plus SR1 audit remediation). Roughly: |
| 97 | |
| 98 | - **S00–S04** — scaffolding, DB baseline, web shell, observability, storage abstractions ✅ |
| 99 | - **S05–S09** — identity (auth, 2FA, SSH keys, PATs, profiles) ✅ |
| 100 | - **S10–S20** — repos, git protocols, code browsing, branches/tags, hooks ✅ (SSH service deferred) |
| 101 | - **S21–S25** — issues, pulls, reviews, status checks, markdown ✅ |
| 102 | - **S26–S29** — social, forks, search, notifications ✅ |
| 103 | - **S30–S33** — orgs, teams, repo settings, webhooks ✅ (current) |
| 104 | - **S34–S40** — site admin, security hardening, federation, polish, accessibility, i18n |
| 105 | - **S41–S49** — actions/CI, social feed, advanced search, GraphQL API, packages, pages, projects, releases, gists |
| 106 | |
| 107 | See `.docs/sprints/` for the per-sprint spec. |
| 108 | |
| 109 | ## Contributing |
| 110 | |
| 111 | See [CONTRIBUTING.md](CONTRIBUTING.md). The project is in active rapid development — substantial PRs are best discussed in an issue first so we don't both write the same code. Small fixes, doc improvements, and bug reports are welcome any time. |
| 112 | |
| 113 | ## Security |
| 114 | |
| 115 | To report a security issue, see [SECURITY.md](SECURITY.md). Please do not open a public issue for security reports. |
| 116 | |
| 117 | ## License |
| 118 | |
| 119 | [AGPLv3](LICENSE). If you run a modified version as a network service, your users are entitled to the source. |