Skip to content

udleinati/redirect.center

Repository files navigation

All Contributors Backers on Open Collective Sponsors on Open Collective

redirect.center

Redirect domains using DNS only.

Requirements

How do I install?

cd /opt
git clone https://github.com/udleinati/redirect.center.git
cd redirect.center

Environment Variables

Look 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

How do I run in development?

deno task dev

How do I run tests?

deno task test

How do I run in production?

Option 1: systemd (recommended)

This 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-center

Common 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 logs

Log rotation (recommended):

To limit logs to max 1GB and 7 days, edit /etc/systemd/journald.conf:

sudo nano /etc/systemd/journald.conf

Set or uncomment these lines:

[Journal]
SystemMaxUse=1G
MaxRetentionSec=7day

Then restart journald:

sudo systemctl restart systemd-journald

To manually clean old logs:

sudo journalctl --vacuum-size=1G --vacuum-time=7d

Option 2: Direct (foreground)

deno task start

DNS Setup

Create a wildcard entry in your DNS:

*.redirect.center CNAME redirect.center

Contributors

This project exists thanks to all the people who contribute. [Contribute].


Udlei Nati

💻 📖 🤔 🚇

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

About

Redirect domains using DNS only

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors