packages/mastodon.install
Jean Lucas 955114a336 Version bump to 2.4.3, routine cleanup
- Correct license
- Remove optdepend of sudo since install file now instructs to run shell
command as root
- Remove install file from source array since it's not needed there
- Quote pkgdir
- Cleanup/reformat install file language
2018-08-06 23:27:07 -04:00

28 lines
1,005 B
Text

post_install() {
getent passwd mastodon > /dev/null ||
useradd -rd /var/lib/mastodon mastodon
chown -R mastodon:mastodon /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:
# su - postgres -s /bin/sh -c \"createdb -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() {
chown -R mastodon:mastodon /var/lib/mastodon
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\""
}
post_remove() {
echo 'You may want to remove the Mastodon user.'
}