{"id":51308796,"url":"https://github.com/loping151/gitshelf","last_synced_at":"2026-07-01T02:01:02.840Z","repository":{"id":368519834,"uuid":"1285545159","full_name":"Loping151/GitShelf","owner":"Loping151","description":"Self-hosted, read-only Git repository browser — read your bare/mirror repos in place (zero copy) with GitHub-style previews for code, Markdown, PDF, images, CSV and more.","archived":false,"fork":false,"pushed_at":"2026-07-01T00:43:35.000Z","size":2391,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-01T01:14:44.076Z","etag":null,"topics":["devtools","git","gitea-alternative","go","golang","read-only","repository-browser","self-hosted"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Loping151.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-30T23:14:31.000Z","updated_at":"2026-07-01T00:42:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Loping151/GitShelf","commit_stats":null,"previous_names":["loping151/gitshelf"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Loping151/GitShelf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Loping151%2FGitShelf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Loping151%2FGitShelf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Loping151%2FGitShelf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Loping151%2FGitShelf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Loping151","download_url":"https://codeload.github.com/Loping151/GitShelf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Loping151%2FGitShelf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34989787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devtools","git","gitea-alternative","go","golang","read-only","repository-browser","self-hosted"],"created_at":"2026-07-01T02:00:52.682Z","updated_at":"2026-07-01T02:01:02.828Z","avatar_url":"https://github.com/Loping151.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/img/logo.png\" alt=\"GitShelf\" width=\"110\"\u003e\n\n# GitShelf\n\n**English** · [简体中文](README.zh-CN.md)\n\nA self-hosted, read-only Git browser. Point it at a folder of bare/mirror\nrepos and read them like GitHub — no import, no copy.\n\n\u003cimg src=\"docs/img/teaser.png\" alt=\"GitShelf\" width=\"100%\"\u003e\n\n[Features](#features) · [Quick start](#quick-start) · [Config](#configuration) · [Screenshots](#screenshots)\n\n\u003c/div\u003e\n\nTypical use: browsing your nightly **GitHub mirror backups** (`git clone --mirror`) offline.\n\nGitShelf reads existing `*.git` mirrors in place and gives you file trees,\nrich previews (code, Markdown, PDF, images, audio/video, CSV, JSON), commit\nhistory and diffs, blame, code search, and — if you export them — the\nissues, PRs and releases that go with the code. It's deliberately read-only:\nno pushing, no CI, no issue editing. Just the browsing layer.\n\n## Why\n\ncgit is bare-bones; Gitea and GitLab are heavy and insist on importing repos\ninto their own storage first. GitShelf sits in between — it reads what's\nalready on disk.\n\n| | Gitea / Forgejo | cgit | GitLab CE | GitShelf |\n|---|---|---|---|---|\n| Reads existing bare repos in place | needs import | yes | needs import | **yes** |\n| File previews (code, PDF, images…) | good | minimal | great | **good** |\n| Shows exported issues / PRs | no | no | no | **yes** |\n| Footprint | low | tiny | heavy | **single binary** |\n| Scope | full forge | minimal | full forge | **read-only** |\n\n## Features\n\n- Reads your existing bare/mirror repos directly — nothing is imported or duplicated.\n- File previews: syntax highlighting (Chroma), GitHub-flavored Markdown, images, PDF, audio/video, CSV/TSV, JSON. Renderers are pluggable.\n- Branch/tag switching, commit history, diffs, compare, blame, `git grep` search, zip/tar.gz downloads.\n- Optional issues / PRs / releases from exported JSON, shown next to the code.\n- Auth is on by default — the first visit walks you through creating an admin account.\n- Dark / light / auto theme, responsive, keyboard-friendly.\n- One static binary, config-driven, binds `127.0.0.1` by default, no database.\n\n## Quick start\n\nGrab a prebuilt binary for your platform from the\n[Releases](https://github.com/Loping151/GitShelf/releases) page (no Go needed —\njust `git` on PATH):\n\n```bash\ncp gitshelf.example.toml gitshelf.toml   # then edit repo_source.path\n./gitshelf -config gitshelf.toml         # http://127.0.0.1:8888\n```\n\nOr build from source (Go 1.26+):\n\n```bash\ngo build -o gitshelf ./cmd/gitshelf\n./gitshelf -config gitshelf.toml\n```\n\nOr Docker:\n\n```bash\ndocker run -p 8888:8888 \\\n  -v /path/to/mirrors:/mirrors:ro \\\n  -v /path/to/gitshelf.toml:/etc/gitshelf.toml:ro \\\n  ghcr.io/loping151/gitshelf\n```\n\nA repo source is just a directory of bare repos:\n\n```\n/path/to/mirrors/\n  project-a.git/      # from: git clone --mirror \u003curl\u003e\n  project-b.git/\n```\n\n## Configuration\n\nOne TOML file drives everything; there are no hard-coded paths. Full reference\nin [`gitshelf.example.toml`](gitshelf.example.toml).\n\n```toml\n[server]\nbind = \"127.0.0.1:8888\"   # 0.0.0.0:8888 to expose on the LAN\ntheme = \"auto\"\n\n[[repo_source]]\npath = \"/path/to/mirrors\"\nglob = \"*.git\"\nnamespace = \"flat\"        # flat: /\u003crepo\u003e   owner: /\u003cowner\u003e/\u003crepo\u003e\n\n[metadata]                # optional\nprovider = \"json-export\"\npath = \"/path/to/meta\"\n\n[auth]\nenabled = true            # first visit creates the admin account\n```\n\n**Auth** is enabled by default. On first launch GitShelf sends you to a one-time\n`/setup` page to pick an admin username and password (stored as a bcrypt hash —\nnever in the config). Turn it off only behind a trusted reverse proxy or for a\npurely local instance.\n\nThe metadata JSON layout is one folder per repo (`\u003cmeta\u003e/\u003crepo\u003e/{summary.json,\nissues/\u003cn\u003e.json, prs/\u003cn\u003e.json, releases/\u003ctag\u003e.json}`). Missing fields and files\nare tolerated — a repo with no metadata just shows no issues tab.\n\n## Screenshots\n\nBrowsing the bundled demo repo, dark and light:\n\n\u003cimg src=\"docs/screenshots/02-repo-dark.png\" width=\"49%\"\u003e \u003cimg src=\"docs/screenshots/02-repo-light.png\" width=\"49%\"\u003e\n\n| Code | Commit diff |\n|---|---|\n| ![code](docs/screenshots/03-code-dark.png) | ![commit](docs/screenshots/05-commit-dark.png) |\n| Issue timeline | CSV as a table |\n| ![issue](docs/screenshots/06-issue-dark.png) | ![csv](docs/screenshots/07-csv-dark.png) |\n\n## URLs\n\n```\n/                              repo list\n/\u003crepo\u003e                        repo home (README + tree)\n/\u003crepo\u003e/src/\u003crev\u003e/\u003cpath\u003e       tree or file\n/\u003crepo\u003e/raw/\u003crev\u003e/\u003cpath\u003e       raw file\n/\u003crepo\u003e/archive/\u003crev\u003e.\u003cfmt\u003e    zip / tar.gz\n/\u003crepo\u003e/commits/\u003crev\u003e          history      /commit/\u003csha\u003e   diff\n/\u003crepo\u003e/compare/\u003ca\u003e...\u003cb\u003e      compare      /blame/\u003crev\u003e/\u003cpath\u003e\n/\u003crepo\u003e/branches  /tags  /search?q=\n/\u003crepo\u003e/issues[/\u003cn\u003e]  /pulls[/\u003cn\u003e]  /releases[/\u003ctag\u003e]\n```\n\n## Architecture\n\n```\nweb        routing · templates · static · auth · CSP\n ├─ git        Adapter interface → git CLI (argument arrays, never shell)\n ├─ render     Registry → pluggable Renderer{code, markdown, image, pdf, …}\n ├─ metadata   Provider interface → json-export\n └─ config     TOML load + validation\n```\n\nThe git layer shells out to `git`, so any mirror/bare/worktree works; a\n`go-git` backend can slot in behind the same interface later. See\n[CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Development\n\n```bash\ngo test ./...\ngo vet ./...\nmake build\n```\n\n## License\n\n[MIT](LICENSE) © 2026 Loping151\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floping151%2Fgitshelf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floping151%2Fgitshelf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floping151%2Fgitshelf/lists"}