Skip to content
Snippets Groups Projects
Commit c4d577b6 authored by Grant Nguyen's avatar Grant Nguyen
Browse files

Add GROUPID and UMASK options to RStudio image

parent 9514a7d7
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,9 @@
USER=${USER:=rstudio}
PASSWORD=${PASSWORD:=rstudio}
USERID=${USERID:=1000}
GROUPID=${GROUPID:=1000}
ROOT=${ROOT:=FALSE}
UMASK=${UMASK:=022}
if [ "$USERID" -lt 1000 ]
......@@ -35,6 +37,14 @@ elif [ "$USER" != "rstudio" ]
chown -R $USER:$USER /home/$USER
echo "USER is now $USER"
fi
if [ "$GROUPID" -ne 1000 ]
## Configure the primary GID (whether rstudio or $USER) with a different GROUPID if requested.
then
echo "Modifying primary group $(id $USER -g -n)"
groupmod -g $GROUPID $(id $USER -g -n)
echo "Primary group ID is now custom_group $GROUPID"
fi
## Add a password to user
echo "$USER:$PASSWORD" | chpasswd
......@@ -46,6 +56,13 @@ if [ "$ROOT" == "TRUE" ]
echo "$USER added to sudoers"
fi
## Change Umask value if desired
if [ "$UMASK" -ne 022 ]
then
echo "server-set-umask=false" >> /etc/rstudio/rserver.conf
echo "Sys.umask(mode=$UMASK)" >> /home/$USER/.Rprofile
fi
## add these to the global environment so they are avialable to the RStudio user
echo "HTTR_LOCALHOST=$HTTR_LOCALHOST" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
\ No newline at end of file
......@@ -4,7 +4,9 @@
USER=${USER:=rstudio}
PASSWORD=${PASSWORD:=rstudio}
USERID=${USERID:=1000}
GROUPID=${GROUPID:=1000}
ROOT=${ROOT:=FALSE}
UMASK=${UMASK:=022}
if [ "$USERID" -lt 1000 ]
......@@ -35,6 +37,14 @@ elif [ "$USER" != "rstudio" ]
chown -R $USER:$USER /home/$USER
echo "USER is now $USER"
fi
if [ "$GROUPID" -ne 1000 ]
## Configure the primary GID (whether rstudio or $USER) with a different GROUPID if requested.
then
echo "Modifying primary group $(id $USER -g -n)"
groupmod -g $GROUPID $(id $USER -g -n)
echo "Primary group ID is now custom_group $GROUPID"
fi
## Add a password to user
echo "$USER:$PASSWORD" | chpasswd
......@@ -46,6 +56,13 @@ if [ "$ROOT" == "TRUE" ]
echo "$USER added to sudoers"
fi
## Change Umask value if desired
if [ "$UMASK" -ne 022 ]
then
echo "server-set-umask=false" >> /etc/rstudio/rserver.conf
echo "Sys.umask(mode=$UMASK)" >> /home/$USER/.Rprofile
fi
## add these to the global environment so they are avialable to the RStudio user
echo "HTTR_LOCALHOST=$HTTR_LOCALHOST" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
\ No newline at end of file
......@@ -4,7 +4,9 @@
USER=${USER:=rstudio}
PASSWORD=${PASSWORD:=rstudio}
USERID=${USERID:=1000}
GROUPID=${GROUPID:=1000}
ROOT=${ROOT:=FALSE}
UMASK=${UMASK:=022}
if [ "$USERID" -lt 1000 ]
......@@ -35,6 +37,14 @@ elif [ "$USER" != "rstudio" ]
chown -R $USER:$USER /home/$USER
echo "USER is now $USER"
fi
if [ "$GROUPID" -ne 1000 ]
## Configure the primary GID (whether rstudio or $USER) with a different GROUPID if requested.
then
echo "Modifying primary group $(id $USER -g -n)"
groupmod -g $GROUPID $(id $USER -g -n)
echo "Primary group ID is now custom_group $GROUPID"
fi
## Add a password to user
echo "$USER:$PASSWORD" | chpasswd
......@@ -46,6 +56,13 @@ if [ "$ROOT" == "TRUE" ]
echo "$USER added to sudoers"
fi
## Change Umask value if desired
if [ "$UMASK" -ne 022 ]
then
echo "server-set-umask=false" >> /etc/rstudio/rserver.conf
echo "Sys.umask(mode=$UMASK)" >> /home/$USER/.Rprofile
fi
## add these to the global environment so they are avialable to the RStudio user
echo "HTTR_LOCALHOST=$HTTR_LOCALHOST" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
echo "HTTR_PORT=$HTTR_PORT" >> /etc/R/Renviron.site
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment