On a vanilla Phoenix deployment (phoenix.owncloud.com) when you click on "All files" the URL path is relative to the logged in user:

We need to make the path shown when clicking on "'All files" configurable to expose a global view of all storages:

In this example, when clicking on "All files" the URL points to the home folder of the user, but the user can navigate the ancestors of the tree and have the same behaviour and experience when accessing the filesystem directly.
Moreover, this mapping allows to copy/paste the URL and give it to someone to share, no need to have a private link generated, our users did that many times in the past and with this behaviour we increase the accessibility of the service.
We need a configuration option in Phoenix to map a click on "All files" to arbitrary paths.
The map should allow for dynamic configuration of the user, for example:
{
"home_mapping": "/eos/user/$first_letter/$username"
}
Maybe a option in the config.json on runtime?
It will be better that we don't need to recompile Phoenix and have to maintain our own images.
In config.json we have option rootFolder which can specify a folder to be loaded when entering file list. That hides though all the folders that are before that. "rootFolder": "/eos/user/$first_letter/$username" this would result then in opening that folder but not seeing anything in breadcrumbs. Not sure if that then solves your use case? @labkode What we would also need to do is translate the vars into real values.
However, this was originally implemented as a workaround and we wanted to let the server handle which folder should be displayed as a root folder in the webUI. @butonic What do you think about that approach? Is this something that would be too complex/too much effort? We can still stick with this workaround in the config but there might be some loose ends - at some point we stopped using that value and just default back to /. Some actions as e.g. upload or create could be then broken.
Hi @LukasHirt , the solution you proposed is almost we are looking for, is only missing the breadcrumbs.
Server side we can expose root (/) but then that will not match the user expectations when clicking on "All my files" as this points to a place that doesn't belong to any particular user.
Can you add the breadcrumb functionality?
This is only a UI functionality, underlying functions like upload should work the same depending where the user is.
The "All my files" is just a pointer like a favourite.
Ok, then we'd need to switch the approach of the feature. Basically select a default folder instead of "replacing" it.
The functionality needed to be adjusted because of the folder being treated as the root and not as the subfolder. We needed then to always specify it in that logic that e.g. file should be uploaded in that folder and not in /. ~I'll bring this up to pm so they are aware of this feature.~ We'll keep this in mind in the next sprint planning.
Is the expectation here, to just make the path visible in the breadcrumbs and still jail the user in their home? Or is a user allowed to access / and just needs another home folder as default location?
Users are allowed to access other paths, eg. /projects/atlas or /eos/users/h/hugo.
@diocas This will however only work properly with https://github.com/cs3org/reva/pull/1346 (which is already merged). You will need to set a prefix for the share with me listing.
@labkode why does it have to be a templateable path? The share with me links need tho home folder anyway. Shouldn't All my files always use the /home prefix?
The idea is that we no longer use /home anywhere. We want to expose always the full EOS path. (the shared with me should point to the full path)
We want users to copy the URL, give it to someone else, and still work. So we don't want users to land on /home relative to someone else, otherwise this flow is broken.
but users can only acces shares using the /home/MyShares folder. The share manager, who is responsible for the result of the listshares with me response does not know anything about mount points. it only knows the id reference. so ocs has to do a stat for every (accepted) item in the share list to fill in details like size and owner display name. While stat info does have a Path property it is relative to the storage root. So you would have to add logic in the gateway to prefix the path of every fileinfo result (as a stat response or part of a fileinfo) with the mount point of the storage in the global namespace.
This affects all clients, because the paths in shared with me results are supposed to be relative to the unsers home ... historically grown. Cannot be changed at will because it will break clients and have weird sideeffects like the ios app running a discovery on these paths ...
this is a list shares with me example:
curl 'https://demo.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json&shared_with_me=true&state=all&include_tags=true' -u demo:demo | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1366 100 1366 0 0 4913 0 --:--:-- --:--:-- --:--:-- 4896
{
"ocs": {
"meta": {
"status": "ok",
"statuscode": 100,
"message": null,
"totalitems": "",
"itemsperpage": ""
},
"data": [
{
"id": "8",
"share_type": 0,
"uid_owner": "admin",
"displayname_owner": "admin",
"permissions": 31,
"stime": 1606850086,
"parent": null,
"expiration": null,
"token": null,
"uid_file_owner": "admin",
"displayname_file_owner": "admin",
"additional_info_owner": null,
"additional_info_file_owner": null,
"state": 0,
"path": "/Photos (2)",
"item_type": "folder",
"mimetype": "httpd/unix-directory",
"storage_id": "shared::/Photos (2)",
"storage": 2,
"item_source": 42,
"file_source": 42,
"file_parent": 6,
"file_target": "/Photos (2)",
"share_with": "demo",
"share_with_displayname": "demo",
"share_with_additional_info": null,
"mail_send": 0,
"attributes": null,
"tags": []
},
{
"id": "10",
"share_type": 0,
"uid_owner": "admin",
"displayname_owner": "admin",
"permissions": 19,
"stime": 1606850103,
"parent": null,
"expiration": null,
"token": null,
"uid_file_owner": "admin",
"displayname_file_owner": "admin",
"additional_info_owner": null,
"additional_info_file_owner": null,
"state": 0,
"path": "/Example.odt",
"item_type": "file",
"mimetype": "application/vnd.oasis.opendocument.text",
"storage_id": "shared::/Example.odt",
"storage": 2,
"item_source": 41,
"file_source": 41,
"file_parent": 6,
"file_target": "/Example.odt",
"share_with": "demo",
"share_with_displayname": "demo",
"share_with_additional_info": null,
"mail_send": 0,
"attributes": null,
"tags": []
}
]
}
}
The file_targetis relative to the users home. In oc10 this can be shown by moving the share to a subfolder:
curl 'https://demo.owncloud.com/ocs/v1.php/apps/files_sharing/api/v1/shares?format=json&shared_with_me=true&state=all&include_tags=true' -u demo:demo | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1460 100 1460 0 0 4786 0 --:--:-- --:--:-- --:--:-- 4771
{
"ocs": {
"meta": {
"status": "ok",
"statuscode": 100,
"message": null,
"totalitems": "",
"itemsperpage": ""
},
"data": [
{
"id": "8",
"share_type": 0,
"uid_owner": "admin",
"displayname_owner": "admin",
"permissions": 31,
"stime": 1606850086,
"parent": null,
"expiration": null,
"token": null,
"uid_file_owner": "admin",
"displayname_file_owner": "admin",
"additional_info_owner": null,
"additional_info_file_owner": null,
"state": 0,
"path": "/subfolder/deeper/Photos (2)",
"item_type": "folder",
"mimetype": "httpd/unix-directory",
"storage_id": "shared::/subfolder/deeper/Photos (2)",
"storage": 2,
"item_source": 42,
"file_source": 42,
"file_parent": 419,
"file_target": "/subfolder/deeper/Photos (2)",
"share_with": "demo",
"share_with_displayname": "demo",
"share_with_additional_info": null,
"mail_send": 0,
"attributes": null,
"tags": []
},
{
"id": "10",
"share_type": 0,
"uid_owner": "admin",
"displayname_owner": "admin",
"permissions": 19,
"stime": 1606850103,
"parent": null,
"expiration": null,
"token": null,
"uid_file_owner": "admin",
"displayname_file_owner": "admin",
"additional_info_owner": null,
"additional_info_file_owner": null,
"state": 0,
"path": "/subfolder/Example.odt",
"item_type": "file",
"mimetype": "application/vnd.oasis.opendocument.text",
"storage_id": "shared::/subfolder/Example.odt",
"storage": 2,
"item_source": 41,
"file_source": 41,
"file_parent": 412,
"file_target": "/subfolder/Example.odt",
"share_with": "demo",
"share_with_displayname": "demo",
"share_with_additional_info": null,
"mail_send": 0,
"attributes": null,
"tags": []
}
]
}
}
The file_target remains relative to the users home.
Being able to prefix the file_target in ocs with eg /home/Shares would only be a workaround. I learned that the desktop client supports prefixing the path ... but thet only realld works when exposing a global namespace at remote.php/webdav. And what do you show at remote.php/dav/file/einstein? because android and ios only use the latter endpoint ... you would have to expose the global namespace there ... which does not work because now your URL contains the userid and cannot be copy pasted...
Or are iOS and android supposed to work differently?
cc @michaelstingl
@labkode @diocas you can find documentation for the configuration of the homeFolder here: https://owncloud.github.io/clients/web/getting-started/#configuration