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:
|
||||
import json
|
||||
except ImportError:
|
||||
@@ -14,6 +14,13 @@ DEFAULT_MIRROR = {
|
||||
'country': 'no',
|
||||
}
|
||||
|
||||
DEFAULT_I2P_MIRROR = {
|
||||
'protocol': 'http',
|
||||
'domain': 'whnxvjwjhzsske5yevyokhskllvtisv5ueokw6yvh6t7zqrpra2q.b32.i2p',
|
||||
'org': 'sigterm.no',
|
||||
'country': 'i2p',
|
||||
}
|
||||
|
||||
|
||||
###################
|
||||
# Download handlers
|
||||
@@ -44,7 +51,11 @@ def read_mirrors():
|
||||
# List of downloads
|
||||
def downloads_list():
|
||||
# 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
|
||||
def downloads_debian():
|
||||
|
Reference in New Issue
Block a user