summarylogtreecommitdiffstats
path: root/mastodon.install
blob: 1bbebea400123513528562905935cd0e46503f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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:
# su - postgres -s /bin/sh -c \"createuser -d mastodon\"
Then, run:
# su - mastodon -s /bin/sh -c \"cd '/var/lib/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 "To upgrade the database schema, run:
# su - mastodon -s /bin/sh -c \"RAILS_ENV=production bundle exec rails db:migrate\"
To pre-compile assets, run:
# su - mastodon -s /bin/sh -c \"RAILS_ENV=production bundle exec rails assets:precompile\""
}