Skip to content

Commit

Permalink
Revise code related to detecting client path
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Sep 2, 2024
1 parent f8a48b0 commit 19a892f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 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 = [
'/usr/share/globaleaks/client/',
os.path.abspath(os.path.join(this_directory, '../../client/build/'))
os.path.abspath(os.path.join(this_directory, '../../client/build/')),
'/usr/share/globaleaks/client'
]


Expand All @@ -36,6 +36,7 @@ def __init__(self):

self.ramdisk_path = '/dev/shm/globaleaks'
self.working_path = '/var/globaleaks'
self.client_path = None

self.authentication_lifetime = 120

Expand Down Expand Up @@ -98,13 +99,12 @@ def eval_paths(self):
self.accesslogfile = os.path.abspath(os.path.join(self.log_path, "access.log"))

# Client path detection
possible_client_paths.insert(0, os.path.join(self.working_path, 'client'))
for path in possible_client_paths:
if os.path.isfile(os.path.join(path, 'index.html')):
self.client_path = path
break

if not self.client_path:
if self.client_path is None:
print("Unable to find a directory to load the client from")
sys.exit(1)

Expand Down

0 comments on commit 19a892f

Please sign in to comment.