alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.34k stars 192 forks source link

✨ [REQUEST] Navidrome #789

Open leokeba opened 1 year ago

leokeba commented 1 year ago

Navidrome Music Server / Streamer

Hi, I am looking to integrate Navidrome into HAOS. It is a powerful music server based on the subsonic protocol, and it implements a web player similar to the Deezer / Spotify experience, but with your own self-hosted music collection.

I know Jellyfin / Emby / Plex can provide similar services, but I want something that's build with music in mind, plus I have a big library with lots of favorites and stuff so migration is not a good option for me.

It has a docker image here : https://hub.docker.com/r/deluan/navidrome

I am not asking you to implement it all by yourself

Rather, I would like a bit of advice/help on how to do it, probably using one of your addons as a template. If you think this would be a good addition to this repo, then I will make a PR. This is also a learning opportunity for me.

Let me know if you have any ideas / directions / recommandations for me. Thanks :)

alexbelgium commented 1 year ago

Hì, thanks for the proposal! I indeed have very little time to implement a new addon but I've struggled a lot learning to build ones so I can help you with pitfalls.

I'll write something a bit later to help you get started.

Here is already the official tutorial (using HA base image) and my tutorial (modifying an existing image)

My tutorial is quite specific for lsio images, so I'll have to adapt it for the 2 main cases : images based on s6 supervisor, or images without.

mihaiaka commented 1 year ago

+1 I would also love to see/get Navidrome via HA add-ons

bilogic commented 8 months ago

let me run thru the tutorials thanks

bilogic commented 8 months ago

I'm basing this off the gitea add-on as my base, but I keep getting this error when trying to install my new add-on

image

alexbelgium commented 8 months ago

Hi, that's due to ADD --chmod 777 in the dockerfile. You need to separate the commands to local build in HA : have only a ADD command to download the file, then a RUN command to perform the chmod

bilogic commented 8 months ago

Yes, I'm aware it was due to the ADD --chmod, but why does it work for gitea and not mine?

What I can't understand is:

  1. I'm replicating the Dockerfile from gitea and hosting it on my own repo at https://github.com/bilogic/ha-addons
  2. I'm loading it the same way in HA as I would with your repo
  3. So, which step of mine is causing this to be a local build?

Thank you

bilogic commented 8 months ago

I found out was it was due to "image": "ghcr.io/alexbelgium/gitea-{arch}", in config.json

bilogic commented 8 months ago

https://github.com/bilogic/ha-addons/tree/470a1edfea1b1fc5d813560357e9f95173276a71/navidrome

It appears that a Docker file is not absolutely required, but I do need some way to change the ENV values.

alexbelgium commented 7 months ago

The best way to set ENV values can be with the "environment" tag in config.yaml if they are fixed, and if they are dynamic (like set from add-on options) you need to set them using a script at boot. This is for example the purpose of my global_var script here : https://github.com/alexbelgium/hassio-addons/blob/master/.templates/01-config_yaml.sh

bilogic commented 7 months ago
  1. There is quite a fair bit of things for me to learn as I'm not familiar with Dockerfile or HA addons.
  2. I'm looking through all the examples to find one that is suitable for navidrome
  3. It seems that VaultWarden (Bitwarden) might be one of them

https://github.com/alexbelgium/hassio-addons/blob/22c66c4f232ba3a179d8ac29277ace32f7296990/bitwarden/Dockerfile#L17-L22

  1. What does the 2 FROM means? From reading the reference, https://docs.docker.com/engine/reference/builder/#from, it seems to be building 2 images, which seems to be more straighforward than other examples
  2. If it is 2 images, how are they interacting with one another, and why is the HA image required?
  3. I also have trouble figuring out how the ha_* scripts know what to do about making the add-on available (in this case, VW). There doesn't seem to be any variables going into them. Or are they supposed to be the same for all add-ons?
bilogic commented 7 months ago

@alexbelgium

I managed to get Navidrome going, would you be so kind as to:

  1. Review my repo at https://github.com/bilogic/ha-addons/tree/master/navidrome, in particular

    • Is there anything I'm missing or ought to include?
    • Are there any files that I can get rid of? Do we need icon.png and logo.png?
  2. Perhaps point me in the right direction on how to implement HTTPS and ingress minimally?

Side note: I have not created an image in config.json as it is still work in progress, I plan to comment my repo heavily so that others will find it easier to create their own add-ons.

Thanks!

alexbelgium commented 7 months ago

Hi, thanks! I'm on holidays i'll check when I'm back. Best regards

bilogic commented 7 months ago

Thanks! I managed to achieve HTTPS using Caddy 2 https://github.com/einschmidt/hassio-addons

On hindsight, Caddy 2 might be acceptable since it simplifies addon creation. But I wouldn't use it for things like Bitwarden which requires end to end encryption, i.e. no traffic should be sent at all via http://

So, still looking forward to implementing HTTPS

celynw commented 5 months ago

Thanks @bilogic! I tried to do this myself following the guide but I was a bit overwhelmed. Yours is working well and I'll use your repo as a base if I want to make any adjustments/enhancements! All I did was change the default ~SavePath~ ND_MUSICFOLDER (which I then had to create manually). I don't need HTTPS built-in since I do it with an external process.

bilogic commented 5 months ago

Happy to hear that. By the way, I moved away from Caddy due to their wonky HTTP3 support, using Nginx Proxy Manager instead.

What SavePath do you mean? If you want me to make changes, better to discuss on my repo instead.

celynw commented 5 months ago

Ah, sorry about the confusion. I meant ND_MUSICFOLDER (updated my comment). I was looking at the field name from a different addon, which I was using as a reference to keep my files in the same place.

Yep, I'm also using Nginx Proxy Manager too.

Anyway I just wanted to comment here in case anybody finds this issue first, since I had a good look for Navidrome (or even subsonic) Home Assistant addons with no luck until I looked here

bilogic commented 5 months ago

Yea, the documentation is lacking on my end. But I really have no bandwidth for now.

baldarn commented 4 days ago

I'm trying to add Navidrome here

any help appreciated!

https://github.com/alexbelgium/hassio-addons/issues/1409

baldarn commented 4 days ago

everyone can use @celynw working addon here

https://github.com/celynw/ha-addons