packages/mastodon/mastodon.install

24 lines
947 B
Text
Raw Normal View History

2017-04-11 13:51:26 +00:00
post_install() {
echo "To setup Mastodon, enable and start PostgreSQL and Redis:
# systemctl enable --now postgresql redis
Create the Mastodon PostgreSQL user and grant it the ability to create databases with:
# sudo -u postgres createuser -d mastodon
Then, run:
# cd /var/lib/mastodon
2022-05-04 00:21:44 +00:00
# sudo chown mastodon:mastodon -R .
# sudo -u mastodon RAILS_ENV=production NODE_OPTIONS=--openssl-legacy-provider bundle exec rails mastodon:setup
Finally, enable and start all the required services:
# systemctl enable --now mastodon.target"
2018-06-19 19:29:37 +00:00
}
post_upgrade() {
2022-05-04 00:10:48 +00:00
cd /var/lib/mastodon
2022-05-04 00:10:48 +00:00
echo "Setting ownership of mastodon files"
find -path ./public/system -prune -o -exec chown -h mastodon:mastodon {} +
2022-05-04 00:10:48 +00:00
echo "Upgrading database schema"
sudo -u mastodon RAILS_ENV=production bundle exec rails db:migrate
echo "Precompiling assets"
2022-11-14 22:15:08 +00:00
sudo -u mastodon RAILS_ENV=production NODE_OPTIONS=--openssl-legacy-provider bundle exec rails assets:precompile
2018-06-19 19:29:37 +00:00
}