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

Fix mod_posix error if prosody user ID was altered #67

Merged
merged 2 commits into from
Jan 29, 2021
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: 9 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/bin/bash
#!/bin/bash -e
set -e

usermod -u "$(stat -c %u /var/lib/prosody/.)" prosody
data_dir_owner="$(stat -c %u "/var/lib/prosody/")"
if [[ "$(id -u prosody)" != "$data_dir_owner" ]]; then
usermod -u "$data_dir_owner" prosody
fi
if [[ "$(stat -c %u /var/run/prosody/)" != "$data_dir_owner" ]]; then
chown "$data_dir_owner" /var/run/prosody/
fi

if [[ "$1" != "prosody" ]]; then
exec prosodyctl "$@"
exit 0;
fi

if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then
prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD"
fi

Expand Down