Skip to content
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

CERN: Synchronisation of shares from the desktop sync client #2972

Closed
labkode opened this issue Jun 14, 2022 · 10 comments
Closed

CERN: Synchronisation of shares from the desktop sync client #2972

labkode opened this issue Jun 14, 2022 · 10 comments

Comments

@labkode
Copy link
Member

labkode commented Jun 14, 2022

  • Only accepted shares will be synced.
  • We'll use a new remote endpoint: /remote.php/webdav/MyShares
    • This is a virtual view (i.e symlink behaviour)

Note that we plan to use the old WebDAV endpoint to introduce this feature (remote.php/webdav/eos/user/h/hugo/...)
We won't be able to introduce a new sync client that talks only Spaces until a migration path is stablished, this issue is stale:
owncloud/ocis#3574

@labkode
Copy link
Member Author

labkode commented Jun 15, 2022

@dragotin @micbar can you provide info on how this feature is being implemented?
And more importantly, how the local folder structure will look like for clients (Linux, Mac and Windows)?

@dragotin
Copy link
Contributor

oCIS edge has virtual views under the routes remote.php/webdav/Shares and also the old, user based Shares path. That means that old clients (version below 3.0.0 which have no spaces knowledge) will find the shared files automatically under that routes. That should not change at all to what you have now.

With the 3.0.0 client, which uses the drives endpoint, the shares will appear as new Space:
grafik
which the user can place anywhere at the local harddisk through the Add-Space Wizard, which is new in the 3.0 client.

The structure by default is like this:

ownCloud - Albert Einstein@localhost/
├── Personal
└── Shares
    └── for-einstein
        └── 800px-Stonehenge_(sun).jpg

but as said, can be adopted by the user.

@labkode
Copy link
Member Author

labkode commented Jul 1, 2022

@dragotin would you be able to show us how the old sync client synchronises shares under a new sync folder pair that talks to remote.php/webdav/Shares?

@labkode
Copy link
Member Author

labkode commented Jul 1, 2022

curl -X PROPFIND ocis.server/remote.php/webdav/Shares

@micbar
Copy link
Member

micbar commented Jul 1, 2022

That works

ocis 2.0.0-beta.4

curl 'https://ocis.ocis-traefik.released.owncloud.works/remote.php/webdav/Shares' \
  -X 'PROPFIND' \
  -H 'authority: ocis.ocis-traefik.released.owncloud.works' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7' \
  -H 'authorization: Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6InByaXZhdGUta2V5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJ3ZWIiLCJleHAiOjE2NTY3NjQwNzYsImp0aSI6ImpRMkUwQWItNm16a01jR3hhclg4MkVSM08taXpVV0o1IiwiaWF0IjoxNjU2Njc3Njc2LCJpc3MiOiJodHRwczovL29jaXMub2Npcy10cmFlZmlrLnJlbGVhc2VkLm93bmNsb3VkLndvcmtzIiwic3ViIjoiaDlKSTVFa0NSWm1XU2NhSEB1bTlNa09nZUdTc2VyTnhMNHNIaGIxaXhsaVMtdGt0cWRXbzJNRGo0cTFrdnBick1BMVdwMFA0ZWdMeHhsRk02ckJvRkFBIiwibGcudCI6IjEiLCJzY3AiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCIsImxnLmkiOnsiZG4iOiJBbGJlcnQgRWluc3RlaW4iLCJpZCI6InVpZD1laW5zdGVpbixvdT11c2VycyxvPWxpYnJlZ3JhcGgtaWRtIiwidW4iOiJlaW5zdGVpbiJ9LCJsZy5wIjoiaWRlbnRpZmllci1sZGFwIn0.D8UcpgUVDrqvHRfct5JDhquSCSU4XZ1cgH6llWAUJcRSZQ0zG0o7rAopARkUgndP61c2S8-jzJOC_YolnjAR81X3O8Fx1Oc5KP5QASRcoDYjg_hYYZrJd0ZQ6znOpPqXSS0wy_9g5GtR0WtzwiFgUziIfbQFj0MHWPKzSpEGKmk8c48CDSxBTjvye5jUFGVGTHk00hGiT2Cze2FU6gfqFrbhEp9Wn3PKgAPt0Eh1N9hE6xOVOYqG7D-r-o-6re94QboKfZBER1Hatl1LMPsYL7SbpqyWWyia3fU4Drct9dXZ1ASKDAy1mIYw0Wk5mExUm2Fejq0b_SPPycRlmnNZyYd-lQzKRgup0YsLTED7fcbv2xkToXOy95ewCCEIBrOUci65mH55moEi2ZgOj6U7jwz8zOw10yxPkU9w4GaVzRNbgYhGyAuUfRe4v25upFQdbKZW3c0-QY0dPPmFxMlYSyxVZ6GbjQUSxl8C7O-Wcjexawp9fOfwUKiAUhGViXByZrnc2tL8wo_LGR1_XTyok9W4BW_GDkQ8n7BfDgZZv1_JbHysVbc978V_7hPOnAKY01kBf1wbV2Dk3WFfyyXo3xF8GgK_Uxv9auv2YNF9LN9qAh0IHL1MTy2V5MOOXih7z29C0sa0cjCDVDO8lH7CCM_VVbWnAIg4A0ZIA7Ow-ew' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/xml; charset=UTF-8' \
  -H 'depth: 1' \
  -H 'ocs-apirequest: true' \
  -H 'origin: https://ocis.ocis-traefik.released.owncloud.works' \
  -H 'pragma: no-cache' \
  -H 'referer: https://ocis.ocis-traefik.released.owncloud.works/files/spaces/personal/1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51?sort-by=name&sort-dir=asc&items-per-page=100' \
  -H 'sec-ch-ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36' \
  -H 'x-request-id: 74c8c33c-eff2-4472-b708-166bcc323a99' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw $'<?xml version="1.0"?>\n<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n  <d:prop>\n    <oc:permissions />\n    <oc:favorite />\n    <oc:fileid />\n    <oc:owner-id />\n    <oc:owner-display-name />\n    <oc:share-types />\n    <oc:privatelink />\n    <d:getcontentlength />\n    <oc:size />\n    <d:getlastmodified />\n    <d:getetag />\n    <d:getcontenttype />\n    <d:resourcetype />\n    <oc:downloadURL />\n  </d:prop>\n</d:propfind>' \
  --compressed | xmllint --format -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2311  100  1875  100   436   7323   1703 --:--:-- --:--:-- --:--:--  9244
<?xml version="1.0"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/Shares/</d:href>
    <d:propstat>
      <d:prop>
        <oc:permissions>S</oc:permissions>
        <oc:favorite>0</oc:favorite>
        <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668</oc:fileid>
        <oc:size>0</oc:size>
        <d:getlastmodified>Fri, 01 Jul 2022 12:14:12 GMT</d:getlastmodified>
        <d:getetag>"733c7ecc76d6d3a5b93ac36aa35869d7"</d:getetag>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:owner-id/>
        <oc:owner-display-name/>
        <oc:share-types/>
        <oc:privatelink/>
        <d:getcontentlength/>
        <d:getcontenttype/>
        <oc:downloadURL/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/webdav/Shares/For%20Hugo/</d:href>
    <d:propstat>
      <d:prop>
        <oc:permissions>S</oc:permissions>
        <oc:favorite>0</oc:favorite>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$7a7aed56-c879-48d0-b820-5f1bb8a736f3!52a6ebb5-5fd6-49c4-8255-6ab28ed808b1</oc:fileid>
        <oc:share-types>
          <oc:share-type>0</oc:share-type>
        </oc:share-types>
        <oc:size>0</oc:size>
        <d:getlastmodified>Fri, 01 Jul 2022 12:14:12 GMT</d:getlastmodified>
        <d:getetag>"733c7ecc76d6d3a5b93ac36aa35869d7"</d:getetag>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:owner-id/>
        <oc:owner-display-name/>
        <oc:privatelink/>
        <d:getcontentlength/>
        <d:getcontenttype/>
        <oc:downloadURL/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

We can see that the share <d:href>/remote.php/webdav/Shares/For%20Hugo/</d:href> is listed there. This endpoint will only list accepted shares.

@labkode
Copy link
Member Author

labkode commented Jul 1, 2022

@micbar that is great! Note that the URLs are:

remote.php/webdav/eos/user/h/hugo/...

and the Shares are not in:

remote.php/webdav/eos/user/h/hugo/Shares

but in /remote.php/webdav/Shares

Just to clarify, as remote.php/webdav/Shares works by chance if your personal home is in /remote.php/webdav/

@micbar
Copy link
Member

micbar commented Jul 1, 2022

@labkode To clarify the behavior of a vanilla ocis regardless of master or edge

Home is /remote.php/webdav
If we do a PROPFIND on this, it includes /remote.php/webdav/Shares

❯ curl 'https://ocis.ocis-traefik.released.owncloud.works/remote.php/webdav/' \
  -X 'PROPFIND' \
  -H 'authority: ocis.ocis-traefik.released.owncloud.works' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7' \
  -H 'authorization: Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6InByaXZhdGUta2V5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJ3ZWIiLCJleHAiOjE2NTY3NjQwNzYsImp0aSI6ImpRMkUwQWItNm16a01jR3hhclg4MkVSM08taXpVV0o1IiwiaWF0IjoxNjU2Njc3Njc2LCJpc3MiOiJodHRwczovL29jaXMub2Npcy10cmFlZmlrLnJlbGVhc2VkLm93bmNsb3VkL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; charset=UTF-8' \
  -H 'depth: 1' \
  -H 'ocs-apirequest: true' \
  -H 'origin: https://ocis.ocis-traefik.released.owncloud.works' \
  -H 'pragma: no-cache' \
  -H 'referer: https://ocis.ocis-traefik.released.owncloud.works/files/spaces/personal/1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51?sort-by=name&sort-dir=asc&items-per-page=100' \
  -H 'sec-ch-ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36' \
  -H 'x-request-id: 74c8c33c-eff2-4472-b708-166bcc323a99' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw $'<?xml version="1.0"?>\n<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n  <d:prop>\n    <oc:permissions />\n    <oc:favorite />\n    <oc:fileid />\n    <oc:owner-id />\n    <oc:owner-display-name />\n    <oc:share-types />\n    <oc:privatelink />\n    <d:getcontentlength />\n    <oc:size />\n    <d:getlastmodified />\n    <d:getetag />\n    <d:getcontenttype />\n    <d:resourcetype />\n    <oc:downloadURL />\n  </d:prop>\n</d:propfind>' \
  --compressed | xmllint --format -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2289  100  1853  100   436   3262    767 --:--:-- --:--:-- --:--:--  4080
<?xml version="1.0"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/</d:href>
    <d:propstat>
      <d:prop>
        <oc:permissions>RDNVCK</oc:permissions>
        <oc:favorite>0</oc:favorite>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51</oc:fileid>
        <oc:owner-id>einstein</oc:owner-id>
        <oc:owner-display-name>Albert Einstein</oc:owner-display-name>
        <oc:size>0</oc:size>
        <d:getlastmodified>Fri, 01 Jul 2022 12:14:37 GMT</d:getlastmodified>
        <d:getetag>"6723ed254b6e0c4b960b1f639d6d1569"</d:getetag>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:share-types/>
        <oc:privatelink/>
        <d:getcontentlength/>
        <d:getcontenttype/>
        <oc:downloadURL/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/webdav/Shares/</d:href>
    <d:propstat>
      <d:prop>
        <oc:permissions>S</oc:permissions>
        <oc:favorite>0</oc:favorite>
        <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668</oc:fileid>
        <oc:size>0</oc:size>
        <d:getlastmodified>Fri, 01 Jul 2022 12:14:12 GMT</d:getlastmodified>
        <d:getetag>"733c7ecc76d6d3a5b93ac36aa35869d7"</d:getetag>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:owner-id/>
        <oc:owner-display-name/>
        <oc:share-types/>
        <oc:privatelink/>
        <d:getcontentlength/>
        <d:getcontenttype/>
        <oc:downloadURL/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

@labkode
Copy link
Member Author

labkode commented Jul 1, 2022

So, to make it more clear:

This call need to work:
/remote.php/webdav/Shares

when the home is in /remote.php/webdav/eos/user/h/hugo or remote.php/webdav/home, basically, outside /

@labkode
Copy link
Member Author

labkode commented Jul 8, 2022

Can we have an example of the OCIS endpoint that we should proxy pass the request going to /remote.php/webdav/Shares?

@micbar
Copy link
Member

micbar commented Nov 10, 2022

Is there still some information needed? AFAICT this works as designed and can be closed.

@micbar micbar closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants