yy4382 / s3-image-port

A dashboard to manage your images in S3 buckets. Can be used as a image hosting service.
https://iport.yfi.moe
Apache License 2.0
29 stars 14 forks source link

More tests should be done when testing connectivity #45

Closed BlockLune closed 5 months ago

BlockLune commented 5 months ago

Currently, when clicking the Test Connectivity button on the S3 Settings page only the result of listObj is used to determine if the connectivity is good or not, but the application connects to the S3 storage bucket with more than just the listObj type of operation.

It would be better to show the connectivity of each operation.

yy4382 commented 5 months ago

The "Test Connectivity" button is employed to verify the validity of the S3 settings. If the listObj request is authorized, it suggests that subsequent operations are unlikely to face unauthorized errors or other types of failures.

As an exception, the public URL attribute is not validated. A potential solution could involve fetching it to ascertain the accuracy of the public URL.

BlockLune commented 5 months ago

The "Test Connectivity" button is employed to verify the validity of the S3 settings. If the listObj request is authorized, it suggests that subsequent operations are unlikely to face unauthorized errors or other types of failures.

As an exception, the public URL attribute is not validated. A potential solution could involve fetching it to ascertain the accuracy of the public URL.

Connectivity should be a broad concept and should validate that all operations of this application are feasible. However, the fact that listObj is valid only means that it is only partially valid. For example, if a user incorrectly fails to give a PUT when setting up the Allowed Methods section of the Cloudflare R2 bucket's CORS, the application will not be able to upload an image properly, and the so-called "upload" functionality's connectivity should be non-connected.

yy4382 commented 5 months ago

For example, if a user incorrectly fails to give a PUT when setting up the Allowed Methods section of the Cloudflare R2 bucket's CORS, the application will not be able to upload an image properly, and the so-called "upload" functionality's connectivity should be non-connected.

Maybe what you need is GetBucketCors - Amazon Simple Storage Service

yy4382 commented 5 months ago

Not every user uses this project for uploading or deleting photos. The GET method is essential, while others are not. We can check for appropriate CORS settings, which should trigger only a warning, not an error.

yy4382 commented 5 months ago

Resolved in #52