ssh: New application to manage SSH server

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2017-09-01 20:03:58 -04:00
1 parent 2e55acb465
commit 07c062aef3
6 files changed
+105 -3

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
#
# 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 OpenSSH server.
"""
from django.utils.translation import ugettext_lazy as _
from plinth import actions
from plinth import service as service_module
from plinth.menu import main_menu
from plinth.views import ServiceView
version = 1
is_essential = True
managed_services = ['ssh']
managed_packages = ['openssh-server']
name = _('Secure Shell (SSH) Server')
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 '
'using such connections.')
]
service = None
def init():
"""Intialize the ssh module."""
menu = main_menu.get('system')
menu.add_urlname(name, 'glyphicon-console', 'ssh:index')
global service
service = service_module.Service(
managed_services[0], name, ports=['ssh'], is_external=True)
def setup(helper, old_version=False):
"""Configure the module."""
actions.superuser_run('ssh', ['setup'])
class SshServiceView(ServiceView):
service_id = managed_services[0]
description = description
Whitespace-only changes.
+29
View File
@@ -0,0 +1,29 @@
#
# 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 Secure Shell Server module.
"""
from django.conf.urls import url
from plinth.modules.ssh import SshServiceView
urlpatterns = [
url(r'^sys/ssh/$', SshServiceView.as_view(), name='index'),
]