bbgit

A Git web interface written in Go.

Features

Getting Started

  1. Configure: Define your repositories in config.yaml:
    repositories:
      - name: "my-project"
        path: "/path/to/repo"
        description: "Project description"
        group: "Category"
    
  2. Run:
    go run .
    
  3. Access: Open http://localhost:8080

Configuration

The config.yaml file defines the repositories served by bbgit:

Field Description
name Unique identifier used in the URL (/r/{name}).
path Absolute path to the local Git repository.
description Short text displayed on the repository index.
group Category name used to group repositories on the home page.

Deployment (systemd)

  1. Copy the service file:
    sudo cp bbgit.service /etc/systemd/system/
    
  2. Edit /etc/systemd/system/bbgit.service to set the correct User, Group, WorkingDirectory, and ExecStart paths.
  3. Reload and start:
    sudo systemctl daemon-reload
    sudo systemctl enable --now bbgit
    

Reverse Proxy (Nginx)

To serve bbgit behind Nginx, add the following to your server block:

location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Technical Details

Routing Table

Endpoint Description
/ Home page with grouped repository list.
/r/{name} Commit history (log) for the repository.
/r/{name}/files/{path} Directory file browser.
/r/{name}/blob/{path} File viewer with syntax highlighting.
/r/{name}/raw/{path} Raw file download.
/r/{name}/markers Results of the TODO: and FIXME: scanner.
/r/{name}/commits.rss RSS feed for commit history (supports ?ref=).
/r/{name}/tags.rss RSS feed for repository tags.
/r/{name}/archive/{path} Snapshot download in .tar.gz format.
/r/{name}/c/{hash} Commit detail view with side-by-side diff.
/r/{name}/c/{hash}/patch Raw patch file for the commit.

Libraries

License

BSD 2-Clause License. See LICENSE for details.