Repository navigation
Description
After owncloud/core#28984 has been implemented on the server side, the private link generation in desktop client needs a small rework, so parameters in config.php like overwritehost are applied to the link…
config/config.php
'trusted_domains' =>
array (
0 => 'mycloud.example.com',
1 => '10.135.63.184',
2 => 'overwritecloud.example.com',
),
'datadirectory' => '/var/www/owncloud/data',
'overwrite.cli.url' => 'https://overwritecloud.example.com',
'overwritehost' => 'overwritecloud.example.com',
Expected behaviour
Client should respect overwritehost parameter from config.php for private link generation, same as for public link generation. (Step 5.)
Actual behaviour
Client ignores overwritehost parameter from config.php for private link generation (Step 4.)
Steps to reproduce
- Install
2.4.0.*-nightly - Restart
explorer.exe - Right-click folder > ownCloud > Copy private link to clipboard
==>https://mycloud.example.com/index.php/f/00000171 - Right-click folder > ownCloud > Share…
- Public Links > Create new > Copy link to clipboard
==>https://overwritecloud.example.com/index.php/s/8fJt9YgSZBOmY0o
Server configuration
Operating system:
Ubuntu 16.04.3 LTS
Web server:
Apache/2.4.18 (Ubuntu)
Database:
10.0.31-MariaDB-0ubuntu0.16.04.
PHP version:
PHP 7.0.22-0ubuntu0.16.04.1
ownCloud version:
{"installed":"true","maintenance":"false","needsDbUpgrade":"false","version":"10.0.3.2","versionstring":"10.0.3 RC1","edition":"Enterprise","productname":"ownCloud"}
Storage backend (external storage):
no
Client configuration
Client version:
ownCloud-2.4.0.8310-nightly20170911-setup.exe
Operating system:
Win 8.1, 32-bit
OS language:
EN
Qt version used by client package (Linux only, see also Settings dialog):
5.6.2
Client package (From ownCloud or distro) (Linux only):
Installation path of client:
default
@SamuAlfageme How does the API work? Is this a client or server issue?
Activity
michaelstingl commentedon Sep 12, 2017
A user reported, private links in the mobile Apps ignore
overwritehostparameter too, while public link generation works correct. Perhaps it's a server issue…SamuAlfageme commentedon Sep 12, 2017
@michaelstingl I don't think this core feature ever really reached any of ownCloud's native clients. (It's the first time I'm hearing about it).
"url"field in the ocs-reply, if the server sets this one correctly, it'll be the one used:So yeah, It's a direct consequence of not having a "private link generation endpoint" but rather a spec of how those should be without taking into account the
overwritehost(IMO that should be transparent to the client)michaelstingl commentedon Sep 12, 2017
If there is no proper API for private link generation yet, I'd vote to remove the feature from the clients for now.
There is also only an experimental PR to resolve private links where @PVince81 isn't sure if the technical approach is acceptable:
owncloud/core#28947
/cc @pmaier1
PVince81 commentedon Sep 12, 2017
Do you need an API for generating private links ? If needed we could add an additional PROPFIND attribute "oc:privatelink" containing the relative or absolute URL that can be reused as is.
Advantage: the server controls the format of the link, no client is required to implement an algorithm to compute said links.
Disadvantage: more data is transferred as every entry in the PROPFIND result would have such link (if the attribute was requested)
SamuAlfageme commentedon Sep 12, 2017
@PVince81 endpoint would be quite handy for it considering this issue, yup (see complexity and discussion on #5763)
I think we don't need to transmit all the file private links on PROPFIND basis (since all of those would belong to the same "domain") but on demand, reducing the overhead and relying on the server reply on runtime rather than storing those in a DB.
Perhaps we could add a 5th ("
private")shareTypeto ocs endpoint https://doc.owncloud.org/server/10.0/developer_manual/core/ocs-share-api.html#create-a-new-share ?michaelstingl commentedon Sep 12, 2017
Sure, I prefer proper generation on the server side, instead of implementing it based on assumptions 3x on all client platforms.
PVince81 commentedon Sep 12, 2017
On-demand would mean that the client needs to do an extra PROPFIND on the file's endpoint and only query the "oc:privatelink" property.
Adding this property on the server is trivial. Raised here as junior job: owncloud/core#28984
[-][2.4.0] Client ignores overwritehost parameter from config.php for private link generation[/-][+]Adapt private link generation to core#28984[/+]ckamm commentedon Sep 12, 2017
Adding a property to discover a file's private link that's accessible via PROPFIND sounds good to me!
ckamm commentedon Sep 15, 2017
The new property is called
privatelinkand there's a newfiles/privateLinkscapability.SamuAlfageme commentedon Oct 17, 2017
Neat! 👍