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

Preserve config file

This commit is contained in:
ericgaspar 2021-04-10 10:49:37 +02:00
parent fc9dea7a60
commit c76763c35b
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 12 additions and 9 deletions

View file

@ -28,6 +28,9 @@ DataFolder = "__CONFIG_PATH__"
# Folder where your music library is stored. Can be read-only # Folder where your music library is stored. Can be read-only
MusicFolder = "/home/yunohost.multimedia/share/Music" MusicFolder = "/home/yunohost.multimedia/share/Music"
# Enable the option in the UI to download music/albums/artists/playlists from the server
EnableDownloads = "true"
#Change background image used in the Login page #Change background image used in the Login page
UILoginBackgroundUrl = "" UILoginBackgroundUrl = ""

View file

@ -80,10 +80,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
# # Create a temporary directory # Create a temporary directory
#tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
# # Backup the config file in the temp dir # Backup the config file in the temp dir
# cp -a "/var/lib/$app/navidrome.toml" "$tmpdir/navidrome.toml" cp -a "/var/lib/$app/navidrome.toml" "$tmpdir/navidrome.toml"
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file=$final_path ynh_secure_remove --file=$final_path
@ -91,11 +91,11 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path --source_id="$architecture" ynh_setup_source --dest_dir=$final_path --source_id="$architecture"
# # Copy the admin saved settings from tmp directory to final config path # Copy the admin saved settings from tmp directory to final config path
# cp -a "$tmpdir/navidrome.toml" "/var/lib/$app/navidrome.toml" cp -a "$tmpdir/navidrome.toml" "/var/lib/$app/navidrome.toml"
# # Remove the tmp directory securely # Remove the tmp directory securely
# ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
#================================================= #=================================================
@ -120,7 +120,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2
config_path="/var/lib/$app" config_path="/var/lib/$app"
ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml" #ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="../conf/systemd.service"