-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't sync when device is on cellular/mobile connection #4808
Comments
How would the client know that? |
Maybe, if possible only sync when connected to specific networks. I don't know whether or not this is doable. On Android, the Podcatcher Antennapod has an option that let's the user specify the WiFi-Networks over which sync is allowed. But to do such a check the ownCloud-client would have to know with which network it is connected. Is this even possible on OSX/Linux/Windows? |
On linux most distributions use the Network Manager. You can talk to it via a socket to know which connection is in use. Alternatively it would be nice if there is a way to do it the other way around. A interface (socket/cmd) i can talk to the ownCloud client to tell it to pause syncing, that would help to write a small plugin for the network manager to pause syncing when certain connections are in use. |
This feature is for me more than an enhancement. I use a cellular modem in my laptop and due to the client i regulary wipe my data plan. This occurs very often to me. Of course, i regulary pause synching, but when I'm home i resume synching. Afterwards i forget it and my data plan is gone - its only 750MB. I know at least in Windows 10 it is possible to define any network connection as "clocked" (thats the translation from german, i don't know how it's called on an english windows 10). I wonder if the client could use this information and automatically pause synching when on a "clocked" network in windows 10. |
Utilizing this function https://msdn.microsoft.com/en-us/library/windows/desktop/aa384702(v=vs.85).aspx we could detect at least if we are connected via LAN. With that, we could have a checkbox
however, we probably would like to include WLAN in that too, right? I wonder why the API does not allow that.... |
I use my laptop on ethernet when i'm home, so such kind of checkbox would be sufficient for me. |
@SamuAlfageme Please check for the API to be used on the Windows side for that. What about MAC? |
In Windows10 you can set a network connection as "metered". Windows will use that setting to not download updates... over a "metered" connection. The selection choice is shown in the UI for WiFi and directly-mobile connections, but not for network devices that look like a wired LAN. |
@hodyroff the support reference that @phil-davis links in his comment is a great place to start understanding the options that allow this behavior in Windows: it's a global OS option that wouldn't add logic to the client. As for today; the convergence in Microsoft's OS (mobile and desktop) is making them the only folks offering these kind of options (Apple is almost always assuming his users on the move are working with iOS, which conveniently offers a comprehensive API for this). There exist many apps designed to do this globally and establish some kind of while/black-list of apps that can access the network under some conditions. But they all still rely in the user input (selecting those networks/profiles and apps that are targeted). Some examples to see how they implement this behavior, are: Manually selecting networks that are known to be mobile/tethered is the most effective way to do this. It would be even possible to give the illusion of doing this automatically with some workarounds: e.g. switching between different OS X profiles and Firewall settings to limit the traffic of the application when connecting to specific networks, trying the low level path and detect tethering in the bottom layers of the packages (e.g. checking the manufacturer part of the MAC address, etc.). But all these options add complexity to the client while not being 100% reliable. At the end of the day there must be always some kind of user input about which networks/SSIDs are cellular connections (or need to be seen as such). |
Using Tripmode would also be my recommended workaround. Works on Win and Mac and is only US$7.99. |
For desktop we should suggest using a tool like @SamuAlfageme and @michaelstingl proposed since every other possibility will either require user input (which amounts to roughly the same as configuring such a tool) or won't be 100% reliable. Can we close here? |
None of the suggested alternatives are free software or at least free (plus they require extra trust for doing questionable modifiactions to your operating system), and older Windows versions which are still supported do not have metered connections (but are aware of mobile broadband connections). |
For me it sounds like the right approach is to do this outside of the ownCloud Desktop Client then. When users want to do this, its likely that oC is not the only application they should worry about. If there is currently no free tool, encouraging to develop one seems the best way, rather then try to put this into the ownCloud Client. We have plenty of corner cases to worry about first. We also have the "pause" as a workaround. If strong, new points come up, please don't hesitate to comment further. |
Not really - ownCloud is pretty much the only application that can single-handedly create hundreds of MB of traffic without asking the user. This just happened to me last week, I accidentally used up 70% of my monthly mobile data quota in a few minutes because I didn't realize that ownCloud was running. In that case, "pause" is not a work-around, because at that point it's already too late. |
I am getting that point - still can think of quite some other applications. |
@sagamusix Shouldn't it be possible with firewall configuration? Blocking the oC desktop sync client when connected within the IP range from the mobile provider? As far as I know, this is what Little Snitch does with a fancy UI. |
@hodyroff On a very basic level, this could be implemented in the way @dragotin suggested, at least on Windows. There are probably similar APIs on other platforms. @michaelstingl Interesting idea, I guess on a more simple level I could block ownCloud from accessing public networks, which is not quite the same but a good approximation (and possibly the only way in Windows 7, as you cannot differentiate rules by NIC: https://serverfault.com/questions/229545/how-to-configure-different-firewall-rules-on-2-different-network-cards-in-window). That way, I do not have to rely on specific IP ranges which could change without further notice. |
I'll keep this open as a request / known issue after all. |
I would really appreciate the feature also for the Linux client - most desktops-linuxes are using NetworkManager which provides the information whethter a connection is metered using DBUS: |
Hi, Paul |
Do you use VFS feature? Then it shouldn't eat so much data? |
Note: when a user forces a sync, pop up a dialog to confirm. (Forced syncs have a higher priority in the scheduler.) |
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Test steps are in the PR. |
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
@michaelstingl I cannot find any documentation on how to query/listen for this. I could post a question on the dev forums, but we should probably open a separate ticket to track that. |
Works for me. Does this help?
|
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Add an advanced configuration setting to pause synchronization when a metered internet connection is detected. When the internet connection is metered, and the user chooses to force-sync a folder, they will now be asked if they are sure that they want to do this. Fixes: #4808
Please update the docs issue with the supported platforms: |
Tablets sometimes have mobile broadband onboard. The client should not sync over such connections or even better let the user define that.
IMO it would be best if the client asked upon detecting an unknown connection whether to automatically sync, not sync at all or ask every time for this network. This should be regardless of connection type (LAN, WiFi, Mobile, …) because some USB broadband devices emulate a LAN connection.
This would also solve #4309 and partially solve #1971
The text was updated successfully, but these errors were encountered: