Closed jqnatividad closed 7 years ago
Hello @jqnatividad I might be missing something here, but ckanext-cloudstorage has supported secure urls for AWS and Azure since the first commit.
@TkTech has a point but I think the key difference in what @jqnatividad is suggesting is using Cloudfront rather than S3, but whether that is actually a bonus will depend on a repository's download volumes and the geographic distribution of downloads.
Hi @TkTech, the context of this request is that we have a user with a lot of large high-value files that they plan to distribute on their CKAN site as @MrkGrgsn suspected.
They don't want to be penalized for success when they release these files in terms of bandwidth overages, so we've formulated a multi-prong strategy to give them a better handle on their bandwidth costs. This includes:
Hello @jqnatividad,
f you want to expose this through CloudFront instead you can subclass the Storage class to add your custom get_url_from_filename()
logic after setting up your Distribution on the AWS CloudFront console. [configuration, client-specific]
If you want to expose torrent links instead you just need to update your template (ex: <a href="{{ storage.get_url_from_filename(...) }}.torrent">...</a>
) since just adding .torrent to the URL will give you a torrent link. [template]
--
Just to summarize, everything you want to do is best done through your client-specific extension and the AWS console, not directly in ckanext-cloudstorage.
ckanext-cloudstorage is intended to support basic CRUD functionality across a significant number of providers in a portable manner more than exposing all possible S3/AWS features, which is best left to your client extension.
Thanks for your expert guidance @TkTech!
Will be sure to implement it per your comment above and share with you and the community our findings with our client-specific extension.
Since boto is already included (#1), consider including Cloudfront signed URL support.
Using boto's create_signed_url, the publisher can ensure that users visit the data portal to download the file, rather than just saving the S3 link: