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

Fix backup/restore

This commit is contained in:
yalh76 2022-03-03 22:54:43 +01:00
parent 3c1412d33d
commit 027bd35a97
2 changed files with 7 additions and 13 deletions

View file

@ -43,12 +43,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================
# BACKUP VARIOUS FILES # BACKUP VARIOUS FILES
#================================================= #=================================================

View file

@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
port=$(ynh_app_setting_get --app=$app --key=port)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -70,7 +71,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.packager.io/srv/deb/op
#================================================= #=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_script_progression --message="Restoring the PostgreSQL database..."
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
@ -86,13 +87,12 @@ chmod 750 "/etc/openproject/"
chmod -R o-rwx "/etc/openproject/" chmod -R o-rwx "/etc/openproject/"
chown -R $app:$app "/etc/openproject/" chown -R $app:$app "/etc/openproject/"
#================================================= openproject config:set PORT=$port
# RESTORE SYSTEMD openproject config:set SERVER_PROTOCOL_FORCE_HTTPS="true"
#================================================= openproject config:set SERVER_HOSTNAME=$domain
ynh_script_progression --message="Restoring the systemd configuration..." openproject config:set SERVER_PATH_PREFIX=$path_url
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" openproject configure >> "$YNH_STDINFO"
systemctl enable $app.service --quiet
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST