1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00
This commit is contained in:
ericgaspar 2020-08-18 16:57:23 +02:00
parent 251719af33
commit 588bc94aa8
5 changed files with 10 additions and 6 deletions

View file

@ -28,6 +28,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -44,7 +45,7 @@ ynh_backup --src_path="$final_path"
# BACKUP THE APP CONFIG DIR # BACKUP THE APP CONFIG DIR
#================================================= #=================================================
ynh_backup --src_path="/var/lib/$app" ynh_backup --src_path="$config_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION

View file

@ -29,6 +29,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -107,7 +108,6 @@ fi
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
path_url="$new_path" path_url="$new_path"
config_path="/var/lib/$app"
cp ../conf/navidrome.toml "$config_path/navidrome.toml" cp ../conf/navidrome.toml "$config_path/navidrome.toml"

View file

@ -112,6 +112,7 @@ ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Music" --dest_dir="sh
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
config_path="/var/lib/$app" config_path="/var/lib/$app"
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
mkdir -p "$config_path" mkdir -p "$config_path"
cp ../conf/navidrome.toml "$config_path/navidrome.toml" cp ../conf/navidrome.toml "$config_path/navidrome.toml"

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -63,7 +64,7 @@ ynh_secure_remove --file="$final_path"
ynh_script_progression --message="Removing $app config directory..." --weight=6 ynh_script_progression --message="Removing $app config directory..." --weight=6
# Remove the config directory securely # Remove the config directory securely
ynh_secure_remove --file="/var/lib/$app" ynh_secure_remove --file="$config_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION

View file

@ -29,6 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) 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)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -61,7 +62,7 @@ ynh_restore_file --origin_path="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Restoring $app config directory..." --weight=2 ynh_script_progression --message="Restoring $app config directory..." --weight=2
ynh_restore_file --origin_path="/var/lib/$app" ynh_restore_file --origin_path="$config_path"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
@ -78,7 +79,7 @@ ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
chown -R $app:$app "/var/lib/$app" chown -R $app:$app "$config_path"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -110,7 +111,7 @@ yunohost service add $app --description "Web-based music collection server and s
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION