2017-04-11 13:51:26 +00:00
|
|
|
post_install() {
|
2018-08-07 03:22:32 +00:00
|
|
|
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:
|
2022-04-28 21:20:28 +00:00
|
|
|
# sudo -u postgres createuser -d mastodon
|
2018-08-07 03:22:32 +00:00
|
|
|
Then, run:
|
2022-04-28 21:20:28 +00:00
|
|
|
# cd /var/lib/mastodon
|
2022-05-04 00:21:44 +00:00
|
|
|
# sudo chown mastodon:mastodon -R .
|
2022-04-28 21:20:28 +00:00
|
|
|
# sudo -u mastodon RAILS_ENV=production bundle exec rails mastodon:setup
|
2018-08-07 03:22:32 +00:00
|
|
|
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-04-28 21:20:28 +00:00
|
|
|
|
2022-05-04 00:10:48 +00:00
|
|
|
echo "Setting ownership of mastodon files"
|
|
|
|
chown mastodon:mastodon -R .
|
|
|
|
echo "Upgrading database schema"
|
|
|
|
sudo -u mastodon RAILS_ENV=production bundle exec rails db:migrate
|
|
|
|
echo "Precompiling assets"
|
|
|
|
sudo -u mastodon RAILS_ENV=production bundle exec rails assets:precompile
|
2018-06-19 19:29:37 +00:00
|
|
|
}
|