GNOME Bugzilla – Bug 727580
sharing: awareness of network
Last modified: 2014-07-30 16:24:10 UTC
I'd like to see some awareness of the current network environment in our sharing setup. 1) If there is no network, the panel should probably inform me of that, instead of happily talking about 'the current network' when there is none. 2) If I am connecting to a new wireless network for the first time and sharing is enabled, I would expect to get a notification warning me that I may end up sharing private data with a wider public. The notification should probably offer me to turn off all sharing for this network, and remember this configuration until I explicitly turn on sharing while on this network. The second point has a strong overlap with privacy - maybe there should be a cross-reference to 'Sharing' in the privacy panel ? The second point also has some similarity with firewall 'zone' configuration - if a firewall is present, we could additionally set the network zone to 'Home' or 'Public' when making this sharing change upon first-time connection to the network. Doing so has the advantage that the firewall may also cover third-party software that does not pay attention to the GNOME sharing settings.
I think it could be pretty elegant to piggy-back this on the 'zone' property that nm already has on its connections. no zone -> first-time connection, ask zone == home -> sharing is safe zone != home -> turn off sharing, possibly with a notification
We can't implement that at the GNOME level. The sharing is usually implemented by various components (rygel, gnome-user-share with its Apache httpd, vino, etc.) and we need to be able to block them until the question has been answered. I don't know how to do that. We couldd run them in a container, and temporarily block their outside network access in the meanwhile, but we still need to figure out how to do that.
Don't these services react to the off switch in the sharing panel ? I would expect that we simply turn things off temporarily doing whatever that switch does. For uncooperative or third-party services, we'll have to rely on the firewall to indeed block their network access.
I'm confused: a new connection will use the default zone until GNOME changes it to home, and firewalld blocks pretty much everything in the default zone. What am I missing: why do we need to block network access and what problem would containers solve?
(In reply to comment #4) > I'm confused: a new connection will use the default zone until GNOME changes it > to home, and firewalld blocks pretty much everything in the default zone. > > What am I missing: why do we need to block network access and what problem > would containers solve? Not using firewalld, which doesn't work/isn't used on anything but Fedora.
Created attachment 275094 [details] quick prototype Here is a quick prototype. It only looks at the vino settings currently. To make the notifications show up, you'll have to put a desktop file in ~/.local/share/applications/org.gnome.fwmon.desktop: [Desktop Entry] Type=Application Name=fwmon Icon=preferences-system-sharing Exec=/home/mclasen/fwmon/fwmon
Created attachment 275095 [details] when connecting to an unknown network with sharing
Created attachment 275096 [details] when connecting to an untrusted network with sharing
unfortunately, we run into some issues with the nm api: updating the zone configuration seems to mess up the security settings.
(In reply to comment #0) > I'd like to see some awareness of the current network environment in our > sharing setup. > > 1) If there is no network, the panel should probably inform me of that, instead > of happily talking about 'the current network' when there is none. Right. I can provide mockups for this if you want. > 2) If I am connecting to a new wireless network for the first time and sharing > is enabled, I would expect to get a notification warning me that I may end up > sharing private data with a wider public. The designs, and the current UI, are based on the idea that you explicitly allow sharing on the current network. The "Share Media on This Network" switch is an example of this. I think we can execute this better, but the idea of manually whitelisting the networks where you want to share makes sense to me. You only typically have one or two networks where you want to share, and we don't want to share irrespective of the network. I don't think that the notification idea is a really good one - most of the time you will not want to share on a new network, and we want to avoid bothering people about this type of thing as much as possible. ... > The second point has a strong overlap with privacy - maybe there should be a > cross-reference to 'Sharing' in the privacy panel ? ... Interesting question - not sure about how you would present this. > The second point also has some similarity with firewall 'zone' configuration - > if a firewall is present, we could additionally set the network zone to 'Home' > or 'Public' when making this sharing change upon first-time connection to the > network. Doing so has the advantage that the firewall may also cover > third-party software that does not pay attention to the GNOME sharing settings. The difficulty I can see here is the case where someone has disabled sharing at some point in the past, then installs an app that needs to use one of the ports that have been closed: here the app doesn't work, and they don't know why.
(In reply to comment #10) > (In reply to comment #0) > > I'd like to see some awareness of the current network environment in our > > sharing setup. > > > > 1) If there is no network, the panel should probably inform me of that, instead > > of happily talking about 'the current network' when there is none. > > Right. I can provide mockups for this if you want. That would be nice.
Initial mockups: https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/sharing/sharing.png I'm a bit uncertain about some aspects of this, but I thought it would be useful to share an initial iteration. Notable changes from the existing design: * Indicate offline state in the panel. * Elaborate the various status strings for each sharing service: "Active" for online and enabled, "Enabled" for enabled but offline, etc. The exact strings and their mapping to the actual states will need a bit more work. * Give each dialog window a status subheading. * Dialog windows include switches. When offline, these indicate position == on, state == off. * Media sharing - show which networks have been approved for media sharing, and allow recently used networks to be selected.
(In reply to comment #12) > Initial mockups: > https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/sharing/sharing.png > > I'm a bit uncertain about some aspects of this, but I thought it would be > useful to share an initial iteration. Notable changes from the existing design: > > * Indicate offline state in the panel. Can you do another pass while also taking Bluetooth sharing into account? (I guess you don't have gnome-user-share installed because Personal File Sharing is missing too).
Great start, Allan. It seems your mockups use 'Offline' where according to your explanation they should say 'Enabled' ? And the screen sharing mockup says 'Enabled' where it should say 'Active' (judging by the blue color of the switch) ? Do these tables capture the intention: subtitle online offline sharing on Active Enabled sharing off Off Offline switch online offline sharing on "on"+blue "on"+gray sharing off "off"+gray "off"+gray a slight complication for this is that multiple network connections can be online at the same time, e.g. home wifi + work vpn. You say 'select networks' and 'select folders' - will there be a selection mode, or is this just click to toggle selected status of each row ? why is there an explicit 'x' only for the 'custom' row ?
I would like to add something, which is more general than the topic of this bug but it is related. IMHO, there is a concept of network profiles, which includes network related settings such as firewall settings, proxy settings and also sharing settings (probably other things too). So I think Gnome should have this concept to manage network related settings. More related to this topic, please don't assume that we have 'a single wired connection' and several wireless connections. We also can have multiple wired connections with different settings. NM currently can have separate settings for wired connections by name, so at least other settings such as sharing should also recognize that (use the connection name rather than 'wired network'). (However (I should probably propose it to NM), some wired networks are also identifiable using the domain name the DHCP server sends, so they should be also recognized automatically just like the way wireless SSID is used to select the connection. sorry for being somewhat off topic)
Created attachment 278846 [details] [review] sharing: Add sharing.ui to the DIST
Created attachment 278847 [details] [review] sharing: Add per-network sharing Using the new D-Bus service from gnome-settings-daemon.
Mockups are at: https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/sharing/sharing-panel.png and: https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/sharing/media-sharing.png
You can add networks to be listed in the tool by changing the gnome-settings-daemon configuration (will require a restart from gnome-settings-daemon, as the only entry point is supposed to be the D-Bus API): gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/gnome-user-share-webdav/ enabled-connections '["Wired connection 2", "Invalid value", "igalia2 - automática"]' Change the network names by any value listed in the NAME column of "nmcli c". You can change "gnome-user-share-webdav" with "rygel" or "vino-server" for the media sharing or the screen sharing configuration.
Created attachment 278988 [details] [review] sharing: Add per-network sharing Using the new D-Bus service from gnome-settings-daemon.
Review of attachment 278846 [details] [review]: glib-compile-resources --generate-dependencies already takes care of this
Review of attachment 278988 [details] [review]: Looks mostly good. The master switches in the dialog headerbars (like priv->media_sharing_switch) should be set insensitive when sharing isn't allowed in the current network, otherwise we get a switch that seems like it should work but doesn't. ::: panels/sharing/cc-sharing-networks.c @@ +129,3 @@ + if (!gsd_sharing_call_list_networks_sync (self->priv->proxy, self->priv->service_name, &networks, NULL, &error)) { + g_warning ("couldn't list networks: %s", error->message); + g_dbus_proxy_set_cached_property (G_DBUS_PROXY (self->priv->proxy), I don't understand this ::: panels/sharing/cc-sharing-panel.c @@ +1306,3 @@ G_CALLBACK (cc_sharing_panel_master_switch_notify), self); + self->priv->sharing_proxy = G_DBUS_PROXY (gsd_sharing_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, This should be cleared in _dispose() ::: panels/sharing/sharing.ui @@ +506,3 @@ </child> + <child type="titlebar"> + <object class="GtkHeaderBar" id="headerbar3"> It would be nice if these headerbars had meaningful Ids. personal-file-sharing-headerbar ? @@ +850,3 @@ </child> + <child type="titlebar"> + <object class="GtkHeaderBar" id="headerbar2"> idem
(In reply to comment #22) > Review of attachment 278988 [details] [review]: > > Looks mostly good. > > The master switches in the dialog headerbars (like priv->media_sharing_switch) > should be set insensitive when sharing isn't allowed in the current network, > otherwise we get a switch that seems like it should work but doesn't. Yep, fixed. > ::: panels/sharing/cc-sharing-networks.c > @@ +129,3 @@ > + if (!gsd_sharing_call_list_networks_sync (self->priv->proxy, > self->priv->service_name, &networks, NULL, &error)) { > + g_warning ("couldn't list networks: %s", error->message); > + g_dbus_proxy_set_cached_property (G_DBUS_PROXY (self->priv->proxy), > > I don't understand this When we fail to get the list of networks from gnome-settings-daemon (such as the proxy not existing), we fake the network being offline, so the UI still looks useful. I fixed that code to use the right type for the SharingStatus. > ::: panels/sharing/cc-sharing-panel.c > @@ +1306,3 @@ > G_CALLBACK (cc_sharing_panel_master_switch_notify), self); > > + self->priv->sharing_proxy = G_DBUS_PROXY (gsd_sharing_proxy_new_for_bus_sync > (G_BUS_TYPE_SESSION, > > This should be cleared in _dispose() Fixed. > ::: panels/sharing/sharing.ui > @@ +506,3 @@ > </child> > + <child type="titlebar"> > + <object class="GtkHeaderBar" id="headerbar3"> > > It would be nice if these headerbars had meaningful Ids. > personal-file-sharing-headerbar ? > > @@ +850,3 @@ > </child> > + <child type="titlebar"> > + <object class="GtkHeaderBar" id="headerbar2"> > > idem Yes, wouldn't it be nice ;) Done.
Created attachment 279091 [details] [review] sharing: Add per-network sharing Using the new D-Bus service from gnome-settings-daemon.
Attachment 279091 [details] pushed as cbeba7c - sharing: Add per-network sharing