FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
176 stars 95 forks source link

Ivalid URL when uses S3 compatibility storage #297

Closed akamajoris closed 2 years ago

akamajoris commented 2 years ago

Bug Report

Hi there.

Steps to Reproduce

  1. Install extension, install s3 requirements
  2. Configure module. Set Endpoint for example as https://s3.fr-par.scw.cloud/
  3. Upload a file
  4. See invalid link in the response
    [upl-image-preview url=https://<bucketname>.s3.fr-par.amazonaws.com/2021-09-10/1631276392-52976-ldpi.png]

Expected Behavior The link should be https://<bucketname>.s3.fr-par.scw.cloud/2021-09-10/1631276392-52976-ldpi.png

The valid setting name of Endpoint is awsS3Endpoint not a cdnUrl that uses in the AwsS3.php file. image

Possible solution(s) replace in file src/Adapters/AwsS3.php $cdnUrl = $settings->get('fof-upload.cdnUrl'); by $settings->get('fof-upload.awsS3Endpoint');

imorland commented 2 years ago

You should also add Content Delivery URL (prefixes files) (just above the S3 settings) to your required value.