Custom URL for your Go modules hosted on Tangled
README.md

Go Packager #

Use a custom URL for your Go modules hosted on Tangled. If the request does not have the query go-get, it is redirected to the host.

For example, the module example.org/foo will be handled as tangled.org/example.org/foo.

Use go-packager -h to print the help.

Run go install anhgelus.world/go-packager@latest to install the latest version.

Use as a service #

Example OpenRC service to run it in background:

#!/sbin/openrc-run
supervisor=supervise-daemon

name="go-packager"
description=""

: ${socket="/run/go-packager/unix.sock"}

command=/usr/local/bin/go-packager
command_args="-syslog -addr $socket -use-fcgi"
command_user=gopackager:www-data

depend() {
        need net localmount
        after firewall
		use syslog
}

start_pre() {
        checkpath -d -o "$command_user" -m 0755 "/run/go-packager"

        if [ -e "$socket" ]; then
                ewarn "Deleting old socket"
                rm "$socket"
        fi
}