mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
3d39136865
* [enh] Switch to tagged release * [enh] Switch to tagged release on upgrade * [fix] Restore pg dump Restore pg dump with mastodon user. * Change version on manifest * [fix] Change rm dump to ynh_secure_remove * [fix] Upgrade from 1.3.3 Fix error: Your local changes to the following files would be overwritten by merge: .babelrc .dockerignore .editorconfig .env.production.sample .gitignore .rubocop.yml .travis.yml Capfile Dockerfile README.md Vagrantfile .... * [fix] Owner of live * [fix] Reinstall dependencies on restore * Return to home * [fix] Jenkins upgrade error * Check .fonctions * Remove unneeded comment * Add apt lists to backup * Change .list name on backup * Copy Apt .lists on restore * version 1.3.3 on manifest * Remove admin instructions + TODO
40 lines
1.4 KiB
Bash
40 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
set -eu
|
|
|
|
if [ ! -e .fonctions ]; then
|
|
# Get file fonction if not been to the current directory
|
|
sudo cp ../settings/scripts/.fonctions ./.fonctions
|
|
sudo chmod a+rx .fonctions
|
|
fi
|
|
# Loads the generic functions usually used in the script
|
|
source .fonctions
|
|
# Source app helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Get multi-instances specific variables
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Retrieve app settings
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
# Copy the app files
|
|
final_path="/opt/${app}"
|
|
ynh_backup "$final_path" "sources" 1
|
|
|
|
# Copy the nginx conf files
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|
|
ynh_backup "/etc/cron.d/${app}" "cron.conf"
|
|
ynh_backup "/etc/systemd/system/mastodon-web.service" "systemd_web.service"
|
|
ynh_backup "/etc/systemd/system/mastodon-sidekiq.service" "systemd_sidekiq.service"
|
|
ynh_backup "/etc/systemd/system/mastodon-streaming.service" "systemd_streaming.service"
|
|
ynh_backup "/etc/apt/sources.list.d/backports.list" "apt_backports.list"
|
|
ynh_backup "/etc/apt/sources.list.d/yarn.list" "apt_yarn.list"
|
|
|
|
# Backup db
|
|
sudo su - postgres <<COMMANDS
|
|
pg_dump --role=mastodon -U postgres --no-password mastodon_production > mastodon_db.sql
|
|
COMMANDS
|
|
ynh_backup "/var/lib/postgresql/${app}_db.sql" "${app}_db.sql"
|
|
ynh_secure_remove /var/lib/postgresql/mastodon_db.sql
|