1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mastodon_ynh.git synced 2024-09-03 19:46:02 +02:00

[fix] Restore db with mastodon user

This commit is contained in:
nemsia 2017-04-30 23:49:00 +02:00 committed by GitHub
parent 3a2f559174
commit 2f578fd2c2

View file

@ -70,9 +70,8 @@ sudo cp -a ./sources/. "$final_path"
# Set permissions
sudo chown -R $app: "$final_path"
sudo chmod -R a+rx /home/yunohost.backup/tmp
# Debug
sudo ls -alh "$final_path"
# Change directory for create user & database postgresql
@ -104,7 +103,16 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile
RCOMMANDS
# restore database
sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql
sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path
sudo su - $app <<RECOMMANDS
dropdb mastodon_production
createdb mastodon_production
psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql
RECOMMANDS
# Remove dump
sudo rm $final_path/mastodon_db.sql
# Create symlink for ruby
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true