From e7b9b106527ef52367811b7be08d6cb21e2311dd Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 4 Apr 2022 11:12:51 +0200 Subject: [PATCH] Try to pass a fixed scope to the workspace mount. --- 06_workspace_mount.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/06_workspace_mount.sh b/06_workspace_mount.sh index f153666..6aa1d5f 100644 --- a/06_workspace_mount.sh +++ b/06_workspace_mount.sh @@ -1,11 +1,6 @@ #!/usr/bin/with-contenv bash -echo "Manage the user's workspace" -workspace_dir='/workspace' -workspace_logdir='/var/log/workspace-lib' -workspace_libdir='/opt/workspace-lib' -workspace_fuse_jar="$workspace_libdir/fuse-workspace.jar" - +# Functions that decode a JWT token _decode_base64_url() { local len=$((${#1} % 4)) local result="$1" @@ -19,6 +14,12 @@ _decode_base64_url() { # $2 => either 1 for header or 2 for body (default is 2) decode_jwt() { _decode_base64_url $(echo -n $1 | cut -d "." -f ${2:-2}) | jq .; } +_workspace_scope="/d4science.research-infrastructures.eu" +echo "Manage the user's workspace" +workspace_dir='/workspace' +workspace_logdir='/var/log/workspace-lib' +workspace_libdir='/opt/workspace-lib' +workspace_fuse_jar="$workspace_libdir/fuse-workspace.jar" [[ ! -d "$workspace_dir" ]] || [[ -z `ls -A "$workspace_dir"` ]] || mv $workspace_dir ${workspace_dir}.old @@ -38,9 +39,8 @@ if [ -d /home/${USER}/workspace ]; then fi fi - echo "Mount the workspace" -su - "$USER" -c "/usr/bin/java -cp .:${workspace_dir}:${workspace_logdir}/ -Dlogback.configurationFile=${workspace_logdir}/logback.xml -jar $workspace_fuse_jar $SHINYPROXY_OIDC_ACCESS_TOKEN $workspace_dir" >/dev/null 2>&1 & +su - "$USER" -c "/usr/bin/java -cp .:${workspace_dir}:${workspace_logdir}/ -Dlogback.configurationFile=${workspace_logdir}/logback.xml -jar $workspace_fuse_jar $SHINYPROXY_OIDC_ACCESS_TOKEN ${_workspace_scope} $workspace_dir" >/dev/null 2>&1 & _retval= _fuse_process=$(ps auwwx | grep fuse | grep java)