Skip to content

re-Director/re-director

Repository files navigation

Tests Release

re:Director

Manage Redirects Like a Pro

A powerful, yet simple to use, self-hosted redirect service.

Overview

re:Director enables you to redirect any domain simply by specifying where it should direct to. Make URLs shorter and easier to memorize.

re:Director Main Page

Key Features

  • Manage Redirects: Create redirects for the domains you want to redirect to some target
  • Filter Redirects: Filter you redirects by source, target or status
  • Pause Redirects: Option to temporarily pause redirects and resume them at a later time
  • Different HTTP Status Codes: Chose between different redirects like: Moved Permanently (301), Found (302), Temporary Redirect (307) and Permanent Redirect (308)
  • Dark Mode: perfect for working in dark environments, respects you system default settings
  • Responsive Design: easily manage your redirects, even with your phone on the go
  • and more upcoming!

Getting Started

Java

Clone this repo, make sure to have Java 25 installed and run the following command:

./mvnw spring-boot:run

Docker

An image of the application can be pulled from Docker Hub.

You can run it using the following command:

docker run \
  --name re-director \
  -p 80:80 \
  -v re-director-data:/data \
  jensknipper/re-director:0.0.6

Docker Compose

You can also run this application using Docker Compose Simply save the following code into a docker-compose.yml file and run docker-compose up.

services:
  re-director:
    image: jensknipper/re-director:0.0.6
    ports:
      - "80:80"
    volumes:
      - re-director-data:/data

volumes:
  re-director-data:

Docker Compose behind Traefik reverse proxy

You might have quite a few applications running behind a Traefik reverse proxy. The configuration should then look like this.

services:
  traefik:
    image: traefik:v3.4
    command:
      - "--providers.docker"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

  re-director:
    image: jensknipper/re-director:0.0.6
    expose:
      - 80
    volumes:
      - re-director-data:/data
    labels:
      - "traefik.http.routers.re-director.rule=Host(`re-director.localhost`) || HostRegexp(`.+`)"
      - "traefik.http.routers.re-director.entrypoints=web"
      - "traefik.http.routers.re-director.priority=1"

volumes:
  re-director-data:

Health Checks

Re:Director uses Spring Actuator to do health checks.

The following checks are available.

  • overall health: /actuator/health
  • liveness: /actuator/health/liveness
  • readiness: /actuator/health/readiness

When the application is healthy a JSON like this is returned

{
  "status": "UP"
}

Possible results for the status attribute are:

  • UP
  • DOWN
  • OUT_OF_SERVICE
  • UNKNOWN

Logging

By default, a log file named re-director.log will be written into the volume of the container. Another way to get the logs is the docker logs command.

You can raise the logging level by setting the following environment variable: LOGGING_LEVEL_ROOT. The following levels are allowed:

  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR

Here the severity is ordered from low to high. By choosing a higher severity, lower severity logs will not be logged, e.g. the level ERROR will only print error logs. The lower ones will include the higher level severities.

The default level is WARN.

Caching

To keep the latency that Re:Director introduces as small as possible, caching is implemented.

Deactivate Caching

Set the environment variable SPRING_CACHE_TYPE=none