Use Fast Redirect to easily redirect your domains.

Overview

Fast Redirect

Use Fast Redirect to easily redirect your domains.

Fast Redirects expects a JSON 'database'. This JSON 'database' contains the domains to be redirected. Fast Redirect then redirects traffic as configured.

Fast Redirect uses Starlette, a high-performance ASGI framework. Your redirects are lightning fast. Requirements for all environments can be found in the requirements directory.

How to use

Install

We recommend running Fast Redirect in a venv. The package has been published to PyPI, so you could install it with pip3 install fast-redirect.

Run

All configuration variables can be found in the .env.example file. Only one configuration variable is required to be set: DATABASE_PATH. We recommend setting it to /var/lib/fast-redirect.json. Configuration variables can be set in an .env file or be passed as environment variables.

Run bin/fast-redirect to start the server. By default, it listens on port 8080 and binds to ::1 (IPv6). The server can be daemonized. An example systemd configuration can be found in fast-redirect.service.

JSON Database

The JSON database contains a redirects object. In turn, this object contains an object for each redirect with the following properties:

  • destination_url. The URL to redirect to. Query parameters and the path may be appended (see other options). This must be a URL (i.e. www.domlimev.nl is invalid).
  • status_code. Allowed values 301, 302 and 303.
  • keep_query_parameters. Whether query parameters are kept. If this is false, query parameters are discarded from the destination_url. For example, if this is false, https://domlimev.nl/page?k=v would be redirected to https://example.com.
  • keep_path. Whether the path is kept. If this is false, the path is discarded from the destination_url. For example, if this is false, https://domlimev.nl/this/is/a/path would be redirected to https://example.com.

In case a redirect is misconfigured, the error is returned to the visitor.

Example JSON database:

{
  "redirects": {
    "domlimev.nl": {
      "destination_url": "https://example.com",
      "status_code": 301,
      "keep_query_parameters": true,
      "keep_path": true
    }
  }
}

Contribute

Feel free to contribute by adding support for real database engines.

Tests

pytest is used for tests. You run it as you'd expect, i.e.:

pytest tests/

Security

You can reach us at [email protected] to report security issues.

You might also like...
Passive TCP/IP Fingerprinting Tool. Run this on your server and find out what Operating Systems your clients are *really* using.

Passive TCP/IP Fingerprinting This is a passive TCP/IP fingerprinting tool. Run this on your server and find out what operating systems your clients a

Control your Puffco Peak Pro from your computer!

PuffcoPC Control your Puffco Peak Pro from your computer! Contributions Pull requests are welcome. For major changes, please open an issue first to di

A simple GitHub Action that physically puts your senses on alert when your build/release fails
A simple GitHub Action that physically puts your senses on alert when your build/release fails

GH Release Paniker A simple GitHub Action that physically puts your senses on alert when your build/release fails Usage Requirements: Raspberry Pi, LE

msgspec is a fast and friendly implementation of the MessagePack protocol for Python 3.8+
msgspec is a fast and friendly implementation of the MessagePack protocol for Python 3.8+

msgspec msgspec is a fast and friendly implementation of the MessagePack protocol for Python 3.8+. In addition to serialization/deserializat

Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files

Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files. It can also get geolocation for each proxy and check if proxies are anonymous.

GlokyPortScannar is a really fast tool to scan TCP ports implemented in Python.

GlokyPortScannar is a really fast tool to scan TCP ports implemented in Python. Installation: This program requires Python 3.9. Linux

High capacity, high availability, well connected, fast lightning node.

LND ⚡ Routing High capacity, high availability, well connected, fast lightning node. We aim to become a top liquidity provider for the lightning netwo

RollerScanner — Fast Port Scanner Written On Python

RollerScanner RollerScanner — Fast Port Scanner Written On Python Installation You should clone this repository using: git clone https://github.com/Ma

An ftp syncing python package that I use to sync pokemon saves between my hacked 3ds running ftpd and my server

Sync file pairs over ftp and apply patches to them. Useful for using ftpd to transfer ROM save files to and from your DS if you also play on an emulator. Setup a cron job to check for your DS's ftp server periodically to setup automatic syncing. Untested on windows. It may just work out of the box, unsure though.

Owner
Cyberfusion
Improve uptime and performance with managed hosting for digital agencies. Hosting for agencies and load balancing solutions.
Cyberfusion
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect

wifi-password Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect. Works on macOS and Li

Siddharth Dushantha 2.6k Jan 5, 2023
This is a simple python script to collect sub-domains from hackertarget API

Domain-Scraper ?? This is a simple python script to collect sub-domains from hackertarget API Note : This is tool is limited to 20 Queries / day with

CHINO TECH TOOLS 4 Sep 9, 2021
Take a list of domains and probe for working HTTP and HTTPS servers

httprobe Take a list of domains and probe for working http and https servers. Install ▶ go get -u github.com/tomnomnom/httprobe Basic Usage httprobe

Tom Hudson 2.3k Dec 28, 2022
Takes a file of hosts or domains and outputs the IP address of each host/domain in the file.

Takes a file of hosts or domains and outputs the IP address of each host/domain in the file. Installation $ git clone https://github.com/whoamisec75/i

whoami security 2 May 10, 2022
A collection of domains, wildcards and substrings designed for dnscrypt-proxy filter method.

A collection of domains, wildcards and substrings designed for dnscrypt-proxy filter method.

null 3 Oct 25, 2022
📨 Share files easily over your local network from the terminal! 📨

Fileshare ?? Share files easily over your local network from the terminal! ?? Installation #

Dopevog 11 Sep 10, 2021
JF⚡can - Super fast port scanning & service discovery using Masscan and Nmap. Scan large networks with Masscan and use Nmap's scripting abilities to discover information about services. Generate report.

Description Killing features Perform a large-scale scans using Nmap! Allows you to use Masscan to scan targets and execute Nmap on detected ports with

null 377 Jan 3, 2023
Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs.

Cybersecurity and Infrastructure Security Agency 1.3k Jan 8, 2023
Easily share folders between VMs.

This package aims to solve the problem of inter-VM file sharing (rather than manual copying) by allowing a VM to mount folders from any other VM's file system (or mounted network shares).

Rudd-O 12 Oct 17, 2022
With the use of this tool, you can change your MAC address

Akshat0404/MAC_CHANGER This tool has to be used on linux kernel. Now o

null 1 Jan 25, 2022