forked from I2P_Developers/i2p.www
Add in-I2P download mirror
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from flask import abort, redirect, render_template
|
from flask import abort, redirect, render_template, request
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -14,6 +14,13 @@ DEFAULT_MIRROR = {
|
|||||||
'country': 'no',
|
'country': 'no',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFAULT_I2P_MIRROR = {
|
||||||
|
'protocol': 'http',
|
||||||
|
'domain': 'whnxvjwjhzsske5yevyokhskllvtisv5ueokw6yvh6t7zqrpra2q.b32.i2p',
|
||||||
|
'org': 'sigterm.no',
|
||||||
|
'country': 'i2p',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# Download handlers
|
# Download handlers
|
||||||
@@ -44,7 +51,11 @@ def read_mirrors():
|
|||||||
# List of downloads
|
# List of downloads
|
||||||
def downloads_list():
|
def downloads_list():
|
||||||
# TODO: read mirror list or list of available files
|
# TODO: read mirror list or list of available files
|
||||||
return render_template('downloads/list.html', def_mirror=DEFAULT_MIRROR)
|
if request.headers.get('X-I2P-Desthash') and not request.headers.get('X-Forwarded-Server'):
|
||||||
|
def_mirror = DEFAULT_I2P_MIRROR
|
||||||
|
else:
|
||||||
|
def_mirror = DEFAULT_MIRROR
|
||||||
|
return render_template('downloads/list.html', def_mirror=def_mirror)
|
||||||
|
|
||||||
# Debian-specific page
|
# Debian-specific page
|
||||||
def downloads_debian():
|
def downloads_debian():
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
{"protocol": "https", "domain": "launchpad.net", "path": "/i2p/trunk/%(version)s/+download/%(file)s", "org": "Launchpad", "org_url": "https://launchpad.net", "country": "us"}
|
{"protocol": "https", "domain": "launchpad.net", "path": "/i2p/trunk/%(version)s/+download/%(file)s", "org": "Launchpad", "org_url": "https://launchpad.net", "country": "us"}
|
||||||
{"protocol": "https", "domain": "download.i2p2.de", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
{"protocol": "https", "domain": "download.i2p2.de", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
||||||
|
{"protocol": "http", "domain": "whnxvjwjhzsske5yevyokhskllvtisv5ueokw6yvh6t7zqrpra2q.b32.i2p", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "i2p"}
|
||||||
{"protocol": "http", "domain": "download.i2p2.de", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
{"protocol": "http", "domain": "download.i2p2.de", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
||||||
{"protocol": "http", "domain": "download.i2p2.no", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
{"protocol": "http", "domain": "download.i2p2.no", "path": "/releases/%(version)s/%(file)s", "org": "sigterm.no", "country": "no"}
|
||||||
{"protocol": "https", "domain": "dl.dropboxusercontent.com", "path": "/u/18621288/I2P/%(version)s/%(file)s", "org": "Dropbox", "country": "us"}
|
{"protocol": "https", "domain": "dl.dropboxusercontent.com", "path": "/u/18621288/I2P/%(version)s/%(file)s", "org": "Dropbox", "country": "us"}
|
||||||
|
Reference in New Issue
Block a user