From 7b7d42fe331575b397346ff18875f64c3185ea4b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 10 Sep 2020 17:45:02 -0700 Subject: [PATCH] tor: Don't check if enabled when not installed Tests: - Install Tor and enable onion service. Restart FreedomBox. During initialization the onion service domain is added. Check in Name Services. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/tor/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/modules/tor/__init__.py b/plinth/modules/tor/__init__.py index 7cd98bfc9..b8ae723f5 100644 --- a/plinth/modules/tor/__init__.py +++ b/plinth/modules/tor/__init__.py @@ -87,7 +87,9 @@ class TorApp(app_module.App): self.add(users_and_groups) # Register hidden service name with Name Services module. - if self.is_enabled() and app_is_running(self): + setup_helper = globals()['setup_helper'] + if setup_helper.get_state() != 'needs-setup' and \ + self.is_enabled() and app_is_running(self): status = utils.get_status(initialized=False) hostname = status['hs_hostname'] services = [int(port['virtport']) for port in status['hs_ports']]