Try to pass a fixed scope to the workspace mount.

This commit is contained in:
Andrea Dell'Amico 2022-04-04 11:12:51 +02:00
parent e90cceb7e8
commit e7b9b10652
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 8 additions and 8 deletions

View File

@ -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)