~blowry/sourcehut-vanity

go-get compatible vanity URLs for Sourcehut
add support for branch name specification
upgrade getopt
spaces -> tabs

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~blowry/sourcehut-vanity
read/write
git@git.sr.ht:~blowry/sourcehut-vanity

You can also use your local clone with git send-email.

#sourcehut-vanity

A simple program to serve redirects to your projects on sr.ht. Compatible with go get clients and godoc.org

#Install

make
sudo make install

#Use

$ sourcehut-vanity -u blowry -p 0.0.0.0:8080

Replace my username with yours, and enter an alternative address to bind to if desired. Redirects will be served like this:

localhost:8080/sourcehut-vanity redirects to https://git.sr.ht/~blowry/sourcehut-vanity

localhost:8080/sourcehut-vanity/README.md redirects to https://git.sr.ht/~blowry/sourcehut-vanity/tree/master/README.md

localhost:8080/sourcehut-vanity?go-get=1 returns an HTML page with meta tags so go get can find the correct repository

There's no HTTPS support, so I'd recommend putting this in front of a reverse proxy like nginx. A sample systemd service file is included in the repository as well.