mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
daemon: Move diagnosing port listening into daemon module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
a1fd8f45be
commit
97d8166f31
6 files changed
+158
-98
No files matched your search
@@ -22,7 +22,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import action_utils
|
||||
from plinth import app as app_module
|
||||
from plinth import menu
|
||||
from plinth import daemon, menu
|
||||
|
||||
from .manifest import backup # noqa, pylint: disable=unused-import
|
||||
|
||||
@@ -58,7 +58,7 @@ class DiagnosticsApp(app_module.App):
|
||||
def diagnose(self):
|
||||
"""Run diagnostics and return the results."""
|
||||
results = super().diagnose()
|
||||
results.append(action_utils.diagnose_port_listening(8000, 'tcp4'))
|
||||
results.append(daemon.diagnose_port_listening(8000, 'tcp4'))
|
||||
results.extend(
|
||||
action_utils.diagnose_url_on_all('http://{host}/plinth/',
|
||||
check_certificate=False))
|
||||
|
||||
@@ -23,9 +23,9 @@ from logging import Logger
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import action_utils, actions
|
||||
from plinth import actions
|
||||
from plinth import app as app_module
|
||||
from plinth import menu, network
|
||||
from plinth import daemon, menu, network
|
||||
|
||||
version = 1
|
||||
|
||||
@@ -69,10 +69,8 @@ class NetworksApp(app_module.App):
|
||||
addresses = _get_interface_addresses(interfaces)
|
||||
|
||||
for address in addresses:
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(53, 'tcp', address))
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(53, 'udp', address))
|
||||
results.append(daemon.diagnose_port_listening(53, 'tcp', address))
|
||||
results.append(daemon.diagnose_port_listening(53, 'udp', address))
|
||||
|
||||
results.append(_diagnose_dnssec('4'))
|
||||
results.append(_diagnose_dnssec('6'))
|
||||
|
||||
@@ -25,7 +25,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import action_utils, actions
|
||||
from plinth import app as app_module
|
||||
from plinth import menu
|
||||
from plinth.daemon import Daemon
|
||||
from plinth.daemon import Daemon, diagnose_port_listening
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.names.components import DomainType
|
||||
from plinth.signals import domain_added, domain_removed
|
||||
@@ -113,35 +113,29 @@ class TorApp(app_module.App):
|
||||
])
|
||||
if 'orport' in ports:
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['orport']),
|
||||
'tcp4'))
|
||||
diagnose_port_listening(int(ports['orport']), 'tcp4'))
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['orport']),
|
||||
'tcp6'))
|
||||
diagnose_port_listening(int(ports['orport']), 'tcp6'))
|
||||
|
||||
results.append([
|
||||
_('Obfs3 transport registered'),
|
||||
'passed' if 'obfs3' in ports else 'failed'
|
||||
])
|
||||
if 'obfs3' in ports:
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['obfs3']),
|
||||
'tcp4'))
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['obfs3']),
|
||||
'tcp6'))
|
||||
results.append(diagnose_port_listening(int(ports['obfs3']),
|
||||
'tcp4'))
|
||||
results.append(diagnose_port_listening(int(ports['obfs3']),
|
||||
'tcp6'))
|
||||
|
||||
results.append([
|
||||
_('Obfs4 transport registered'),
|
||||
'passed' if 'obfs4' in ports else 'failed'
|
||||
])
|
||||
if 'obfs4' in ports:
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['obfs4']),
|
||||
'tcp4'))
|
||||
results.append(
|
||||
action_utils.diagnose_port_listening(int(ports['obfs4']),
|
||||
'tcp6'))
|
||||
results.append(diagnose_port_listening(int(ports['obfs4']),
|
||||
'tcp4'))
|
||||
results.append(diagnose_port_listening(int(ports['obfs4']),
|
||||
'tcp6'))
|
||||
|
||||
results.append(_diagnose_url_via_tor('http://www.debian.org', '4'))
|
||||
results.append(_diagnose_url_via_tor('http://www.debian.org', '6'))
|
||||
|
||||
Reference in new issue
Block a user