-
Notifications
You must be signed in to change notification settings - Fork 663
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
Fix S3 and add generic S3 compatible server support #2376
Conversation
@amosshapira |
I'm one step further. I hardcoded keys and bucket stings and manually added
|
95bc099
to
699d892
Compare
Okay, works now with MinIO:
The question remains whether we want to make |
@urandu |
00288d3
to
870c099
Compare
Signed-off-by: MichaIng <[email protected]>
Merging this now, it fixes the currently non-functional S3 upload service and fine tuning can be done based on beta testing/feedback. |
WIP: AFAIK this still cannot work.
@jmichault
You merged #1063 and finished the class, but it seems you didn't test it?
main.js
prevented secret key and bucket inputs from being used, leading to a failure inboto3
.upload_authorization_key
is handled, initialising it as empty string and then usingmarkHideIfNull
to hide it ifnull
. I'm not sure about the rational behind this, but makes sense to follow existing logics.'upload_bucket_region': $('#uploadBucketRegionEntry').val(),
in the code, which from what I see is never used, but instead you re-used the existinglocation
input, which seems reasonable. Generally I'd suggest to re-use username and password configs for the two keys and just show them with different text, so we have no redundant/empty settings stored in camera configs while only one upload service can be selected anyway.What I'm most unhappy with is that this does not work with other S3 compatible servers, just with AWS. There is another PR for adding MinIO support, but again MinIO only: #1490
This PR may btw help to actually fix the AWS S3 implementation, e.g. see how the configs are handled and persistently stored in camera config.
I wonder whether there is a generic S3 module which works with AWS and MinIO and other S3 compatible servers. From a drop-down we could add a provider selection which translates to a URL (for AWS at least), combined with a "Custom" entry which, when selected, shows an additional custom URL input field.
EDIT: Ah,
boto3
seems to be able to upload to other S3 compatible servers viaendpoint_url
: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.clientAlso, I suggest to not make
boto3
(or whatever it will be) a hard dependency. Instead, when AWS S3 (or any other S3 server) is selected, and the related module is not found, a notification could be shown about how to install the missing module.