diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1555272 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +GO ?= go +GOFLAGS ?= -v +PREFIX ?= /usr/local + +vanityserver: + $(GO) build $(GOFLAGS) ./cmd/$@ +install: + install -m0755 vanityserver $(PREFIX)/bin/vanityserver +uninstall: + rm -f $(PREFIX)/bin/vanityserver diff --git a/cmd/vanityserver/main.go b/cmd/vanityserver/main.go index dcc1de8..9553a33 100644 --- a/cmd/vanityserver/main.go +++ b/cmd/vanityserver/main.go @@ -38,13 +38,14 @@ import ( "strings" "time" - "go.jonnrb.io/vanity" + "git.chaotic.ninja/koizumi.aoi/vanity" ) var ( showIndex = flag.Bool("index", false, "Show a list of repos at /") noHealthz = flag.Bool("nohealthz", false, "Disable healthcheck endpoint at /healthz") watch = flag.Bool("watch", false, "Watch repos file for changes and reload") + listenPort = flag.String("listen", ":8080", "Port to bind on") ) var ( @@ -179,7 +180,7 @@ func buildServer(h http.Handler) *http.Server { WriteTimeout: 5 * time.Second, IdleTimeout: 5 * time.Second, - Addr: ":8080", + Addr: *listenPort, Handler: h, } } diff --git a/go.mod b/go.mod index 0b673cb..b89bf52 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go.jonnrb.io/vanity +module git.chaotic.ninja/koizumi.aoi/vanity go 1.14 diff --git a/vanity.go b/vanity.go index ff24636..ead31f5 100644 --- a/vanity.go +++ b/vanity.go @@ -100,7 +100,7 @@ Nothing to see here; move along. // Use default GDDO Redirector. if cfg.redir == nil { cfg.redir = func(pkg string) string { - return "https://godoc.org/" + pkg + return "https://godocs.io/" + pkg } }