Custom URL for your Go modules hosted on Tangled
1

Configure Feed

Select the types of activity you want to include in your feed.

Go 91.9%
HTML 5.0%
Just 3.1%
11 1 0

Clone this repository

https://tangled.org/anhgelus.world/go-packager https://tangled.org/did:plc:7pdlav2fmnl6gkioc43dvuyb
git@tangled.org:anhgelus.world/go-packager git@tangled.org:did:plc:7pdlav2fmnl6gkioc43dvuyb

For self-hosted knots, clone URLs may differ based on your setup.



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
}