A look at changkun/redir: 97 stars on GitHub, written primarily in Go, tracked under the Backend category. 🧭 Full-featured, self-hosted URL shortener.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
A self-hosted link shortener and Go vanity import server, in one binary.
You own the domain, the links and the numbers. changkun.de/s/blog
redirects; changkun.de/x/redir resolves for go get; the console shows
who followed what, with crawlers separated out rather than counted as
readers.
What it does
Short links under /s/, with semantic aliases rather than
generated ones: /s/blog, /s/talks/2026.
Go vanity imports under /x/, serving the go-import meta tag so
go get yourdomain.com/x/repo resolves to your VCS, and at import
paths a site lists one by one, such as a module at the domain itself.
A public index of the links a visitor may follow, which discloses
neither targets nor traffic.
An operator console at /s?mode=admin: totals, the month as a
chart, a dense listing with recent traffic per link, and per-link
detail. It is light or dark as the reader chose, on it or elsewhere on
the site, and as the system is set otherwise.
Statistics of page and unique views over time, referring hosts,
browsers, systems and devices. Automated traffic is classified where a
visit is recorded and excluded from every figure, with a count of what
was left out. On a real deployment that is around half of all visits.
Several sites from one process, each with its own aliases and its
own statistics.
Access control per link: keep it off the public index, hold it
until a date, or warn before sending someone off-site.
Pages the GDPR asks for: impressum, privacy and contact, with
optional IP hashing.
Public index
Held until a date
Leaving the site
Getting started
redir needs PostgreSQL. Create a database and a role for it:
$ docker network create traefik_proxy
$ make build && make up
or from source, which needs Go 1.27 and
Node.js 22:
$ make dashboard # build the front end
$ make # build the server, embedding it
$ REDIR_CONF=data/redirconf.yml ./redir -s
The schema is applied at start up from migrations embedded in the binary,
so there is nothing to run first. Each start applies what is missing and
nothing else.
data/redirconf.yml is not tracked and is mounted into the container
rather than built into the image, because it holds credentials. If
REDIR_CONF names a file that cannot be read the server stops, rather
than starting quietly against the wrong database.
Configuration
Signing in
auth.enable decides who may administer the links:
Mode
Who can administer
latere
Anyone signing in through auth.latere.ai who is on the allowlist
basic
The username and password pairs under auth.basic
none
Everyone. Only sensible behind other access control
latere runs OAuth 2.0 with PKCE and keeps the result in an encrypted
session cookie. Register an OAuth client whose redirect_uris include
<host>/s/.auth/callback and whose allowed_origins include <host>,
for each site you serve. Set the environment variables in
.env.template.
Signing in proves who someone is, not that they may manage your links, so
AUTH_ALLOWED_PRINCIPALS decides that separately: a comma separated list
of emails or principal ids, matched case insensitively. An empty list
rejects every login.
Several sites
The store keys links by hostname, so each site has its own aliases and
its own statistics, and a request belongs to whichever site its Host
header names. Only what differs needs configuring:
host: https://changkun.de
x:
repo_path: https://github.com/changkun
hosts:
golang.design:
# /x/ import paths and the VCS probe resolve here instead.
repo_path: https://github.com/golang-design
# The impressum and privacy pages name an operator, so they do not
# follow onto another domain unless it is the same one.
legal: false
A Host header naming no configured site falls back to the primary one.
It is chosen by the client and becomes part of a link's identity, so it
is matched against the configured sites rather than trusted.
A site offers short links under s.prefix and repositories under
x.prefix unless it turns them off, and it can serve import paths of its
own, each from its own repository. A domain that is one module path and
nothing else:
hosts:
poly.red:
links: false
repos: false
imports:
# The import path and every package below it.
poly.red:
repo: https://github.com/changkun/polyred
# Where a browser goes. Unset, it is the package on godoc_host.
web: https://github.com/changkun/polyred
A site's import paths come before its other services, so every path below
one answers for the module. A site without short links gets no login and
no aliases.
Command line
The server is redir -s. The same binary manages links from a shell,
which is how a deployment without a browser adds one:
$ redir -op create -a blog -l https://blog.example.com -trust
$ redir -op update -a blog -l https://blog.example.com/new
$ redir -op fetch -a blog
$ redir -op delete -a blog
$ redir -f import.yml # import aliases from a file
$ redir -d export.yml # dump them to one
Flag
Meaning
-p
private: the link works but is not listed publicly
-trust
redirect directly instead of warning before leaving the site
-vt
hold the link until an RFC 3339 time
-rederive
recompute the stored browser, system, device and bot columns, then exit. Needed after a change to how visits are classified
Documentation
API reference
GDPR
Troubleshooting
Who uses this
Design specs — how the storage, statistics and console got
the way they are, and what went wrong on the way
Contributing
Feedback is the easiest contribution: what is useful, and what is
missing. Pull requests are welcome too.
Yes — changkun/redir ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/changkun/redir.
What else is in the Backend space?
changkun/redir is tracked by TopGit under the Backend category, alongside 9 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is changkun/redir?
changkun/redir (changkun/redir) is a Go project on GitHub. From the project's own README: 🧭 Full-featured, self-hosted URL shortener.
What license does changkun/redir use?
changkun/redir is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see changkun/redir in action?
The project maintains a homepage at https://changkun.de/s/redir. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about changkun/redir?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/changkun/redir is the definitive source.
Why is changkun/redir categorized under Backend?
TopGit places changkun/redir in the Backend category based on its GitHub topics and description (tagged: "gdpr-consent", "go", "golang"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Is redir worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of redir.