URL simplicity via redirects, because bookmarks are for books.
This is by no means novel, but I figure it may be useful to some.
rdrx aims to simplify URLs that you frequently visit, but can't always recall. It does so via a docker container, which can run on your machine, or, if leveraging this for a workplace, on some internally-accessible server.
what had been... | ...is now |
---|---|
portal.some-obscure-unhelpful.name/login.foo | g0/paystubs |
rdrx can also handle mailto:
links, so "g0/help!" or "g0/security!" can be an
easy way to shave off a little time that could make a big difference.
While at #lastjob, I had a simple solution to smooth UX around a growing list of internal URLs, and used it to scratch an itch that DNS couldn't reach: a list of 301 redirects on an apache server. Google's "go/" shortener (for corp use by employees etc.) served as inspiration for what had initially been devoid of any magic whatsoever. This project aims to tackle a "simple" challenge with a little more magic, hopefully in the style of an ops engineer as opposed to a sys admin.
rdrx could easily run on a corp server with little modification, but is presented here as a local docker implementation.
If leveraging this company-wide, a (private/internal) DNS entry is the way to go. Ensure the DNS completion path (what macOS calls "Search Domains") on your users' systems is managed if doing so, since 'ua/jira' is much quicker than 'ua.corp.urbanairship.com/jira'.
- You're on a Linux or macOS box and:
- have the following in your $PATH:
- aren't hosting anything from that box on port 80 (although port customization is easily achieved in the pre-commit-hook).
- Ensure your
/etc/hosts
file contains the line:127.0.0.1 g0
- Be sure to link the pre-commit-hook:
ln -s ../../pre-commit-hook .git/hooks/pre-commit # from top of the repo
It should helpfully let you know what's missing wrt the above.
-
Modify only the
addr.json
file (disregard line order); "name" and "target" key/value pairs must exist for each line. -
WARNING: The pre-commit hook herein is aggressive, as described below.
Commit; the pre-commit-hook will:
-
sort
addr.json
-
generate the Redirects table in the README
-
generate of the rdrx.conf file
-
stop and remove a pre-existing docker container
-
build and start a fresh docker container (total downtime is ~3s on a modern MacBook Pro)
-
run helpful tests along the way, with some red/green color coding, and helpful output along the way, as so:
-
- dockerize
- json-ify
- Custom 404 with a form for magical ingestion/addition of a shortcut
- Get json from GCS/S3
- Put json into GCS/S3 from a Google Sheet (for 'zero-chops admin')
- Analytics support
- Prometheus exporter