All Projects → hulloitskai → vaingogh

hulloitskai / vaingogh

Licence: MIT license
A vanity URL generator for your Go packages.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to vaingogh

goalie-url-shortener
An implementation of go/ vanity-urls with LDAP support that makes it simple to access internal web assets on a coorporate network.
Stars: ✭ 16 (+33.33%)
Mutual labels:  vanity-url
redir
🧭 Full-featured, self-hosted URL shortener.
Stars: ✭ 61 (+408.33%)
Mutual labels:  vanity-url
Athens
A Go module datastore and proxy
Stars: ✭ 3,736 (+31033.33%)
Mutual labels:  go-modules
cyclonedx-gomod
Creates CycloneDX Software Bill of Materials (SBOM) from Go modules
Stars: ✭ 27 (+125%)
Mutual labels:  go-modules
go-modules
Docker + go modules in go1.11
Stars: ✭ 23 (+91.67%)
Mutual labels:  go-modules
go-wx-api
微信公众号开发API封装
Stars: ✭ 17 (+41.67%)
Mutual labels:  go-modules

vaingogh

A vanity URL generator for your Go packages.

Git Tag Drone: Status Go Report Card GoDoc Microbadger

Introduction

This is the lazy man's vanity Go URL generator—a fully-automatic, set-it-and-forget-it solution for people who don't want to have to update a static file every time they create a new Go repo.

How It Works

vaingogh is a server that continually watches your GitHub account for an updated list of repos that contain Go. When a request is made to the server, a repo name is derived, and checked against the list of valid repos; if the check succeeds, a vanity imports page is generated (see template/default.go) in order to handle both go get and user visits to that webpage (real users will be redirected to the GoDoc).

Usage

# Create a config file.
$ cat <<EOF > config.yaml
server:
  baseURL: localhost:3000

lister:
  github:
    username: stevenxie
EOF

# Run the server.
$ docker run \
    --rm -d \
    -v $(PWD)/config.yaml:/etc/vaingogh/config.yaml \
    -p 3000:3000 \
    --name vaingogh \
    stevenxie/vaingogh

# Try loading a repo page!
$ curl http://localhost:3000/vaingogh
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="go-import" content="localhost:3000/vaingogh git https://github.com/stevenxie/vaingogh">
    <meta name="go-source" content="localhost:3000/vaingogh https://github.com/stevenxie/vaingogh https://github.com/stevenxie/vaingogh/tree/master{/dir} https://github.com/stevenxie/vaingogh/blob/master{/dir}/{file}#L{line}">
    <meta http-equiv="refresh" content="0; url=https://godoc.org/localhost:3000/vaingogh">
  </head>
  <body>
    Nothing to see here; <a href="https://godoc.org/localhost:3000/vaingogh">move along</a>.
  </body>
</html>

# Stop the server.
$ docker stop vaingogh

Of course, none of these imports will actually work until you run this on an actual server behind a valid externally-reachable domain. Spin up a server and change the server.baseURL in the config to go.${YOURDOMAIN}.com or somethin', and try it out!

Authenticated Requests and Rate Limits

In order to increase the rate of requests to the Github API (i.e. with a small enough watcher.checkInterval), authentication must be enabled.

To enable authentication, ensure that the environment variable GITHUB_TOKEN is set with a personal access token:

$ docker run \
    -e GITHUB_TOKEN=... \
    # ...other flags...
    stevenxie/vaingogh
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].