packages/mastodon.install

25 lines
883 B
Text

post_install() {
echo "Setting ownership of mastodon files"
chown mastodon:mastodon -R /var/lib/mastodon
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
# sudo -u mastodon RAILS_ENV=production bundle exec rails mastodon:setup
Finally, enable and start all the required services:
# systemctl enable --now mastodon.target"
}
post_upgrade() {
echo "Setting ownership of mastodon files"
chown mastodon:mastodon -R /var/lib/mastodon
echo "To upgrade the database schema, run:
# sudo -u mastodon RAILS_ENV=production bundle exec rails db:migrate
To pre-compile assets, run:
# sudo -u mastodon RAILS_ENV=production bundle exec rails assets:precompile"
}