diff options
Diffstat (limited to 'mastodon.install')
-rw-r--r-- | mastodon.install | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mastodon.install b/mastodon.install index 0014d119e2e1..edbad88f417b 100644 --- a/mastodon.install +++ b/mastodon.install @@ -3,15 +3,23 @@ post_install() { useradd -rd /var/lib/mastodon mastodon chown -R mastodon:mastodon /var/lib/mastodon - echo "To setup Mastodon, enable and start PostgreSQL and Redis, create the Mastodon PostgreSQL user using 'sudo -u postgres createuser -d mastodon', run 'sudo su - mastodon', then 'RAILS_ENV=production bundle exec rails mastodon:setup'. -Enable mastodon.target to have all Mastodon's required services start at boot." + 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 'sudo su - mastodon', then 'RAILS_ENV=production bundle exec rails db:migrate'. -To pre-compile assets, run 'sudo su - mastodon', then 'RAILS_ENV=production bundle exec rails assets:precompile'." + 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() { |