mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-22 14:53:15 +00:00
f13ebd02c9
/sbin/tini ends up running the Sass compiler, which seems to need a larger thread stack size than the musl default. This patch incorporates a fix from https://raw.githubusercontent.com/jubel-han/dockerfiles/master/common/stack-fix.c, as described in https://github.com/sass/node-sass/issues/2031.
15 lines
676 B
Bash
15 lines
676 B
Bash
#!/bin/sh
|
|
|
|
### 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})..."
|
|
addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
|
|
|
|
echo "Updating permissions..."
|
|
find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon
|
|
|
|
echo "Executing process..."
|
|
LD_PRELOAD=/lib/stack-fix.so exec su-exec mastodon:mastodon /sbin/tini -- "$@"
|