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

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 redirector@GRA:/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
You might also like...
Heroku Cloudflare App Domain

Heroku Cloudflare App Domain Creating branded herokuapp.com-like domains using Cloudflare, based on the app name (eg my-app-prod.example.com). Feature

Azure-function-proxy - Basic proxy as an azure function serverless app

azure function proxy (for phishing) here are config files for using *[.]azureweb

KoreaVPN - Create a VPN App for Mac Using Automator

VPN app 만들기 (a.k.a. KoreaVPN) VPN을 사용하기 위해 들어가는 10초의 시간을 아끼고, 귀찮음을 최소화 하기 위해 크롤링

Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

Client library for relay - a service for relaying server side messages to the client side browsers via websockets.

Program can control your server via discord bot

GTPS Controller Program can control your server via discord bot Require Python How To Use Download This Source Extract The Zip File Paste gtps.py to y

Tiny JSON RPC via HTTP library.

jrpc Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx. Installation pip install async-jrpc Usage Import JRPC

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.

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

A vpn that sits in your browser, accessible via a website

VPNInYourBrowser A vpn that sits in your browser, accessible via a website Example setup: https://VPNInBrowser.jaffa42.repl.co Setup Put the code onto

A vpn that sits in your browser, accessible via a website

VPNInYourBrowser A vpn that sits in your browser, accessible via a website Example setup: https://VPNInBrowser.jaffa42.repl.co Setup Put the code onto

Owner
Maxime Weyl
Maxime Weyl
A protocol or procedure that connects an ever-changing IP address to a fixed physical machine address

p0znMITM ARP Poisoning Tool What is ARP? Address Resolution Protocol (ARP) is a protocol or procedure that connects an ever-changing IP address to a f

Furkan OZKAN 9 Sep 18, 2022
Multiple-requests-poster - A tool to send multiple requests to a particular website written in Python

Multiple-requests-poster - A tool to send multiple requests to a particular website written in Python

RLX 2 Feb 14, 2022
A project that forwards data it receives in a URL POST Request to a Discord Webhook link

Mailman Mailman is a project that basically just forwards data it receives in a URL POST Request to a Discord Webhook link and act as a sort of messag

Prakhar Trivedi 2 Mar 14, 2022
A simple, configurable application and set of services to monitor multiple raspberry pi's on a network.

rpi-info-monitor A simple, configurable application and set of services to monitor multiple raspberry pi's on a network. It can be used in a terminal

Kevin Kirchhoff 11 May 22, 2022
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.

Almaz 385 Dec 31, 2022
Process incoming JSON-RPC requests in Python

August 16, 2021: Version 5 has been released. Read about the changes in version 5, or read the full documentation. Version 5 is for Python 3.8+ only.

Exploding Labs 156 Dec 31, 2022
🔥 Minimal performant package to asynchronously make GET requests.

Minimal performant package to asynchronously make GET requests without any dependencies other than asyncio.

Yannick Perrenet 1 Jun 1, 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

null 1 Sep 13, 2022
A p2p chat app for zephyr

A p2p chat app for zephyr

L3gacy B3ta 4 Jun 2, 2021
Official ProtonVPN Linux app

ProtonVPN Linux App Copyright (c) 2021 Proton Technologies AG This repository holds the ProtonVPN Linux App. For licensing information see COPYING. Fo

ProtonVPN 288 Jan 1, 2023