A small HTTP server for Go vanity import paths.
It serves the go-import metadata required by the Go toolchain and optionally provides go-source metadata for source-code navigation.
The project has no runtime dependencies and is intentionally kept small. Configuration is provided as YAML.
Suppose a project is hosted at:
https://git.example.org/example/project
but you want users to import it as:
import "go.example.org/project"The vanity server responds to:
https://go.example.org/project?go-get=1
with metadata such as:
<meta name="go-import"
content="go.example.org/project git https://git.example.org/example/project">Go then uses the repository URL to obtain the module.
The server can also provide go-source metadata:
<meta name="go-source"
content="go.example.org/project https://git.example.org/example/project/tree/{dir} https://git.example.org/example/project/blob/{file} #L{line}">- Go
go-importdiscovery. - Optional
go-sourcemetadata. - YAML configuration (w/ validation).
- Import path matching with wildcard rules.
- Most-specific matching rule wins.
- Docker image and Docker Compose configuration.
Requires Go.
Clone the repository and build:
go build -o vanity .Install directly into $GOBIN:
go install .Build the image:
docker build -t vanity .The image contains only the compiled application and uses the configuration mounted at runtime.
The repository includes compose.yaml and config.example.yaml.
Adjust the configuration and start the service:
docker compose up -d --buildThe example Compose configuration exposes the server on port 80.
See the LICENSE file for license rights and limitations (MIT).