diff --git a/check_process b/check_process index 9289924..7211c17 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,7 @@ backup_restore=1 multi_instance=0 port_already_use=1 - change_url=0 + change_url=1 ;;; Levels Level 5=auto ;;; Options diff --git a/conf/navidrome.toml b/conf/navidrome.toml index a8715df..fce04bf 100644 --- a/conf/navidrome.toml +++ b/conf/navidrome.toml @@ -4,4 +4,5 @@ Port = "__PORT__" BaseURL = "__PATH_URL__" ScanInterval = "90s" TranscodingCacheSize = "150MiB" +DataFolder = "__CONFIG_PATH__" MusicFolder = "/home/yunohost.navidrome/Music" diff --git a/manifest.json b/manifest.json index 78fffa3..b4bc507 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern Music Server and Streamer compatible with Subsonic/Airsonic", "fr": "Serveur de musique moderne et Streamer compatibles avec Subsonic/Airsonic" }, - "version": "0.30.1~ynh1", + "version": "0.30.1~ynh2", "url": "https://github.com/deluan/navidrome/", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/change_url b/scripts/change_url index 126bdb3..923adc9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -101,6 +101,23 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Modifying a config file..." --weight=1 + +config_path="/var/lib/$app" +path_url="$new_path" + +cp ../conf/navidrome.toml "$config_path/navidrome.toml" + +# Main config File +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml" +ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml" + +ynh_store_file_checksum --file="$config_path/navidrome.toml" + #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index 4112b89..b913601 100644 --- a/scripts/install +++ b/scripts/install @@ -118,6 +118,7 @@ cp ../conf/navidrome.toml "$config_path/navidrome.toml" # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml" +ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml" ynh_store_file_checksum --file="$config_path/navidrome.toml" diff --git a/scripts/upgrade b/scripts/upgrade index 9fdea81..f8d8d18 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,6 +115,7 @@ cp ../conf/navidrome.toml "$config_path/navidrome.toml" # Main config File ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml" +ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml" ynh_store_file_checksum --file="$config_path/navidrome.toml"