hook the firefox profile download page to the mirror system
This commit is contained in:
@ -23,6 +23,7 @@ except ImportError:
|
||||
# Constants
|
||||
|
||||
CURRENT_I2P_VERSION = '0.9.37'
|
||||
CURRENT_I2P_FIREFOX_PROFILE_VERSION = '0.01a'
|
||||
|
||||
CANONICAL_DOMAIN = 'geti2p.net'
|
||||
|
||||
|
@ -68,7 +68,12 @@ def downloads_debian():
|
||||
|
||||
# Firefox-specific page
|
||||
def downloads_firefox():
|
||||
return render_template('downloads/firefox.html')
|
||||
# TODO: read mirror list or list of available files
|
||||
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/firefox.html', def_mirror=def_mirror)
|
||||
|
||||
# Specific file downloader
|
||||
def downloads_select(version, file):
|
||||
|
@ -1,18 +1,32 @@
|
||||
{% extends "global/layout.html" %}
|
||||
{%- from "downloads/macros" import package_outer with context -%}
|
||||
{% block title %}Firefox Profile{% endblock %}
|
||||
{% block content %}
|
||||
<h1>{{ _('I2P Firefox Browser Profile') }}</h1>
|
||||
{% trans -%}
|
||||
Your browser needs to be configured for use with I2P. To make that easy, we are offering a Firefox browser profile pre-configured to work with I2P. While you can use any browser to access I2P sites, using a dedicated browser profile keeps your I2P browsing activity separate from your clearnet activity.
|
||||
{%- endtrans %}
|
||||
<h2 id="windows">{{ _('Windows Installer') }}</h2>
|
||||
{% trans installer='https://download.i2p2.de/experimental/I2P-Profile-Installer-0.1a.exe' -%}
|
||||
The <a href="{{ installer }}">windows installer</a> will install the profile and configure I2P to use it. You must already have Firefox and I2P installed.
|
||||
{%- endtrans %}
|
||||
|
||||
<h2 id="other">{{ _('Other OSes') }}</h2>
|
||||
{% trans -%}
|
||||
Support for other OSes is coming soon.
|
||||
{%- endtrans %}
|
||||
{%- set name = 'Windows' -%}
|
||||
{%- set icon = 'images/download/windows.png' -%}
|
||||
{%- set filename = 'I2P-Profile-Installer-%s.exe' -%}
|
||||
{%- set hash = '1234' -%}
|
||||
|
||||
{% call package_outer('windows', name, icon) %}
|
||||
<div class = "file">
|
||||
<a class = "default" href="{{ url_for('downloads_redirect', version=pver(), net=def_mirror.net, protocol=def_mirror.protocol, domain=def_mirror.domain, file=pver(filename) )}}">
|
||||
<span class = "name">{{ pver(filename) }}</span><br/>
|
||||
<span class="mirror">{{ _('Mirror:') }} <img src="{{ url_for('static', filename='images/flags/'+def_mirror.country+'.png') }}" /> {{ def_mirror.org }}</span>
|
||||
</a>
|
||||
<a class="mirrors" href="{{ get_url('downloads_select', version=pver(), file=pver(filename)) }}">{{ _('select alternate mirror') }}</a>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<div class="hash">
|
||||
<code>{{ hash }}</code>
|
||||
</div>
|
||||
</div>
|
||||
<p>{% trans -%}
|
||||
Download that file and run it.
|
||||
{%- endtrans %}</p>
|
||||
{% endcall %}
|
||||
{% endblock %}
|
||||
|
@ -6,6 +6,7 @@ from urlparse import urlsplit, urlunsplit
|
||||
from i2p2www import (
|
||||
CANONICAL_DOMAIN,
|
||||
CURRENT_I2P_VERSION,
|
||||
CURRENT_I2P_FIREFOX_PROFILE_VERSION,
|
||||
PROPOSAL_DIR,
|
||||
RTL_LANGS,
|
||||
SUPPORTED_LANGS,
|
||||
@ -195,6 +196,13 @@ def utility_processor():
|
||||
return string % CURRENT_I2P_VERSION
|
||||
return CURRENT_I2P_VERSION
|
||||
|
||||
def get_current_firefox_profile_version(string=None, ver=None):
|
||||
if string:
|
||||
if ver:
|
||||
return string % ver
|
||||
return string % CURRENT_I2P_FIREFOX_PROFILE_VERSION
|
||||
return CURRENT_I2P_FIREFOX_PROFILE_VERSION
|
||||
|
||||
return dict(i2pconv=convert_url_to_clearnet,
|
||||
i2pclr=convert_url_to_clearnet_inc_https,
|
||||
url_for_other_page=url_for_other_page,
|
||||
@ -208,6 +216,7 @@ def utility_processor():
|
||||
is_rtl=is_rtl_lang,
|
||||
get_flag=get_flag,
|
||||
ver=get_current_version,
|
||||
pver=get_current_firefox_profile_version,
|
||||
canonical=get_canonical_link,
|
||||
supported_langs=SUPPORTED_LANGS,
|
||||
lang_names=SUPPORTED_LANG_NAMES)
|
||||
|
Reference in New Issue
Block a user