Golinks
A simple local HTTP redirect service that turns short URLs like go/github into full URLs.
Installation
Install from pypi
bash -c "$(curl -fsSL https://raw.githubusercontent.com/haranrk/golinks/main/install.sh)"
Install from source
# Clone the repository
git clone https://github.com/yourusername/golinks.git
cd golinks
# Run the install script
./install
# Edit the config
vim ~/.config/golinks/config.json
Update
uv tool upgrade golinks
golinks start-service
How it works
The ./install script does the following:
- Installs the Python package using uv
- Adds
127.0.0.1 goto your/etc/hostsfile (with sudo permission) - Sets up port forwarding from port 80 to 8888 using pfctl (macOS) or iptables (Linux), so you can use
go/shortcutinstead ofgo:8888/shortcut - Sets up a LaunchAgent (macOS) or systemd service (Linux) to run the server at startup
- Starts the golinks server immediately on port 8888
Once installed, golinks runs a lightweight HTTP server that reads shortcuts from a JSON config file at ~/.golinks/config.json and redirects http://go/shortcut to the configured destination URL. The config file is hot-reloaded, so you can add new shortcuts without restarting the server.
Configuration
The configuration file (~/.config/golinks/config.json) supports two types of shortcuts:
Simple URL Redirects
Map a shortcut directly to a URL:
{
"github": "https://github.com",
"mail": "https://gmail.com",
"calendar": "https://calendar.google.com"
}
go/github→https://github.comgo/mail→https://gmail.com
Template URLs with Parameters
Use placeholders ({1}, {2}, etc.) for dynamic URLs:
{
"repo": {
"template_url": "https://github.com/{1}/{2}",
"defaults": {
"1": "haranrk",
"2": "golinks"
}
}
}
go/repo→https://github.com/haranrk/golinks(uses defaults)go/repo//otherrepo→https://github.com/haranrk/otherrepo(uses default for 1)go/repo/facebook/→https://github.com/facebook/golinks(uses default for 2)go/repo/facebook/react→https://github.com/facebook/react
Note: If a template parameter doesn't have a default value and isn't provided, it's replaced with an empty string.
Query Parameter Forwarding
Query parameters are automatically forwarded to the destination:
{
"search": "https://google.com/search"
}
go/search?q=golang&num=10→https://google.com/search?q=golang&num=10
Troubleshooting
If go/ links stop working, restart the service:
golinks start-service
This will recreate the LaunchAgent and reload the service.
Metadata
Release files for golinks 1.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| golinks-1.5.1.tar.gz | 43.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| golinks-1.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.3 kB
Release files / golinks-1.5.1.tar.gz
| Download URL | golinks-1.5.1.tar.gz |
|---|---|
| Size | 43.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09e8112c9dee67bc779c3b4dfc6a6485e4a679b7870c6e1fced8dd9cadd8174e
|
|
BLAKE2b-256 checksum How to use checksums |
1396785d4c72acb4f8ee163f031e6f5709558b309691f31899915207d63dcf41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / golinks-1.5.1-py3-none-any.whl
| Download URL | golinks-1.5.1-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
815c0f74ff898d01601a99f7aef878131dfc86a92ee9ebcc77aabb3c0610d096
|
|
BLAKE2b-256 checksum How to use checksums |
9f2e3d899edd9899cd43d53a6e472e11ad23a175778f9d3ef5ec5825e6b3e896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for golinks 1.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.