Skip to content
Snippets Groups Projects
Commit 3acffcde authored by Diogo Castro's avatar Diogo Castro
Browse files

[UCA-376] Make EOS user home path configurable

Necessary to allow EOS Home as the new default home.
Necessary to allow ScienceBox EOS path structure (/eos/docker/user).
parent 31c9152f
No related branches found
No related tags found
No related merge requests found
Pipeline #1224856 passed
......@@ -86,7 +86,10 @@ class SwanFileManagerMixin(FileManagerMixin):
path = path.split('/')
if len(path) < 3:
raise HTTPError(404)
return url_path_join('/eos/user', path[1][0], path[1], 'SWAN_projects', "/".join(path[2:]))
eosbasepath_format = os.getenv('EOS_PATH_FORMAT', '/eos/user/{username[0]}/{username}/')
user_basepath = eosbasepath_format.format(username = path[1])
return url_path_join(user_basepath, 'SWAN_projects', *(path[2:]))
else:
return super()._get_os_path(path)
......
......@@ -18,6 +18,7 @@ class SwanAuthenticatedFileHandler(AuthenticatedFileHandler):
self.root = os.path.abspath(path) + os.path.sep
self.default_filename = default_filename
self.default_path = default_path
self.eosbasepath_format = os.getenv('EOS_PATH_FORMAT', '/eos/user/{username[0]}/{username}/')
@web.authenticated
def get(self, path):
......@@ -25,7 +26,8 @@ class SwanAuthenticatedFileHandler(AuthenticatedFileHandler):
if self.root.startswith('/eos/'):
if path.startswith('swan_sharing_folder/'):
path = path.split('/')
path = url_path_join('/eos/user', path[1][0], path[1], 'SWAN_projects', "/".join(path[2:]))
user_basepath = self.eosbasepath_format.format(username = path[1])
path = url_path_join(user_basepath, 'SWAN_projects', *(path[2:]))
else:
path = url_path_join(self.default_path, path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment