From 48531c915a61ccad1fbe7d1bb638b8f834f3c31a Mon Sep 17 00:00:00 2001
From: Zlatin Balevsky
Date: Thu, 26 Aug 2021 14:41:36 +0100
Subject: [PATCH] mac dmg page
---
i2p2www/downloads.py | 16 ++++++++-
i2p2www/legacy.py | 1 +
i2p2www/pages/downloads/list.html | 7 ++++
i2p2www/pages/downloads/mac.html | 59 +++++++++++++++++++++++++++++++
i2p2www/sitemap.py | 3 ++
i2p2www/urls.py | 1 +
6 files changed, 86 insertions(+), 1 deletion(-)
create mode 100644 i2p2www/pages/downloads/mac.html
diff --git a/i2p2www/downloads.py b/i2p2www/downloads.py
index 2c6c16f9..419d5ac9 100644
--- a/i2p2www/downloads.py
+++ b/i2p2www/downloads.py
@@ -104,7 +104,21 @@ def downloads_firefox():
# The Lab
def downloads_lab():
- return render_template('downloads/lab.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/lab.html', def_mirror=def_mirror)
+
+# Mac DMG page
+def downloads_mac():
+ # 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/mac.html', def_mirror=def_mirror)
def downloads_config():
return render_template('downloads/config.html')
diff --git a/i2p2www/legacy.py b/i2p2www/legacy.py
index 715d27eb..4f5b9d0f 100644
--- a/i2p2www/legacy.py
+++ b/i2p2www/legacy.py
@@ -19,6 +19,7 @@ LEGACY_FUNCTIONS_MAP={
'debian': {'function': 'downloads_debian', 'params': {}},
'firefox': {'function': 'downloads_firefox', 'params': {}},
'lab': {'function': 'downloads_lab', 'params': {}},
+ 'mac': {'function': 'downloads_mac', 'params': {}},
'download': {'function': 'downloads_list', 'params': {}},
'installation': {'function': 'downloads_list', 'params': {}},
'meetings': {'function': 'meetings_index', 'params': {}},
diff --git a/i2p2www/pages/downloads/list.html b/i2p2www/pages/downloads/list.html
index db73a608..d6f2a941 100644
--- a/i2p2www/pages/downloads/list.html
+++ b/i2p2www/pages/downloads/list.html
@@ -128,6 +128,13 @@ I2P connections.
java -jar i2pinstall_{{ i2pversion }}.jar -console
to follow
the install procedure in your terminal.
{%- endtrans %}
+
+ {% trans %}DMG Bundle (BETA){% endtrans %}
+ If you do not want to use the installer or do not have a Java Runtime Environment available
+ on your Mac, you can try our latest DMG bundle.
+
{% endcall %}
{%- trans %}I2P for Linux{%- endtrans %}
diff --git a/i2p2www/pages/downloads/mac.html b/i2p2www/pages/downloads/mac.html
new file mode 100644
index 00000000..7b3b0b4d
--- /dev/null
+++ b/i2p2www/pages/downloads/mac.html
@@ -0,0 +1,59 @@
+{% extends "global/layout.html" %}
+{%- from "downloads/macros" import package_outer with context -%}
+{% block title %}Mac OS DMG Bundle (BETA){% endblock %}
+{% block content %}
+
+{{ _('Mac OS DMG Bundle (BETA)') }}
+{% trans -%}
+We are excited to offer you a DMG bundle for Mac OS. It installs and behaves the same way many other Mac OS applications do and does not require a Java Runtime Environment to be available.
+{%- endtrans %}
+{{ _('How do I use it?') }}
+{% trans -%}
+I2P behaves like any other Mac application. When you launch I2P, the I2P icon will appear on the Dock and a few seconds later a browser will open with the I2P console page, inviting you to complete the setup wizard.
+{%- endtrans %}
+{% trans -%}
+If you want to browse hidden websites ('eepsites') on the I2P network, you need to configure your browser.
+{%- endtrans %}
+
+{%- set name = 'Windows' -%}
+{%- set icon = 'images/download/mac-osx.png' -%}
+{%- set filename = 'I2P-%s.dmg' -%}
+{%- set hash = '07c729c26fc8a31c0e74fe7b4de7be1f8e390d018748322ada35b29de9d' -%}
+
+{% call package_outer('osx', name, icon) %}
+
+
+ {% trans -%}
+Download that file and double-click on it. Accept the License Agreement, then drag the I2P
icon on top of the Applications
icon. Launch I2P from Finder.
+ {%- endtrans %}
+{% endcall %}
+
+{{ _('Limitations') }}
+{% trans -%}
+I2P will not install any launch agents on your Mac. If you want I2P to start on system startup, you need to configure a launch agent yourself. You can configure I2P to launch when your user logs in by right-clicking on the I2P Dock icon.
+{%- endtrans %}
+{{ _('Source Code and Issue Tracking') }}
+{% trans -%}
+If you would like to examine the source code for individual components, you may
+find it on i2pgit.org.
+{%- endtrans %}
+
+{% trans -%}
+If you wish to file an issue about the DMG Bundle, 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 %}
+
+
+{% endblock %}
diff --git a/i2p2www/sitemap.py b/i2p2www/sitemap.py
index 355eb921..77202a04 100644
--- a/i2p2www/sitemap.py
+++ b/i2p2www/sitemap.py
@@ -115,6 +115,9 @@ def render_sitemap():
urls.append({
'path': '/download/lab',
})
+ urls.append({
+ 'path': '/download/mac',
+ })
# Render and return the sitemap
response = make_response(render_template('global/sitemap.xml', url_root=url_root, langs=LANG_FRAGS,
diff --git a/i2p2www/urls.py b/i2p2www/urls.py
index aee5f2bb..37fbc46b 100644
--- a/i2p2www/urls.py
+++ b/i2p2www/urls.py
@@ -95,6 +95,7 @@ url('//download/windows', 'downloads.downloads_windows')
url('//download/firefox', 'downloads.downloads_firefox')
url('//download/config', 'downloads.downloads_config')
url('//download/lab', 'downloads.downloads_lab')
+url('//download/mac', 'downloads.downloads_mac')
url('//download///mirrors', 'downloads.downloads_select')
url('//download///any//download', 'downloads.downloads_redirect', defaults={'protocol': None, 'domain': None})
url('//download////any//download', 'downloads.downloads_redirect', defaults={'domain': None})