This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-05-20 06:12:29 -07:00
|
|
|
#!/bin/sh
|
2017-05-20 11:01:05 -07:00
|
|
|
|
|
|
|
### 1. Adds local user (UID and GID are provided from environment variables).
|
|
|
|
### 2. Updates permissions, except for ./public/system (should be chown on previous installations).
|
|
|
|
### 3. Executes the command as that user.
|
|
|
|
|
|
|
|
echo "Creating mastodon user (UID : ${UID} and GID : ${GID})..."
|
2017-05-20 06:12:29 -07:00
|
|
|
addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
|
2017-05-20 11:01:05 -07:00
|
|
|
|
|
|
|
echo "Updating permissions..."
|
2017-05-20 06:12:29 -07:00
|
|
|
find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon
|
2017-05-20 11:01:05 -07:00
|
|
|
|
|
|
|
echo "Executing process..."
|
|
|
|
exec su-exec mastodon:mastodon /sbin/tini -- "$@"
|