https://github.com/systemli/dereferrer
https://github.com/systemli/dereferrer
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/systemli/dereferrer
- Owner: systemli
- License: gpl-3.0
- Created: 2023-09-12T12:34:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-10-03T07:04:50.000Z (8 months ago)
- Last Synced: 2025-10-03T09:08:25.235Z (8 months ago)
- Language: Go
- Size: 121 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Dereferrer Service
[](https://github.com/systemli/dereferrer/actions/workflows/integration.yml) [](https://github.com/systemli/dereferrer/actions/workflows/quality.yml) [](https://codecov.io/gh/systemli/dereferrer)
This small service aims to prevent links to be tracked by the website they are linking to. It takes the URL as a parameter and returns a redirect to the URL with the referrer header removed. Especially useful for privacy-aware sites.
Imagine you serve this service on `https://dereferrer.example.com` and you want to link to `https://example.com`. Instead of linking to `https://example.com` directly, you link to `https://dereferrer.example.com/?https%3A%2F%2Fexample.com`. The service will then redirect you to `https://example.com` with the referrer header replaced with `https://dereferrer.example.com`.
Important: The query parameter should be URL encoded.
## Usage
### Environment Variables
| Variable | Description | Default |
| -------- | ----------- | ------- |
| `LISTEN_ADDR` | Address to listen on | `:8080` |
| `METRICS_ADDR` | Address to listen on for metrics | `:8081` |
| `LOG_LEVEL` | Log level | `info` |
### Docker
```bash
docker run -p 8080:8080 -p 8081:8081 -d --name dereferrer \
docker.io/systemli/dereferrer:latest
```
The service needs no special capabilities and can start as read-only.
```bash
docker run -p 8080:8080 -p 8081:8081 -d --name dereferrer \
--read-only --cap-drop all \
docker.io/systemli/dereferrer:latest
```
### Go
```bash
go install github.com/systemli/dereferrer@latest
dereferrer
```
## Metrics
The service exposes metrics on the `/metrics` endpoint on port `8081`. The metrics are compatible with Prometheus.
Exported metrics:
```text
# HELP requests_total Number of requests
# TYPE requests_total counter
requests_total{status="200"} 6145
requests_total{status="400"} 619
requests_total{status="404"} 651
requests_total{status="405"} 35
```
## License
This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.