Skip to content

Commit 17ba8f8

Browse files
Always specify config file in command and always run as gemstash user.
1 parent 283daef commit 17ba8f8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

entrypoint.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
set -e
44

5-
# Drop root privileges if we are running gemstash as root.
6-
if [ "$1" = "bundle" ] && [ "$2" = "exec" ] && [ "$3" = "gemstash" ] && [ "$(id -u)" = "0" ]; then
5+
# Always run this as gemstash user.
6+
if [ "$1" = "bundle" ] && [ "$2" = "exec" ] && [ "$3" = "gemstash" ]; then
77
# Change the ownership of user-mutable directories to gemstash
88
chown -R "${GEMSTASH_USER}:${GEMSTASH_USER}" "${GEMSTASH_HOME}/data"
99

10-
# Run gemstash as gemstash user
10+
# Specify config to be used by gemstash.
1111
command="tini -- ${*} --config-file=${GEMSTASH_HOME}/app/config.yml.erb"
12+
# Run gemstash as gemstash user
1213
set -- su-exec "${GEMSTASH_USER}" ${command}
1314
fi
1415

0 commit comments

Comments
 (0)