selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

legit logo

Self-host legit

v0.2.4

Minimal web frontend for browsing your git repositories

BetaOpen SourceMIT
Updated11 hours ago
LanguageGo
Setup difficultyModerate
Stars
467
Docker
ghcr.io/icyphox/legit
Install with Go

What is legit?

legit is a small web UI for Git repositories, implemented in Go, aimed at people who keep their repos on their own server and want a clean way to browse them. It scans a directory of repositories, renders each repo's readme with a selectable chroma syntax theme, supports cloning over HTTP(S), and lets you fully override the shipped templates and static styling. Entries in the ignore or unlisted config lists stay hidden from the site. Install it by cloning the source and building with go, or pull the ghcr.io/icyphox/legit container image; configure it with a yaml file (config.yaml in the working directory, or a path given via --config) and run it behind a TLS-terminating proxy such as nginx or relayd. Notable limits: cloning works only for bare repositories, HTTPS push is implemented but switched off by default since authentication is fiddly (SSH is recommended), and subdirectories under the scan path are not traversed.

Should you self-host legit?

legit scores 45/100 on selfhost.directory (how scoring works) and ranks #12 of 14 in Code Hosting. It has 467 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Gitea (89/100, 58 745 stars). It scores higher overall, so compare the two before you pick. See legit vs Gitea side by side.

Features

  • Customizable templates and stylesheets
  • Git clone over HTTP(S)Cloning only works in bare repos, a limitation inherent to git.
  • Git push over HTTPSPushing over https is supported in code but disabled because auth is a pain; use ssh.
  • Hiding unlisted repos
  • Readme Rendering
  • Syntax highlighting

legit README

How to install legit

Install legit with Go

Clone it, 'go build' it.

Reads a config.yaml from the current directory by default; pass --config elsewhere.

How to configure legit

  • --configCLI flag to point legit at a config file other than ./config.yaml.

    CLI flag to point legit at a config file other than ./config.yaml.

    values: path to yaml config

  • dirsOverride the default templates and static assets directories.

    Override the default templates and static assets directories.

    values: paths (e.g. ./templates, ./static)

  • meta.syntaxHighlightSyntax theme used to render; blank uses native theme, invalid value falls back to monokailight (chroma themes).

    Syntax theme used to render; blank uses native theme, invalid value falls back to monokailight (chroma themes).

    values: chroma style name

  • repo.ignoreRepos to ignore, relative to scanPath.

    Repos to ignore, relative to scanPath.

    values: list of repo names

  • repo.mainBranchMain branch names to look for.

    Main branch names to look for.

    values: e.g. master, main

  • repo.readmeReadme file names to look for in each repo.

    Readme file names to look for in each repo.

    values: e.g. readme, README, readme.md, README.md

  • repo.scanPathDirectory where all your git repos live; legit doesn't traverse subdirs yet.

    Directory where all your git repos live; legit doesn't traverse subdirs yet.

    values: filesystem path

  • repo.unlistedRepos to hide, relative to scanPath.

    Repos to hide, relative to scanPath.

    values: list of repo names

  • server.nameUsed for go-import meta tags and clone URLs.

    Used for go-import meta tags and clone URLs.

    values: domain name

legit releases & version history

More in Version Control

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…