simojenki / bonob

sonos SMAPI implementation allowing integrating different music sources with sonos.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remote VPS

mycanaletto opened this issue · comments

Hello,
I'm trying to set up Bonob+Navidrome in a VPS and to connect one (or two) sound systems at home. Is this possible? How can I get my remote Sonos to discover Bonob?

Yes this should work, you need to follow the section "Running bonob on a different network to your sonos devices".

I would suggest that you use a firewall or similar to restrict access, however that is up to you.

I understood that, but on the Sonos equipment side I only have the sonos, how do I tell the sonos to reach Bonob?

I don't have a docker in my house, just a Sonos installation.

Maybe do what I did with Subsonic ?

Open http://SONOS_IP:1400/customsd.htm in a browser.
Enter the following values in the web form:

SID – Any legal value except 242
Service Name – Any name, for instance "Subsonic Remote"
Endpoint URL – http://SUBSONIC_IP:4040/ws/Sonos?ip=SUBSONIC_IP
Secure Endpoint URL – http://SUBSONIC_IP:4040/ws/Sonos?ip=SUBSONIC_IP
Polling Interval – 1200
Authentication – Session ID
Strings Table – Version: 6, URI: http://SUBSONIC_IP:4040/sonos/strings.xml
Presentation Map – Version: 3, URI: http://SUBSONIC_IP:4040/sonos/presentationMap.xml
Container Type – Music Service
Capabilities – Search, Favorites, User Content Playlists, Extended Metadata

Yes, the process is the same, the values different.

That's what I thought and now it's working fine. But I had a problem.
Bonob has to connect to Navidrome and this starts with authentication from Sonos. I had this line:

BNB_SUBSONIC_URL:http://192.168.10.10:4533 (my host)

Bonob couldn't see Navidrome. And I had to put this :
BNB_SUBSONIC_URL: http://172.19.0.3:4533 (Navidrome IP container)

To avoid the external address :
BNB_SUBSONIC_URL: https://bonob.domain.tld (via pfsense)

I'm left with two problems:

  • Seeing the files in French, but I don't think that's available.
  • See the source IP address in Navidrome.
    • If you connect directly to Navidrome, it logs the source IPs sent to it by pfsense.
    • If you connect via Bonob (Sonos>Bonob>Navidrome), Navidrome only logs Bonob's IP without passing on the source IP.

I know I'm going a bit far... Especially since it's possible in pfsense to authorize only a few source IPs to make things a little more secure... But if it's something easy to do, then why not...

Regarding BNB_SUBSONIC_URL, this needs to be the IP/hostname that allows bonob to communicate with ND. You could 'link' the containers rather than using the internal network IP, as that may change on restart. There is no need to go back via the external address, you should be able to route this internally through the docker private network.

What do you mean by "Seeing the files in French"? ND takes names of albums/tracks/artists from the ID3 tags, if they are in French it should appear in French, there is no translation in bonob, you should see what you see in the ND UI. If you mean the menus of bonob itself you can raise a PR for the french translations by changing https://github.com/simojenki/bonob/blob/master/src/i8n.ts#L49

Re: networking, I think its unlikely that bonob would see the sonos device IP anyway as presumably you have a setup like this;

sonos device -> home router -> internet -> pfsense(VPS) -> bonob(VPS) -> Navidrome(VPS)

In which case the IP address that pfsense sees will be your public IP of the home router, not the sonos device. If you are using haproxy plugin in pfsense that can be configured to support X-Forwarded-For, in which case bonob would see your home routers IP. I guess bonob could pass the X-Forwarded-For header through again so that ND can see where the request came from, however I don't really see what the benefit of that would be?

Thank you for your reply.
For the translation I was just thinking of these texts:
image

For the network these are the IPs of the home server and not of the Sonos devices, but that's not very important indeed because I'm going to restrict access.

The text for those menu items is defined in the i8n.ts file that I sent. For example "Artists" in en-US is defined here -> https://github.com/simojenki/bonob/blob/master/src/i8n.ts#L52.

If you can provide a PR with a French translation for all the different words in that file then it would display French.

Thanks for all your help.

I've tried to translate it as well as possible for a French version:

    AppLinkMessage: "Associer Sonos à $BNB_SONOS_SERVICE_NAME",
    artists: "Artistes",
    albums: "Albums",
    tracks: "Pistes",
    playlists: "Playlists",
    genres: "Genres",
    random: "Aléatoire",
    topRated: "Les mieux notés",
    recentlyAdded: "Récemment ajouté",
    recentlyPlayed: "Récemment joué",
    mostPlayed: "Les plus joué",
    success: "Succès",
    failure: "Échec",
    expectedConfig: "Configuration attendue",
    existingServiceConfig: "La configuration de service existe",
    noExistingServiceRegistration: "Aucun enregistrement de service existant",
    register: "Inscription",
    removeRegistration: "Supprimer l'inscription",
    devices: "Appareils",
    services: "Services",
    login: "Se connecter",
    logInToBonob: "Se connecter à $BNB_SONOS_SERVICE_NAME",
    username: "Nom d'utilisateur",
    password: "Mot de passe",
    successfullyRegistered: "Connecté avec succès",
    registrationFailed: "Échec de la connexion !",
    successfullyRemovedRegistration: "Inscription supprimée avec succès",
    failedToRemoveRegistration: "Échec de la suppression de l'inscription !",
    invalidLinkCode: "Code non valide !",
    loginSuccessful: "Connexion réussie !",
    loginFailed: "La connexion a échoué !",
    noSonosDevices: "Aucun appareil Sonos",
    favourites: "Favoris",
    STAR: "Suivre",
    UNSTAR: "Ne plus suivre",
    STAR_SUCCESS: "Piste suivie",
    UNSTAR_SUCCESS: "Piste non suivie",
    LOVE: "Aimer",
    LOVE_SUCCESS: "Pistes aimée"

I've applied this change for the fr-FR LANG and released 0.6.9.

Please confirm whether or not it works?

As I've not heard back I'm going to assume that this is working now and close issue?

I haven't had time, but I'll be looking soon ;-)