When the application is started for the fist time, it could help to have an automatically populated list of servers obtained through zeroconf.
Will also help while developing with multiple servers.
Analysis
When entering the preferences dialog, listen to the network for a service of type _mopidy-http._tcp. Display a label in preference dialog when a service is found. Add a button to update the base URL entry.
Case of multiple services
Don't try to handle multiple services to start with.
Mopidy behind a web server
When Mopidy isn't directly exposed, say there's nginx acting as a proxy, the port exported through the Mopidy's zeroconf implementation may be wrong. One must configure http.zeroconf to an empty string to disable Mopidy's zeroconf, and configure DNSSD by hand. It's easy using systemd-resolved for example.
Install systemd-resolved, disable avahi-daemon.
Enable mDNS on the network interface (this is persistent):
:question: Not clear whether there's a bug on second run of the preference dialog: Sometimes the information bar doesn't pop-up, because the service isn't discovered anymore or service information is missing...
Context
When the application is started for the fist time, it could help to have an automatically populated list of servers obtained through zeroconf.
Will also help while developing with multiple servers.
Analysis
When entering the preferences dialog, listen to the network for a service of type
_mopidy-http._tcp
. Display a label in preference dialog when a service is found. Add a button to update the base URL entry.Case of multiple services
Don't try to handle multiple services to start with.
Mopidy behind a web server
When Mopidy isn't directly exposed, say there's
nginx
acting as a proxy, the port exported through the Mopidy's zeroconf implementation may be wrong. One must configurehttp.zeroconf
to an empty string to disable Mopidy's zeroconf, and configure DNSSD by hand. It's easy usingsystemd-resolved
for example.Install
systemd-resolved
, disableavahi-daemon
.Enable mDNS on the network interface (this is persistent):
For DNSSD, create the file
/etc/systemd/dnssd/mopidy.dnssd
with content:and restart
systemd-resolved
.