diff options
Diffstat (limited to 'mastodon.install')
-rw-r--r-- | mastodon.install | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/mastodon.install b/mastodon.install index 25ff428c8b12..8634de8ff73e 100644 --- a/mastodon.install +++ b/mastodon.install @@ -1,8 +1,18 @@ -_user=mastodon -_homedir=/var/lib/mastodon -_shell=/bin/false - post_install() { - getent group ${_user} > /dev/null || groupadd ${_user} > /dev/null - getent passwd ${_user} > /dev/null || useradd -d ${_homedir} -g ${_user} -s ${_shell} ${_user} > /dev/null + getent passwd mastodon > /dev/null || + useradd -rd /var/lib/mastodon -s /sbin/nologin mastodon + chown -R mastodon:mastodon /var/lib/mastodon + + echo 'Enable mastodon.target to have all the Mastodon services start at boot.' +} + +post_upgrade() { + chown -R mastodon:mastodon /var/lib/mastodon + + echo "To upgrade the database schema, run 'sudo -u mastodon RAILS_ENV=production bundle exec rails db:migrate'. +To pre-compile updated assets, run 'sudo -u mastodon RAILS_ENV=production bundle exec rails assets:precompile'." +} + +post_remove() { + echo 'You may want to remove the mastodon user.' } |