docker-mastodon/rootfs/usr/local/bin/run

45 lines
1.3 KiB
Text
Raw Normal View History

2018-06-12 14:54:14 +00:00
#!/bin/sh
echo "
---------------------------------------------
_____ _ _
| |___ ___| |_ ___ _| |___ ___
| | | | .'|_ -| _| . | . | . | |
|_|_|_|__,|___|_| |___|___|___|_|_|
A GNU Social-compatible microblogging server
https://github.com/tootsuite/mastodon
---------------------------------------------
UID/GID settings
---------------------------------------------
User ID : ${UID}
Group ID : ${GID}
---------------------------------------------
Logs location
---------------------------------------------
Sidekiq : /mastodon/log/sidekiq.log
Streaming : /mastodon/log/streaming.log
Web : /mastodon/log/web.log
---------------------------------------------
"
echo "Creating mastodon user..."
addgroup -g ${GID} mastodon &>/dev/null
adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon &>/dev/null
echo "Updating permissions, this can take a while..."
find /mastodon -path /mastodon/public/system -prune -o -print0 | xargs -0 chown -f mastodon:mastodon
2018-06-12 14:54:14 +00:00
chown -R mastodon:mastodon /etc/s6.d
if [ "$RUN_DB_MIGRATIONS" == "true" ]; then
echo "Running database migrations task..."
su-exec mastodon:mastodon bundle exec rake db:migrate
fi
echo "Executing process(es)..."
if [ '$@' == '' ]; then
exec su-exec mastodon:mastodon /bin/s6-svscan /etc/s6.d
else
exec su-exec mastodon:mastodon "$@"
fi