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

GH-1934 Check if user/group already exist in entrypoint.sh #1934

Merged
merged 1 commit into from
Sep 18, 2023
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
12 changes: 10 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ if [ "$UID" -ne "0" ]; then
$REPOSILITE_ARGS
else
GROUP_ID="${PGID:-999}"
addgroup --gid "$GROUP_ID" reposilite
grep "^reposilite" /etc/group > /dev/null
if [ $? -ne 0 ]
then
addgroup --gid "$GROUP_ID" reposilite
fi

USER_ID="${PUID:-999}"
adduser --system -uid "$USER_ID" --ingroup reposilite --shell /bin/sh reposilite
grep "^reposilite" /etc/passwd > /dev/null
if [ $? -ne 0 ]
then
adduser --system -uid "$USER_ID" --ingroup reposilite --shell /bin/sh reposilite
fi

chown -R reposilite:reposilite /app
chown -R reposilite:reposilite /var/log/reposilite
Expand Down
Loading