sourcehut-vanity

command module
v0.0.0-...-d2a4ff1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

README

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.

Documentation

Overview

sourcehut-vanity hosts an HTTP server that redirects HTTP requests to projects hosted on sourcehut. Example usage:

$ sourcehut-vanity -u blowry -p 0.0.0.0:8080
# 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

Compatible with go-get(1) and standard browsers. SPDX-License-Identifier: GPL-3.0-or-later

Directories

Path Synopsis
VanityServer implements an HTTP.Handler that redirects HTTP requests to projects hosted on sourcehut.
VanityServer implements an HTTP.Handler that redirects HTTP requests to projects hosted on sourcehut.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL