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 .
|
2023-02-13 22:11:22 +00:00
|
|
|
# sudo -u mastodon RAILS_ENV=production NODE_OPTIONS=--openssl-legacy-provider 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"
|
2023-07-08 03:03:44 +00:00
|
|
|
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
|
|
|
}
|