Changes
2 changed files (+67/-90)
-
README.md (new)
-
@@ -0,0 +1,67 @@<!-- Copyright 2025 Shota FUJI <pockawoooh@gmail.com> SPDX-License-Identifier: MIT --> # legit legit is a web frontend for git repositories, written in Go. This code is a fork of <https://github.com/icyphox/legit>, with HTML/CSS/JS customization and typed template pipelines. I'm using legit along with [soft-serve](https://github.com/charmbracelet/soft-serve) and this fork is optimized for this usecase; good viewing experience, minimum Git operation for security and integration for soft-serve. ## Features - Repository browsing; commits, refs, tree, etc. - Simple deployment; single binary without CGI. - Template customization; modify HTML/CSS/JS to your liking. - Supports GitWeb `description` file. ## Requirements - Building and running without building requires Go toolchain >= v1.24.1. - Both Linux and macOS is supported. - Put TLS terminating proxy such as nginx or Caddy in front of legit. ## Install ### Manual Clone and run `go build` at repository root directory. Go compiler generates `legit` executable file at the repository root directory. You can also run legit without installing by `go run .`. ### Nix As a quick and dirty way, you can use the original `legit-web` package and overlay to install this fork. ```nix final: prev: { legit-web = prev.legit-web.overrideAttrs (old: { src = prev.fetchFromGitHub { owner = "pocka"; repo = "legit"; rev = "bc147a9425e6265adca2672103c0d0b0dfcd735d"; hash = "sha256-We3ceKWo9viSfM9C/l7CvKiwfGf8bbKvH7M6M0xU1Cg="; }; vendorHash = "sha256-QxkMxO8uzBCC3oMSWjdVsbR2cluYMx5OOKTgaNOLHxc="; }); } ``` Runtime error will happen if Go toolchain in your nixpkgs is older than v1.24.1. ## Configuration legit reads YAML config file. Create YAML file somewhere (e.g. `$XDG_CONFIG_HOME/legit/config.yaml`) and pass the path to legit via `--config` flag. See the sample [`config.yaml`](./config.yaml) for more info. ## License This software is licensed under MIT. See `LICENSE` file for license text. Newly added files have [REUSE](https://reuse.software/) compliant comment headers for easier per-file use.
-
-
readme (deleted)
-
@@ -1,90 +0,0 @@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 This application requires Go >= v1.24.1. 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 syntaxHighlight: monokailight server: name: github.com/pocka 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. • dirs: use this to override the default templates and static assets. • repo.readme: readme files to look for. • repo.mainBranch: main branch names to look for. • repo.ignore: repos to ignore, relative to scanPath. • repo.unlisted: repos to hide, relative to scanPath. • server.name: used for go-import meta tags and clone URLs. • meta.syntaxHighlight: this is used to select the syntax theme to render. If left blank or removed, the native theme will be used. If an invalid theme is set in this field, it will default to "monokailight". For more information about themes, please refer to chroma's gallery [1]. 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 non-bare repos just fine in legit. • Pushing over https, while supported, is disabled because auth is a pain. Use ssh. • Paths are unveil(2)'d on OpenBSD. • Docker images are available ghcr.io/icyphox/legit:{master,latest,vX.Y.Z}. [2] LICENSE legit is licensed under MIT. [1]: https://swapoff.org/chroma/playground/ [2]: https://github.com/icyphox/legit/pkgs/container/legit
-