Skip to content

Open-sourced short link redirect service in Golang

License

Notifications You must be signed in to change notification settings

haostudio/golinks

Repository files navigation

GOLINKS

MIT license go-build docker-master docker-release Go Report Card go.dev reference

Golinks is a open-sourced short link redirect service in Golang, under MIT-license.

index

Feature Highlights

  • Golinks styled (go/mylink) short link redirect
  • Parameter substitution (go/mylink/{VAR} -> https://mylink.com/{VAR}/mypage)
  • Multiple organizations(namespaces) support
  • Out-of-box solution with public docker image haosutdio/golinks
  • Tracing with Jaeger

Get started

Run with docker

$ docker run -v \
  /path/to/datadir:/opt/golinks/datadir \
  -p 8000:8000 \
  haostudio/golinks

Run with source code

Build binary

# Clone repo
$ git clone https://github.com/haostudio/golinks
# Install dependencies
$ make deps
# Build binary
$ make golinks
# Run
$ ./build/golinks

Advanced options

Run in NoAuth mode

By default, golinks supports multiple organizations with JWT authentication. The links of different organizations are stored in different namespaces. Running golinks in NoAuth mode disables authentication and stores all the links in a shared namespace of the default org.

$ docker run -v \
  /path/to/datadir:/opt/golinks/datadir \
  -p 8000:8000 \
  -e AUTHPROVIDER_NOAUTH_ENABLED=true \
  -e AUTHPROVIDER_NOAUTH_DEFAULTORG=my_org \ # optional
  haostudio/golinks

Enable static wiki site

$ docker run -v \
  /path/to/datadir:/opt/golinks/datadir \
  -p 8000:8000 \
  -e HTTP_GOLINKS_WIKI=true \
  haostudio/golinks

For more options, checkout the configuration guide

Demo

Edit link

edit_link