Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak script description #872

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions scripts/experimental/batch_user_creation.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
#!/bin/bash

# Batch creation of user accounts in RStudio Server. The script reads a list
# of username and password pairs from the `BATCH_USER_CREATION` environment
# variable and uses this information to update a group of existing users when
# the container starts. Each pair is of the format `username:password` and is
# separated from the next by a semicolon, with no intervening whitespace.
# Usernames may only be up to 32 characters long (required by `useradd`) and
# by default the supplied passwords must be in clear-text (later encrypted by
# `chpasswd`). If a username already exists, the script will deny that
# particular account creation request; otherwise, the user account will be
# created, the login shell set to Bash and the user's home directory created
# unless it already exists. By default, a group will be created for each new
# user with the same name as her username. If the groupname already exists,
# the script will deny the group creation request. If the password is not
# specified, it is assumed to be equal to the username. All users will also be
# added to the `staff` group (same as the default `rstudio` user). A directory
# called `.rstudio/monitored/user-settings/user-settings` is created in that
# user's home directory to store RStudio initial preferences. Users are not
# allowed to read other users' home directory.
# Batch creation of user accounts in RStudio Server
#
# This script reads a list of username and password pairs from the
# `BATCH_USER_CREATION` environment variable and uses this information to create
# or update user accounts when the container starts.
#
# Each pair is of the format `username:password` and is separated from the next
# one by a semicolon, with no intervening whitespace. Usernames may only be up
# to 32 characters long (required by `useradd`). By default, the supplied
# passwords must be in clear-text (later encrypted by `chpasswd`). If the
# password is not specified, it is assumed to be equal to the username.
#
# If a username already exists, the script will skip that particular account
# creation; otherwise, the user account will be created, the login shell set to
# Bash and the user's home directory created unless it already exists.
#
# By default, a group will be created for each new user with the same name as
# their username. If the groupname already exists, the script will skip the
# group creation. All users will also be added to the `staff` group (same as the
# default `rstudio` user).
#
# Finally, a directory called `.rstudio/monitored/user-settings/user-settings`
# is created in the user's home directory to store initial RStudio preferences.
#
# Users are not allowed to read other users' home directories.

set -e

Expand Down