3 Commits

6 changed files with 108 additions and 110 deletions

View File

@@ -1,7 +1,10 @@
FROM debian:oldoldstable as builder
FROM debian:buster as builder
ENV SERVERNAME=geti2p.net \
SERVERMAIL=example@geti2p.net
# Replace the buster repos with the archive.debian.org versions
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list
# Install only build dependencies first
RUN apt-get update && \
apt-get install -y --no-install-recommends \
@@ -9,8 +12,10 @@ RUN apt-get update && \
python-pip \
patch \
python-virtualenv \
virtualenv \
git \
python-polib && \
python-polib \
build-essential && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
@@ -34,7 +39,10 @@ RUN . env/bin/activate && \
echo "Git revision: $(git log -n 1 | grep commit | sed 's/commit //' | sed 's/ .*$//')" > ./i2p2www/pages/include/mtnversion
# Start second stage with same old base image
FROM debian:oldoldstable
FROM debian:buster
# Replace the buster repos with the archive.debian.org versions
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list
# Install only runtime dependencies
RUN apt-get update && \
@@ -42,7 +50,8 @@ RUN apt-get update && \
apache2 \
apache2-utils \
libapache2-mod-wsgi \
python2-minimal && \
python2-minimal \
build-essential && \
rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/i2p.www

View File

@@ -1,11 +1,13 @@
from flask import abort, redirect, render_template, request
from flask import abort, redirect, render_template, request, jsonify
try:
import json
except ImportError:
import simplejson as json
from random import randint
import re
import os.path
from i2p2www import CURRENT_I2P_VERSION, MIRRORS_FILE
from i2p2www import CURRENT_I2P_VERSION, MIRRORS_FILE, TEMPLATE_DIR
DEFAULT_MIRROR = {
"net": "clearnet",
@@ -73,6 +75,85 @@ def read_mirrors():
ret[net][protocol][domain]=obj
return ret
# Extract hashes and filenames from macros file
def extract_hashes_from_macros():
macros_path = os.path.join(TEMPLATE_DIR, 'downloads', 'macros')
if not os.path.exists(macros_path):
return {}
with open(macros_path, 'r') as f:
content = f.read()
# Dictionary to store hash variable name to hash value mapping
hashes = {}
# Regex to extract hash variables
hash_pattern = re.compile(r'{%\s*set\s+(\w+_hash)\s*=\s*[\'"]([a-fA-F0-9]+)[\'"]')
for match in hash_pattern.finditer(content):
var_name = match.group(1)
hash_value = match.group(2)
hashes[var_name] = hash_value
# Now map hash variables to their corresponding file patterns
hash_to_file = {}
# Extract the filename patterns for each package type
if 'i2pinstall_windows_hash' in hashes:
hash_to_file['i2pinstall_windows_hash'] = {
'hash': hashes['i2pinstall_windows_hash'],
'filename_pattern': 'i2pinstall_{version}_windows.exe'
}
if 'i2pinstall_jar_hash' in hashes:
hash_to_file['i2pinstall_jar_hash'] = {
'hash': hashes['i2pinstall_jar_hash'],
'filename_pattern': 'i2pinstall_{version}.jar'
}
if 'i2psource_hash' in hashes:
hash_to_file['i2psource_hash'] = {
'hash': hashes['i2psource_hash'],
'filename_pattern': 'i2psource_{version}.tar.bz2'
}
if 'i2pupdate_hash' in hashes:
hash_to_file['i2pupdate_hash'] = {
'hash': hashes['i2pupdate_hash'],
'filename_pattern': 'i2pupdate_{version}.zip'
}
if 'i2p_android_hash' in hashes:
hash_to_file['i2p_android_hash'] = {
'hash': hashes['i2p_android_hash'],
'filename_pattern': 'app.apk'
}
if 'i2p_macnative_hash' in hashes:
# Extract the OSX launcher version from macros
osx_version_pattern = re.compile(r'{%\s*set\s+i2p_macosx_launcher_version\s*=\s*[\'"]([^\'\"]+)[\'"]')
osx_match = osx_version_pattern.search(content)
osx_version = osx_match.group(1) if osx_match else '1.9.0'
hash_to_file['i2p_macnative_hash'] = {
'hash': hashes['i2p_macnative_hash'],
'filename_pattern': 'I2PMacLauncher-{version}-beta-' + osx_version + '.dmg'
}
if 'i2p_bundle_hash' in hashes:
hash_to_file['i2p_bundle_hash'] = {
'hash': hashes['i2p_bundle_hash'],
'filename_pattern': 'i2p-bundle-{version}.exe'
}
# Generate final JSON with actual filenames using current version
result = {}
for key, data in hash_to_file.items():
filename = data['filename_pattern'].format(version=CURRENT_I2P_VERSION)
result[filename] = data['hash']
return result
# List of downloads
def downloads_list():
# TODO: read mirror list or list of available files
@@ -178,3 +259,10 @@ def downloads_redirect(version, net, protocol, domain, file):
return render_template('downloads/redirect.html',
version=version, protocol=protocol, domain=domain, file=file,
url=mirrors[domain]['url'] % data)
# JSON endpoint for hashes
def downloads_hashes():
"""Return JSON with hashes and filenames from the macros file"""
hashes = extract_hashes_from_macros()
return jsonify(hashes)

View File

@@ -47,7 +47,7 @@ start an installer, "double-click" the downloaded .exe file.
<p>{% trans -%}
Running the installer will create a shortcut to start browsing I2P in your start
menu and on your desktop. Clicking this shortcut will start I2P if necessary,
then start an I2P Browser. On the first run, you will also be promted with the
then start an I2P Browser. On the first run, you will also be prompted with the
bandwidth wizard in your browser window. You will also see a "Toopie" icon in
your taskbar to indicate that I2P is working when the browser window is closed.
{%- endtrans %}</p>
@@ -60,7 +60,7 @@ special configuration. You don't even need to close existing Firefox windows.
{%- set name = 'Windows' -%}
{%- set icon = 'images/download/windows.png' -%}
{%- set filename = 'I2P-Easy-Install-Bundle-%s.exe' -%}
{%- set hash = 'a8e7e02b00428a150d8287774879c3babd4f0eeede7b691403dc283c05bda750' -%}
{%- set hash = i2p_bundle_hash -%}
{% call package_outer('windows', name, icon) %}
<div class = "file">

View File

@@ -1,5 +1,5 @@
{% extends "global/layout.html" %}
{%- from "downloads/macros" import package_outer with context -%}
{%- from "downloads/macros" import package, package_outer with context -%}
{% block title %}Firefox Profile{% endblock %}
{% block content %}
@@ -14,105 +14,4 @@ time it installs the browser profile. This page has been kept to document the
motivations and design of the included Firefox profile. To learn more about the
new bundle, visit <a href="{{ nsis }}">The Easy Install Bundle Page</a>.
{%- endtrans %}</p>
<p>{% trans -%}
The latest I2P Easy-Install bundle for Windows has been released unsigned.
Please verify that the hashes match the downloads when installing the bundle.
{%- endtrans %}</p>
<h2>{{ _('I2P Firefox Browser Profile') }}</h2>
<p>{% trans -%}
Now that you have joined the I2P network, you will want to see I2P Sites and and
other content that is hosted on the network. The Firefox browser profile is
pre-configured to allow you to access the content available on the network.
{%- endtrans %}</p>
<h2>{{ _('Why should I use it?') }}</h2>
<p>{% trans -%}
Browsers are highly complex and powerful engines for executing code and displaying
information obtained mainly from strangers on the internet. By default, they
tend to leak a great deal of information about the person using them to the servers
they retrieve information from. Using this browser profile allows you to become
part of a "common" set of very similar browser users, instead of appearing unique
or revealing details of your hardware or software. Because this involves disabling
some browser features, this also reduces the attack surface available to outsiders.
This keeps you safer while browsing the Invisible Web.
{%- endtrans %}</p>
<h2>{{ _('How do I use it?') }}</h2>
<p>{% trans firefox="https://www.mozilla.org/" -%}
First, download and install <a href="{{ firefox }}">Firefox</a>, then,
just download and install this installer(below). To
start an installer, "double-click" the downloaded .exe file.
{%- endtrans %}</p>
{%- set name = 'Windows' -%}
{%- set icon = 'images/download/windows.png' -%}
{%- set filename = 'I2P-Easy-Install-Bundle-%s.exe' -%}
{%- set hash = 'a8e7e02b00428a150d8287774879c3babd4f0eeede7b691403dc283c05bda750' -%}
{% 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 %}
<h2>{{ _('What is in it?') }}</h2>
<p><strong>{% trans -%}
A Jpackaged I2P Router: {%- endtrans %}</strong>
{% trans -%}The I2P router is "jpackaged" which means that it includes all
the required Java components it needs to run successfully. It does not require
a separate Java installation, because it bundles a Java 16 Runtime which is only
used for I2P.
{%- endtrans %}</p>
<p><strong>{% trans -%}
Browser Extensions: {%- endtrans %}</strong>
{% trans -%}The browser profile also includes both the NoScript and HTTPSEverywhere plugin for
better protection Javascript based attacks and HTTPS support where available. It
also keeps your I2P search activity separate from your visible internet search
activity. The profile configures the I2P Proxy for all sites and browser features.
I2P In Private Browsing is used to provide I2P-Specific browser integrations.
{%- endtrans %}</p>
<h3>{{ _('Source Code and Issue Tracking') }}</h3>
<div>{% trans -%}
If you would like to examine the source code for individual components, you may
find it on i2pgit.org or github.com. The license for each respective component
can be found in the license directory of the <code>i2p.firefox</code> project.
{%- endtrans %}</div>
<div><a href="https://i2pgit.org/I2P_Developers/i2p.firefox">{% trans -%}Gitlab Repository{%- endtrans %}</a></div>
<div><a href="https://github.com/i2p/i2p.firefox">{% trans -%}Github Repository{%- endtrans %}</a></div>
<div><a href="https://i2pgit.org/idk/i2p.plugins.firefox">{% trans -%}Gitlab Repository for Profile Manager{%- endtrans %}</a></div>
<div><a href="https://github.com/eyedeekay/i2p.plugins.firefox">{% trans -%}Github Repository Profile Manager{%- endtrans %}</a></div>
<div>{% trans -%}
If you wish to file an issue about the Firefox profile, please use Gitlab to
contact us. For security-sensitive issues, please remember to check the
"This issue is confidential and should only be visible to team members with at least Reporter access"
option when filing the issue.
{%- endtrans %}</div>
<div><a href="https://i2pgit.org/I2P_Developers/i2p.firefox/issues">{% trans -%}Gitlab Repository{%- endtrans %}</a></div>
<h2>{{ _('How is it different from Tor Browser?') }}</h2>
<p>{% trans -%}
This is not a fork of Firefox. Instead, it is a browser profile with pre-configured
settings, combined with an I2P router and some launcher scripts. That means that
it requires Firefox(Or Tor Browser) to be installed before you can use it. This
is for security reasons, it is important that you are able to recieve reliable
updates from a trustworthy vendor.
{%- endtrans %}</p>
<p>{% trans -%}
I2P routers are designed to have long uptimes, and so unlike Tor Browser, the
lifetime of your I2P Router is not tied to the lifetime of your I2P browsing
session. The browser profile will manage your history, your browser's local
storage and cache, and your browsing context but it will never stop your I2P
router on its own. You may stop the router using the web interface on the
router console homepage.
{%- endtrans %}</p>
{% endblock %}

View File

@@ -4,6 +4,7 @@
{% set i2pupdate_hash = '1b79b2593bbe60e08da3f84411d48a5f1fe0c8cfd934f1c90d2fece436c1f2b5' %}
{% set i2p_android_hash = '13b6e3c35756605e8e65804ab91cb34521c819fcfaebafb348eba5d40bed6699' %}
{% set i2p_macnative_hash = '18cb22cfcc3cbe0cec150e89a394d1a35703cb508ed627ef48084b7ba7c90dde' %}
{% set i2p_bundle_hash = 'e2b70423b4f4bef4179bf54dee4284d897a8b48f1c3c63a3f24acb45388a38c8' %}
{% set i2p_windows_subver = '' %}
{% set i2p_macosx_launcher_version = '1.9.0' %}

View File

@@ -99,6 +99,7 @@ url('/<lang:lang>/download/firefox', 'downloads.downloads_firefox')
url('/<lang:lang>/download/config', 'downloads.downloads_config')
url('/<lang:lang>/download/lab', 'downloads.downloads_lab')
url('/<lang:lang>/download/mac', 'downloads.downloads_mac')
url('/<lang:lang>/download/hashes.json', 'downloads.downloads_hashes')
url('/<lang:lang>/download/<string:version>/<path:file>/mirrors', 'downloads.downloads_select')
url('/<lang:lang>/download/<string:version>/<string:net>/any/<path:file>/download', 'downloads.downloads_redirect', defaults={'protocol': None, 'domain': None})
url('/<lang:lang>/download/<string:version>/<string:net>/<string:protocol>/any/<path:file>/download', 'downloads.downloads_redirect', defaults={'domain': None})