-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Webdav property to advise the sync clients to not sync this entry #26311
Comments
I'd even go as far as to say that these different criteria should be implemented / implementable as apps, which means that core needs to provide hooks (for sabre plugins?) for apps to be able to decide which entries to exclude. |
then people can really go crazy with any custom use cases 😄 |
cc @pmaier1 |
Thanks for taking care of ! |
Keep It Simple and Stupid. |
@AnrDaemon The problem with 403 is that not only sync clients use Webdav. And I don't think we should do user agent checking to do conditional blocking. Another name for this new Webdav property could be "sync permission" for people who prefer that name. 😄 |
We could do that, but my concern is that people will fail to understand why some things are synced and others not. How do we get that reasoning to the clients? First reaction might be to add a string to the XML explaining that. That is hard to do because of translations. It would mean that clients need to send an accept-language header with propfinds and the server needs to parse it in case. Not sure if that is expensive or not. Probably we can do that, but I am not sure if there aren't better alternatives. ... |
Who ? The sysadmins, the developers from third party clients, or the people using the desktop client ? |
So we would check this property only for new folders? and we would still allow the user to check it in the selective sync? So it would be a default off for selective sync? |
@ogoffart hmm, good point. I actually forgot about selective sync and was thinking of a "hard" way of blocking syncing, basically that the desktop client would refuse syncing any of these folders. Yeah, but maybe you're right that it should rather be a suggestion that preselects (or pre de-selects) folders using the selective sync feature. |
Seems there was already a client ticket, linking here owncloud/client#4621 😄 |
Added this to main post_ |
HTTP protocol is extensible by nature.
The code (403) tells CLIENT ITSELF that it shouldn't attempt to repeat the request. |
@AnrDaemon yes, but this would need special handling in every client which are not sync client if they want to use the folder. Because most clients interpret 403 as an error and give up, they'd need to parse the text to find out that in fact it's not an error and they can indeed explore the folder and are only advised not to sync. I think it's best to still return a success response to allow exploration, and add a hint there about the "please don't sync" info. |
Default handling MUST be sufficient. Or a client just poorly written and needs fixing. 403 in itself IS A success response.
(q) RFC 7231 "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content" |
@PVince81 @ogoffart Totally disagree on soft = suggested = preselect folders to exclude where the sync client still would be able to overrule the admins decision to not sync a folder. |
Hello, Please consider and distinguish several cases which are different:
For efficiency reasons PROPFIND with depth 1 (directory listing) should be sufficient for the client to decide if it makes sense to walk a subdirectory. It should not be required |
|
But that would also hide it from the web UI and other clients. Then you'd need the server to decide which client to send which response, based on user-agent (unreliable) or other criteria. |
You're asking an impossible question. You either want this object exposed or not. There's no middle ground. No "web interface vs. desktop client". |
Can anyone point me to the use case to implement this, and reasons why sync filtering should be implemented server side (and not client side)? As a user, if I want to download a file I don't care what the server suggests: if it's there, I want it. The same for files that I don't want to download. Let's make an example with an iOS / android user: The user opens the app, browse some directories, and decide to download a folder with photos. What should be the behaviour of the app if the folder has the "do-not-sync" property?
From the desktop side, as someone has already pointed out, this will lead to frustrations since you will see files from the web UI that won't be synced in the client. If you let the user choose to ignore that property, he will because he hasn't asked for it. I'll remark again: these filters should be done client side. The server should provide enough information for the client to decide whether if it should sync the target folder or not.
If you want to filter out by storage type, you should send that information. Otherwise you'll have to name all your SMB mounts with the same prefix and tell the client to ignore folders starting with whatever prefix, which will lead to issues with local folders sharing the same prefix. We might want to include a server side flag to include those custom / internal / private properties in the result or not. |
I don't think this is about server or client side, but about server AND client side. |
Would be good if people who requested this kind of feature could elaborate on the detailed use real-world case. So far I had the feeling that it was mostly about providing a way for admins to dictate behavior to the clients, similar to how in some enterprises the system administrator can remote setup (provisioning) or remote wipe clients/devices. |
So, you say that you need to create a proprietary functionality, that already confusing people even before implementation, to achieve… what? |
First of all we should differnciate between
The following explanation is on Why does IT has created methods like Active Directory, LDAP, Kerberos ect? It is to authenticate users or machines and grant them access rights to resources. Someone defines the rules and the admin implements them. Lets look for a detailed example in AD: There is a share containing marketing stuff. Some of that is common, some of that has restricted access. Usually you create groups reflecting the rights, assign the grous to the folder or drive and also assign these groups to users. Giving the link to our case, remember - Lets have a more detailed look on possible cases:
As an admin I need to grant access but I also want to restrict from the server side syncing the complete share (hard, no choice!!). Having ony 10 users who are granted access, I would need to sync 15TB. Having a notebook user, 1.5TB would most likely bust his local drive ... Case 2:
As an admin I need to grant access but I also want to restrict from the server side syncing to particular parts of the shared resource (hard, no choice!!). In the example we have an hard exclude of subfolder pictures to all users/groups and an partial exclude of subfolder internal to some users/groups. Hope that this clarifies the stuff and why there is a differentation between Post note: As an example, at the admin page add a new part where you can assign groups (plural!) to the sync types of |
You're making the life harder for yourself without any gain whatsoever. |
After being +30 years in business, I can tell that this capability whould be VERY useful... You are right that you can fake eg the user agent. Even it can be done, no professional would do that and regular users cant do that. If you use ownCloud as playgroud between IT specialists your statement is true. But I expect that the majority of users are regular users and the majority of admins are regular admins. All of them having the same whises and issues eveywhere. |
After being in business for so long, you seems to have grown a habit of making your life complicated, and of your coworkers as well. Let me put it more straightforward. The term "sync" we were frivolously using in conversation up to this point does not constitute an actual action (request). The actions are
Now, where does your "selective sync" comes in play? |
From my POV we should differentiate between admin and user functionality. If a user does not want to sync content, he can use selective sync/ignore list in the client. This covers all suggested use cases if the user has the intention to prevent certain directories from being synced. Regarding admin functionality we have the use case that an admin might want to suggest/enforce (soft/hard) certain directories not to sync globally (e.g. external storage/other dirs) or not to sync particular dirs based on user/group. hard way (blocking) Afaik these requirements can be satisfied with tagging and file firewall. As we chose this mechanism to handle such issues we should probably use it instead of developing new mechanisms that produce inconsistencies. The FF relies on criteria that may easily be spoofed and that are not secure therefore, but this is not a security feature. It rather is an easy-to-use helper for admins whose users make use of the official client. The main thing in this context that comes up to my mind is that we need to inform users about restrictions. soft way (suggestion) It would definitely be nice for an admin to give a suggestion and set syncing defaults for users. Regarding consistency this would then also need to happen within the FF which probably would be inconsistent again since the FF is a tool for hard blocking ultimately. Moreover there is no functionality to inform the client about the reason for restriction. A user should clearly see why some folders are not synced by default.
Wrapping up I think if we want to provide the 'soft way' there's no way around adding a webdav property to let clients know a bit more about imposed restrictions to provide proper user feedback. |
For solution 1 - there is a place for reason, you can give it along with a denial reply. In the reply itself, in the reply body, or both. |
If server has to filter out files, it must do it for good. I mean, the file won't be exposed to ANY client. It's pointless to try to control clients from the server side. At most you might be able to control YOUR client (aka, the official ownCloud desktop client) but not any other. Whatever people do in their own computer is their own business. If I want to download my whole ownCloud account I will, and I don't care if the files are stored outside or if I have to download 10TB. I can go to my ownCloud account and download my root folder, or automate the download with a couple of curl requests. @mmattel for your case1 there are several approaches that fit better:
|
Most of us look to the examples from a very high knowledge and experiene level. Ordianry users do not use curl or any other technology which needs deep knowledge and understanding. They do not even know that these things exist, and just use it and want to use it as a no-brainer. Give them access with the browser, they use it, give them access with a client (sync or dav), they use it. They do not want to spend a lot of brain into it that is not their focus. All users do understand if the admin says, use the browser, use the (dav) client, this is what you can post configure and this is restricted and you can not change for what reason ever. 99.9% of the users do not change or try to fake the standard settings, maybe they ask to be granted access but not more. This causes much less post work to the admin and the users as they just work and do not want to tinker. Just my opinion, based on experience. |
That's how the fall starts. First you separate people into "ordinary" and "some other", then you point to a chosen group and say "look, they are not complaining and very content with features we provide, we should continue in this direction". That's how Windows 10 was born. |
FYI The 2.3 client has an option now "Ask for confirmation before synchronizing external storages" which should already help for a lot of scenarios. |
This is very good and useful !! From the client side, clients (human) do not know and/or care if the storage behind is external or not, they just see "folders". And client side choices are, by design, not oC admin driven. |
Would it be easier for all implementations to get a new flag inside the oc:permissions? soft: Something like an "advisory soft don't sync"? hard: We of course return a 403 for that file/folder. However I think there should also be a flag in permissions being returned so that the clients can avoid even doing those unsucessful network requests? So two new permissions in core/apps/dav/lib/Connector/Sabre/Node.php Line 291 in f10d105
|
New property or not doesn't affect server implementation that much. Not sure about clients... |
Yes. I agree that there are two cases: soft and hard "do-not-sync". This will provide a general framework to fit most of the applications. Soft is anything that is just advisory and may be overriden by the client settings. However hard means that the server will return 403 (or equivalent) when the client tries to access the subfolder. Therefore it does not make any sense for the client to try (or retry) to access this. It makes sense to have this as a webdav property to avoid calls which we know will return 403. The client side logic could be the following:
You may take into account that this property may be modified in the future. So you should not cache forever (if at all) the value of this property on the client side. If a request fails with 403 then one should see the property of enclosing parent folders. You can imagine that X/Y/Z fails with 403 but also X/Y fails with 403 because X is hard-do-not-sync. This can happen in the middle of the sync run if server property is modified but the subsequent sync run should handle it well. My particular use-case for this is hard: a part of the tree is not readible by the current user. |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io. |
There are several tickets that propose different approaches and different criteria for sync exclusions.
Regardless of the criteria, I think the basic mechanism should be that the server returns an extra Webdav property
<oc:do-not-sync>1</oc:do-not-sync>
to tell the client to not sync this item.It is then the responsibility of apps or whichever code that decides what the exclusion criteria is to set the property on the entries.
This is purely the backend/protocol level.
Some proposed criteria that would need to be implemented separately:
@owncloud/filesystem @guruz @ogoffart @dragotin @davivel @DeepDiver1975 @butonic
The text was updated successfully, but these errors were encountered: