torproxy: Add shortcut to home page for logged in users

Describing the SOCKS service provided by this instance of FreedomBox and
providing a convenient link to Manual.

Tests:

- The short cut shows as expected. Clicking on the shortcut shows description,
manual page link and configuration link.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-07-22 13:05:41 -07:00 committed by James Valleroy
parent 1409a6c493
commit b7613d6e5a
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -3,10 +3,11 @@
import logging
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from plinth import app as app_module
from plinth import cfg, menu
from plinth import cfg, frontpage, menu
from plinth.daemon import Daemon
from plinth.modules.apache.components import diagnose_url
from plinth.modules.backups.components import BackupRestore
@ -57,6 +58,13 @@ class TorProxyApp(app_module.App):
'torproxy:index', parent_url_name='apps')
self.add(menu_item)
shortcut = frontpage.Shortcut(
'shortcut-torproxy', info.name,
short_description=info.short_description, icon=info.icon_filename,
description=info.description, manual_page=info.manual_page,
configure_url=reverse_lazy('torproxy:index'), login_required=True)
self.add(shortcut)
packages = Packages('packages-torproxy', [
'tor', 'tor-geoipdb', 'torsocks', 'obfs4proxy', 'apt-transport-tor'
])