apps, system: Remove modules and merge into main

- Remove apps and system modules and merge their views into main views.

- Move main_menu from cfg into menu.py.

- Remove dependencies of other modules on apps and system modules.

- Update tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2017-05-05 22:31:45 -04:00
1 parent 184bced823
commit ee7cc98fee
64 files changed
+164 -354

No files matched your search

-29
View File
@@ -1,29 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Plinth module for Apps section page
"""
from . import apps
from .apps import init
__all__ = ['apps', 'init']
version = 1
is_essential = True
-32
View File
@@ -1,32 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
def init():
"""Initailize the apps module"""
cfg.main_menu.add_urlname(_('Apps'), 'glyphicon-download-alt',
'apps:index')
def index(request):
"""Serve the apps index page"""
return TemplateResponse(request, 'apps.html', {'title': _('Applications')})
-44
View File
@@ -1,44 +0,0 @@
{% extends 'base.html' %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load i18n %}
{% block content %}
<h2>{% trans "Services and Applications" %}</h2>
<p>
{% blocktrans trimmed %}
You can install and run various services and applications on
your {{ box_name }}. Click on any app page link on the left to
read a description of the application and choose to install it.
{% endblocktrans %}
</p>
<p>
{% blocktrans trimmed %}
This box can be your photo sharing site, your instant messaging
site, your social networking site, your news site. Remember web
portals? We can be one of those too. Many of the services you
use on the web could soon be on site and under your control!
{% endblocktrans %}
</p>
{% endblock %}
Whitespace-only changes.
-29
View File
@@ -1,29 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
URLs for the Apps module
"""
from django.conf.urls import url
from . import apps as views
urlpatterns = [
url(r'^apps/$', views.index, name='index'),
]
+2 -3
View File
@@ -23,6 +23,7 @@ from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
from plinth.views import ServiceView
@@ -32,8 +33,6 @@ version = 1
is_essential = True
depends = ['system']
managed_services = ['avahi-daemon']
managed_packages = ['avahi-daemon']
@@ -56,7 +55,7 @@ service = None
def init():
"""Intialize the service discovery module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-lamp', 'avahi:index')
global service # pylint: disable=W0603
+2 -4
View File
@@ -25,14 +25,12 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['system']
title = _('Domain Name Server \n (BIND)')
service = None
@@ -57,7 +55,7 @@ CONFIG_FILE = '/etc/bind/named.conf.options'
def init():
"""Intialize the BIND module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-globe', 'bind:index')
global service
+1 -1
View File
@@ -28,4 +28,4 @@ version = 1
is_essential = True
depends = ['system', 'firewall', 'names']
depends = ['firewall', 'names']
+2 -1
View File
@@ -35,6 +35,7 @@ import socket
import plinth
from plinth import actions
from plinth import cfg
from plinth.menu import main_menu
from plinth.modules import firewall
from plinth.modules.names import SERVICES
from plinth.signals import pre_hostname_change, post_hostname_change
@@ -146,7 +147,7 @@ class ConfigurationForm(forms.Form):
def init():
"""Initialize the module"""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(ugettext_lazy('Configure'), 'glyphicon-cog',
'config:index')
+2 -4
View File
@@ -22,16 +22,14 @@ Plinth module to configure system date and time
from django.utils.translation import ugettext_lazy as _
import subprocess
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
managed_services = ['ntp']
managed_packages = ['ntp']
@@ -48,7 +46,7 @@ service = None
def init():
"""Intialize the date/time module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-time', 'datetime:index')
global service
+2 -4
View File
@@ -23,15 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
service = None
managed_services = ['deluge-web']
@@ -53,7 +51,7 @@ reserved_usernames = ['debian-deluged']
def init():
"""Initialize the Deluge module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-magnet', 'deluge:index')
global service
+3 -4
View File
@@ -22,7 +22,8 @@ Plinth module for system diagnostics
from django.utils.translation import ugettext_lazy as _
from plinth import action_utils
from plinth import cfg
from plinth.menu import main_menu
version = 1
@@ -36,12 +37,10 @@ description = [
'expected.')
]
depends = ['system']
def init():
"""Initialize the module"""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-screenshot', 'diagnostics:index')
+2 -5
View File
@@ -20,18 +20,15 @@ Plinth module to manage disks.
"""
from django.utils.translation import ugettext_lazy as _
import json
import logging
import subprocess
from plinth import actions
from plinth import cfg
from plinth.menu import main_menu
version = 1
depends = ['system']
title = _('Disks')
description = []
@@ -43,7 +40,7 @@ logger = logging.getLogger(__name__)
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-hdd', 'disks:index')
+3 -3
View File
@@ -22,11 +22,11 @@ Plinth module to configure ez-ipupdate client
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['system']
version = 1
managed_packages = ['ez-ipupdate']
@@ -54,7 +54,7 @@ reserved_usernames = ['ez-ipupd']
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-refresh', 'dynamicdns:index')
+2 -4
View File
@@ -26,17 +26,15 @@ import socket
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.signals import pre_hostname_change, post_hostname_change
from plinth.signals import domainname_change
version = 1
depends = ['apps']
managed_services = ['ejabberd']
managed_packages = ['ejabberd']
@@ -61,7 +59,7 @@ logger = logging.getLogger(__name__)
def init():
"""Initialize the ejabberd module"""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-comment', 'ejabberd:index')
global service
+3 -3
View File
@@ -24,16 +24,16 @@ import logging
from plinth import actions
from plinth import cfg
from plinth.menu import main_menu
from plinth.signals import service_enabled
import plinth.service as service_module
from plinth.utils import format_lazy
version = 1
is_essential = True
depends = ['system']
managed_packages = ['firewalld']
title = _('Firewall')
@@ -51,7 +51,7 @@ LOGGER = logging.getLogger(__name__)
def init():
"""Initailze firewall module"""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-fire', 'firewall:index')
service_enabled.connect(on_service_enabled)
@@ -37,7 +37,7 @@
</p>
<div class="text-center">
<a class="btn btn-lg btn-primary" href="{% url 'apps:index' %}">
<a class="btn btn-lg btn-primary" href="{% url 'apps' %}">
{% trans "Go to Apps" %}</a>
</div>
+3 -2
View File
@@ -27,12 +27,13 @@ from django.utils.translation import ugettext as _, ugettext_lazy
from stronghold.decorators import public
from plinth import cfg, __version__
from plinth.menu import main_menu
def init():
"""Initialize the Help module"""
menu = cfg.main_menu.add_urlname(ugettext_lazy('Documentation'),
'glyphicon-book', 'help:index')
menu = main_menu.add_urlname(ugettext_lazy('Documentation'),
'glyphicon-book', 'help:index')
menu.add_urlname(ugettext_lazy('Where to Get Help'), 'glyphicon-search',
'help:index_explicit', 5)
menu.add_urlname(ugettext_lazy('Manual'), 'glyphicon-info-sign',
+2 -4
View File
@@ -23,15 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_packages = ['ikiwiki', 'libdigest-sha-perl', 'libxml-writer-perl',
'xapian-omega', 'libsearch-xapian-perl',
'libimage-magick-perl']
@@ -51,7 +49,7 @@ description = [
def init():
"""Initialize the ikiwiki module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-edit', 'ikiwiki:index')
global service
+2 -3
View File
@@ -27,14 +27,13 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
from plinth.views import ServiceView
version = 1
depends = ['apps']
service = None
managed_services = ['infinoted']
@@ -56,7 +55,7 @@ description = [
def init():
"""Initialize the infinoted module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-pencil', 'infinoted:index')
global service
+2 -4
View File
@@ -24,15 +24,13 @@ from django.utils.translation import ugettext_lazy as _
import logging
import socket
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_packages = ['libjs-jsxc']
title = _('Chat Client \n (JSXC)')
@@ -50,7 +48,7 @@ logger = logging.getLogger(__name__)
def init():
"""Initialize the JSXC module"""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-comment', 'jsxc:index')
global service
+3 -2
View File
@@ -23,6 +23,7 @@ from django.utils.translation import ugettext_lazy as _
from plinth import action_utils
from plinth import cfg
from plinth.menu import main_menu
from plinth.modules import names
from plinth.utils import format_lazy
@@ -31,7 +32,7 @@ version = 1
is_essential = False
depends = ['apps', 'names']
depends = ['names']
managed_packages = ['certbot']
@@ -59,7 +60,7 @@ service = None
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(_('Certificates (Let\'s Encrypt)'),
'glyphicon-lock', 'letsencrypt:index')
+3 -4
View File
@@ -28,14 +28,13 @@ from ruamel.yaml.util import load_yaml_guess_indent
from plinth import action_utils
from plinth import actions
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.modules import names
version = 1
depends = ['apps']
version = 1
managed_services = ['matrix-synapse']
@@ -67,7 +66,7 @@ SERVER_NAME_PATH = "/etc/matrix-synapse/conf.d/server_name.yaml"
def init():
"""Initialize the matrix-synapse module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-comment', 'matrixsynapse:index')
global service
+2 -3
View File
@@ -29,13 +29,12 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 2
depends = ['apps']
service = None
managed_services = ['minetest-server']
@@ -65,7 +64,7 @@ AUG_PATH = '/files' + CONFIG_FILE + '/.anon'
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-th-large', 'minetest:index')
global service
+3 -4
View File
@@ -21,12 +21,11 @@ Plinth module for monkeysphere.
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.menu import main_menu
version = 1
depends = ['system']
managed_packages = ['monkeysphere']
title = _('Monkeysphere')
@@ -56,7 +55,7 @@ reserved_usernames = ['monkeysphere']
def init():
"""Initialize the monkeysphere module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(_('Monkeysphere'), 'glyphicon-certificate',
'monkeysphere:index')
+2 -4
View File
@@ -24,16 +24,14 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.views import ServiceView
version = 1
depends = ['apps']
title = _('Voice Chat \n (Mumble)')
service = None
@@ -56,7 +54,7 @@ reserved_usernames = ['mumble-server']
def init():
"""Intialize the Mumble module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-headphones', 'mumble:index')
global service
+3 -4
View File
@@ -22,9 +22,10 @@ Plinth module to configure name services
from django.utils.translation import ugettext_lazy as _
import logging
from plinth import cfg
from plinth.menu import main_menu
from plinth.signals import domain_added, domain_removed
SERVICES = (
('http', _('HTTP'), 80),
('https', _('HTTPS'), 443),
@@ -35,8 +36,6 @@ version = 1
is_essential = True
depends = ['system']
title = _('Name Services')
domain_types = {}
@@ -47,7 +46,7 @@ logger = logging.getLogger(__name__)
def init():
"""Initialize the names module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-tag', 'names:index')
domain_added.connect(on_domain_added)
+2 -4
View File
@@ -24,16 +24,14 @@ from logging import Logger
import subprocess
from plinth import action_utils
from plinth import cfg
from plinth import network
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
managed_packages = ['network-manager', 'batctl']
title = _('Networks')
@@ -43,7 +41,7 @@ logger = Logger(__name__)
def init():
"""Initialize the Networks module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-signal', 'networks:index')
+2 -4
View File
@@ -27,13 +27,12 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['apps']
service = None
managed_services = ['openvpn@freedombox']
@@ -56,8 +55,7 @@ description = [
def init():
"""Initialize the OpenVPN module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-lock', 'openvpn:index')
global service
+4 -2
View File
@@ -23,11 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from . import utils
from plinth import cfg
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['system', 'names']
depends = ['names']
managed_packages = ['pagekite']
@@ -77,7 +79,7 @@ description = [
def init():
"""Intialize the PageKite module"""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-flag', 'pagekite:index')
# Register kite name with Name Services module.
+2 -4
View File
@@ -21,14 +21,12 @@ Plinth module for power controls.
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
title = _('Power')
description = [
@@ -38,5 +36,5 @@ description = [
def init():
"""Initialize the power module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-off', 'power:index')
+2 -2
View File
@@ -42,7 +42,7 @@ def restart(request):
if request.method == 'POST':
actions.superuser_run('power', ['restart'], async=True)
return redirect(reverse('apps:index'))
return redirect(reverse('apps'))
else:
form = Form(prefix='power')
@@ -57,7 +57,7 @@ def shutdown(request):
if request.method == 'POST':
actions.superuser_run('power', ['shutdown'], async=True)
return redirect(reverse('apps:index'))
return redirect(reverse('apps'))
else:
form = Form(prefix='power')
+2 -3
View File
@@ -27,6 +27,7 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
from plinth.views import ServiceView
@@ -35,8 +36,6 @@ version = 1
is_essential = False
depends = ['apps']
managed_services = ['privoxy']
managed_packages = ['privoxy']
@@ -66,7 +65,7 @@ service = None
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-cloud-upload', 'privoxy:index')
global service
+2 -3
View File
@@ -27,13 +27,12 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
from plinth.views import ServiceView
version = 1
depends = ['apps']
service = None
managed_services = ['quasselcore']
@@ -64,7 +63,7 @@ reserved_usernames = ['quasselcore']
def init():
"""Initialize the quassel module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-retweet', 'quassel:index')
global service
+3 -3
View File
@@ -28,11 +28,11 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['apps']
version = 1
service = None
@@ -59,7 +59,7 @@ CONFIG_FILE = '/etc/radicale/config'
def init():
"""Initialize the radicale module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-calendar', 'radicale:index')
global service
+2 -4
View File
@@ -24,15 +24,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.views import ServiceView
version = 2
depends = ['apps']
managed_services = ['repro']
managed_packages = ['repro']
@@ -67,7 +65,7 @@ service = None
def init():
"""Initialize the repro module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-phone-alt', 'repro:index')
global service
+2 -3
View File
@@ -23,13 +23,12 @@ from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['apps']
managed_services = ['node-restore']
managed_packages = ['node-restore']
@@ -56,7 +55,7 @@ service = None
def init():
"""Initialize the reStore module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-hdd', 'restore:index')
global service
+2 -4
View File
@@ -23,15 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_packages = ['sqlite3', 'roundcube', 'roundcube-sqlite3']
title = _('Email Client \n (Roundcube)')
@@ -63,7 +61,7 @@ service = None
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-envelope', 'roundcube:index')
global service
+2 -4
View File
@@ -21,16 +21,14 @@ Plinth module for security configuration
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth import actions
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
title = _('Security')
@@ -40,7 +38,7 @@ ACCESS_CONF_SNIPPET = '-:ALL EXCEPT root fbx (admin) (sudo):ALL'
def init():
"""Initialize the module"""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-lock', 'security:index')
+2 -4
View File
@@ -23,15 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_packages = ['shaarli']
title = _('Bookmarks \n (Shaarli)')
@@ -50,7 +48,7 @@ service = None
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-bookmark', 'shaarli:index')
global service
+2 -4
View File
@@ -22,13 +22,11 @@ Plinth module to manage filesystem snapshots.
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import cfg
from plinth.menu import main_menu
version = 1
depends = ['system']
managed_packages = ['snapper']
title = _('Snapshots')
@@ -52,7 +50,7 @@ service = None
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-film', 'snapshot:index')
+2 -3
View File
@@ -26,13 +26,12 @@ from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.utils import format_lazy
version = 1
depends = ['apps']
managed_services = ['syncthing']
managed_packages = ['syncthing']
@@ -62,7 +61,7 @@ service = None
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-refresh', 'syncthing:index')
global service
-47
View File
@@ -1,47 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Plinth module for system section page
"""
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.utils import format_lazy
version = 1
is_essential = True
title = _('System Configuration')
description = [
format_lazy(
_('Here you can administrate the underlying system of your '
'{box_name}.'), box_name=_(cfg.box_name)),
format_lazy(
_('The options affect the {box_name} at its most general level, '
'so be careful!'), box_name=_(cfg.box_name))
]
def init():
"""Initialize the system module"""
cfg.main_menu.add_urlname(title, 'glyphicon-cog', 'system:index')
@@ -1,19 +0,0 @@
{% extends 'simple_service.html' %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
Whitespace-only changes.
-29
View File
@@ -1,29 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
URLs for the System module
"""
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^sys/$', views.index, name='index'),
]
-27
View File
@@ -1,27 +0,0 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.template.response import TemplateResponse
from plinth.modules import system
def index(request):
"""Serve the index page"""
return TemplateResponse(request, 'system.html',
{'title': system.title,
'description': system.description})
+3 -3
View File
@@ -24,8 +24,8 @@ import json
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.modules.names import SERVICES
from plinth.signals import domain_added, domain_removed
@@ -34,7 +34,7 @@ from . import utils
version = 2
depends = ['apps', 'names']
depends = ['names']
managed_packages = ['tor', 'tor-geoipdb', 'torsocks', 'obfs4proxy',
'apt-transport-tor']
@@ -58,7 +58,7 @@ bridge_service = None
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-eye-close', 'tor:index')
setup_helper = globals()['setup_helper']
+2 -4
View File
@@ -24,15 +24,13 @@ import json
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_services = ['transmission-daemon']
managed_packages = ['transmission-daemon']
@@ -53,7 +51,7 @@ service = None
def init():
"""Intialize the Transmission module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-save', 'transmission:index')
global service
+2 -4
View File
@@ -23,15 +23,13 @@ from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import frontpage
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
depends = ['apps']
managed_services = ['tt-rss']
managed_packages = ['tt-rss', 'postgresql', 'dbconfig-pgsql', 'php-pgsql']
@@ -52,7 +50,7 @@ service = None
def init():
"""Intialize the module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-envelope', 'ttrss:index')
global service
+2 -4
View File
@@ -22,16 +22,14 @@ Plinth module for upgrades
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import cfg
from plinth import service as service_module
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
managed_packages = ['unattended-upgrades']
title = _('Software Upgrades')
@@ -47,7 +45,7 @@ service = None
def init():
"""Initialize the module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-refresh', 'upgrades:index')
global service
service = service_module.Service(
+3 -4
View File
@@ -22,16 +22,15 @@ Plinth module to manage users
from django.utils.translation import ugettext_lazy as _
import subprocess
from plinth import cfg
from plinth import action_utils
from plinth import actions
from plinth.menu import main_menu
version = 1
is_essential = True
depends = ['system']
managed_packages = ['ldapscripts', 'ldap-utils', 'libnss-ldapd',
'libpam-ldapd', 'nslcd', 'slapd']
@@ -48,7 +47,7 @@ title = _('Users and Groups')
def init():
"""Intialize the user module."""
menu = cfg.main_menu.get('system:index')
menu = main_menu.get('system')
menu.add_urlname(title, 'glyphicon-user', 'users:index')