diff options
| author | nemsia <nemsia@nemsia.org> | 2017-04-28 18:05:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-28 18:05:07 +0200 |
| commit | e245bb18e477317a4ac0b68fdb55f6eb29a119ae (patch) | |
| tree | a97cd61daa27f26bb1fa6c69a50f8540870d73fa | |
| parent | 3a936561602b8ec357ce34cd4be0252ff4fef8bd (diff) | |
| parent | f79e0148cb4f388402a671f36087570ab0041b0d (diff) | |
| download | mastodon_ynh-e245bb18e477317a4ac0b68fdb55f6eb29a119ae.tar.gz mastodon_ynh-e245bb18e477317a4ac0b68fdb55f6eb29a119ae.tar.bz2 mastodon_ynh-e245bb18e477317a4ac0b68fdb55f6eb29a119ae.zip | |
Merge branch 'master' into patch-1
| -rw-r--r-- | scripts/restore | 13 | ||||
| -rw-r--r-- | scripts/upgrade | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/scripts/restore b/scripts/restore index f754d81..7820e04 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +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 + # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ @@ -81,12 +83,19 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" +# Copy postgresql dump +sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path + # Restore db ynh_psql_create_db_without_password "$app" +sudo systemctl restart postgresql sudo su - postgres <<COMMANDS -pg_dump --role=mastodon -U postgres --no-password mastodon < $YNH_APP_BACKUP_DIR/mastodon_db.sql +pg_restore --role=mastodon -U postgres --no-password < $final_path/mastodon_db.sql COMMANDS +# Delete dump after restore +# 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 @@ -121,4 +130,4 @@ sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming # Reload services -sudo systemctl reload nginx
\ No newline at end of file +sudo systemctl reload nginx diff --git a/scripts/upgrade b/scripts/upgrade index 655f22f..076e3fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ sudo systemctl stop mastodon-*.service # Update Mastodon sudo su - $app <<COMMANDS -pushd ~/live +cd live git fetch git pull https://github.com/tootsuite/mastodon.git master git checkout $(git tag | tail -n 1) |
