From 2a4bf3b5dd2188bc6c538b58de84a9449fbb40ce Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Sun, 18 Aug 2024 19:26:43 +0100 Subject: [PATCH 1/7] Navidrome: only give Navidrome read-only access to /media as it doesn't need write permissions See https://www.navidrome.org/docs/usage/security/ . --- navidrome/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navidrome/config.json b/navidrome/config.json index d90435c3a..d22de3f49 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -9,7 +9,7 @@ "init": false, "map": [ "addon_config:rw", - "media:rw", + "media", "share:rw", "ssl:rw" ], From 64833e65ba2dca92b5f6c94cf7e1aa61a78c093c Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Sun, 18 Aug 2024 19:30:46 +0100 Subject: [PATCH 2/7] Navidrome: Set the web UI link to use the default port for the web UI --- navidrome/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navidrome/config.json b/navidrome/config.json index d22de3f49..d3768a9ed 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -38,5 +38,5 @@ "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/navidrome", "version": "0.52.5-6", - "webui": "[PROTO:ssl]://[HOST]:[PORT:8080]" + "webui": "[PROTO:ssl]://[HOST]:[PORT:4533]" } From a5a64357568e54fd6de3b4941bf330f1553f2a44 Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Mon, 19 Aug 2024 08:46:30 +0100 Subject: [PATCH 3/7] Navidrome: Make the config options work by splitting default values and the schema --- navidrome/config.json | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/navidrome/config.json b/navidrome/config.json index d3768a9ed..9a5220b8d 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -17,15 +17,10 @@ "options": { "base_url": "localhost", "certfile": "fullchain.pem", - "cifsdomain": "str?", - "cifspassword": "str?", - "cifsusername": "str?", - "data_folder": "/data/data", + "data_folder": "/data", "keyfile": "privkey.pem", - "localdisks": "str?", "log_level": "info", "music_folder": "/data/music", - "networkdisks": "str?", "ssl": false }, "ports": { @@ -34,6 +29,20 @@ "ports_description": { "4533/tcp": "Web interface" }, + "schema": { + "base_url": "str", + "certfile": "str?", + "cifsdomain": "str?", + "cifspassword": "str?", + "cifsusername": "str?", + "data_folder": "str", + "keyfile": "str?", + "localdisks": "str?", + "log_level": "str", + "music_folder": "str", + "networkdisks": "str?", + "ssl": "bool" + }, "slug": "navidrome", "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/navidrome", From 9796e0540e604cc2c3be8a2c372fc0608d43b24e Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Mon, 19 Aug 2024 08:56:17 +0100 Subject: [PATCH 4/7] Navidrome: Exclude the cache from backups --- navidrome/config.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/navidrome/config.json b/navidrome/config.json index 9a5220b8d..e3cc18170 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -3,6 +3,9 @@ "amd64", "aarch64" ], + "backup_exclude": [ + "**/cache/**" + ], "codenotary": "alexandrep.github@gmail.com", "description": "Navidrome for Home Assistant", "image": "ghcr.io/alexbelgium/navidrome-{arch}", From 31d3b04646fb4a5ea9097a9f15c826367424d88f Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Tue, 20 Aug 2024 08:04:42 +0100 Subject: [PATCH 5/7] Navidrome: Expose more Navidrome config options through the addon config --- navidrome/config.json | 12 ++++++++- navidrome/rootfs/etc/cont-init.d/99-run.sh | 30 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/navidrome/config.json b/navidrome/config.json index e3cc18170..315dee278 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -39,12 +39,22 @@ "cifspassword": "str?", "cifsusername": "str?", "data_folder": "str", + "default_language": "str?", + "image_cache_size": "str?", "keyfile": "str?", + "lastfm_api_key": "str?", + "lastfm_secret": "str?", "localdisks": "str?", "log_level": "str", "music_folder": "str", "networkdisks": "str?", - "ssl": "bool" + "password_encryption_key": "str?", + "scan_schedule": "str?", + "spotify_id": "str?", + "spotify_secret": "str?", + "ssl": "bool", + "transcoding_cache_size": "str?", + "welcome_message": "str?" }, "slug": "navidrome", "udev": true, diff --git a/navidrome/rootfs/etc/cont-init.d/99-run.sh b/navidrome/rootfs/etc/cont-init.d/99-run.sh index e9b92ced7..d1e1a4584 100755 --- a/navidrome/rootfs/etc/cont-init.d/99-run.sh +++ b/navidrome/rootfs/etc/cont-init.d/99-run.sh @@ -14,6 +14,36 @@ if bashio::config.true 'ssl'; then ND_TLSCERT=$(bashio::config 'certfile') ND_TLSKEY=$(bashio::config 'keyfile') fi +if bashio::config.has_value 'default_language'; then + ND_DEFAULTLANGUAGE=$(bashio::config 'default_language') +fi +if bashio::config.has_value 'image_cache_size'; then + ND_IMAGECACHESIZE=$(bashio::config 'image_cache_size') +fi +if bashio::config.has_value 'lastfm_api_key'; then + ND_LASTFM_APIKEY=$(bashio::config 'lastfm_api_key') +fi +if bashio::config.has_value 'lastfm_secret'; then + ND_LASTFM_SECRET=$(bashio::config 'lastfm_secret') +fi +if bashio::config.has_value 'password_encryption_key'; then + ND_PASSWORDENCRYPTIONKEY=$(bashio::config 'password_encryption_key') +fi +if bashio::config.has_value 'scan_schedule'; then + ND_SCANSCHEDULE=$(bashio::config 'scan_schedule') +fi +if bashio::config.has_value 'spotify_id'; then + ND_SPOTIFY_ID=$(bashio::config 'spotify_id') +fi +if bashio::config.has_value 'spotify_secret'; then + ND_SPOTIFY_SECRET=$(bashio::config 'spotify_secret') +fi +if bashio::config.has_value 'transcoding_cache_size'; then + ND_TRANSCODINGCACHESIZE=$(bashio::config 'transcoding_cache_size') +fi +if bashio::config.has_value 'welcome_message'; then + ND_UIWELCOMEMESSAGE=$(bashio::config 'welcome_message') +fi ############## From 790b73ce92326ce9c75c41ed73edba1c5db76de3 Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Tue, 20 Aug 2024 08:21:55 +0100 Subject: [PATCH 6/7] Navidrome: Update version and changelog for 0.52.5-7 release --- navidrome/CHANGELOG.md | 15 +++++++++++++++ navidrome/config.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/navidrome/CHANGELOG.md b/navidrome/CHANGELOG.md index 8638f80e6..2af70ebb2 100644 --- a/navidrome/CHANGELOG.md +++ b/navidrome/CHANGELOG.md @@ -1,14 +1,29 @@ +## 0.52.5-7 (20-08-2024) + +- Reduced access to media to read-only as write permissions are not required https://www.navidrome.org/docs/usage/security/#permissions +- Set the web UI link to use the default port +- Make config options work by splitting default values and schemas +- Exclude the cache from backups +- Expose more Navidrome config options + ## 0.52.5-6 (17-08-2024) + - Gave access to /media + ## 0.52.5-5 (16-08-2024) + - Minor bugs fixed + ## 0.52.5-4 (14-08-2024) + - Minor bugs fixed ## 0.52.5-3 (13-07-2024) + - Add rootfs to docker image ## 0.52.5-2 (22-05-2024) + - Minor bugs fixed ## 0.52.5 (22-05-2024) diff --git a/navidrome/config.json b/navidrome/config.json index 315dee278..23f5354b1 100644 --- a/navidrome/config.json +++ b/navidrome/config.json @@ -59,6 +59,6 @@ "slug": "navidrome", "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/navidrome", - "version": "0.52.5-6", + "version": "0.52.5-7", "webui": "[PROTO:ssl]://[HOST]:[PORT:4533]" } From b05e07ad94bb97d3507b5dbe4a1bf4d60bb68691 Mon Sep 17 00:00:00 2001 From: Arunan Balasubramaniam Date: Tue, 20 Aug 2024 19:29:25 +0100 Subject: [PATCH 7/7] Navidrome: Explicitly export shell variables for Navidrome to pick up --- navidrome/CHANGELOG.md | 1 + navidrome/rootfs/etc/cont-init.d/99-run.sh | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/navidrome/CHANGELOG.md b/navidrome/CHANGELOG.md index 2af70ebb2..3fe63b0ad 100644 --- a/navidrome/CHANGELOG.md +++ b/navidrome/CHANGELOG.md @@ -5,6 +5,7 @@ - Make config options work by splitting default values and schemas - Exclude the cache from backups - Expose more Navidrome config options +- Explicitly export shell variables for Navidrome to pick up ## 0.52.5-6 (17-08-2024) diff --git a/navidrome/rootfs/etc/cont-init.d/99-run.sh b/navidrome/rootfs/etc/cont-init.d/99-run.sh index d1e1a4584..8e0813568 100755 --- a/navidrome/rootfs/etc/cont-init.d/99-run.sh +++ b/navidrome/rootfs/etc/cont-init.d/99-run.sh @@ -6,43 +6,63 @@ set -e # https://www.navidrome.org/docs/usage/configuration-options/#available-options ND_MUSICFOLDER=$(bashio::config 'music_folder') +export ND_MUSICFOLDER + ND_DATAFOLDER=$(bashio::config 'data_folder') +export ND_DATAFOLDER + ND_LOGLEVEL=$(bashio::config 'log_level') +export ND_LOGLEVEL + ND_BASEURL=$(bashio::config 'base_url') +export ND_BASEURL + if bashio::config.true 'ssl'; then bashio::log.info "ssl is enabled" ND_TLSCERT=$(bashio::config 'certfile') + export ND_TLSCERT ND_TLSKEY=$(bashio::config 'keyfile') + export ND_TLSKEY fi if bashio::config.has_value 'default_language'; then ND_DEFAULTLANGUAGE=$(bashio::config 'default_language') + export ND_DEFAULTLANGUAGE fi if bashio::config.has_value 'image_cache_size'; then ND_IMAGECACHESIZE=$(bashio::config 'image_cache_size') + export ND_IMAGECACHESIZE fi if bashio::config.has_value 'lastfm_api_key'; then ND_LASTFM_APIKEY=$(bashio::config 'lastfm_api_key') + export ND_LASTFM_APIKEY fi if bashio::config.has_value 'lastfm_secret'; then ND_LASTFM_SECRET=$(bashio::config 'lastfm_secret') + export ND_LASTFM_SECRET fi if bashio::config.has_value 'password_encryption_key'; then ND_PASSWORDENCRYPTIONKEY=$(bashio::config 'password_encryption_key') + export ND_PASSWORDENCRYPTIONKEY fi if bashio::config.has_value 'scan_schedule'; then ND_SCANSCHEDULE=$(bashio::config 'scan_schedule') + export ND_SCANSCHEDULE fi if bashio::config.has_value 'spotify_id'; then ND_SPOTIFY_ID=$(bashio::config 'spotify_id') + export ND_SPOTIFY_ID fi if bashio::config.has_value 'spotify_secret'; then ND_SPOTIFY_SECRET=$(bashio::config 'spotify_secret') + export ND_SPOTIFY_SECRET fi if bashio::config.has_value 'transcoding_cache_size'; then ND_TRANSCODINGCACHESIZE=$(bashio::config 'transcoding_cache_size') + export ND_TRANSCODINGCACHESIZE fi if bashio::config.has_value 'welcome_message'; then ND_UIWELCOMEMESSAGE=$(bashio::config 'welcome_message') + export ND_UIWELCOMEMESSAGE fi @@ -53,4 +73,3 @@ fi bashio::log.info "Please wait while the app is loading!" /app/navidrome -