Go to file
cel 🌸 29165c4c93 add bunny.garden assets 2024-02-20 00:40:51 +00:00
config config: Ensure we always have an absolute path 2023-02-05 12:45:46 +02:00
contrib contrib: add systemd service file 2023-04-16 10:34:46 +05:30
git tree: directories first, add size column, fix .. 2023-02-08 00:30:57 +05:30
routes fix routes 2024-02-20 00:24:38 +00:00
static add bunny.garden assets 2024-02-20 00:40:51 +00:00
templates add bunny.garden assets 2024-02-20 00:40:51 +00:00
.gitignore all: init 2022-12-11 11:22:47 +05:30
config.yaml add bunny.garden assets 2024-02-20 00:40:51 +00:00
go.mod deps: bump go-git 2023-12-27 17:20:48 +02:00
go.sum deps: bump go-git 2023-12-27 17:20:48 +02:00
license add license 2022-12-19 18:09:45 +05:30
main.go unveil: remove git executable and /dev/null 2022-12-24 15:05:04 +05:30
readme log errors from git.Open 2023-11-05 10:04:37 +02:00
unveil.go unveil: add git executable 2022-12-22 11:35:32 +05:30
unveil_stub.go unveil: initial commit 2022-12-22 11:17:59 +05:30

readme

legit
-----

A git web frontend written in Go.

Pronounced however you like; I prefer channeling my inner beret-wearing
Frenchman, and saying "Oui, il est le git!"

But yeah it's pretty legit, no cap on god fr fr.


FEATURES

• Fully customizable templates and stylesheets.
• Cloning over http(s).
• Less archaic HTML.
• Not CGI.


INSTALLING

Clone it, 'go build' it.


CONFIG

Uses yaml for configuration. Looks for a 'config.yaml' in the current
directory by default; pass the '--config' flag to point it elsewhere.

Example config.yaml:

    repo:
      scanPath: /var/www/git
      readme:
        - readme
        - README
        - readme.md
        - README.md
      mainBranch:
        - master
        - main
      ignore:
        - foo
        - bar
    dirs:
      templates: ./templates
      static: ./static
    meta:
      title: git good
      description: i think it's a skill issue
    server:
      name: git.icyphox.sh
      host: 127.0.0.1
      port: 5555

These options are fairly self-explanatory, but of note are:

• repo.scanPath: where all your git repos live (or die). legit doesn't
  traverse subdirs yet.
• repo.readme: readme files to look for. Markdown isn't rendered.
• repo.mainBranch: main branch names to look for.
• repo.ignore: repos to ignore, relative to scanPath.
• server.name: used for go-import meta tags and clone URLs.


NOTES

• Run legit behind a TLS terminating proxy like relayd(8) or nginx.
• Cloning only works in bare repos -- this is a limitation inherent to git. You
  can still view bare repos just fine in legit.
• The default head.html template uses my CDN to fetch fonts -- you may
  or may not want this.
• Pushing over https, while supported, is disabled because auth is a
  pain. Use ssh.
• Your remote's default branch must point to one of the listed
  repo.mainBranch. (ref:
  https://social.alexschroeder.ch/@alex/statuses/01HEA8T69WANTMZSTX0X5YF0WM)
• Paths are unveil(2)'d on OpenBSD.


IDEAS

• "Private" repos only available over Tailscale.
• Support or cgit-like filters (for readmes etc.).


LICENSE

legit is licensed under MIT.