Skip to content

gleich/vanityprox

Repository files navigation

vanityprox

build deploy lint go report card

A simple webserver that allows for custom vanity URLs for go modules. Allows for go modules to be installed like go get go.mattglei.ch/timber instead of go get github.com/gleich/timber.

How to use

Want to use vanityprox for your own domain and GitHub account/organization? Simply run the following docker command to get started:

docker run -p 8000:8000 \
  -e VANITYPROX_HOST="https://go.mattglei.ch" \
  -e VANITYPROX_SOURCE_PREFIX="https://github.com/gleich" \
  ghcr.io/gleich/vanityprox

This will then start the server on port 8000. It's that easy!

As you can see vanityprox is configured with environment variables. Below is details on what all of the environment variables mean.

Configuration

  • VANITYPROX_HOST
    • Host vanity URL that the server will get requests from.
    • Example: https://go.mattglei.ch
    • REQUIRED
  • VANITYPROX_SOURCE_PREFIX
    • Prefix for where all of the code for the go modules is stored. If you're using GitHub it should simply just be the URL of the GitHub account/organization.
    • Example: https://github.com/gleich
    • REQUIRED
  • VANITYPROX_ROOT_REDIRECT
    • If a request is made to GET / where should the server send the user? Set this environment variable to have them be redirected (via a 301 permanent redirect) to the given URL. If no URL is supplied then it simply will just return a 404 error when something hits GET /.
    • Example: https://github.com/gleich/vanityprox
    • OPTIONAL
  • VANITYPROX_LOG_TIMEZONE
  • VANITYPROX_LOG_TIME_FORMAT
  • VANITYPROX_FAVICON
    • URL for a favicon. This will be displayed in the HTML that gets returned from the server.
    • OPTIONAL