diff --git a/conf/systemd.service b/conf/systemd.service index 440cb14..d6004c8 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,18 +1,17 @@ [Unit] Description=Navidrome: Music Server and Streamer After=remote-fs.target network.target -AssertPathExists=__CONFIG_PATH__ [Service] Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__CONFIG_PATH__/ -ExecStart=__INSTALL_DIR__/__APP__ --configfile "__CONFIG_PATH__/navidrome.toml" +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/__APP__ --configfile "__INSTALL_DIR__/navidrome.toml" TimeoutStopSec=20 KillMode=process Restart=on-failure -ReadWritePaths=__CONFIG_PATH__ +ReadWritePaths=__INSTALL_DIR__/ # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/config_panel.toml b/config_panel.toml index d57a1af..634c825 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,7 +13,7 @@ services = ["__APP__"] yes = "true" no = "false" help = "Controls whether the player in the UI will animate the album cover" - bind = "EnableCoverAnimation:/var/lib/__APP__/navidrome.toml" + bind = "EnableCoverAnimation:__INSTALL_DIR__/navidrome.toml" [main.config.enable_downloads] ask = "Allow music download" @@ -21,7 +21,7 @@ services = ["__APP__"] yes = "true" no = "false" help = "Enable the option in the UI to download music/albums/artists/playlists from the server" - bind = "EnableDownloads:/var/lib/__APP__/navidrome.toml" + bind = "EnableDownloads:__INSTALL_DIR__/navidrome.toml" [main.config.enable_sharing] ask = "Enable Sharing feature" @@ -29,7 +29,7 @@ services = ["__APP__"] yes = "true" no = "false" help = "Enable the Sharing feature" - bind = "EnableSharing:/var/lib/__APP__/navidrome.toml" + bind = "EnableSharing:__INSTALL_DIR__/navidrome.toml" [main.config.scanner_extractor] ask = "Select metadata extractor" @@ -37,7 +37,7 @@ services = ["__APP__"] choices = ["taglib", "ffmpeg"] default = "taglib" help = "Select metadata extractor implementation" - bind = "Scanner.Extractor:/var/lib/__APP__/navidrome.toml" + bind = "Scanner.Extractor:__INSTALL_DIR__/navidrome.toml" [main.config.enable_transcoding] ask = "Enable transcoding" @@ -45,10 +45,10 @@ services = ["__APP__"] yes = "true" no = "false" help = "Enables transcoding configuration in the UI" - bind = "EnableTranscodingConfig:/var/lib/__APP__/navidrome.toml" + bind = "EnableTranscodingConfig:__INSTALL_DIR__/navidrome.toml" [main.config.welcome_message] ask = "Welcome message" type = "string" help = "Add a welcome message to the login screen" - bind = "UIWelcomeMessage:/var/lib/__APP__/navidrome.toml" + bind = "UIWelcomeMessage:__INSTALL_DIR__/navidrome.toml" diff --git a/scripts/install b/scripts/install index 33532a9..d28315d 100644 --- a/scripts/install +++ b/scripts/install @@ -19,7 +19,6 @@ enable_animation="true" enable_transcoding="false" welcome_message="" enable_sharing="false" -config_path="/var/lib/$app" #================================================= # STORE SETTINGS FROM MANIFEST @@ -32,7 +31,6 @@ ynh_app_setting_set --app=$app --key=enable_animation --value=$enable_animation ynh_app_setting_set --app=$app --key=enable_transcoding --value=$enable_transcoding ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message ynh_app_setting_set --app=$app --key=enable_sharing --value=$enable_sharing -ynh_app_setting_set --app=$app --key=config_path --value=$config_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -42,8 +40,6 @@ ynh_script_progression --message="Setting up source files..." --weight=4 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -mkdir -p "$config_path" - chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -75,10 +71,10 @@ ynh_multimedia_build_main_dir ynh_script_progression --message="Adding a configuration file..." --weight=1 # Main config File -ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml" +ynh_add_config --template="navidrome.toml" --destination="$install_dir/navidrome.toml" -chmod 600 "$config_path/navidrome.toml" -chown -R $app:$app "$config_path" +chmod 600 "$$install_dir/navidrome.toml" +chown -R $app:$app "$install_dir/navidrome.toml" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 3a7c4af..bf20493 100644 --- a/scripts/restore +++ b/scripts/restore @@ -20,16 +20,6 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." --weight=2 - -ynh_restore_file --origin_path="/var/lib/$app" - -chmod 600 "/var/lib/$app/navidrome.toml" -chown -R $app "/var/lib/$app" - #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 26566c4..87c07d2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,7 +76,7 @@ then ynh_secure_remove --file=$install_dir # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir" --keep="nadidrome.toml" fi chmod -R o-rwx "$install_dir" @@ -100,13 +100,11 @@ yunohost service add $app --description="Web-based music collection server and s #================================================= ynh_script_progression --message="Updating a configuration file..." -config_path="/var/lib/$app" - # Uncomment when there is new options added upstream -ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml" +ynh_add_config --template="navidrome.toml" --destination="$install_dir/navidrome.toml" -chmod 600 "$config_path/navidrome.toml" -chown -R $app:$app "$config_path" +chmod 600 "$install_dir/navidrome.toml" +chown -R $app:$app "$install_dir/navidrome.toml" #================================================= # START SYSTEMD SERVICE