Support S3 Server Side Encryption with custom key#3192
Support S3 Server Side Encryption with custom key#3192tuxgasy wants to merge 4 commits intomotioneye-project:devfrom
Conversation
|
MD5 hash of the encryption key is required. How to ignore the failing check ? |
0ab3648 to
eda83cc
Compare
motioneye/uploadservices.py
Outdated
| s3.upload_file( | ||
| filename, | ||
| self._bucket, | ||
| filename[(len(target_dir)+1) :], |
There was a problem hiding this comment.
The +1 was added to remove the last slash as well? Did this always appear in the resulting key? But what happens if the target_dir is passed with trailing slash? I am currently not sure whether it is striped somewhere, otherwise we could either target_dir.rstrip('/') or alternatively filename[len(target_dir) :].lstrip('/') to achieve the same effect.
There was a problem hiding this comment.
Ohh, it seems to be actually solved better here: https://github.com/motioneye-project/motioneye/pull/2760/changes
Let me merge this first.
Signed-off-by: MichaIng <micha@dietpi.com>
2a8441c to
5de0275
Compare
|
@tuxgasy |
Without SSECustomerKeyMD5, I get the following error message : |
|
This is latest boto3? Weird, the docs say it is not needed: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/upload_part.html However, if it does not work reliably without, I'll add it back in. Since I want to fix/merge #2760 first, can you confirm that using slashes in the filename creates subdirectories on the S3 server? |
The subdirectories are created on S3 server. But when I disable We need to check if |
Add a supports of Server Side Encryption known as SSE-C for compatible S3 bucket provider.
The encryption is performed on the S3 server with the provided key. The key is not stored on the S3 server. To download encrypted file, you must therefore provide the same key.
The encryption key must be a base64 encoded string with a length of 32 bytes. You can generate one as following:
openssl rand 32 | base64