mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-25 09:21:10 +00:00
app: Refactor all apps to use the Info component
- Remove the need to pass all the individual information elements to the AppView separately. This eliminates many issues with elements that were mistakenly not sent to AppView. Also reduces a lot of code duplication. - Create App classes for power and sso for consistency. Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
67a216ba18
commit
b576a77c3d
@ -100,8 +100,6 @@ view to show the app page for our app. In ``views.py``, let us add a view.
|
||||
|
||||
class TransmissionAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
name = transmission.name
|
||||
description = transmission.description
|
||||
app_id = 'transmission'
|
||||
|
||||
The base view :class:`~plinth.views.AppView` takes care of a lot of details for
|
||||
|
||||
@ -48,6 +48,10 @@ class ApacheApp(app_module.App):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential)
|
||||
self.add(info)
|
||||
|
||||
web_server_ports = Firewall('firewall-web', _('Web Server'),
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(web_server_ports)
|
||||
|
||||
@ -43,9 +43,7 @@ managed_services = ['avahi-daemon']
|
||||
|
||||
managed_packages = ['avahi-daemon', 'avahi-utils']
|
||||
|
||||
name = _('Service Discovery')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Service discovery allows other devices on the network to '
|
||||
'discover your {box_name} and services running on it. It '
|
||||
@ -69,7 +67,14 @@ class AvahiApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-avahi', name, None, 'fa-compass',
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Service Discovery'), icon='fa-compass',
|
||||
description=_description,
|
||||
manual_page='ServiceDiscovery')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-avahi', info.name, None, info.icon,
|
||||
'avahi:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
@ -78,7 +83,7 @@ class AvahiApp(app_module.App):
|
||||
can_have_certificate=False)
|
||||
self.add(domain_type)
|
||||
|
||||
firewall = Firewall('firewall-avahi', name, ports=['mdns'],
|
||||
firewall = Firewall('firewall-avahi', info.name, ports=['mdns'],
|
||||
is_external=False)
|
||||
self.add(firewall)
|
||||
|
||||
@ -123,6 +128,3 @@ def on_post_hostname_change(sender, old_hostname, new_hostname, **kwargs):
|
||||
|
||||
class AvahiAppView(AppView):
|
||||
app_id = 'avahi'
|
||||
name = name
|
||||
description = description
|
||||
manual_page = manual_page
|
||||
|
||||
@ -37,16 +37,12 @@ version = 2
|
||||
|
||||
managed_packages = ['borgbackup', 'sshfs']
|
||||
|
||||
name = _('Backups')
|
||||
|
||||
depends = ['storage']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Backups allows creating and managing backup archives.'),
|
||||
]
|
||||
|
||||
manual_page = 'Backups'
|
||||
|
||||
MANIFESTS_FOLDER = '/var/lib/plinth/backups-manifests/'
|
||||
# session variable name that stores when a backup file should be deleted
|
||||
SESSION_PATH_VARIABLE = 'fbx-backups-upload-path'
|
||||
@ -62,7 +58,13 @@ class BackupsApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-backups', name, None, 'fa-files-o',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
depends=depends, name=_('Backups'),
|
||||
icon='fa-files-o', description=_description,
|
||||
manual_page='Backups')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-backups', info.name, None, info.icon,
|
||||
'backups:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
@ -96,7 +98,7 @@ def _backup_handler(packet, encryption_passphrase=None):
|
||||
manifests = {
|
||||
'apps': [{
|
||||
'name': app.name,
|
||||
'version': app.app.version,
|
||||
'version': app.app.app.info.version,
|
||||
'backup': app.manifest
|
||||
} for app in packet.apps]
|
||||
}
|
||||
|
||||
@ -43,10 +43,10 @@ def _get_app_choices(apps):
|
||||
"""Return a list of check box multiple choices from list of apps."""
|
||||
choices = []
|
||||
for app in apps:
|
||||
name = app.app.name
|
||||
name = app.app.app.info.name
|
||||
if not app.has_data:
|
||||
name = ugettext('{app} (No data to backup)').format(
|
||||
app=app.app.name)
|
||||
app=app.app.app.info.name)
|
||||
|
||||
choices.append((app.name, name))
|
||||
|
||||
|
||||
@ -54,9 +54,7 @@ class IndexView(TemplateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Return additional context for rendering the template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['name'] = backups.name
|
||||
context['description'] = backups.description
|
||||
context['manual_page'] = backups.manual_page
|
||||
context['app_info'] = backups.app.info
|
||||
context['repositories'] = [
|
||||
repository.get_view_content() for repository in get_repositories()
|
||||
]
|
||||
|
||||
@ -36,15 +36,11 @@ from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 2
|
||||
|
||||
name = _('BIND')
|
||||
|
||||
short_description = _('Domain Name Server')
|
||||
|
||||
managed_services = ['bind9']
|
||||
|
||||
managed_packages = ['bind9']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('BIND enables you to publish your Domain Name System (DNS) information '
|
||||
'on the Internet, and to resolve DNS queries for your user devices on '
|
||||
'your network.'),
|
||||
@ -97,12 +93,18 @@ class BindApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-bind', name, short_description,
|
||||
'fa-globe-w', 'bind:index',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('BIND'), icon='fa-globe-w',
|
||||
short_description=_('Domain Name Server'),
|
||||
description=_description)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-bind', info.name, info.short_description,
|
||||
info.icon, 'bind:index',
|
||||
parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
firewall = Firewall('firewall-bind', name, ports=['dns'],
|
||||
firewall = Firewall('firewall-bind', info.name, ports=['dns'],
|
||||
is_external=False)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -25,15 +25,13 @@ from plinth import actions
|
||||
from plinth.views import AppView
|
||||
from plinth.modules import bind, names
|
||||
|
||||
from . import description, get_config, name, port_forwarding_info
|
||||
from . import get_config, port_forwarding_info
|
||||
from .forms import BindForm
|
||||
|
||||
|
||||
class BindAppView(AppView): # pylint: disable=too-many-ancestors
|
||||
"""A specialized view for configuring Bind."""
|
||||
app_id = 'bind'
|
||||
name = name
|
||||
description = description
|
||||
show_status_block = True
|
||||
form_class = BindForm
|
||||
template_name = 'bind.html'
|
||||
|
||||
@ -42,13 +42,7 @@ managed_services = ['cockpit.socket']
|
||||
|
||||
managed_packages = ['cockpit']
|
||||
|
||||
name = _('Cockpit')
|
||||
|
||||
icon_filename = 'cockpit'
|
||||
|
||||
short_description = _('Server Administration')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Cockpit is a server manager that makes it easy to administer '
|
||||
'GNU/Linux servers via a web browser. On a {box_name}, controls '
|
||||
@ -65,8 +59,6 @@ description = [
|
||||
' of the URL.')),
|
||||
]
|
||||
|
||||
manual_page = 'Cockpit'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -78,19 +70,28 @@ class CockpitApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-cockpit', name, short_description,
|
||||
'fa-wrench', 'cockpit:index',
|
||||
parent_url_name='system')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Cockpit'),
|
||||
icon='fa-wrench', icon_filename='cockpit',
|
||||
short_description=_('Server Administration'),
|
||||
description=_description, manual_page='Cockpit',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-cockpit', info.name,
|
||||
info.short_description, info.icon,
|
||||
'cockpit:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-cockpit', name,
|
||||
short_description=short_description,
|
||||
icon='cockpit', url='/_cockpit/',
|
||||
clients=clients, login_required=True)
|
||||
shortcut = frontpage.Shortcut('shortcut-cockpit', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url='/_cockpit/', clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-cockpit', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-cockpit', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-cockpit', 'cockpit-freedombox',
|
||||
|
||||
@ -17,21 +17,14 @@
|
||||
"""
|
||||
Views for the Cockpit module
|
||||
"""
|
||||
from plinth.modules.cockpit import (clients, description, icon_filename,
|
||||
manual_page, name)
|
||||
from plinth.modules.cockpit.utils import get_origin_domains, load_augeas
|
||||
from plinth.views import AppView
|
||||
|
||||
|
||||
class CockpitAppView(AppView):
|
||||
app_id = 'cockpit'
|
||||
name = name
|
||||
description = description
|
||||
show_status_block = True
|
||||
clients = clients
|
||||
manual_page = manual_page
|
||||
template_name = 'cockpit.html'
|
||||
icon_filename = icon_filename
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
@ -34,17 +34,13 @@ version = 2
|
||||
|
||||
is_essential = True
|
||||
|
||||
name = _('General Configuration')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Here you can set some general configuration options '
|
||||
'like hostname, domain name, webserver home page etc.')
|
||||
]
|
||||
|
||||
depends = ['firewall', 'names']
|
||||
|
||||
manual_page = 'Configure'
|
||||
|
||||
APACHE_CONF_ENABLED_DIR = '/etc/apache2/conf-enabled'
|
||||
APACHE_HOMEPAGE_CONF_FILE_NAME = 'freedombox-apache-homepage.conf'
|
||||
APACHE_HOMEPAGE_CONFIG = os.path.join(APACHE_CONF_ENABLED_DIR,
|
||||
@ -64,7 +60,14 @@ class ConfigApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-config', _('Configure'), None, 'fa-cog',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, depends=depends,
|
||||
name=_('General Configuration'), icon='fa-cog',
|
||||
description=_description,
|
||||
manual_page='Configure')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-config', _('Configure'), None, info.icon,
|
||||
'config:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -35,11 +35,8 @@ LOGGER = logging.getLogger(__name__)
|
||||
|
||||
class ConfigAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
name = config.name
|
||||
description = config.description
|
||||
form_class = ConfigurationForm
|
||||
app_id = 'config'
|
||||
manual_page = config.manual_page
|
||||
show_status_block = False
|
||||
|
||||
def get_initial(self):
|
||||
|
||||
@ -29,19 +29,13 @@ from plinth.modules.firewall.components import Firewall
|
||||
|
||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
|
||||
clients = clients
|
||||
|
||||
version = 1
|
||||
|
||||
managed_services = ['coquelicot']
|
||||
|
||||
managed_packages = ['coquelicot']
|
||||
|
||||
name = _('Coquelicot')
|
||||
|
||||
short_description = _('File Sharing')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Coquelicot is a "one-click" file sharing web application with a focus '
|
||||
'on protecting users\' privacy. It is best used for quickly sharing a '
|
||||
'single file. '),
|
||||
@ -51,8 +45,6 @@ description = [
|
||||
'The default upload password is "test".')
|
||||
]
|
||||
|
||||
manual_page = 'Coquelicot'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -64,18 +56,27 @@ class CoquelicotApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-coquelicot', name, short_description,
|
||||
'coquelicot', 'coquelicot:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Coquelicot'),
|
||||
icon_filename='coquelicot',
|
||||
short_description=_('File Sharing'),
|
||||
description=_description,
|
||||
manual_page='Coquelicot', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-coquelicot', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'coquelicot:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-coquelicot', name,
|
||||
short_description=short_description,
|
||||
shortcut = frontpage.Shortcut('shortcut-coquelicot', info.name,
|
||||
short_description=info.short_description,
|
||||
icon='coquelicot', url='/coquelicot',
|
||||
clients=clients, login_required=True)
|
||||
clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-coquelicot', name,
|
||||
firewall = Firewall('firewall-coquelicot', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -23,22 +23,16 @@ from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions, views
|
||||
from plinth.errors import ActionError
|
||||
from plinth.modules.coquelicot import (clients, description,
|
||||
get_current_max_file_size, manual_page,
|
||||
name)
|
||||
from plinth.modules.coquelicot import get_current_max_file_size
|
||||
|
||||
from .forms import CoquelicotForm
|
||||
|
||||
|
||||
class CoquelicotAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
clients = clients
|
||||
name = name
|
||||
description = description
|
||||
app_id = 'coquelicot'
|
||||
form_class = CoquelicotForm
|
||||
show_status_block = True
|
||||
manual_page = manual_page
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the status of the service to fill in the form."""
|
||||
|
||||
@ -36,15 +36,11 @@ managed_services = ['systemd-timesyncd']
|
||||
|
||||
managed_packages = []
|
||||
|
||||
name = _('Date & Time')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Network time server is a program that maintains the system time '
|
||||
'in synchronization with servers on the Internet.')
|
||||
]
|
||||
|
||||
manual_page = 'DateTime'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -56,7 +52,14 @@ class DateTimeApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-datetime', name, None, 'fa-clock-o',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential,
|
||||
name=_('Date & Time'), icon='fa-clock-o',
|
||||
description=_description,
|
||||
manual_page='DateTime')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-datetime', info.name, None, info.icon,
|
||||
'datetime:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules import datetime
|
||||
from plinth.views import AppView
|
||||
|
||||
from .forms import DateTimeForm
|
||||
@ -33,11 +32,8 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class DateTimeAppView(AppView):
|
||||
name = datetime.name
|
||||
description = datetime.description
|
||||
form_class = DateTimeForm
|
||||
app_id = 'datetime'
|
||||
manual_page = datetime.manual_page
|
||||
|
||||
def get_initial(self):
|
||||
status = super().get_initial()
|
||||
|
||||
@ -26,7 +26,7 @@ from plinth import frontpage, menu
|
||||
from plinth.daemon import Daemon
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users import register_group, add_user_to_share_group
|
||||
from plinth.modules.users import add_user_to_share_group, register_group
|
||||
|
||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
|
||||
@ -36,13 +36,7 @@ managed_services = ['deluged', 'deluge-web']
|
||||
|
||||
managed_packages = ['deluged', 'deluge-web']
|
||||
|
||||
name = _('Deluge')
|
||||
|
||||
icon_filename = 'deluge'
|
||||
|
||||
short_description = _('BitTorrent Web Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Deluge is a BitTorrent client that features a Web UI.'),
|
||||
_('The default password is \'deluge\', but you should log in and '
|
||||
'change it immediately after enabling this service.')
|
||||
@ -52,10 +46,6 @@ group = ('bit-torrent', _('Download files using BitTorrent applications'))
|
||||
|
||||
reserved_usernames = ['debian-deluged']
|
||||
|
||||
clients = clients
|
||||
|
||||
manual_page = 'Deluge'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -67,18 +57,28 @@ class DelugeApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-deluge', name, short_description, 'deluge',
|
||||
'deluge:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Deluge'), icon_filename='deluge',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description, manual_page='Deluge',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-deluge', info.name, info.short_description,
|
||||
info.icon_filename, 'deluge:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-deluge', name, short_description=short_description,
|
||||
url='/deluge', icon=icon_filename, clients=clients,
|
||||
login_required=True, allowed_groups=[group[0]])
|
||||
shortcut = frontpage.Shortcut('shortcut-deluge', info.name,
|
||||
short_description=info.short_description,
|
||||
url='/deluge', icon=info.icon_filename,
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-deluge', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-deluge', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-deluge', 'deluge-plinth',
|
||||
|
||||
@ -25,21 +25,15 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions, views
|
||||
from plinth.modules import deluge
|
||||
|
||||
from .forms import DelugeForm
|
||||
|
||||
|
||||
class DelugeAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
clients = deluge.clients
|
||||
name = deluge.name
|
||||
description = deluge.description
|
||||
diagnostics_module_name = 'deluge'
|
||||
form_class = DelugeForm
|
||||
app_id = 'deluge'
|
||||
manual_page = deluge.manual_page
|
||||
icon_filename = deluge.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Get current Deluge server settings."""
|
||||
@ -62,8 +56,8 @@ class DelugeAppView(views.AppView):
|
||||
'download_location', new_status['storage_path']
|
||||
]
|
||||
|
||||
actions.superuser_run(
|
||||
'deluge', ['set-configuration'] + new_configuration)
|
||||
actions.superuser_run('deluge', ['set-configuration'] +
|
||||
new_configuration)
|
||||
messages.success(self.request, _('Configuration updated'))
|
||||
|
||||
return super().form_valid(form)
|
||||
|
||||
@ -30,16 +30,12 @@ version = 1
|
||||
|
||||
is_essential = True
|
||||
|
||||
name = _('Diagnostics')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('The system diagnostic test will run a number of checks on your '
|
||||
'system to confirm that applications and services are working as '
|
||||
'expected.')
|
||||
]
|
||||
|
||||
manual_page = 'Diagnostics'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -51,7 +47,14 @@ class DiagnosticsApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-diagnostics', name, None, 'fa-heartbeat',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential,
|
||||
name=_('Diagnostics'), icon='fa-heartbeat',
|
||||
description=_description,
|
||||
manual_page='Diagnostics')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-diagnostics', info.name, None, info.icon,
|
||||
'diagnostics:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -45,10 +45,8 @@ def index(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'diagnostics.html', {
|
||||
'name': diagnostics.name,
|
||||
'description': diagnostics.description,
|
||||
'app_info': diagnostics.app.info,
|
||||
'is_running': _running_task is not None,
|
||||
'manual_page': diagnostics.manual_page,
|
||||
'results': current_results
|
||||
})
|
||||
|
||||
|
||||
@ -51,15 +51,11 @@ def get_configured_domain_name():
|
||||
|
||||
version = 1
|
||||
|
||||
name = _('diaspora*')
|
||||
|
||||
short_description = _('Federated Social Network')
|
||||
|
||||
managed_services = ['diaspora']
|
||||
|
||||
managed_packages = ['diaspora']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('diaspora* is a decentralized social network where you can store '
|
||||
'and control your own data.'),
|
||||
format_lazy(
|
||||
@ -71,7 +67,6 @@ description = [
|
||||
]
|
||||
|
||||
from .manifest import clients # noqa pylint:disable=E402 isort:skip
|
||||
clients = clients
|
||||
|
||||
app = None
|
||||
|
||||
@ -84,19 +79,25 @@ class DiasporaApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-diaspora', name, short_description,
|
||||
'diaspora', 'diaspora:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('diaspora*'), icon_filename='diaspora',
|
||||
short_description=_('Federated Social Network'),
|
||||
description=_description, clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-diaspora', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'diaspora:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = Shortcut('shortcut-diaspora', name,
|
||||
short_description=short_description,
|
||||
icon='diaspora', url=None, clients=clients,
|
||||
login_required=True)
|
||||
shortcut = Shortcut('shortcut-diaspora', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url=None,
|
||||
clients=info.clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-diaspora', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-diaspora', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-diaspora', 'diaspora-plinth')
|
||||
|
||||
@ -35,8 +35,8 @@ class DiasporaSetupView(FormView):
|
||||
"""Show diaspora setup page."""
|
||||
template_name = 'diaspora-pre-setup.html'
|
||||
form_class = DomainSelectionForm
|
||||
description = diaspora.description
|
||||
title = diaspora.name
|
||||
description = diaspora.app.info.description
|
||||
title = diaspora.app.info.name
|
||||
success_url = reverse_lazy('diaspora:index')
|
||||
|
||||
def form_valid(self, form):
|
||||
@ -60,7 +60,6 @@ class DiasporaAppView(AppView):
|
||||
form_class = DiasporaAppForm
|
||||
app_id = 'diaspora'
|
||||
template_name = 'diaspora-post-setup.html'
|
||||
name = diaspora.name
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not diaspora.is_setup():
|
||||
@ -70,7 +69,6 @@ class DiasporaAppView(AppView):
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['domain_name'] = diaspora.get_configured_domain_name()
|
||||
context['clients'] = diaspora.clients
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
|
||||
@ -37,9 +37,7 @@ depends = ['names']
|
||||
|
||||
managed_packages = ['ez-ipupdate']
|
||||
|
||||
name = _('Dynamic DNS Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('If your Internet provider changes your IP address periodically '
|
||||
'(i.e. every 24h), it may be hard for others to find you on the '
|
||||
@ -57,8 +55,6 @@ description = [
|
||||
|
||||
reserved_usernames = ['ez-ipupd']
|
||||
|
||||
manual_page = 'DynamicDNS'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -70,7 +66,14 @@ class DynamicDNSApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-dynamicdns', name, None, 'fa-refresh',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, depends=depends,
|
||||
name=_('Dynamic DNS Client'), icon='fa-refresh',
|
||||
description=_description,
|
||||
manual_page='DynamicDNS')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-dynamicdns', info.name, None, info.icon,
|
||||
'dynamicdns:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -52,10 +52,8 @@ def index(request):
|
||||
"""Serve Dynamic DNS page."""
|
||||
return TemplateResponse(
|
||||
request, 'dynamicdns.html', {
|
||||
'title': dynamicdns.name,
|
||||
'name': dynamicdns.name,
|
||||
'description': dynamicdns.description,
|
||||
'manual_page': dynamicdns.manual_page,
|
||||
'app_info': dynamicdns.app.info,
|
||||
'title': dynamicdns.app.info.name,
|
||||
'subsubmenu': subsubmenu
|
||||
})
|
||||
|
||||
@ -77,9 +75,7 @@ def configure(request):
|
||||
return TemplateResponse(
|
||||
request, 'dynamicdns_configure.html', {
|
||||
'title': _('Configure Dynamic DNS'),
|
||||
'name': dynamicdns.name,
|
||||
'description': dynamicdns.description,
|
||||
'manual_page': dynamicdns.manual_page,
|
||||
'app_info': dynamicdns.app.info,
|
||||
'form': form,
|
||||
'subsubmenu': subsubmenu
|
||||
})
|
||||
@ -103,9 +99,7 @@ def statuspage(request):
|
||||
return TemplateResponse(
|
||||
request, 'dynamicdns_status.html', {
|
||||
'title': _('Dynamic DNS Status'),
|
||||
'name': dynamicdns.name,
|
||||
'description': dynamicdns.description,
|
||||
'manual_page': dynamicdns.manual_page,
|
||||
'app_info': dynamicdns.app.info,
|
||||
'no_nat': no_nat,
|
||||
'nat_unchecked': nat_unchecked,
|
||||
'timer': timer,
|
||||
|
||||
@ -47,13 +47,7 @@ managed_packages = ['ejabberd']
|
||||
|
||||
managed_paths = [pathlib.Path('/etc/ejabberd/')]
|
||||
|
||||
name = _('ejabberd')
|
||||
|
||||
icon_filename = 'ejabberd'
|
||||
|
||||
short_description = _('Chat Server')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('XMPP is an open and standardized communication protocol. Here '
|
||||
'you can run and configure your XMPP server, called ejabberd.'),
|
||||
format_lazy(
|
||||
@ -66,12 +60,8 @@ description = [
|
||||
jsxc_url=reverse_lazy('jsxc:index'))
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['ejabberd']
|
||||
|
||||
manual_page = 'ejabberd'
|
||||
|
||||
port_forwarding_info = [
|
||||
('TCP', 5222),
|
||||
('TCP', 5269),
|
||||
@ -91,19 +81,27 @@ class EjabberdApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-ejabberd', name, short_description,
|
||||
'ejabberd', 'ejabberd:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('ejabberd'), icon_filename='ejabberd',
|
||||
short_description=_('Chat Server'),
|
||||
description=_description,
|
||||
manual_page='ejabberd', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-ejabberd', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'ejabberd:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-ejabberd', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('ejabberd:index'), clients=clients,
|
||||
'shortcut-ejabberd', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('ejabberd:index'), clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-ejabberd', name,
|
||||
firewall = Firewall('firewall-ejabberd', info.name,
|
||||
ports=['xmpp-client', 'xmpp-server',
|
||||
'xmpp-bosh'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
@ -32,12 +32,8 @@ class EjabberdAppView(AppView):
|
||||
"""Show ejabberd as a service."""
|
||||
app_id = 'ejabberd'
|
||||
template_name = 'ejabberd.html'
|
||||
name = ejabberd.name
|
||||
description = ejabberd.description
|
||||
form_class = EjabberdForm
|
||||
manual_page = ejabberd.manual_page
|
||||
port_forwarding_info = ejabberd.port_forwarding_info
|
||||
icon_filename = ejabberd.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
initdict = super().get_initial()
|
||||
@ -49,7 +45,6 @@ class EjabberdAppView(AppView):
|
||||
context = super().get_context_data(*args, **kwargs)
|
||||
domains = ejabberd.get_domains()
|
||||
context['domainname'] = domains[0] if domains else None
|
||||
context['clients'] = ejabberd.clients
|
||||
return context
|
||||
|
||||
def form_valid(self, form):
|
||||
|
||||
@ -36,9 +36,7 @@ managed_packages = ['firewalld', 'nftables']
|
||||
|
||||
managed_services = ['firewalld']
|
||||
|
||||
name = _('Firewall')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Firewall is a security system that controls the incoming and '
|
||||
'outgoing network traffic on your {box_name}. Keeping a '
|
||||
@ -46,8 +44,6 @@ description = [
|
||||
'security threat from the Internet.'), box_name=cfg.box_name)
|
||||
]
|
||||
|
||||
manual_page = 'Firewall'
|
||||
|
||||
_port_details = {}
|
||||
|
||||
app = None
|
||||
@ -61,7 +57,13 @@ class FirewallApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-firewall', name, None, 'fa-shield',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Firewall'),
|
||||
icon='fa-shield', description=_description,
|
||||
manual_page='Firewall')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-firewall', info.name, None, info.icon,
|
||||
'firewall:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -26,10 +26,7 @@ from . import components
|
||||
|
||||
class FirewallAppView(views.AppView):
|
||||
"""Serve firewall index page."""
|
||||
name = firewall.name
|
||||
description = firewall.description
|
||||
app_id = 'firewall'
|
||||
manual_page = firewall.manual_page
|
||||
template_name = 'firewall.html'
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
|
||||
@ -35,19 +35,11 @@ from .forms import is_repo_url
|
||||
from .manifest import (GIT_REPO_PATH, # noqa, pylint: disable=unused-import
|
||||
backup, clients)
|
||||
|
||||
clients = clients
|
||||
|
||||
version = 1
|
||||
|
||||
managed_packages = ['gitweb', 'highlight']
|
||||
|
||||
name = _('Gitweb')
|
||||
|
||||
icon_filename = 'gitweb'
|
||||
|
||||
short_description = _('Simple Git Hosting')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Git is a distributed version-control system for tracking changes in '
|
||||
'source code during software development. Gitweb provides a web '
|
||||
'interface to Git repositories. You can browse history and content of '
|
||||
@ -59,8 +51,6 @@ description = [
|
||||
'<a href="https://git-scm.com/docs/gittutorial">Git tutorial</a>.')
|
||||
]
|
||||
|
||||
manual_page = 'GitWeb'
|
||||
|
||||
group = ('git-access', _('Read-write access to Git repositories'))
|
||||
|
||||
app = None
|
||||
@ -77,19 +67,28 @@ class GitwebApp(app_module.App):
|
||||
|
||||
self.repos = []
|
||||
|
||||
menu_item = menu.Menu('menu-gitweb', name, short_description, 'gitweb',
|
||||
'gitweb:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Gitweb'), icon_filename='gitweb',
|
||||
short_description=_('Simple Git Hosting'),
|
||||
description=_description, manual_page='GitWeb',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-gitweb', info.name, info.short_description,
|
||||
info.icon_filename, 'gitweb:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-gitweb', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/gitweb/',
|
||||
clients=clients, login_required=True,
|
||||
shortcut = frontpage.Shortcut('shortcut-gitweb', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url='/gitweb/',
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-gitweb', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-gitweb', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-gitweb', 'gitweb-freedombox',
|
||||
|
||||
@ -37,14 +37,9 @@ from .forms import CreateRepoForm, EditRepoForm
|
||||
class GitwebAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
|
||||
clients = gitweb.clients
|
||||
name = gitweb.name
|
||||
description = gitweb.description
|
||||
app_id = 'gitweb'
|
||||
show_status_block = False
|
||||
template_name = 'gitweb_configure.html'
|
||||
icon_filename = gitweb.icon_filename
|
||||
manual_page = gitweb.manual_page
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
"""Add repositories to the context data."""
|
||||
@ -163,6 +158,6 @@ def delete(request, name):
|
||||
return redirect(reverse_lazy('gitweb:index'))
|
||||
|
||||
return TemplateResponse(request, 'gitweb_delete.html', {
|
||||
'title': gitweb.name,
|
||||
'title': gitweb.app.info.name,
|
||||
'name': name
|
||||
})
|
||||
|
||||
@ -20,8 +20,8 @@ FreedomBox app for help pages.
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import app as app_module
|
||||
from plinth import menu
|
||||
from plinth.app import App
|
||||
|
||||
version = 1
|
||||
|
||||
@ -29,7 +29,7 @@ is_essential = True
|
||||
app = None
|
||||
|
||||
|
||||
class HelpApp(App):
|
||||
class HelpApp(app_module.App):
|
||||
"""FreedomBox app for showing help."""
|
||||
|
||||
app_id = 'help'
|
||||
@ -37,6 +37,11 @@ class HelpApp(App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-help', _('Documentation'), None, 'fa-book',
|
||||
'help:index', parent_url_name='index')
|
||||
self.add(menu_item)
|
||||
|
||||
@ -39,13 +39,7 @@ managed_services = [service_name]
|
||||
|
||||
managed_packages = ['i2p']
|
||||
|
||||
name = _('I2P')
|
||||
|
||||
icon_filename = 'i2p'
|
||||
|
||||
short_description = _('Anonymity Network')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('The Invisible Internet Project is an anonymous network layer intended '
|
||||
'to protect communication from censorship and surveillance. I2P '
|
||||
'provides anonymity by sending encrypted traffic through a '
|
||||
@ -56,12 +50,8 @@ description = [
|
||||
'configuration process.')
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
group = ('i2p', _('Manage I2P application'))
|
||||
|
||||
manual_page = 'I2P'
|
||||
|
||||
port_forwarding_info = [
|
||||
('TCP', 4444),
|
||||
('TCP', 4445),
|
||||
@ -85,19 +75,28 @@ class I2PApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-i2p', name, short_description, 'i2p',
|
||||
'i2p:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('I2P'), icon_filename='i2p',
|
||||
short_description=_('Anonymity Network'),
|
||||
description=_description, manual_page='I2P',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-i2p', info.name, info.short_description,
|
||||
info.icon_filename, 'i2p:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-i2p', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/i2p/',
|
||||
clients=clients, login_required=True,
|
||||
shortcut = frontpage.Shortcut('shortcut-i2p', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url='/i2p/',
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-i2p-web', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-i2p-web', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
firewall = Firewall('firewall-i2p-proxies', _('I2P Proxy'),
|
||||
|
||||
@ -41,20 +41,14 @@ subsubmenu = [{
|
||||
class I2PAppView(AppView):
|
||||
"""Serve configuration page."""
|
||||
app_id = 'i2p'
|
||||
clients = i2p.clients
|
||||
name = i2p.name
|
||||
description = i2p.description
|
||||
show_status_block = True
|
||||
template_name = 'i2p.html'
|
||||
icon_filename = i2p.icon_filename
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Return the context data for rendering the template view."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['title'] = i2p.name
|
||||
context['description'] = i2p.description
|
||||
context['clients'] = i2p.clients
|
||||
context['manual_page'] = i2p.manual_page
|
||||
context['title'] = i2p.app.info.name
|
||||
context['app_info'] = i2p.app.info
|
||||
context['subsubmenu'] = subsubmenu
|
||||
context['port_forwarding_info'] = i2p.port_forwarding_info
|
||||
return context
|
||||
@ -69,11 +63,8 @@ class ServiceBaseView(TemplateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Add context data for template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['title'] = i2p.name
|
||||
context['name'] = i2p.name
|
||||
context['description'] = i2p.description
|
||||
context['clients'] = i2p.clients
|
||||
context['manual_page'] = i2p.manual_page
|
||||
context['title'] = i2p.app.info.name
|
||||
context['app_info'] = i2p.app.info
|
||||
context['subsubmenu'] = subsubmenu
|
||||
context['is_enabled'] = i2p.app.is_enabled()
|
||||
context['service_title'] = self.service_title
|
||||
|
||||
@ -38,13 +38,7 @@ managed_packages = [
|
||||
'libsearch-xapian-perl', 'libimage-magick-perl'
|
||||
]
|
||||
|
||||
name = _('ikiwiki')
|
||||
|
||||
icon_filename = 'ikiwiki'
|
||||
|
||||
short_description = _('Wiki and Blog')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('ikiwiki is a simple wiki and blog application. It supports '
|
||||
'several lightweight markup languages, including Markdown, and '
|
||||
'common blogging functionality such as comments and RSS feeds.'),
|
||||
@ -57,12 +51,8 @@ description = [
|
||||
users_url=reverse_lazy('users:index'))
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
group = ('wiki', _('View and edit wiki applications'))
|
||||
|
||||
manual_page = 'Ikiwiki'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -74,15 +64,22 @@ class IkiwikiApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-ikiwiki', name, short_description,
|
||||
'ikiwiki', 'ikiwiki:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('ikiwiki'), icon_filename='ikiwiki',
|
||||
short_description=_('Wiki and Blog'),
|
||||
description=_description, manual_page='Ikiwiki',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-ikiwiki', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'ikiwiki:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
self.refresh_sites()
|
||||
|
||||
firewall = Firewall('firewall-ikiwiki', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-ikiwiki', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-ikiwiki', 'ikiwiki-plinth',
|
||||
@ -92,8 +89,9 @@ class IkiwikiApp(app_module.App):
|
||||
def add_shortcut(self, site, title):
|
||||
"""Add an ikiwiki shortcut to frontpage."""
|
||||
shortcut = frontpage.Shortcut('shortcut-ikiwiki-' + site, title,
|
||||
icon=icon_filename,
|
||||
url='/ikiwiki/' + site, clients=clients)
|
||||
icon=self.info.icon_filename,
|
||||
url='/ikiwiki/' + site,
|
||||
clients=self.info.clients)
|
||||
self.add(shortcut)
|
||||
return shortcut
|
||||
|
||||
|
||||
@ -33,13 +33,8 @@ from .forms import IkiwikiCreateForm
|
||||
class IkiwikiAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
app_id = 'ikiwiki'
|
||||
name = ikiwiki.name
|
||||
description = ikiwiki.description
|
||||
show_status_block = False
|
||||
template_name = 'ikiwiki_configure.html'
|
||||
manual_page = ikiwiki.manual_page
|
||||
clients = ikiwiki.clients
|
||||
icon_filename = ikiwiki.icon_filename
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Return the context data for rendering the template view."""
|
||||
@ -77,11 +72,8 @@ def create(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'ikiwiki_create.html', {
|
||||
'title': ikiwiki.name,
|
||||
'clients': ikiwiki.clients,
|
||||
'description': ikiwiki.description,
|
||||
'title': ikiwiki.app.info.name,
|
||||
'form': form,
|
||||
'manual_page': ikiwiki.manual_page,
|
||||
'is_enabled': ikiwiki.app.is_enabled(),
|
||||
})
|
||||
|
||||
@ -134,6 +126,6 @@ def delete(request, name):
|
||||
return redirect(reverse_lazy('ikiwiki:index'))
|
||||
|
||||
return TemplateResponse(request, 'ikiwiki_delete.html', {
|
||||
'title': ikiwiki.name,
|
||||
'title': ikiwiki.app.info.name,
|
||||
'name': title
|
||||
})
|
||||
|
||||
@ -37,15 +37,7 @@ managed_services = ['infinoted']
|
||||
|
||||
managed_packages = ['infinoted']
|
||||
|
||||
manual_page = 'Infinoted'
|
||||
|
||||
name = _('infinoted')
|
||||
|
||||
icon_filename = 'infinoted'
|
||||
|
||||
short_description = _('Gobby Server')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('infinoted is a server for Gobby, a collaborative text editor.'),
|
||||
format_lazy(
|
||||
_('To use it, <a href="https://gobby.github.io/">download Gobby</a>, '
|
||||
@ -54,8 +46,6 @@ description = [
|
||||
box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
port_forwarding_info = [('TCP', 6523)]
|
||||
|
||||
app = None
|
||||
@ -69,19 +59,27 @@ class InfinotedApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-infinoted', name, short_description,
|
||||
'infinoted', 'infinoted:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('infinoted'), icon_filename='infinoted',
|
||||
short_description=_('Gobby Server'),
|
||||
description=_description,
|
||||
manual_page='Infinoted', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-infinoted', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'infinoted:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-infinoted', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('infinoted:index'), clients=clients,
|
||||
login_required=False)
|
||||
'shortcut-infinoted', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('infinoted:index'),
|
||||
clients=info.clients, login_required=False)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-infinoted', name,
|
||||
firewall = Firewall('firewall-infinoted', info.name,
|
||||
ports=['infinoted-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
@ -102,11 +100,7 @@ def init():
|
||||
|
||||
class InfinotedAppView(AppView):
|
||||
app_id = 'infinoted'
|
||||
name = name
|
||||
description = description
|
||||
clients = clients
|
||||
port_forwarding_info = port_forwarding_info
|
||||
icon_filename = icon_filename
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
|
||||
@ -33,19 +33,11 @@ version = 1
|
||||
|
||||
managed_packages = ['libjs-jsxc']
|
||||
|
||||
name = _('JSXC')
|
||||
|
||||
icon_filename = 'jsxc'
|
||||
|
||||
short_description = _('Chat Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('JSXC is a web client for XMPP. Typically it is used with an XMPP '
|
||||
'server running locally.'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
app = None
|
||||
@ -59,19 +51,26 @@ class JSXCApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-jsxc', name, short_description, 'jsxc',
|
||||
'jsxc:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('JSXC'), icon_filename='jsxc',
|
||||
short_description=_('Chat Client'),
|
||||
description=_description, clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-jsxc', info.name, info.short_description,
|
||||
info.icon_filename, 'jsxc:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-jsxc', name=name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename,
|
||||
shortcut = frontpage.Shortcut('shortcut-jsxc', name=info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url=reverse_lazy('jsxc:jsxc'),
|
||||
clients=clients)
|
||||
clients=info.clients)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-jsxc', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-jsxc', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ Views for the JSXC module
|
||||
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from plinth.modules import config, jsxc
|
||||
from plinth.modules import config
|
||||
from plinth.views import AppView
|
||||
|
||||
|
||||
@ -28,11 +28,7 @@ class JSXCAppView(AppView):
|
||||
"""Show ejabberd as an app."""
|
||||
app_id = 'jsxc'
|
||||
template_name = 'jsxc.html'
|
||||
name = jsxc.name
|
||||
description = jsxc.description
|
||||
show_status_block = False
|
||||
clients = jsxc.clients
|
||||
icon_filename = jsxc.icon_filename
|
||||
|
||||
|
||||
class JsxcView(TemplateView):
|
||||
|
||||
@ -45,11 +45,7 @@ depends = ['names']
|
||||
|
||||
managed_packages = ['certbot']
|
||||
|
||||
name = _('Let\'s Encrypt')
|
||||
|
||||
short_description = _('Certificates')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('A digital certificate allows users of a web service to verify the '
|
||||
'identity of the service and to securely communicate with it. '
|
||||
@ -64,8 +60,6 @@ description = [
|
||||
'Subscriber Agreement</a> before using this service.')
|
||||
]
|
||||
|
||||
manual_page = 'LetsEncrypt'
|
||||
|
||||
LIVE_DIRECTORY = '/etc/letsencrypt/live/'
|
||||
CERTIFICATE_CHECK_DELAY = 120
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -81,9 +75,17 @@ class LetsEncryptApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-letsencrypt', name, short_description,
|
||||
'fa-lock', 'letsencrypt:index',
|
||||
parent_url_name='system')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, depends=depends,
|
||||
name=_('Let\'s Encrypt'), icon='fa-lock',
|
||||
short_description=_('Certificates'),
|
||||
description=_description,
|
||||
manual_page='LetsEncrypt')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-letsencrypt', info.name,
|
||||
info.short_description, info.icon,
|
||||
'letsencrypt:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
def diagnose(self):
|
||||
|
||||
@ -39,10 +39,8 @@ def index(request):
|
||||
return TemplateResponse(
|
||||
request, 'letsencrypt.html', {
|
||||
'app_id': 'letsencrypt',
|
||||
'name': letsencrypt.name,
|
||||
'description': letsencrypt.description,
|
||||
'app_info': letsencrypt.app.info,
|
||||
'status': status,
|
||||
'manual_page': letsencrypt.manual_page,
|
||||
'has_diagnostics': True,
|
||||
'is_enabled': letsencrypt.app.is_enabled(),
|
||||
})
|
||||
|
||||
@ -45,13 +45,7 @@ managed_packages = ['matrix-synapse', 'matrix-synapse-ldap3']
|
||||
|
||||
managed_paths = [pathlib.Path('/etc/matrix-synapse/')]
|
||||
|
||||
name = _('Matrix Synapse')
|
||||
|
||||
icon_filename = 'matrixsynapse'
|
||||
|
||||
short_description = _('Chat Server')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('<a href="https://matrix.org/docs/guides/faq.html">Matrix</a> is an new '
|
||||
'ecosystem for open, federated instant messaging and VoIP. Synapse is a '
|
||||
'server implementing the Matrix protocol. It provides chat groups, '
|
||||
@ -65,10 +59,6 @@ description = [
|
||||
'client is recommended.')
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
manual_page = 'MatrixSynapse'
|
||||
|
||||
port_forwarding_info = [('TCP', 8448)]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -87,20 +77,28 @@ class MatrixSynapseApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-matrixsynapse', name, short_description,
|
||||
'matrixsynapse', 'matrixsynapse:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Matrix Synapse'),
|
||||
icon_filename='matrixsynapse',
|
||||
short_description=_('Chat Server'),
|
||||
description=_description,
|
||||
manual_page='MatrixSynapse', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-matrixsynapse', info.name,
|
||||
info.short_description, 'matrixsynapse',
|
||||
'matrixsynapse:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-matrixsynapse', name,
|
||||
short_description=short_description, icon=icon_filename,
|
||||
description=description,
|
||||
configure_url=reverse_lazy('matrixsynapse:index'), clients=clients,
|
||||
login_required=True)
|
||||
'shortcut-matrixsynapse', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('matrixsynapse:index'),
|
||||
clients=info.clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-matrixsynapse', name,
|
||||
firewall = Firewall('firewall-matrixsynapse', info.name,
|
||||
ports=['matrix-synapse-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -38,8 +38,6 @@ class SetupView(FormView):
|
||||
template_name = 'matrix-synapse-pre-setup.html'
|
||||
form_class = DomainSelectionForm
|
||||
success_url = reverse_lazy('matrixsynapse:index')
|
||||
icon_filename = matrixsynapse.icon_filename
|
||||
title = matrixsynapse.name
|
||||
|
||||
def form_valid(self, form):
|
||||
"""Handle valid form submission."""
|
||||
@ -50,9 +48,8 @@ class SetupView(FormView):
|
||||
"""Provide context data to the template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
context['name'] = matrixsynapse.name
|
||||
context['description'] = matrixsynapse.description
|
||||
context['icon_filename'] = matrixsynapse.icon_filename
|
||||
context['title'] = matrixsynapse.app.info.name
|
||||
context['app_info'] = matrixsynapse.app.info
|
||||
context['domain_names'] = names.components.DomainName.list_names(
|
||||
'matrix-synapse-plinth')
|
||||
|
||||
@ -63,11 +60,8 @@ class MatrixSynapseAppView(AppView):
|
||||
"""Show matrix-synapse service page."""
|
||||
app_id = 'matrixsynapse'
|
||||
template_name = 'matrix-synapse.html'
|
||||
name = matrixsynapse.name
|
||||
description = matrixsynapse.description
|
||||
form_class = MatrixSynapseForm
|
||||
port_forwarding_info = matrixsynapse.port_forwarding_info
|
||||
icon_filename = matrixsynapse.icon_filename
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
"""Redirect to setup page if setup is not done yet."""
|
||||
@ -80,8 +74,6 @@ class MatrixSynapseAppView(AppView):
|
||||
"""Add additional context data for template."""
|
||||
context = super().get_context_data(*args, **kwargs)
|
||||
context['domain_name'] = matrixsynapse.get_configured_domain_name()
|
||||
context['clients'] = matrixsynapse.clients
|
||||
context['manual_page'] = matrixsynapse.manual_page
|
||||
context['certificate_status'] = matrixsynapse.get_certificate_status()
|
||||
return context
|
||||
|
||||
|
||||
@ -37,13 +37,7 @@ managed_packages = ['mediawiki', 'imagemagick', 'php-sqlite3']
|
||||
|
||||
managed_services = ['mediawiki-jobrunner']
|
||||
|
||||
name = _('MediaWiki')
|
||||
|
||||
icon_filename = 'mediawiki'
|
||||
|
||||
short_description = _('Wiki')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('MediaWiki is the wiki engine that powers Wikipedia and other WikiMedia '
|
||||
'projects. A wiki engine is a program for creating a collaboratively '
|
||||
'edited website. You can use MediaWiki to host a wiki-like website, '
|
||||
@ -58,10 +52,6 @@ description = [
|
||||
'logged in can make changes to the content.')
|
||||
]
|
||||
|
||||
manual_page = 'MediaWiki'
|
||||
|
||||
clients = clients
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -75,18 +65,25 @@ class MediaWikiApp(app_module.App):
|
||||
super().__init__()
|
||||
self._private_mode = True
|
||||
|
||||
menu_item = menu.Menu('menu-mediawiki', name, short_description,
|
||||
'mediawiki', 'mediawiki:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('MediaWiki'), icon_filename='mediawiki',
|
||||
short_description=_('Wiki'),
|
||||
description=_description,
|
||||
manual_page='MediaWiki', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-mediawiki', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'mediawiki:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = Shortcut('shortcut-mediawiki', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/mediawiki',
|
||||
clients=clients, login_required=True)
|
||||
shortcut = Shortcut('shortcut-mediawiki', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url='/mediawiki',
|
||||
clients=info.clients, login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-mediawiki', name,
|
||||
firewall = Firewall('firewall-mediawiki', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -35,15 +35,10 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class MediaWikiAppView(views.AppView):
|
||||
"""App configuration page."""
|
||||
clients = mediawiki.clients
|
||||
name = mediawiki.name
|
||||
description = mediawiki.description
|
||||
app_id = 'mediawiki'
|
||||
form_class = MediaWikiForm
|
||||
manual_page = mediawiki.manual_page
|
||||
show_status_block = False
|
||||
template_name = 'mediawiki.html'
|
||||
icon_filename = mediawiki.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the values to fill in the form."""
|
||||
|
||||
@ -47,13 +47,7 @@ mods = [
|
||||
|
||||
managed_packages = ['minetest-server'] + mods
|
||||
|
||||
name = _('Minetest')
|
||||
|
||||
icon_filename = 'minetest'
|
||||
|
||||
short_description = _('Block Sandbox')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Minetest is a multiplayer infinite-world block sandbox. This '
|
||||
'module enables the Minetest server to be run on this '
|
||||
@ -62,10 +56,6 @@ description = [
|
||||
'is needed.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
manual_page = 'Minetest'
|
||||
|
||||
port_forwarding_info = [('UDP', 30000)]
|
||||
|
||||
reserved_usernames = ['Debian-minetest']
|
||||
@ -84,19 +74,27 @@ class MinetestApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-minetest', name, short_description,
|
||||
'minetest', 'minetest:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Minetest'), icon_filename='minetest',
|
||||
short_description=_('Block Sandbox'),
|
||||
description=_description,
|
||||
manual_page='Minetest', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-minetest', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'minetest:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-minetest', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('minetest:index'), clients=clients,
|
||||
'shortcut-minetest', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('minetest:index'), clients=info.clients,
|
||||
login_required=False)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-minetest', name,
|
||||
firewall = Firewall('firewall-minetest', info.name,
|
||||
ports=['minetest-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -25,22 +25,17 @@ from plinth import actions
|
||||
from plinth.modules import minetest, names
|
||||
from plinth.views import AppView
|
||||
|
||||
from . import description, get_configuration
|
||||
from . import get_configuration
|
||||
from .forms import MinetestForm
|
||||
|
||||
|
||||
class MinetestAppView(AppView): # pylint: disable=too-many-ancestors
|
||||
"""A specialized view for configuring minetest."""
|
||||
app_id = 'minetest'
|
||||
name = minetest.name
|
||||
description = description
|
||||
show_status_block = True
|
||||
template_name = 'minetest.html'
|
||||
form_class = MinetestForm
|
||||
clients = minetest.clients
|
||||
manual_page = minetest.manual_page
|
||||
port_forwarding_info = minetest.port_forwarding_info
|
||||
icon_filename = minetest.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the values to fill in the form."""
|
||||
|
||||
@ -30,17 +30,11 @@ from .manifest import backup, clients # noqa
|
||||
|
||||
version = 1
|
||||
|
||||
name = 'minidlna'
|
||||
|
||||
icon_filename = name
|
||||
|
||||
managed_packages = ['minidlna']
|
||||
|
||||
managed_services = ['minidlna']
|
||||
|
||||
short_description = _('Simple Media Server')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('MiniDLNA is a simple media server software, with the aim of being '
|
||||
'fully compliant with DLNA/UPnP-AV clients. '
|
||||
'The MiniDNLA daemon serves media files '
|
||||
@ -51,8 +45,6 @@ description = [
|
||||
'such as PS3 and Xbox 360) or applications such as totem and Kodi.')
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
group = ('minidlna', _('Media streaming server'))
|
||||
|
||||
app = None
|
||||
@ -65,24 +57,30 @@ class MiniDLNAApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Initialize the app components"""
|
||||
super().__init__()
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name='minidlna', icon_filename='minidlna',
|
||||
short_description=_('Simple Media Server'),
|
||||
description=_description, clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu(
|
||||
'menu-minidlna',
|
||||
name=name,
|
||||
short_description=short_description,
|
||||
name=info.name,
|
||||
short_description=info.short_description,
|
||||
url_name='minidlna:index',
|
||||
parent_url_name='apps',
|
||||
icon=icon_filename,
|
||||
icon=info.icon_filename,
|
||||
)
|
||||
firewall = Firewall('firewall-minidlna', name, ports=['minidlna'],
|
||||
firewall = Firewall('firewall-minidlna', info.name, ports=['minidlna'],
|
||||
is_external=False)
|
||||
webserver = Webserver('webserver-minidlna', 'minidlna-freedombox',
|
||||
urls=['http://localhost:8200/'])
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-minidlna',
|
||||
name,
|
||||
short_description=short_description,
|
||||
description=description,
|
||||
icon=icon_filename,
|
||||
info.name,
|
||||
short_description=info.short_description,
|
||||
description=info.description,
|
||||
icon=info.icon_filename,
|
||||
url='/_minidlna/',
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]],
|
||||
|
||||
@ -23,7 +23,6 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules import minidlna
|
||||
from plinth.views import AppView
|
||||
|
||||
from .forms import MiniDLNAServerForm
|
||||
@ -31,11 +30,7 @@ from .forms import MiniDLNAServerForm
|
||||
|
||||
class MiniDLNAAppView(AppView):
|
||||
app_id = 'minidlna'
|
||||
name = minidlna.name
|
||||
description = minidlna.description
|
||||
form_class = MiniDLNAServerForm
|
||||
icon_filename = minidlna.icon_filename
|
||||
clients = minidlna.clients
|
||||
|
||||
def get_initial(self):
|
||||
"""Initial form value as found in the minidlna.conf"""
|
||||
|
||||
@ -37,13 +37,7 @@ managed_services = ['mldonkey-server']
|
||||
|
||||
managed_packages = ['mldonkey-server']
|
||||
|
||||
name = _('MLDonkey')
|
||||
|
||||
icon_filename = 'mldonkey'
|
||||
|
||||
short_description = _('Peer-to-peer File Sharing')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('MLDonkey is a peer-to-peer file sharing application used to exchange '
|
||||
'large files. It can participate in multiple peer-to-peer networks '
|
||||
'including eDonkey, Kademlia, Overnet, BitTorrent and DirectConnect.'),
|
||||
@ -56,14 +50,10 @@ description = [
|
||||
'directory.'), box_name=cfg.box_name)
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['mldonkey']
|
||||
|
||||
group = ('ed2k', _('Download files using eDonkey applications'))
|
||||
|
||||
manual_page = 'MLDonkey'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -75,20 +65,27 @@ class MLDonkeyApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-mldonkey', name, short_description,
|
||||
'mldonkey', 'mldonkey:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(
|
||||
app_id=self.app_id, version=version, name=_('MLDonkey'),
|
||||
icon_filename='mldonkey',
|
||||
short_description=_('Peer-to-peer File Sharing'),
|
||||
description=_description, manual_page='MLDonkey', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-mldonkey', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'mldonkey:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcuts = frontpage.Shortcut('shortcut-mldonkey', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/mldonkey/',
|
||||
login_required=True, clients=clients,
|
||||
allowed_groups=[group[0]])
|
||||
shortcuts = frontpage.Shortcut(
|
||||
'shortcut-mldonkey', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
url='/mldonkey/', login_required=True, clients=info.clients,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcuts)
|
||||
|
||||
firewall = Firewall('firewall-mldonkey', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-mldonkey', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-mldonkey', 'mldonkey-freedombox',
|
||||
|
||||
@ -20,16 +20,12 @@ URLs for the mldonkey module.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from plinth.modules import mldonkey
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^apps/mldonkey/$',
|
||||
AppView.as_view(app_id='mldonkey', name=mldonkey.name,
|
||||
description=mldonkey.description,
|
||||
clients=mldonkey.clients,
|
||||
manual_page=mldonkey.manual_page,
|
||||
show_status_block=True,
|
||||
icon_filename=mldonkey.icon_filename), name='index'),
|
||||
url(r'^apps/mldonkey/$',
|
||||
AppView.as_view(
|
||||
app_id='mldonkey',
|
||||
show_status_block=True,
|
||||
), name='index'),
|
||||
]
|
||||
|
||||
@ -29,9 +29,7 @@ version = 1
|
||||
|
||||
managed_packages = ['monkeysphere']
|
||||
|
||||
name = _('Monkeysphere')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('With Monkeysphere, an OpenPGP key can be generated for each configured '
|
||||
'domain serving SSH. The OpenPGP public key can then be uploaded to the '
|
||||
'OpenPGP keyservers. Users connecting to this machine through SSH can '
|
||||
@ -50,8 +48,6 @@ description = [
|
||||
'website</a>.')
|
||||
]
|
||||
|
||||
manual_page = "Monkeysphere"
|
||||
|
||||
reserved_usernames = ['monkeysphere']
|
||||
|
||||
app = None
|
||||
@ -65,9 +61,15 @@ class MonkeysphereApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-monkeysphere', name, None,
|
||||
'fa-certificate', 'monkeysphere:index',
|
||||
parent_url_name='system', advanced=True)
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Monkeysphere'), icon='fa-certificate',
|
||||
description=_description,
|
||||
manual_page='Monkeysphere')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-monkeysphere', info.name, None, info.icon,
|
||||
'monkeysphere:index', parent_url_name='system',
|
||||
advanced=True)
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
|
||||
@ -39,11 +39,9 @@ def index(request):
|
||||
status = get_status()
|
||||
return TemplateResponse(
|
||||
request, 'monkeysphere.html', {
|
||||
'title': monkeysphere.name,
|
||||
'name': monkeysphere.name,
|
||||
'description': monkeysphere.description,
|
||||
'app_info': monkeysphere.app.info,
|
||||
'title': monkeysphere.app.info.name,
|
||||
'status': status,
|
||||
'manual_page': monkeysphere.manual_page,
|
||||
'running': bool(publish_process)
|
||||
})
|
||||
|
||||
@ -67,7 +65,7 @@ def import_key(request, ssh_fingerprint):
|
||||
def details(request, fingerprint):
|
||||
"""Get details for an OpenPGP key."""
|
||||
return TemplateResponse(request, 'monkeysphere_details.html', {
|
||||
'title': monkeysphere.name,
|
||||
'title': monkeysphere.app.info.name,
|
||||
'key': get_key(fingerprint)
|
||||
})
|
||||
|
||||
|
||||
@ -30,17 +30,11 @@ from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 1
|
||||
|
||||
name = _('Mumble')
|
||||
|
||||
icon_filename = 'mumble'
|
||||
|
||||
short_description = _('Voice Chat')
|
||||
|
||||
managed_services = ['mumble-server']
|
||||
|
||||
managed_packages = ['mumble-server']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Mumble is an open source, low-latency, encrypted, high quality '
|
||||
'voice chat software.'),
|
||||
_('You can connect to your Mumble server on the regular Mumble port '
|
||||
@ -48,12 +42,8 @@ description = [
|
||||
'from your desktop and Android devices are available.')
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['mumble-server']
|
||||
|
||||
manual_page = 'Mumble'
|
||||
|
||||
port_forwarding_info = [
|
||||
('TCP', 64738),
|
||||
('UDP', 64738),
|
||||
@ -70,18 +60,26 @@ class MumbleApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-mumble', name, short_description, 'mumble',
|
||||
'mumble:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Mumble'), icon_filename='mumble',
|
||||
short_description=_('Voice Chat'),
|
||||
description=_description, manual_page='Mumble',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-mumble', info.name, info.short_description,
|
||||
'mumble', 'mumble:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-mumble', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('mumble:index'), clients=clients)
|
||||
'shortcut-mumble', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('mumble:index'), clients=info.clients)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-mumble', name, ports=['mumble-plinth'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-mumble', info.name,
|
||||
ports=['mumble-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
daemon = Daemon(
|
||||
|
||||
@ -18,20 +18,14 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules.mumble import (clients, description, icon_filename,
|
||||
manual_page, name, port_forwarding_info)
|
||||
from plinth.modules.mumble import port_forwarding_info
|
||||
from plinth.modules.mumble.forms import MumbleForm
|
||||
from plinth.views import AppView
|
||||
|
||||
|
||||
class MumbleAppView(AppView):
|
||||
app_id = 'mumble'
|
||||
name = name
|
||||
description = description
|
||||
clients = clients
|
||||
manual_page = manual_page
|
||||
port_forwarding_info = port_forwarding_info
|
||||
icon_filename = icon_filename
|
||||
form_class = MumbleForm
|
||||
|
||||
def form_valid(self, form):
|
||||
|
||||
@ -34,13 +34,9 @@ version = 1
|
||||
|
||||
is_essential = True
|
||||
|
||||
name = _('Name Services')
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
manual_page = 'NameServices'
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Name Services provides an overview of the ways {box_name} can be '
|
||||
'reached from the public Internet: domain name, Tor onion service, '
|
||||
@ -60,7 +56,14 @@ class NamesApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-names', name, None, 'fa-tags',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential,
|
||||
name=_('Name Services'), icon='fa-tags',
|
||||
description=_description,
|
||||
manual_page='NameServices')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-names', info.name, None, info.icon,
|
||||
'names:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -29,13 +29,10 @@ def index(request):
|
||||
"""Serve name services page."""
|
||||
status = get_status()
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'names.html', {
|
||||
'name': names.name,
|
||||
'description': names.description,
|
||||
'manual_page': names.manual_page,
|
||||
'status': status
|
||||
})
|
||||
return TemplateResponse(request, 'names.html', {
|
||||
'app_info': names.app.info,
|
||||
'status': status
|
||||
})
|
||||
|
||||
|
||||
def get_status():
|
||||
|
||||
@ -39,9 +39,7 @@ first_boot_steps = [{
|
||||
'order': 4,
|
||||
}]
|
||||
|
||||
name = _('Networks')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Configure network devices. Connect to the Internet via Ethernet, Wi-Fi '
|
||||
'or PPPoE. Share that connection with other devices on the network.'),
|
||||
_('Devices administered through other methods may not be available for '
|
||||
@ -50,8 +48,6 @@ description = [
|
||||
|
||||
logger = Logger(__name__)
|
||||
|
||||
manual_page = 'Networks'
|
||||
|
||||
app = None
|
||||
|
||||
ROUTER_CONFIGURATION_TYPE_KEY = 'networks_router_configuration_type'
|
||||
@ -65,7 +61,13 @@ class NetworksApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-networks', name, None, 'fa-signal',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Networks'),
|
||||
icon='fa-signal', description=_description,
|
||||
manual_page='Networks')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-networks', info.name, None, info.icon,
|
||||
'networks:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -24,11 +24,11 @@ from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.http import require_POST
|
||||
|
||||
from plinth import network, kvstore
|
||||
from plinth.modules import networks, first_boot
|
||||
from plinth import kvstore, network
|
||||
from plinth.modules import first_boot, networks
|
||||
|
||||
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
|
||||
PPPoEForm, WifiForm, RouterConfigurationWizardForm)
|
||||
PPPoEForm, RouterConfigurationWizardForm, WifiForm)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -40,10 +40,8 @@ def index(request):
|
||||
return TemplateResponse(
|
||||
request, 'connections_list.html', {
|
||||
'app_id': 'networks',
|
||||
'app_info': networks.app.info,
|
||||
'title': _('Network Connections'),
|
||||
'name': networks.name,
|
||||
'description': networks.description,
|
||||
'manual_page': networks.manual_page,
|
||||
'has_diagnostics': True,
|
||||
'is_enabled': True,
|
||||
'connections': connections
|
||||
@ -431,10 +429,8 @@ def router_configuration_help_page(request):
|
||||
if form.is_valid():
|
||||
logger.info('Updating router configuration setup with value: %s' %
|
||||
request.POST['router_config'])
|
||||
kvstore.set(
|
||||
networks.ROUTER_CONFIGURATION_TYPE_KEY,
|
||||
request.POST['router_config']
|
||||
)
|
||||
kvstore.set(networks.ROUTER_CONFIGURATION_TYPE_KEY,
|
||||
request.POST['router_config'])
|
||||
if is_firstboot:
|
||||
resp = reverse_lazy(first_boot.next_step())
|
||||
else:
|
||||
@ -446,8 +442,9 @@ def router_configuration_help_page(request):
|
||||
else:
|
||||
html = "router_configuration_update.html"
|
||||
initial = {
|
||||
"router_config": kvstore.get_default(
|
||||
networks.ROUTER_CONFIGURATION_TYPE_KEY, 'dmz'),
|
||||
"router_config":
|
||||
kvstore.get_default(networks.ROUTER_CONFIGURATION_TYPE_KEY,
|
||||
'dmz'),
|
||||
}
|
||||
template_kwargs = {
|
||||
'form': RouterConfigurationWizardForm(initial=initial),
|
||||
|
||||
@ -36,13 +36,7 @@ managed_services = ['openvpn-server@freedombox']
|
||||
|
||||
managed_packages = ['openvpn', 'easy-rsa']
|
||||
|
||||
name = _('OpenVPN')
|
||||
|
||||
icon_filename = 'openvpn'
|
||||
|
||||
short_description = _('Virtual Private Network')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Virtual Private Network (VPN) is a technique for securely '
|
||||
'connecting two devices in order to access resources of a '
|
||||
@ -53,14 +47,10 @@ description = [
|
||||
'for added security and anonymity.'), box_name=_(cfg.box_name))
|
||||
]
|
||||
|
||||
manual_page = 'OpenVPN'
|
||||
|
||||
port_forwarding_info = [('UDP', 1194)]
|
||||
|
||||
app = None
|
||||
|
||||
clients = clients
|
||||
|
||||
|
||||
class OpenVPNApp(app_module.App):
|
||||
"""FreedomBox app for OpenVPN."""
|
||||
@ -70,9 +60,16 @@ class OpenVPNApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-openvpn', name, short_description,
|
||||
'openvpn', 'openvpn:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('OpenVPN'), icon_filename='openvpn',
|
||||
short_description=_('Virtual Private Network'),
|
||||
description=_description, manual_page='OpenVPN',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-openvpn', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'openvpn:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
download_profile = \
|
||||
@ -80,12 +77,13 @@ class OpenVPNApp(app_module.App):
|
||||
'Download Profile</a>'),
|
||||
link=reverse_lazy('openvpn:profile'))
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-openvpn', name, short_description=short_description,
|
||||
icon=icon_filename, description=description + [download_profile],
|
||||
'shortcut-openvpn', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description + [download_profile],
|
||||
configure_url=reverse_lazy('openvpn:index'), login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-openvpn', name, ports=['openvpn'],
|
||||
firewall = Firewall('firewall-openvpn', info.name, ports=['openvpn'],
|
||||
is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -59,10 +59,7 @@ def index(request):
|
||||
return TemplateResponse(
|
||||
request, 'openvpn.html', {
|
||||
'app_id': 'openvpn',
|
||||
'clients': openvpn.clients,
|
||||
'name': openvpn.name,
|
||||
'description': openvpn.description,
|
||||
'manual_page': openvpn.manual_page,
|
||||
'app_info': openvpn.app.info,
|
||||
'port_forwarding_info': openvpn.port_forwarding_info,
|
||||
'status': status,
|
||||
'form': form,
|
||||
@ -70,7 +67,6 @@ def index(request):
|
||||
'is_running': status['is_running'],
|
||||
'has_diagnostics': True,
|
||||
'is_enabled': status['enabled'],
|
||||
'icon_filename': openvpn.icon_filename
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -36,11 +36,7 @@ managed_services = ['pagekite']
|
||||
|
||||
managed_packages = ['pagekite']
|
||||
|
||||
name = _('PageKite')
|
||||
|
||||
short_description = _('Public Visibility')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('PageKite is a system for exposing {box_name} services when '
|
||||
'you don\'t have a direct connection to the Internet. You only '
|
||||
@ -66,8 +62,6 @@ description = [
|
||||
box_name=_(cfg.box_name))
|
||||
]
|
||||
|
||||
manual_page = 'PageKite'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -79,9 +73,17 @@ class PagekiteApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-pagekite', name, short_description,
|
||||
'fa-flag', 'pagekite:index',
|
||||
parent_url_name='system')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
depends=depends, name=_('PageKite'),
|
||||
icon='fa-flag',
|
||||
short_description=_('Public Visibility'),
|
||||
description=_description,
|
||||
manual_page='PageKite')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-pagekite', info.name,
|
||||
info.short_description, info.icon,
|
||||
'pagekite:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-pagekite', _('PageKite Domain'),
|
||||
|
||||
@ -35,10 +35,8 @@ class ContextMixin(object):
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Use self.title and the module-level subsubmenu"""
|
||||
context = super(ContextMixin, self).get_context_data(**kwargs)
|
||||
context['title'] = pagekite.name
|
||||
context['name'] = pagekite.name
|
||||
context['description'] = pagekite.description
|
||||
context['manual_page'] = pagekite.manual_page
|
||||
context['app_info'] = pagekite.app.info
|
||||
context['title'] = pagekite.app.info.name
|
||||
context['is_enabled'] = pagekite.app.is_enabled()
|
||||
return context
|
||||
|
||||
|
||||
@ -20,19 +20,38 @@ FreedomBox app for power controls.
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import app as app_module
|
||||
|
||||
from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 1
|
||||
|
||||
is_essential = True
|
||||
|
||||
name = _('Power')
|
||||
_description = [_('Restart or shut down the system.')]
|
||||
|
||||
description = [_('Restart or shut down the system.')]
|
||||
app = None
|
||||
|
||||
manual_page = 'Power'
|
||||
|
||||
class PowerApp(app_module.App):
|
||||
"""FreedomBox app for power controls."""
|
||||
|
||||
app_id = 'power'
|
||||
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Power'),
|
||||
description=_description, manual_page='Power')
|
||||
self.add(info)
|
||||
|
||||
# not in menu, see issue #834
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the power module."""
|
||||
pass # not in menu, see issue #834
|
||||
global app
|
||||
app = PowerApp()
|
||||
app.set_enabled(True)
|
||||
|
||||
@ -22,7 +22,6 @@ from django.forms import Form
|
||||
from django.shortcuts import redirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules import power
|
||||
@ -32,10 +31,8 @@ def index(request):
|
||||
"""Serve power controls page."""
|
||||
return TemplateResponse(
|
||||
request, 'power.html', {
|
||||
'title': power.name,
|
||||
'name': power.name,
|
||||
'description': power.description,
|
||||
'manual_page': power.manual_page,
|
||||
'title': power.app.info.name,
|
||||
'app_info': power.app.info,
|
||||
'pkg_manager_is_busy': _is_pkg_manager_busy()
|
||||
})
|
||||
|
||||
@ -52,9 +49,9 @@ def restart(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'power_restart.html', {
|
||||
'title': _('Power'),
|
||||
'title': power.app.info.name,
|
||||
'form': form,
|
||||
'manual_page': power.manual_page,
|
||||
'manual_page': power.app.info.manual_page,
|
||||
'pkg_manager_is_busy': _is_pkg_manager_busy()
|
||||
})
|
||||
|
||||
@ -71,9 +68,9 @@ def shutdown(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'power_shutdown.html', {
|
||||
'title': _('Power'),
|
||||
'title': power.app.info.name,
|
||||
'form': form,
|
||||
'manual_page': power.manual_page,
|
||||
'manual_page': power.app.info.manual_page,
|
||||
'pkg_manager_is_busy': _is_pkg_manager_busy()
|
||||
})
|
||||
|
||||
|
||||
@ -40,13 +40,7 @@ managed_services = ['privoxy']
|
||||
|
||||
managed_packages = ['privoxy']
|
||||
|
||||
name = _('Privoxy')
|
||||
|
||||
icon_filename = 'privoxy'
|
||||
|
||||
short_description = _('Web Proxy')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Privoxy is a non-caching web proxy with advanced filtering '
|
||||
'capabilities for enhancing privacy, modifying web page data and '
|
||||
'HTTP headers, controlling access, and removing ads and other '
|
||||
@ -63,8 +57,6 @@ description = [
|
||||
|
||||
reserved_usernames = ['privoxy']
|
||||
|
||||
manual_page = 'Privoxy'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -76,18 +68,25 @@ class PrivoxyApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-privoxy', name, short_description,
|
||||
'privoxy', 'privoxy:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Privoxy'), icon_filename='privoxy',
|
||||
short_description=_('Web Proxy'),
|
||||
description=_description, manual_page='Privoxy')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-privoxy', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'privoxy:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-privoxy', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
'shortcut-privoxy', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('privoxy:index'), login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-privoxy', name, ports=['privoxy'],
|
||||
firewall = Firewall('firewall-privoxy', info.name, ports=['privoxy'],
|
||||
is_external=False)
|
||||
self.add(firewall)
|
||||
|
||||
@ -122,10 +121,6 @@ def setup(helper, old_version=None):
|
||||
|
||||
class PrivoxyAppView(AppView):
|
||||
app_id = 'privoxy'
|
||||
name = name
|
||||
description = description
|
||||
manual_page = manual_page
|
||||
icon_filename = icon_filename
|
||||
|
||||
|
||||
def diagnose_url_with_proxy():
|
||||
|
||||
@ -42,13 +42,7 @@ managed_packages = ['quassel-core']
|
||||
|
||||
managed_paths = [pathlib.Path('/var/lib/quassel/')]
|
||||
|
||||
name = _('Quassel')
|
||||
|
||||
icon_filename = 'quassel'
|
||||
|
||||
short_description = _('IRC Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Quassel is an IRC application that is split into two parts, a '
|
||||
'"core" and a "client". This allows the core to remain connected '
|
||||
@ -64,12 +58,8 @@ description = [
|
||||
'are available.'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['quasselcore']
|
||||
|
||||
manual_page = 'Quassel'
|
||||
|
||||
port_forwarding_info = [('TCP', 4242)]
|
||||
|
||||
app = None
|
||||
@ -83,20 +73,28 @@ class QuasselApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-quassel', name, short_description,
|
||||
'quassel', 'quassel:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Quassel'), icon_filename='quassel',
|
||||
short_description=_('IRC Client'),
|
||||
description=_description, manual_page='Quassel',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-quassel', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'quassel:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-quassel', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('quassel:index'), clients=clients,
|
||||
'shortcut-quassel', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('quassel:index'), clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-quassel', name, ports=['quassel-plinth'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-quassel', info.name,
|
||||
ports=['quassel-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
letsencrypt = LetsEncrypt(
|
||||
|
||||
@ -23,13 +23,8 @@ from .forms import QuasselForm
|
||||
|
||||
class QuasselAppView(AppView):
|
||||
app_id = 'quassel'
|
||||
name = quassel.name
|
||||
description = quassel.description
|
||||
clients = quassel.clients
|
||||
manual_page = quassel.manual_page
|
||||
port_forwarding_info = quassel.port_forwarding_info
|
||||
form_class = QuasselForm
|
||||
icon_filename = quassel.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the values to fill in the form."""
|
||||
|
||||
@ -42,13 +42,7 @@ managed_services = ['radicale']
|
||||
|
||||
managed_packages = ['radicale', 'uwsgi', 'uwsgi-plugin-python3']
|
||||
|
||||
name = _('Radicale')
|
||||
|
||||
icon_filename = 'radicale'
|
||||
|
||||
short_description = _('Calendar and Addressbook')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Radicale is a CalDAV and CardDAV server. It allows synchronization '
|
||||
'and sharing of scheduling and contact data. To use Radicale, a '
|
||||
@ -60,12 +54,8 @@ description = [
|
||||
'contacts, which must be done using a separate client.'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['radicale']
|
||||
|
||||
manual_page = 'Radicale'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
CONFIG_FILE = '/etc/radicale/config'
|
||||
@ -83,19 +73,27 @@ class RadicaleApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-radicale', name, short_description,
|
||||
'radicale', 'radicale:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Radicale'), icon_filename='radicale',
|
||||
short_description=_('Calendar and Addressbook'),
|
||||
description=_description,
|
||||
manual_page='Radicale', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-radicale', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'radicale:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-radicale', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/radicale/',
|
||||
clients=clients, login_required=True)
|
||||
shortcut = frontpage.Shortcut('shortcut-radicale', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url='/radicale/', clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-radicale', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-radicale', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = RadicaleWebserver('webserver-radicale', None,
|
||||
|
||||
@ -22,22 +22,16 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth.modules import radicale
|
||||
from plinth.views import AppView
|
||||
|
||||
from . import description, get_rights_value
|
||||
from . import get_rights_value
|
||||
from .forms import RadicaleForm
|
||||
|
||||
|
||||
class RadicaleAppView(AppView):
|
||||
"""A specialized view for configuring radicale service."""
|
||||
clients = radicale.clients
|
||||
name = radicale.name
|
||||
description = description
|
||||
form_class = RadicaleForm
|
||||
app_id = 'radicale'
|
||||
manual_page = radicale.manual_page
|
||||
icon_filename = radicale.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the values to fill in the form."""
|
||||
|
||||
@ -32,13 +32,7 @@ version = 1
|
||||
|
||||
managed_packages = ['sqlite3', 'roundcube', 'roundcube-sqlite3']
|
||||
|
||||
name = _('Roundcube')
|
||||
|
||||
icon_filename = 'roundcube'
|
||||
|
||||
short_description = _('Email Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Roundcube webmail is a browser-based multilingual IMAP '
|
||||
'client with an application-like user interface. It provides '
|
||||
'full functionality you expect from an email client, including '
|
||||
@ -58,8 +52,6 @@ description = [
|
||||
'>https://www.google.com/settings/security/lesssecureapps</a>).'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
manual_page = 'Roundcube'
|
||||
|
||||
app = None
|
||||
@ -73,18 +65,26 @@ class RoundcubeApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-roundcube', name, short_description,
|
||||
'roundcube', 'roundcube:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Roundcube'), icon_filename='roundcube',
|
||||
short_description=_('Email Client'),
|
||||
description=_description,
|
||||
manual_page='Roundcube', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-roundcube', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'roundcube:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-roundcube', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/roundcube/',
|
||||
clients=clients, login_required=True)
|
||||
shortcut = frontpage.Shortcut('shortcut-roundcube', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url='/roundcube/', clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-roundcube', name,
|
||||
firewall = Firewall('firewall-roundcube', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -20,15 +20,10 @@ URLs for the Roundcube module.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from plinth.modules import roundcube
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^apps/roundcube/$',
|
||||
AppView.as_view(app_id='roundcube', name=roundcube.name,
|
||||
description=roundcube.description,
|
||||
show_status_block=False, clients=roundcube.clients,
|
||||
manual_page=roundcube.manual_page,
|
||||
icon_filename=roundcube.icon_filename), name='index'),
|
||||
url(r'^apps/roundcube/$',
|
||||
AppView.as_view(app_id='roundcube', show_status_block=False),
|
||||
name='index'),
|
||||
]
|
||||
|
||||
@ -43,13 +43,7 @@ managed_services = ['smbd', 'nmbd']
|
||||
|
||||
managed_packages = ['samba', 'acl']
|
||||
|
||||
name = _('Samba')
|
||||
|
||||
icon_filename = 'samba'
|
||||
|
||||
short_description = _('File Sharing')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Samba allows to share files and folders between FreedomBox and '
|
||||
'other computers in your local network.'),
|
||||
format_lazy(
|
||||
@ -67,8 +61,6 @@ description = [
|
||||
|
||||
group = ('freedombox-share', _('Access to the private shares'))
|
||||
|
||||
clients = clients
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -80,18 +72,26 @@ class SambaApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-samba', name, short_description, 'samba',
|
||||
'samba:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Samba'), icon_filename='samba',
|
||||
short_description=_('File Sharing'),
|
||||
description=_description, clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-samba', info.name, info.short_description,
|
||||
info.icon_filename, 'samba:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-samba', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
configure_url=reverse_lazy('samba:index'), clients=clients,
|
||||
'shortcut-samba', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('samba:index'), clients=info.clients,
|
||||
login_required=True, allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-samba', name, ports=['samba'])
|
||||
firewall = Firewall('firewall-samba', info.name, ports=['samba'])
|
||||
self.add(firewall)
|
||||
|
||||
daemon = Daemon(
|
||||
|
||||
@ -37,11 +37,8 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class SambaAppView(views.AppView):
|
||||
"""Samba sharing basic configuration."""
|
||||
name = samba.name
|
||||
description = samba.description
|
||||
app_id = 'samba'
|
||||
template_name = 'samba.html'
|
||||
icon_filename = samba.icon_filename
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
"""Return template context data."""
|
||||
|
||||
@ -32,19 +32,11 @@ from plinth.modules.users import register_group
|
||||
from .manifest import (PUBLIC_ACCESS_SETTING_FILE, # noqa, pylint: disable=unused-import
|
||||
backup, clients)
|
||||
|
||||
clients = clients
|
||||
|
||||
version = 3
|
||||
|
||||
managed_packages = ['searx', 'uwsgi', 'uwsgi-plugin-python3']
|
||||
|
||||
name = _('Searx')
|
||||
|
||||
icon_filename = 'searx'
|
||||
|
||||
short_description = _('Web Search')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Searx is a privacy-respecting Internet metasearch engine. '
|
||||
'It aggregrates and displays results from multiple search engines.'),
|
||||
_('Searx can be used to avoid tracking and profiling by search engines. '
|
||||
@ -66,19 +58,28 @@ class SearxApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-searx', name, short_description, 'searx',
|
||||
'searx:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Searx'), icon_filename='searx',
|
||||
short_description=_('Web Search'),
|
||||
description=_description, manual_page='Searx',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-searx', info.name, info.short_description,
|
||||
info.icon_filename, 'searx:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-searx', name, short_description=short_description,
|
||||
icon=icon_filename, url='/searx/', clients=clients,
|
||||
'shortcut-searx', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
url='/searx/', clients=info.clients,
|
||||
login_required=(not is_public_access_enabled()),
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-searx', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-searx', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-searx', 'searx-freedombox',
|
||||
|
||||
@ -30,14 +30,9 @@ from .forms import SearxForm
|
||||
|
||||
class SearxAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
clients = searx.clients
|
||||
name = searx.name
|
||||
description = searx.description
|
||||
app_id = 'searx'
|
||||
form_class = SearxForm
|
||||
show_status_block = False
|
||||
manual_page = searx.manual_page
|
||||
icon_filename = searx.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Return the status of the service to fill in the form."""
|
||||
|
||||
@ -35,14 +35,10 @@ version = 6
|
||||
|
||||
is_essential = True
|
||||
|
||||
name = _('Security')
|
||||
|
||||
managed_packages = ['fail2ban', 'debsecan']
|
||||
|
||||
managed_services = ['fail2ban']
|
||||
|
||||
manual_page = 'Security'
|
||||
|
||||
ACCESS_CONF_FILE = '/etc/security/access.d/50freedombox.conf'
|
||||
ACCESS_CONF_FILE_OLD = '/etc/security/access.conf'
|
||||
ACCESS_CONF_SNIPPET = '-:ALL EXCEPT root fbx plinth (admin) (sudo):ALL'
|
||||
@ -60,7 +56,12 @@ class SecurityApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-security', name, None, 'fa-lock',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Security'),
|
||||
icon='fa-lock', manual_page='Security')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-security', info.name, None, info.icon,
|
||||
'security:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -44,8 +44,7 @@ def index(request):
|
||||
form = SecurityForm(initial=status, prefix='security')
|
||||
|
||||
return TemplateResponse(request, 'security.html', {
|
||||
'name': _('Security'),
|
||||
'manual_page': security.manual_page,
|
||||
'app_info': security.app.info,
|
||||
'form': form,
|
||||
})
|
||||
|
||||
|
||||
@ -31,11 +31,7 @@ version = 1
|
||||
|
||||
managed_packages = ['shaarli']
|
||||
|
||||
name = _('Shaarli')
|
||||
|
||||
short_description = _('Bookmarks')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Shaarli allows you to save and share bookmarks.'),
|
||||
_('When enabled, Shaarli will be available from <a href="/shaarli" '
|
||||
'data-turbolinks="false">/shaarli</a> path on the web server. Note that '
|
||||
@ -43,10 +39,6 @@ description = [
|
||||
'setup on the initial visit.'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
manual_page = 'Shaarli'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -58,19 +50,27 @@ class ShaarliApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-shaarli', name, short_description,
|
||||
'shaarli', 'shaarli:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Shaarli'), icon_filename='shaarli',
|
||||
short_description=_('Bookmarks'),
|
||||
description=_description, manual_page='Shaarli',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-shaarli', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'shaarli:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-shaarli', name,
|
||||
short_description=short_description,
|
||||
icon='shaarli', url='/shaarli',
|
||||
clients=clients, login_required=True)
|
||||
shortcut = frontpage.Shortcut('shortcut-shaarli', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url='/shaarli',
|
||||
clients=info.clients,
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-shaarli', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-shaarli', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-shaarli', 'shaarli')
|
||||
|
||||
@ -20,14 +20,10 @@ URLs for the Shaarli module.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from plinth.modules import shaarli
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^apps/shaarli/$',
|
||||
AppView.as_view(app_id='shaarli', name=shaarli.name,
|
||||
description=shaarli.description,
|
||||
show_status_block=False,
|
||||
manual_page=shaarli.manual_page), name='index'),
|
||||
url(r'^apps/shaarli/$',
|
||||
AppView.as_view(app_id='shaarli', show_status_block=False),
|
||||
name='index'),
|
||||
]
|
||||
|
||||
@ -32,17 +32,11 @@ from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 1
|
||||
|
||||
name = _('Shadowsocks')
|
||||
|
||||
icon_filename = 'shadowsocks'
|
||||
|
||||
short_description = _('Socks5 Proxy')
|
||||
|
||||
managed_services = ['shadowsocks-libev-local@freedombox']
|
||||
|
||||
managed_packages = ['shadowsocks-libev']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Shadowsocks is a lightweight and secure SOCKS5 proxy, designed to '
|
||||
'protect your Internet traffic. It can be used to bypass Internet '
|
||||
'filtering and censorship.'),
|
||||
@ -56,8 +50,6 @@ description = [
|
||||
'device, browser or application to http://freedombox_address:1080/')
|
||||
]
|
||||
|
||||
manual_page = 'Shadowsocks'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -69,19 +61,28 @@ class ShadowsocksApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-shadowsocks', name, short_description,
|
||||
'shadowsocks', 'shadowsocks:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Shadowsocks'),
|
||||
icon_filename='shadowsocks',
|
||||
short_description=_('Socks5 Proxy'),
|
||||
description=_description,
|
||||
manual_page='Shadowsocks')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-shadowsocks', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'shadowsocks:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-shadowsocks', name, short_description=short_description,
|
||||
icon=icon_filename, description=description,
|
||||
'shortcut-shadowsocks', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description,
|
||||
configure_url=reverse_lazy('shadowsocks:index'),
|
||||
login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-shadowsocks', name,
|
||||
firewall = Firewall('firewall-shadowsocks', info.name,
|
||||
ports=['shadowsocks-local-plinth'],
|
||||
is_external=False)
|
||||
self.add(firewall)
|
||||
|
||||
@ -25,7 +25,6 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions, views
|
||||
from plinth.errors import ActionError
|
||||
from plinth.modules import shadowsocks
|
||||
|
||||
from .forms import ShadowsocksForm
|
||||
|
||||
@ -34,10 +33,6 @@ class ShadowsocksAppView(views.AppView):
|
||||
"""Configuration view for Shadowsocks local socks5 proxy."""
|
||||
app_id = 'shadowsocks'
|
||||
form_class = ShadowsocksForm
|
||||
name = shadowsocks.name
|
||||
description = shadowsocks.description
|
||||
manual_page = shadowsocks.manual_page
|
||||
icon_filename = shadowsocks.icon_filename
|
||||
|
||||
def get_initial(self, *args, **kwargs):
|
||||
"""Get initial values for form."""
|
||||
|
||||
@ -31,9 +31,7 @@ from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 1
|
||||
|
||||
name = _('Sharing')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('Sharing allows you to share files and folders on your {box_name} '
|
||||
'over the web with chosen groups of users.'),
|
||||
@ -42,8 +40,6 @@ description = [
|
||||
|
||||
app = None
|
||||
|
||||
icon_filename = 'sharing'
|
||||
|
||||
|
||||
class SharingApp(app_module.App):
|
||||
"""FreedomBox app for sharing files."""
|
||||
@ -53,8 +49,14 @@ class SharingApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-sharing', name, None, 'sharing',
|
||||
'sharing:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Sharing'), icon_filename='sharing',
|
||||
description=_description)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-sharing', info.name, None,
|
||||
info.icon_filename, 'sharing:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
|
||||
@ -39,10 +39,9 @@ class IndexView(TemplateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Return additional context for rendering the template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['title'] = sharing.name
|
||||
context['description'] = sharing.description
|
||||
context['title'] = sharing.app.info.name
|
||||
context['app_info'] = sharing.app.info
|
||||
context['shares'] = sharing.list_shares()
|
||||
context['icon_filename'] = sharing.icon_filename
|
||||
return context
|
||||
|
||||
|
||||
|
||||
@ -34,9 +34,7 @@ version = 4
|
||||
|
||||
managed_packages = ['snapper']
|
||||
|
||||
name = _('Storage Snapshots')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Snapshots allows creating and managing btrfs file system snapshots. '
|
||||
'These can be used to roll back the system to a previously known '
|
||||
'good state in case of unwanted changes to the system.'),
|
||||
@ -50,8 +48,6 @@ description = [
|
||||
'they can only be stored on the same partition. ')
|
||||
]
|
||||
|
||||
manual_page = 'Snapshots'
|
||||
|
||||
DEFAULT_FILE = '/etc/default/snapper'
|
||||
|
||||
fs_types_supported = ['btrfs']
|
||||
@ -67,7 +63,13 @@ class SnapshotApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-snapshot', name, None, 'fa-film',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Storage Snapshots'), icon='fa-film',
|
||||
description=_description,
|
||||
manual_page='Snapshots')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-snapshot', info.name, None, info.icon,
|
||||
'snapshot:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -50,12 +50,10 @@ subsubmenu = [
|
||||
def not_supported_view(request):
|
||||
"""Show that snapshots are not supported on the system."""
|
||||
template_data = {
|
||||
'title': snapshot_module.name,
|
||||
'name': snapshot_module.name,
|
||||
'description': snapshot_module.description,
|
||||
'app_info': snapshot_module.app.info,
|
||||
'title': snapshot_module.app.info.name,
|
||||
'fs_type': storage.get_filesystem_type(),
|
||||
'fs_types_supported': snapshot_module.fs_types_supported,
|
||||
'manual_page': snapshot_module.manual_page,
|
||||
}
|
||||
return TemplateResponse(request, 'snapshot_not_supported.html',
|
||||
template_data)
|
||||
@ -78,10 +76,8 @@ def index(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'snapshot.html', {
|
||||
'title': snapshot_module.name,
|
||||
'name': snapshot_module.name,
|
||||
'description': snapshot_module.description,
|
||||
'manual_page': snapshot_module.manual_page,
|
||||
'app_info': snapshot_module.app.info,
|
||||
'title': snapshot_module.app.info,
|
||||
'subsubmenu': subsubmenu,
|
||||
'form': form
|
||||
})
|
||||
@ -109,10 +105,8 @@ def manage(request):
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'snapshot_manage.html', {
|
||||
'title': snapshot_module.name,
|
||||
'name': snapshot_module.name,
|
||||
'description': snapshot_module.description,
|
||||
'manual_page': snapshot_module.manual_page,
|
||||
'title': snapshot_module.app.info.name,
|
||||
'app_info': snapshot_module.app.info,
|
||||
'snapshots': snapshots,
|
||||
'has_deletable_snapshots': has_deletable_snapshots,
|
||||
'subsubmenu': subsubmenu,
|
||||
|
||||
@ -40,9 +40,7 @@ managed_services = ['ssh']
|
||||
|
||||
managed_packages = ['openssh-server']
|
||||
|
||||
name = _('Secure Shell (SSH) Server')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('A Secure Shell server uses the secure shell protocol to accept '
|
||||
'connections from remote computers. An authorized remote computer '
|
||||
'can perform administration tasks, copy files or run other services '
|
||||
@ -62,11 +60,17 @@ class SSHApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-ssh', name, None, 'fa-terminal',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential,
|
||||
name=_('Secure Shell (SSH) Server'),
|
||||
icon='fa-terminal', description=_description)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-ssh', info.name, None, info.icon,
|
||||
'ssh:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
firewall = Firewall('firewall-ssh', name, ports=['ssh'],
|
||||
firewall = Firewall('firewall-ssh', info.name, ports=['ssh'],
|
||||
is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -30,9 +30,6 @@ from .forms import SSHServerForm
|
||||
|
||||
class SshAppView(AppView):
|
||||
app_id = 'ssh'
|
||||
name = ssh.name
|
||||
description = ssh.description
|
||||
port_forwarding_info = ssh.port_forwarding_info
|
||||
template_name = 'ssh.html'
|
||||
form_class = SSHServerForm
|
||||
|
||||
|
||||
@ -18,17 +18,17 @@
|
||||
FreedomBox app to configure Single Sign On services.
|
||||
"""
|
||||
|
||||
from plinth import actions
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
from plinth import app as app_module
|
||||
|
||||
version = 1
|
||||
|
||||
is_essential = True
|
||||
|
||||
depends = ['security', 'apache']
|
||||
|
||||
name = _('Single Sign On')
|
||||
|
||||
managed_packages = [
|
||||
'libapache2-mod-auth-pubtkt',
|
||||
'openssl',
|
||||
@ -37,6 +37,18 @@ managed_packages = [
|
||||
]
|
||||
|
||||
|
||||
class SSOApp(app_module.App):
|
||||
"""FreedomBox app for single sign on."""
|
||||
app_id = 'sso'
|
||||
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, depends=depends,
|
||||
name=_('Single Sign On'))
|
||||
self.add(info)
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install the required packages"""
|
||||
helper.install(managed_packages)
|
||||
|
||||
@ -27,6 +27,7 @@ from axes.decorators import axes_form_invalid
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth.views import LoginView, LogoutView
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
from plinth import actions, utils, web_framework
|
||||
|
||||
from .forms import AuthenticationForm, CaptchaAuthenticationForm
|
||||
@ -82,8 +83,8 @@ class CaptchaLoginView(LoginView):
|
||||
form_class = CaptchaAuthenticationForm
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
response = super(CaptchaLoginView, self).dispatch(
|
||||
request, *args, **kwargs)
|
||||
response = super(CaptchaLoginView,
|
||||
self).dispatch(request, *args, **kwargs)
|
||||
if not request.POST:
|
||||
return response
|
||||
|
||||
|
||||
@ -36,13 +36,11 @@ from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
version = 4
|
||||
|
||||
name = _('Storage')
|
||||
|
||||
managed_services = ['freedombox-udiskie']
|
||||
|
||||
managed_packages = ['parted', 'udiskie', 'gir1.2-udisks-2.0']
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
format_lazy(
|
||||
_('This module allows you to manage storage media attached to your '
|
||||
'{box_name}. You can view the storage media currently in use, mount '
|
||||
@ -52,8 +50,6 @@ description = [
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
manual_page = 'Storage'
|
||||
|
||||
is_essential = True
|
||||
|
||||
app = None
|
||||
@ -67,7 +63,13 @@ class StorageApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-storage', name, None, 'fa-hdd-o',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
is_essential=is_essential, name=_('Storage'),
|
||||
icon='fa-hdd-o', description=_description,
|
||||
manual_page='Storage')
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-storage', info.name, None, info.icon,
|
||||
'storage:index', parent_url_name='system')
|
||||
self.add(menu_item)
|
||||
|
||||
|
||||
@ -39,9 +39,6 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class StorageAppView(views.AppView):
|
||||
"""Show storage information."""
|
||||
name = storage.name
|
||||
description = storage.description
|
||||
manual_page = storage.manual_page
|
||||
app_id = 'storage'
|
||||
template_name = 'storage.html'
|
||||
show_status_block = False
|
||||
|
||||
@ -37,13 +37,7 @@ managed_services = ['syncthing@syncthing']
|
||||
|
||||
managed_packages = ['syncthing']
|
||||
|
||||
name = _('Syncthing')
|
||||
|
||||
icon_filename = 'syncthing'
|
||||
|
||||
short_description = _('File Synchronization')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Syncthing is an application to synchronize files across multiple '
|
||||
'devices, e.g. your desktop computer and mobile phone. Creation, '
|
||||
'modification, or deletion of files on one device will be automatically '
|
||||
@ -58,12 +52,8 @@ description = [
|
||||
'users belonging to the "admin" group.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
group = ('syncthing', _('Administer Syncthing application'))
|
||||
|
||||
manual_page = 'Syncthing'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -75,23 +65,31 @@ class SyncthingApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-syncthing', name, short_description,
|
||||
'syncthing', 'syncthing:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Syncthing'), icon_filename='syncthing',
|
||||
short_description=_('File Synchronization'),
|
||||
description=_description,
|
||||
manual_page='Syncthing', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-syncthing', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'syncthing:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-syncthing', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/syncthing/',
|
||||
clients=clients, login_required=True,
|
||||
shortcut = frontpage.Shortcut('shortcut-syncthing', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename,
|
||||
url='/syncthing/', clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-syncthing-web', name,
|
||||
firewall = Firewall('firewall-syncthing-web', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
firewall = Firewall('firewall-syncthing-ports', name,
|
||||
firewall = Firewall('firewall-syncthing-ports', info.name,
|
||||
ports=['syncthing'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -20,16 +20,10 @@ URLs for the Syncthing module.
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from plinth.modules import syncthing
|
||||
from plinth.views import AppView
|
||||
|
||||
urlpatterns = [
|
||||
url(
|
||||
r'^apps/syncthing/$',
|
||||
AppView.as_view(app_id='syncthing', name=syncthing.name,
|
||||
description=syncthing.description,
|
||||
clients=syncthing.clients,
|
||||
manual_page=syncthing.manual_page,
|
||||
icon_filename=syncthing.icon_filename,
|
||||
show_status_block=True), name='index'),
|
||||
url(r'^apps/syncthing/$',
|
||||
AppView.as_view(app_id='syncthing', show_status_block=True),
|
||||
name='index'),
|
||||
]
|
||||
|
||||
@ -21,6 +21,7 @@ FreedomBox app to configure Tahoe-LAFS.
|
||||
import json
|
||||
import os
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import actions
|
||||
@ -40,11 +41,16 @@ managed_services = ['tahoe-lafs']
|
||||
|
||||
managed_packages = ['tahoe-lafs']
|
||||
|
||||
name = _('Tahoe-LAFS')
|
||||
|
||||
icon_filename = 'tahoe-lafs'
|
||||
|
||||
short_description = _('Distributed File Storage')
|
||||
_description = [
|
||||
_('Tahoe-LAFS is a decentralized secure file storage system. '
|
||||
'It uses provider independent security to store files over a '
|
||||
'distributed network of storage nodes. Even if some of the nodes fail, '
|
||||
'your files can be retrieved from the remaining nodes.'),
|
||||
format_lazy(
|
||||
_('This {box_name} hosts a storage node and an introducer by default. '
|
||||
'Additional introducers can be added, which will introduce this '
|
||||
'node to the other storage nodes.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
port_forwarding_info = [
|
||||
('TCP', 3456),
|
||||
@ -71,19 +77,28 @@ class TahoeApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-tahoe', name, short_description,
|
||||
'tahoe-lafs', 'tahoe:index',
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Tahoe-LAFS'),
|
||||
icon_filename='tahoe-lafs',
|
||||
short_description=_('Distributed File Storage'),
|
||||
description=_description)
|
||||
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-tahoe', info.name, info.short_description,
|
||||
info.icon_filename, 'tahoe:index',
|
||||
parent_url_name='apps', advanced=True)
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-tahoe', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url=None,
|
||||
login_required=True)
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-tahoe', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
description=info.description, url=None,
|
||||
configure_url=reverse_lazy('tahoe:index'), login_required=True)
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-tahoe', name, ports=['tahoe-plinth'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-tahoe', info.name,
|
||||
ports=['tahoe-plinth'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-tahoe', 'tahoe-plinth')
|
||||
@ -130,18 +145,6 @@ def get_configured_domain_name():
|
||||
return dnf.read().rstrip()
|
||||
|
||||
|
||||
description = [
|
||||
_('Tahoe-LAFS is a decentralized secure file storage system. '
|
||||
'It uses provider independent security to store files over a '
|
||||
'distributed network of storage nodes. Even if some of the nodes fail, '
|
||||
'your files can be retrieved from the remaining nodes.'),
|
||||
format_lazy(
|
||||
_('This {box_name} hosts a storage node and an introducer by default. '
|
||||
'Additional introducers can be added, which will introduce this '
|
||||
'node to the other storage nodes.'), box_name=_(cfg.box_name)),
|
||||
]
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize the module."""
|
||||
global app
|
||||
|
||||
@ -30,8 +30,6 @@ class TahoeSetupView(FormView):
|
||||
"""Show tahoe-lafs setup page."""
|
||||
template_name = 'tahoe-pre-setup.html'
|
||||
form_class = DomainSelectionForm
|
||||
description = tahoe.description
|
||||
title = tahoe.name
|
||||
success_url = reverse_lazy('tahoe:index')
|
||||
|
||||
def form_valid(self, form):
|
||||
@ -41,8 +39,8 @@ class TahoeSetupView(FormView):
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['description'] = self.description
|
||||
context['title'] = self.title
|
||||
context['description'] = tahoe.app.info.description
|
||||
context['title'] = tahoe.app.info.name
|
||||
context['domain_names'] = names.components.DomainName.list_names(
|
||||
'tahoe-plinth')
|
||||
|
||||
@ -53,10 +51,7 @@ class TahoeAppView(AppView):
|
||||
"""Show tahoe-lafs service page."""
|
||||
app_id = 'tahoe'
|
||||
template_name = 'tahoe-post-setup.html'
|
||||
name = tahoe.name
|
||||
description = tahoe.description
|
||||
port_forwarding_info = tahoe.port_forwarding_info
|
||||
icon_filename = tahoe.icon_filename
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not tahoe.is_setup():
|
||||
|
||||
@ -44,11 +44,7 @@ managed_packages = [
|
||||
|
||||
managed_services = ['tor@plinth']
|
||||
|
||||
name = _('Tor')
|
||||
|
||||
short_description = _('Anonymity Network')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Tor is an anonymous communication system. You can learn more '
|
||||
'about it from the <a href="https://www.torproject.org/">Tor '
|
||||
'Project</a> website. For best protection when web surfing, the '
|
||||
@ -57,16 +53,10 @@ description = [
|
||||
'Tor Browser</a>.')
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['debian-tor']
|
||||
|
||||
manual_page = 'Tor'
|
||||
|
||||
app = None
|
||||
|
||||
icon_filename = 'tor'
|
||||
|
||||
|
||||
class TorApp(app_module.App):
|
||||
"""FreedomBox app for Tor."""
|
||||
@ -76,8 +66,16 @@ class TorApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-tor', name, short_description, 'tor',
|
||||
'tor:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Tor'), icon_filename='tor',
|
||||
short_description=_('Anonymity Network'),
|
||||
description=_description, manual_page='Tor',
|
||||
clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-tor', info.name, info.short_description,
|
||||
info.icon_filename, 'tor:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
domain_type = DomainType('domain-type-tor', _('Tor Onion Service'),
|
||||
|
||||
@ -53,10 +53,7 @@ def index(request):
|
||||
return TemplateResponse(
|
||||
request, 'tor.html', {
|
||||
'app_id': 'tor',
|
||||
'name': tor.name,
|
||||
'description': tor.description,
|
||||
'clients': tor.clients,
|
||||
'manual_page': tor.manual_page,
|
||||
'app_info': tor.app.info,
|
||||
'status': status,
|
||||
'config_running': bool(config_process),
|
||||
'form': form,
|
||||
@ -65,7 +62,6 @@ def index(request):
|
||||
'is_enabled': status['enabled'],
|
||||
'show_status_block': True,
|
||||
'is_running': status['is_running'],
|
||||
'icon_filename': tor.icon_filename,
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -38,26 +38,16 @@ managed_services = ['transmission-daemon']
|
||||
|
||||
managed_packages = ['transmission-daemon']
|
||||
|
||||
name = _('Transmission')
|
||||
|
||||
icon_filename = 'transmission'
|
||||
|
||||
short_description = _('BitTorrent Web Client')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('BitTorrent is a peer-to-peer file sharing protocol. '
|
||||
'Transmission daemon handles Bitorrent file sharing. Note that '
|
||||
'BitTorrent is not anonymous.'),
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
reserved_usernames = ['debian-transmission']
|
||||
|
||||
group = ('bit-torrent', _('Download files using BitTorrent applications'))
|
||||
|
||||
manual_page = 'Transmission'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -69,19 +59,27 @@ class TransmissionApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-transmission', name, short_description,
|
||||
'transmission', 'transmission:index',
|
||||
parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Transmission'),
|
||||
icon_filename='transmission',
|
||||
short_description=_('BitTorrent Web Client'),
|
||||
description=_description,
|
||||
manual_page='Transmission', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-transmission', info.name,
|
||||
info.short_description, info.icon_filename,
|
||||
'transmission:index', parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-transmission', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/transmission',
|
||||
clients=clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
shortcut = frontpage.Shortcut(
|
||||
'shortcut-transmission', info.name,
|
||||
short_description=info.short_description, icon=info.icon_filename,
|
||||
url='/transmission', clients=info.clients, login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-transmission', name,
|
||||
firewall = Firewall('firewall-transmission', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
|
||||
@ -27,7 +27,6 @@ from django.contrib import messages
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from plinth import actions, views
|
||||
from plinth.modules import transmission
|
||||
|
||||
from .forms import TransmissionForm
|
||||
|
||||
@ -36,13 +35,8 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class TransmissionAppView(views.AppView):
|
||||
"""Serve configuration page."""
|
||||
clients = transmission.clients
|
||||
name = transmission.name
|
||||
description = transmission.description
|
||||
form_class = TransmissionForm
|
||||
app_id = 'transmission'
|
||||
manual_page = transmission.manual_page
|
||||
icon_filename = transmission.icon_filename
|
||||
|
||||
def get_initial(self):
|
||||
"""Get the current settings from Transmission server."""
|
||||
|
||||
@ -40,13 +40,7 @@ managed_packages = [
|
||||
'tt-rss', 'postgresql', 'dbconfig-pgsql', 'php-pgsql', 'python3-psycopg2'
|
||||
]
|
||||
|
||||
name = _('Tiny Tiny RSS')
|
||||
|
||||
icon_filename = 'ttrss'
|
||||
|
||||
short_description = _('News Feed Reader')
|
||||
|
||||
description = [
|
||||
_description = [
|
||||
_('Tiny Tiny RSS is a news feed (RSS/Atom) reader and aggregator, '
|
||||
'designed to allow reading news from any location, while feeling as '
|
||||
'close to a real desktop application as possible.'),
|
||||
@ -60,12 +54,8 @@ description = [
|
||||
'/tt-rss-app</a> for connecting.'))
|
||||
]
|
||||
|
||||
clients = clients
|
||||
|
||||
group = ('feed-reader', _('Read and subscribe to news feeds'))
|
||||
|
||||
manual_page = 'TinyTinyRSS'
|
||||
|
||||
app = None
|
||||
|
||||
|
||||
@ -77,19 +67,28 @@ class TTRSSApp(app_module.App):
|
||||
def __init__(self):
|
||||
"""Create components for the app."""
|
||||
super().__init__()
|
||||
menu_item = menu.Menu('menu-ttrss', name, short_description, 'ttrss',
|
||||
'ttrss:index', parent_url_name='apps')
|
||||
info = app_module.Info(app_id=self.app_id, version=version,
|
||||
name=_('Tiny Tiny RSS'), icon_filename='ttrss',
|
||||
short_description=_('News Feed Reader'),
|
||||
description=_description,
|
||||
manual_page='TinyTinyRSS', clients=clients)
|
||||
self.add(info)
|
||||
|
||||
menu_item = menu.Menu('menu-ttrss', info.name, info.short_description,
|
||||
info.icon_filename, 'ttrss:index',
|
||||
parent_url_name='apps')
|
||||
self.add(menu_item)
|
||||
|
||||
shortcut = frontpage.Shortcut('shortcut-ttrss', name,
|
||||
short_description=short_description,
|
||||
icon=icon_filename, url='/tt-rss',
|
||||
clients=clients, login_required=True,
|
||||
shortcut = frontpage.Shortcut('shortcut-ttrss', info.name,
|
||||
short_description=info.short_description,
|
||||
icon=info.icon_filename, url='/tt-rss',
|
||||
clients=info.clients,
|
||||
login_required=True,
|
||||
allowed_groups=[group[0]])
|
||||
self.add(shortcut)
|
||||
|
||||
firewall = Firewall('firewall-ttrss', name, ports=['http', 'https'],
|
||||
is_external=True)
|
||||
firewall = Firewall('firewall-ttrss', info.name,
|
||||
ports=['http', 'https'], is_external=True)
|
||||
self.add(firewall)
|
||||
|
||||
webserver = Webserver('webserver-ttrss', 'tt-rss-plinth',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user