2019-12-08 06:50:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
while [[ -e /state/.starting ]]; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "web starting..."
|
|
|
|
|
2019-12-09 10:02:22 +00:00
|
|
|
|
|
|
|
rm -rf \
|
|
|
|
/mastodon/app/public/system \
|
|
|
|
/mastodon/app/public/assets \
|
|
|
|
/mastodon/app/public/packs \
|
|
|
|
/mastodon/log
|
|
|
|
|
|
|
|
if [[ ! -d /state/mastodon/system ]]; then
|
|
|
|
mkdir -p /state/mastodon/system
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d /state/mastodon/assets ]]; then
|
|
|
|
mkdir -p /state/mastodon/assets
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d /state/mastodon/packs ]]; then
|
|
|
|
mkdir -p /state/mastodon/packs
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d /state/mastodon/log ]]; then
|
|
|
|
mkdir -p /state/mastodon/log
|
|
|
|
fi
|
|
|
|
|
|
|
|
chown mastodon:mastodon /state/mastodon /state/mastodon/*
|
|
|
|
|
|
|
|
ln -s /state/mastodon/system /mastodon/app/public/system
|
|
|
|
ln -s /state/mastodon/assets /mastodon/app/public/assets
|
|
|
|
ln -s /state/mastodon/packs /mastodon/app/public/packs
|
|
|
|
ln -s /state/mastodon/log /mastodon/app/log
|
|
|
|
|
2019-12-08 06:50:36 +00:00
|
|
|
cd /mastodon/app
|
2019-12-09 10:02:22 +00:00
|
|
|
|
|
|
|
envdir /state/envdir \
|
|
|
|
chpst -u mastodon:mastodon \
|
|
|
|
bash -i -c "
|
|
|
|
OTP_SECRET=precompile_placeholder
|
|
|
|
SECRET_KEY_BASE=precompile_placeholder
|
|
|
|
bundle exec rails assets:precompile
|
|
|
|
"
|
|
|
|
|
2019-12-09 09:15:23 +00:00
|
|
|
exec \
|
|
|
|
envdir /state/envdir \
|
|
|
|
chpst -u mastodon:mastodon \
|
|
|
|
bash -i -c "bundle exec puma -C config/puma.rb"
|