Add mDNS local device discovery portal #1365
Replies: 35 comments 14 replies
-
Just to state the obvious: There is a difference from iOS since |
Beta Was this translation helpful? Give feedback.
-
It's a useful API to have whether or not particular types of network access are prevented, or rather until they are. |
Beta Was this translation helpful? Give feedback.
-
Does this go through glibc resolver? If yes, then there could be a plugin configured through nsswitch.conf that would communicate to a portal in host. (fallbacking regular DNS) This would probably not require changes in flatpak? |
Beta Was this translation helpful? Give feedback.
-
I don't think there's currently any way to extension points for NSS plugins, is there? If that were the case, it might be a useful stop-gap until we have a portal for mDNS support, not a complete replacement for it. |
Beta Was this translation helpful? Give feedback.
-
systemd-resolved now has access to host varlink out of the box when --share=network is given through flatpak/flatpak@e5da98f; freedesktop-sdk 21.08 will contain required NSS plugins and configurations. |
Beta Was this translation helpful? Give feedback.
-
As I mentioned in systemd/systemd#18860 (comment) this unfortunately gives access to more information about the local network than what was previously allowed. |
Beta Was this translation helpful? Give feedback.
-
What is the scope of this portal?
|
Beta Was this translation helpful? Give feedback.
-
Has there been any progress on this? This is a big issue for anyone who uses a Flatpak web browser and tries to connect to something on their local network, but just gets a "The connection has timed out" error for mysterious reasons. I suspect the only reason there aren't many more people on this thread is the fact that it is not at all obvious that Flatpak is the reason why they can't connect. If there's anything I can do to help out. please let me know :) |
Beta Was this translation helpful? Give feedback.
-
AFAIK there has been no work on this. If you want to pick this up feel free to do so and if you have questions there is the #xdg-desktop-portals:matrix.org channel. |
Beta Was this translation helpful? Give feedback.
-
Linked freedesktop-sdk issue, FYI |
Beta Was this translation helpful? Give feedback.
-
I've read through all the discussions on this and would suggest the following way forward. I don't know if I have enough free time to implement all of this, but I might start the work.
I don't think we need a backend interface and implementation. The |
Beta Was this translation helpful? Give feedback.
-
So is the intent that unless hostname ends in .local, the NSS plugin will immediately fail so glibc will switch to next resolver? |
Beta Was this translation helpful? Give feedback.
-
On a basic level yes. That's also what avahi's libnss_mdns seems to be doing (though their logic is a bit more complex. They read |
Beta Was this translation helpful? Give feedback.
-
If you mean requesting access to all local devices, I would say no. It is generally better to access individual objects (here devices) rather than all objects when several can be distinguished. We can then wonder if it makes sense to access individual objects rather than all of them. In this case, giving permission to individual objects rather than all allows communication only with the relevant devices. This also prevents the app from knowing all the devices we own (this provides a bit of privacy). Additionally, if this applies, it would probably be useful to distinguish between listing all available devices and only listing devices using a specific protocol to communicate (e.g. games). Note that here I only followed the links given in the first post. Finally, if there is a reason to let an app always discover and access any local (network) device rather than the app getting a list of all available devices, then it is best to know what the case is and if we can have both (select devices from a list and always discover and access those). |
Beta Was this translation helpful? Give feedback.
-
@Mikenux I think what you're describing goes a lot further than what mDNS is and can do. First of all we can't prevent an app from accessing local devices. mDNS is only about finding local devices. If you already know the IP (or guess or brute-force it) you can still talk to it. Also because there are no networking restrictions an app could probably still manuall implement mDNS to discover devices. Second mDNS doesn't have a way to list all local devices, so we can't show a list to users and have them choose a device. mDNS also doesn't have a way to discover what services a device offers (that's where DNS-SD would come in, which can but doesn't have to be used on top of mDNS. But that's a completely different topic). We could have fine grained permissions on a per-domain level ("Allow $app to access foo.local?"). I personally don't think that this is worth the effort and would prefer a general permission ("Allow $app to discover local devices?"). Asking too many questions might get annoying for users (though I'm willing to have my mind changed on this). |
Beta Was this translation helpful? Give feedback.
-
@swick: Overall, I'm talking about having what is needed to distinguish Internet access from LAN access (which includes mDNS local device discovery) for the network "portal". @nanonyme: If kernel support is needed, then this should be worked on. However, this will require a new kernel, which is inconvenient. Just that in the current state it would be better to just be able to enable the feature without requesting access. Indeed, from my user perspective, it doesn't really make sense to request access to local devices if we already have access to the local network (regardless of the underlying protocols). Also, can anyone explain what "bikeshedding" is? I still have trouble understanding this word in context. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@Mikenux there has been talk for last few years of need for unprivileged network namespaces. I'm not holding my breath anything will materialize this decade. |
Beta Was this translation helpful? Give feedback.
-
unpriv network namespaces are possible right now. |
Beta Was this translation helpful? Give feedback.
-
Really? Then under that kind of environment for sure this granular DNS limiting might make sense. |
Beta Was this translation helpful? Give feedback.
-
... I forgot this was available (even saw them mentioned in network issues here and in flatpak). For the network portal: #1166. However, first knowing the status on this point is necessary. If nothing can happen within a given time frame, then other solutions can be considered. |
Beta Was this translation helpful? Give feedback.
-
Since flatpak is in maintenance mode landing new features is a rather rare thing. |
Beta Was this translation helpful? Give feedback.
-
@Erick555: What does this mean regarding this issue? |
Beta Was this translation helpful? Give feedback.
-
It means introducing network namespaces support and more sophisticated network access than on/off may be unlikely in the foreseeable future. |
Beta Was this translation helpful? Give feedback.
-
I did some prototyping and apparently the As I would expect mDNS lookups to sometimes happen in the background this makes me prefer only showing a dialog once to allow mDNS lookups for all domains even more. |
Beta Was this translation helpful? Give feedback.
-
With the little information I have, maybe we have the following choices:
|
Beta Was this translation helpful? Give feedback.
-
Here are 3 cases identified here:
The problem is file access. Concerning this access, offering the user to precisely select the files to give to an application is important to limit access. This is a bit of a problem for applications whose main functionality is to connect to local file shares to browse them. So, what kind of cases are you targeting? |
Beta Was this translation helpful? Give feedback.
-
Somewhat impressively not one of those is what this issue is actually about? |
Beta Was this translation helpful? Give feedback.
-
@ZanderBrown @/Mikenux has been known to do that around this issue tracker for years. So this is nothing new. |
Beta Was this translation helpful? Give feedback.
-
I don't think this should be a portal, even if the portal prototype is finished it would have a very slow adoption. |
Beta Was this translation helpful? Give feedback.
-
What really seems necessary is to clearly state what is wanted, because, in my opinion, there is clearly confusion about this on various issues. For me, what is wanted here - at least by the people concerned with this issue - is a name resolver: the app sends a local name and the "system" returns the IP. Make sure that this is how maintainers or others interpret your vision of "device discovery" when you discuss it with them. |
Beta Was this translation helpful? Give feedback.
-
To implement
.local
device discovery (as opposed to service discovery), it would be useful to have a portal that does that lookup, using either Avahi or systemd-resolved depending on the system configuration. This would also allow for permissions to be requested when the application starts using this functionality.Prior art
iOS
Beta Was this translation helpful? Give feedback.
All reactions