Redirect domains using DNS only.
- Deno v2+
cd /opt
git clone https://github.com/udleinati/redirect.center.git
cd redirect.centerLook at the file ./src/config.ts to see all available environment variables.
You must set at least these variables:
export FQDN=redirect.center
export ENTRY_IP=54.84.55.102
export LISTEN_PORT=80| Variable | Default | Description |
|---|---|---|
FQDN |
localhost |
Service domain (used to detect homepage vs redirect) |
ENTRY_IP |
127.0.0.1 |
IP users must set in their A record |
LISTEN_PORT |
3000 |
Server port |
LISTEN_IP |
0.0.0.0 |
Server bind address |
ENVIRONMENT |
dev1 |
Environment name |
PROJECT_NAME |
redirect.center |
Displayed in UI and meta tags |
LOGGER_LEVEL |
debug |
Log level |
deno task devdeno task testThis runs the service in the background, auto-restarts on crash, and starts on boot. You can SSH in, start it, and disconnect without issues.
# 1. Copy the service file to systemd
sudo cp redirect-center.service /etc/systemd/system/
# 2. Edit the service file to match your environment
# - WorkingDirectory: path to your project (default: /opt/redirect-center)
# - User: the system user to run as (default: www-data)
# - ExecStart: path to deno binary (check with: which deno)
# In the editor, add:
# [Service]
# Environment=FQDN=redirect.center
# Environment=ENTRY_IP=54.84.55.102
# Environment=LISTEN_PORT=80
sudo nano /etc/systemd/system/redirect-center.service
# 4. Reload systemd, enable on boot, and start
sudo systemctl daemon-reload
sudo systemctl enable redirect-center
sudo systemctl start redirect-centerCommon systemd commands:
sudo systemctl status redirect-center # Check if running
sudo systemctl restart redirect-center # Restart
sudo systemctl stop redirect-center # Stop
journalctl -u redirect-center -f # View logs in real-time
journalctl -u redirect-center --since today # Today's logsLog rotation (recommended):
To limit logs to max 1GB and 7 days, edit /etc/systemd/journald.conf:
sudo nano /etc/systemd/journald.confSet or uncomment these lines:
[Journal]
SystemMaxUse=1G
MaxRetentionSec=7dayThen restart journald:
sudo systemctl restart systemd-journaldTo manually clean old logs:
sudo journalctl --vacuum-size=1G --vacuum-time=7ddeno task startCreate a wildcard entry in your DNS:
*.redirect.center CNAME redirect.center
This project exists thanks to all the people who contribute. [Contribute].
Udlei Nati 💻 📖 🤔 🚇 |
|---|
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]