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/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"