GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - legoktm/webgit: [MIRROR] fully client-side Git repository viewer

BranchesTags
Open more actions menu

Latest commit

 

History

263 Commits
263 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.github/workflows
.github/workflows
 
 
crates
crates
 
 
notes
notes
 
 
scripts
scripts
 
 
src
src
 
 
vendor
vendor
 
 
webcat
webcat
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
COPYING
COPYING
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 
Trunk.toml
Trunk.toml
 
 
cooldown.toml
cooldown.toml
 
 
index.html
index.html
 
 
markdown.css
markdown.css
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
styles.css
styles.css
 
 

Repository files navigation

gib ("git-in-browser") is a fully client-side Git repository viewer. At a very high level, it acts like a Git client, fetching and storing individual Git objects in IndexedDB, and then walking the tree to calculate and display files, diffs, logs, etc.

This is largely a proof-of-concept; it should work, but it hasn't really been extensively tested for all the different edge cases for things you can do with Git. If you want to deploy it for your own purposes, that would be sick, but it may not be super mature.

For the most part webgit is aiming to imitate cgit (https://git.zx2c4.com/cgit/about/) as closely as possible because it's probably my favorite Git viewer.

Motivation

gib is essentially scraper-proof, because it relies on "do-the-work" protection instead of solutions like Anubis, which are proof-of-work. Because everything runs client-side, gib can be deployed as static files, which take minimal server resources. If a user makes an expensive blame request, all the computation is done on their browser, not on your server.

More details are in the initial blog post announcing this project.

License

In as much as there is copyrightable code in this repository (most of it is vibecoded), it's available under the GPL v2 as a derivative work of Git and/or cgit. It vendors git's xdiff code, which is LGPL v2.1 or later, as well as other individual files from Git. Some of the git handling code originated from https://github.com/cyberia-ng/git-async, which is also available under the MIT or Apache 2.0 licenses.

Set up

  • Download the latest signed release from GitHub.
  • Copy the dist/ directory to your web server, e.g. /var/www/webgit/.
  • You'll then need to set up your webserver to serve index.html in place of each repository. For Apache, my configuration looks like:
Alias /assets     /var/www/webgit/dist/assets
<Directory /var/www/webgit/dist/>
    Require all granted
    AllowOverride None
    AllowOverrideList Header
</Directory>

# Rewrite repositories to the webgit index
RewriteCond %{REQUEST_URI} ^/(public|mirrors)/[^/]+\.git/((archive|blame|branches|commits?|log|src|summary|tags|tree)(/.*)?)?$
RewriteRule ^ /var/www/webgit/dist/index.html [L]

You should definitely enable HTTP/2 on your webserver too.

Repositories

Your webserver should be set up to serve bare Git repositories. It's strongly recommended that you run git update-server-info in each.

I rsync the repositories from Forgejo's storage to my webserver and it seems to work fine.

Commit Graph

To optimize a number of git operations, you should generate a "commit-graph" file by running git commit-graph write --reachable --changed-paths.

Index listing

You'll need to create a /listing.json file that contains a JSON array of objects, each mapping a directory prefix to the repositories under it:

[
    {"public": ["foo.git", "bar.git"]},
    {"mirrors": ["linux.git"]}
]

This will be transformed into the index.

If your repositories already sit in a directory tree, you can generate the file from it, using each repository's parent directory as its prefix:

find /var/www/repos -type d -name '*.git' -prune -printf '%P\n' | sort |
    jq -R -s '[splits("\n")|select(. != "")]|map(split("/"))|group_by(.[:-1])|map({(.[0][:-1]|join("/")): map(.[-1])})' > /var/www/repos/listing.json

WEBCAT

WEBCAT allows users to verify the website in question is running a signed, non-tampered version of gib. WEBCAT is in alpha and support is still experimental.

About

[MIRROR] fully client-side Git repository viewer

git.legoktm.com/public/webgit.git

Resources

Readme
GPL-2.0 license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.