Simple app that redirect fixed URL to changing URL, configurable via POST requests

Related tags

Networkingredirector
Overview

This is a basic URL redirection service. It stores associations between apps and redirection URLs, for apps with changing URLs.

You can then use GET requests to redirect to the URL of an app, or POST/PUT requests to modify the URL of an app.

This might be useful for having a single fixed URL to an app whose URL changes. The use case was to provide a fixed URL to simple apps hosted in OVHcloud AI-Training, because the URL is linked to the job's ID, which is renewed at each job run. In such a context, redirector can be used to provide a fixed URL to the app, as long as it gets the right POST/PUT requests to update the URL properly.

Launch

With python

You can just run the main.py. The dependencies are handled by poetry, so you can install them with poetry install, or use any other method you like.

You can change the default port by setting the PORT environment variable.

You can change the location of the json "database" by setting the CONFIG_FILE_PATH environment variable.

With docker

docker run -e BASIC_AUTH_USERNAME=user -e BASIC_AUTH_PASSWORD=password -e CONFIG_FILE_PATH=/database/redirects.json -v redirector:/database -p 8080:8080 ghcr.io/maximeweyl/redirector

With OVHcloud AI-Training job

ovhai job run --cpu 1 -e BASIC_AUTH_USERNAME=user -e BASIC_AUTH_PASSWORD=password -e CONFIG_FILE_PATH=/database/redirects.json -v [email protected]:/database:rw --unsecure-http ghcr.io/maximeweyl/redirector

Create/update a redirection

To POST or PUT a new redirection, use the /app/ url, where is the name of the application. The body of the request should have this form (json-formatted):

{
    "url": "https://my-url.com"
}

You must use basic authentication ('Authorization' header) for creating/updating a redirection. Alternatively, you can also use the headers XX-redirector-user and XX-redirector-password.

The default username is 'admin' with the default password 'admin'. You can change the default username and password by using these environment variables:

  • BASIC_AUTH_USERNAME
  • BASIC_AUTH_PASSWORD

Use a redirection

Just make a GET request to the same URL used when creating or updating the redirection. The browser will be redirected to the new URL, that will be displayed in the address bar. So your user should bookmark the redirector URL, and not the URL after redirection.

See the entire configuration

You can make a GET request to the /config url, and you will get a json with the entire configuration of redirections. You will see that updates do not erase previous ones, the current values is just the last one of each redirection list.

Limitations

  • The redirection does not hide the real URL. The user will be redirected to the URL and will be able to see it in its address bar.
  • The app is really simple, and was not tested under heavy load.
  • The redirections are stored in a simple json file. While simple and easy to read, this is not a really safe solution. Remember this is all really basic.
  • It uses a basic flask development server. No really you should not use this for something too serious.
  • I do not give any warranty of any sort, and I am not responsible for any damage caused by this service
Owner
Maxime Weyl
Maxime Weyl
Tool for pretty printing and optimizing Lightning Network channels.

Suez Tool for pretty printing and optimizing Lightning Network channels. Installation Install poetry poetry install poetry run ./suez Channel fee poli

Pavol Rusnak 69 Nov 03, 2022
jarbou3 is rat tool coded in python with C&C which can accept multiple connections from clients

jarbou3 Jarbou3 is rat tool with coded in python with C&C which can accept multi

youhacker55 108 Dec 29, 2022
ProtOSINT is a Python script that helps you investigate Protonmail accounts and ProtonVPN IP addresses

ProtOSINT ProtOSINT is a Python script that helps you investigate ProtonMail accounts and ProtonVPN IP addresses. Description This tool can help you i

pixelbubble 249 Dec 23, 2022
Utility for converting IP Fabric webhooks into a Teams format.

IP Fabric Webhook Integration for Microsoft Teams Setup IP Fabric Setup Go to Settings Webhooks Add webhook Provide a name URL will be: 'http://Y

Community Fabric 1 Jan 26, 2022
Extended refactoring capabilities for Python LSP Server using Rope.

pylsp-rope Extended refactoring capabilities for Python LSP Server using Rope. This is a plugin for Python LSP Server, so you also need to have it ins

36 Dec 24, 2022
The module that allows the collection of data sampling, which is transmitted with WebSocket via WIFI or serial port for CSV file.

The module that allows the collection of data sampling, which is transmitted with WebSocket via WIFI or serial port for CSV file.

Nelson Wenner 2 Apr 01, 2022
Search ports in multiples hosts

Search Port ✨ Multiples Searchs ✨ Create list hosts Create list targets Start Require Python 3.10.0+. python main.py Struture Function Directory load_

Tux#3634 7 Apr 29, 2022
IP-Escaner - A Python Tool to obtain information from an IP address

IP-Escaner Herramienta para obtener informacion de una direccion IP Opciones de

4 Apr 09, 2022
Qobuz-rpc - A simple discord rich presence client for qobuz written in Python

qobuz-rpc A simple discord rich presence client for qobuz written in Python It's

Raphael O. 13 Dec 15, 2022
Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Rashid 7 Aug 08, 2022
A TrueCharts automatic and bulk update utility

trueupdate A TrueCharts automatic and bulk update utility How to install run pip install trueupdate Please be aware you will need to reinstall after e

TrueCharts 125 Jan 04, 2023
批量检查目标是否为cdn

🐸 Frog For Automatic Scan 🐶 Doge For Defense Evasion&Offensive Security Frog-checkCDN 批量检查目标是否为cdn Usage: python3 checkCDN.py list.txt list内可以为ip或者d

TimWhite 119 Dec 27, 2022
A web-based app that allows easy, simple - and if desired high-throughput - analysis of qPCR data

qpcr-Analyser A web-based GUI for the qpcr package that allows easy, simple and high-throughput analysis of qPCR data. As is described in more detail

1 Sep 13, 2022
Simple DNS resolver for asyncio

Simple DNS resolver for asyncio aiodns provides a simple way for doing asynchronous DNS resolutions using pycares. Example import asyncio import aiodn

Saúl Ibarra Corretgé 471 Dec 27, 2022
Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa

MAC-Converter Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa Stores the results to a file in the same dir

Stew Alexander 0 Dec 24, 2022
Ipscanner - A simple threaded IP-Scanner written in python3 that can monitor local IP's in your network

IPScanner 🔬 A simple threaded IP-Scanner written in python3 that can monitor lo

4 Dec 12, 2022
ThorFI: A Novel Approach for Network Fault Injection as a Service

ThorFI: a Novel Approach for Network Fault Injection as a Service This repo includes ThorFI, a novel fault injection solution for virtual networks in

DESSERT research lab (Federico II University of Naples, Italy) 6 Dec 14, 2022
A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT connected light.

Description A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT

Lorentz Factr 8 Dec 16, 2022
Network-Shredder is a python based NIDS.

Network-Shredder is a python based NIDS.

Oussama RAHALI 9 Dec 13, 2022
TradingView Interactive Brokers Integration using Webhooks

TradingView Interactive Brokers Integration using Webhooks

84 Dec 19, 2022