-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
No USER in dockerfile anymore #43
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,9 @@ readonly DATA_DIR="/data" | |||||
readonly BARE_BONES_CONFIG_FILE="/etc/mumble/bare_config.ini" | ||||||
readonly CONFIG_REGEX="^(\;|\#)?\ *([a-zA-Z_0-9]+)=.*" | ||||||
CONFIG_FILE="${DATA_DIR}/mumble_server_config.ini" | ||||||
MUMBLE_UID=${MUMBLE_UID:-10000} | ||||||
MUMBLE_GID=${MUMBLE_GID:-10000} | ||||||
MUMBLE_CHOWN=${MUMBLE_CHOWN:-true} | ||||||
|
||||||
readonly SENSITIVE_CONFIGS=( | ||||||
"dbPassword" | ||||||
|
@@ -159,11 +162,27 @@ if [[ -n "${MUMBLE_SUPERUSER_PASSWORD}" ]]; then | |||||
fi | ||||||
|
||||||
# Show /data permissions, in case the user needs to match the mount point access | ||||||
echo "Running Mumble server as uid=$(id -u) gid=$(id -g)" | ||||||
echo "Entrypoint running as uid=$(id -u) gid=$(id -g)" | ||||||
echo "Preparing Mumble server to run as uid=$(MUMBLE_UID) gid=$(MUMBLE_GID)" | ||||||
|
||||||
if [[ "$MUMBLE_UID" != "0" ]]; then | ||||||
groupmod -og "$MUMBLE_GID" mumble | ||||||
usermod -ou "$MUMBLE_UID" mumble | ||||||
if [[ "$MUMBLE_CHOWN" = true ]]; then | ||||||
echo "Changing owner of folder {DATA_DIR}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
chown -R mumble:mumble ${DATA_DIR} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fi | ||||||
exec runuser -u mumble -g mumble -- "$@" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do? If it starts the server, I don't think that should happen here (as well) |
||||||
fi | ||||||
|
||||||
echo "\"${DATA_DIR}\" has the following permissions set:" | ||||||
echo " $( stat ${DATA_DIR} --printf='%A, owner: \"%U\" (UID: %u), group: \"%G\" (GID: %g)' )" | ||||||
|
||||||
echo "Command run to start the service : ${server_invocation[*]}" | ||||||
echo "Starting..." | ||||||
|
||||||
exec "${server_invocation[@]}" | ||||||
if [[ "$MUMBLE_UID" != "0" ]]; then | ||||||
exec runuser -u mumble -g mumble -- "${server_invocation[@]}" | ||||||
else | ||||||
exec "${server_invocation[@]}" | ||||||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.