MichaIng 0656d6ce04 Remove the URL schemes from mirrors (#15)
* Remove the URL schemes from mirrors

as of: https://github.com/armbian/dl-router/pull/14

Signed-off-by: MichaIng <micha@dietpi.com>

* Remove the URL schemes from mirrors

as of: https://github.com/armbian/dl-router/pull/14

But leave https://minio.k-space.ee untouched as it does a forced HTTPS redirect anyway. That way one additional redirect is prevented, if the client's original request is plain HTTP.

Signed-off-by: MichaIng <micha@dietpi.com>

* Fix syntax in scheme check

Signed-off-by: MichaIng <micha@dietpi.com>
2021-08-03 15:14:33 -04:00
2020-12-29 21:43:38 +10:00
2020-07-30 08:25:28 -04:00
2020-12-19 23:04:45 -05:00
2020-12-29 21:43:38 +10:00
2020-11-29 19:35:21 -05:00
2020-11-29 19:35:21 -05:00

dl-router

router of download URLs

returns 302 to a mirror configured. Can manually select region.

currently designed for app folder to be mapped into a usgi container. see sample launch script launch_redirect.sh

expects userdata.csv in app folder.. map as needed. expects mirrors.yaml in app folder.. map as needed

run local

cd app
export FLASK_APP=main
python -m flask run --host 0.0.0.0 --port 5000

configuration

see examples folder

modes

redirect - standard redirect functionality dl_map - will attempt to use contents of userdata.csv to map downloads

mirrors

mirror target with trailing slash is placed in a yaml list under a key for regions

yaml configured

---
mode: dl_map
NA:
  - https://mirror1.example/images/
  - https://mirror2.example/images/
EU:
  - https://mirror3.example/weirdfolder/images/
  - https://mirror4.example/many/sub/folders/images/

API

/status meant for simplee healtcheck. returns 200 OK

/reload Flushes cache and reloads userdata file. Return JSON of what new userdata is

/mirrors Shows all mirrors configured

/regions Shows all mirror regions

/dl_map shows download map for images

/geoip show geoip info from requestor IP

/region/REGIONCODE/ will redirect to desired configurd regions:
NA - north america EU - Europe AS - Asia (currently China)

Description
No description provided
Readme 142 KiB
Languages
Python 82.7%
Shell 17.3%