Skip to content

Commit

Permalink
Start the backend even if the client is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Nov 18, 2024
1 parent ef9c27d commit 2c5eaf9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/globaleaks/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'))
]


Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 2c5eaf9

Please sign in to comment.