From 2c5eaf9c4ca8a288ce95dd9697226f00086a342c Mon Sep 17 00:00:00 2001 From: Giovanni Pellerano Date: Mon, 18 Nov 2024 19:23:57 +0100 Subject: [PATCH] Start the backend even if the client is not found --- backend/globaleaks/settings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/globaleaks/settings.py b/backend/globaleaks/settings.py index f0272395b6..19a6d718d7 100644 --- a/backend/globaleaks/settings.py +++ b/backend/globaleaks/settings.py @@ -8,8 +8,8 @@ this_directory = os.path.dirname(__file__) possible_client_paths = [ - os.path.abspath(os.path.join(this_directory, '../../client/build/')), - '/usr/share/globaleaks/client' + '/usr/share/globaleaks/client', + os.path.abspath(os.path.join(this_directory, '../../client/build/')) ] @@ -98,14 +98,16 @@ def eval_paths(self): self.accesslogfile = os.path.abspath(os.path.join(self.log_path, "access.log")) # Client path detection + client_found=False + self.client_path = possible_client_paths[0] for path in possible_client_paths: if os.path.isfile(os.path.join(path, 'index.html')): self.client_path = path + client_found=True break - if self.client_path is None: + if not client_found: print("Unable to find a directory to load the client from") - sys.exit(1) self.appdata_file = os.path.join(self.client_path, 'data/appdata.json') self.questionnaires_path = os.path.join(self.client_path, 'data/questionnaires')