Skip to content

Conversation

@CarlSchwan
Copy link
Member

@CarlSchwan CarlSchwan commented Aug 15, 2025

Summary

This is faster than going back to nextcloud and setting up the file system to download the files.

TODO

  • Currently in my dev docker setup, the minio service is not available from outside, so the url can't be accessed. There should be a way to configure whether the s3 service is available or not from outside Minio + pre-signed urls juliusknorr/nextcloud-docker-dev#431
  • Also expose the preview url like this (let's move that to a seperate PR)

Checklist

@CarlSchwan CarlSchwan self-assigned this Aug 15, 2025
@invario
Copy link
Contributor

invario commented Aug 17, 2025

FYI I've been working on #53634 to enable previews to generate by passing a presigned URL to ffmpeg.

@ldpr
Copy link

ldpr commented Oct 18, 2025

very excited for this! it'll be a gamechanger for nextcloud users no longer being "choked" behind nextcloud proxying everything. can't wait!
thanks so much @CarlSchwan !!

@ser
Copy link

ser commented Oct 22, 2025

I am also super excited, as it would allow to distribute data geographically with several auto mirroring minio instances across continents. Web browsers are automatically getting the file from the shortest round trip servers.

@artonge artonge linked an issue Oct 29, 2025 that may be closed by this pull request
@volf3n
Copy link

volf3n commented Nov 5, 2025

Oh, this would be amazing for something I've been cooking up on the side!
Any idea how the development is going?

@CarlSchwan CarlSchwan added 3. to review Waiting for reviews pending documentation This pull request needs an associated documentation update and removed 2. developing Work in progress labels Nov 10, 2025
@CarlSchwan CarlSchwan marked this pull request as ready for review November 10, 2025 14:41
@CarlSchwan CarlSchwan requested a review from a team as a code owner November 10, 2025 14:41
@CarlSchwan CarlSchwan requested review from Altahrim, come-nc, icewind1991 and salmart-dev and removed request for a team November 10, 2025 14:41
@lakema17
Copy link

Is there any way we can get a basic guide to testing this PR? I'm looking to get some basic performance data so I can plan my setup ahead of the release (and also have a bit of fun with it)

@CarlSchwan CarlSchwan force-pushed the s3-signed-url branch 2 times, most recently from 09235cc to fd292e4 Compare November 12, 2025 14:55
@CarlSchwan
Copy link
Member Author

Is there any way we can get a basic guide to testing this PR? I'm looking to get some basic performance data so I can plan my setup ahead of the release (and also have a bit of fun with it)

Best way is to test this PR is with juliusknorr/nextcloud-docker-dev#431 just change in .env PRIMARY to minio and start it up with docker compose up minio nextcloud

@CarlSchwan CarlSchwan force-pushed the s3-signed-url branch 3 times, most recently from a9ac87c to 9fa3576 Compare November 19, 2025 11:58
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. How is this behaving for files without read or download permissions?
  2. What happens if the object store is not available publicly?

@CarlSchwan CarlSchwan force-pushed the s3-signed-url branch 2 times, most recently from 93cca86 to e903621 Compare November 19, 2025 13:56
@CarlSchwan
Copy link
Member Author

  • How is this behaving for files without read or download permissions?

I added a check for read. For the download permissions, the downloadUrl dav properties is already completely disabled for shares.

  • What happens if the object store is not available publicly?

This is opt-in an behavior. You need to mark 'use_presigned_url' to true in your config.php for the object store. I need to add it to the documentation

@artonge
Copy link
Contributor

artonge commented Nov 19, 2025

This is opt-in an behavior. You need to mark 'use_presigned_url' to true in your config.php for the object store. I need to add it to the documentation

Should we add a setup check to hint to this new possibility?

Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as is.

@ser
Copy link

ser commented Nov 19, 2025

  • What happens if the object store is not available publicly?

This is opt-in an behavior. You need to mark 'use_presigned_url' to true in your config.php for the object store. I need to add it to the documentation

I would propose to specify the URL instead, as the URL of the front S3 server might be and often is different than the one set internally

@ldpr
Copy link

ldpr commented Nov 20, 2025

Quick question.

Also expose the preview url like this (let's move that to a seperate PR)

Does this mean the actual download url provided to the user within nextcloud while using this PR is still proxied?
The reason I ask is i have a spare install with s3 so i updated it and disabled extensions, then pulled down and applied the patch but downloads are still proxied. It is offsite s3 if that helps, maybe i'm misinterpreting this PR and this is focused on local s3 instead?
Sorry also, I'm just pretty excited to test it out so i'm probably just far too early to be testing. Thanks :)

@ser
Copy link

ser commented Nov 29, 2025

The reason I ask is i have a spare install with s3 so i updated it and disabled extensions, then pulled down and applied the patch but downloads are still proxied.

@ldpr Have you set use_presigned_url?

@ldpr
Copy link

ldpr commented Nov 29, 2025

The reason I ask is i have a spare install with s3 so i updated it and disabled extensions, then pulled down and applied the patch but downloads are still proxied.

@ldpr Have you set use_presigned_url?

Yes, I really should have mentioned that, sorry. It's set within the S3 config block.

This is faster than going back to nextcloud to download the files.

This is an opt-in setting that can be enabled by setting
use_presigned_url in the object store config.

Additionally add support for the proxy config which is needed in a
docker setup. See juliusknorr/nextcloud-docker-dev#431

Signed-off-by: Carl Schwan <[email protected]>
@AndyScherzinger AndyScherzinger merged commit 71c2e94 into master Dec 9, 2025
187 of 189 checks passed
@AndyScherzinger AndyScherzinger deleted the s3-signed-url branch December 9, 2025 11:38
@AndyScherzinger AndyScherzinger added this to the Nextcloud 33 milestone Dec 9, 2025
* @return array{url: ?string, expiration: ?int}|false
* @since 33.0.0
*/
public function getDirectDownloadById(string $fileId): array|false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change for apps that provide a storage wrapper 🙈
Please document accordingly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Surprised me a bit while doing some groupfolders changes; thought it was my fault. ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@joshtrichards joshtrichards Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: the real issue was outdated stubs in gf repo that lacked this new method. All good now (at least in terms of fallback behavior).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement pending documentation This pull request needs an associated documentation update performance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve thumbnail reading performance with more direct access