Restore ~ as the project home.

This commit is contained in:
Andrea Dell'Amico 2022-04-08 16:03:14 +02:00
parent e5222b5927
commit ba454de833
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
3 changed files with 16 additions and 7 deletions

View File

@ -64,8 +64,7 @@ if [ "$USERID" -ne 1000 ]
elif [ "$USER" != "$DEFAULT_USER" ]
then
## cannot move home folder when it's a shared volume, have to copy and change permissions instead
#cp -r /home/$DEFAULT_USER/.??* /home/$USER || true
cp -r /home/$DEFAULT_USER /home/$USER
cp -r /home/$DEFAULT_USER/.??* /home/$USER || true
## RENAME the user
usermod -l $USER -d /home/$USER $DEFAULT_USER
groupmod -n $USER $DEFAULT_USER

View File

@ -3,8 +3,8 @@
echo "session-timeout-minutes=7200" >> /etc/rstudio/rsession.conf
echo "session-disconnected-timeout-minutes=1440" >> /etc/rstudio/rsession.conf
echo "session-quit-child-processes-on-exit=0" >> /etc/rstudio/rsession.conf
echo "session-default-working-dir=~/rstudio" >> /etc/rstudio/rsession.conf
echo "session-default-new-project-dir=~/rstudio" >> /etc/rstudio/rsession.conf
echo "session-default-working-dir=~" >> /etc/rstudio/rsession.conf
echo "session-default-new-project-dir=~" >> /etc/rstudio/rsession.conf
#echo "session-save-action-default=yes" >> /etc/rstudio/rsession.conf
echo "allow-shell=1" >> /etc/rstudio/rsession.conf
#echo "allow-terminal-websockets=1" >> /etc/rstudio/rsession.conf

View File

@ -42,13 +42,23 @@ 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_scope} $workspace_dir" >/dev/null 2>&1 &
sleep 5
_retval=
_fuse_process=$(ps auwwx | grep fuse | grep java)
_retval=$?
if [ $_retval -ne 0 ]; then
echo "The mount of the workspace failed"
exit 1
else
pushd /home/${USER}
if [ $? -ne 0 ]; then
if ! [ -L workspace ]; then
su - "$USER" -c "ln -s $workspace_dir /workspace"
fi
else
echo "Cannot cd inside the user's home directory"
exit 1
fi
echo "The workspace has been mounted"
exit 0
fi
ln -sf $workspace_dir /home/${USER}/workspace
exit 0