Skip to content
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

Issue on BackBlaze B2's S3 compatibility and possible solution #341

Open
SumiHeart opened this issue Jul 26, 2023 · 2 comments
Open

Issue on BackBlaze B2's S3 compatibility and possible solution #341

SumiHeart opened this issue Jul 26, 2023 · 2 comments
Labels

Comments

@SumiHeart
Copy link

Bug Report

Current Behavior
After setting the S3 content correctly to BackBlaze B2 (reference: https://www.backblaze.com/docs/cloud-storage-use-the-aws-sdk-for-php-with-backblaze-b2) (which includes key and endpoint), a 500 error always appears when trying to upload a file.

Steps to Reproduce

  1. Set up S3’s key, bucket, endpoint...etc. details.
  2. Attempt to upload a file while publishing an article in the frontend (with permitted MIME settings).
  3. Receive the following error message.

Expected Behavior
Should be able to upload correctly due to compatibility between B2 and S3.

Environment

  • Flarum version: 1.8.1
  • Extension version: 1.2.3
  • Website URL: https://forum.azk.ie
  • Webserver: LiteSpeed
  • Hosting environment: dedicated server
  • PHP version: 8.2.7
  • Browser: Chrome 115

Possible solution(s)

The issue can be resolved currently by modifying the code within the src/Adapters/AwsS3.php file from:

if ($acl = $settings->get('fof-upload.awsS3ACL')) {
    $config->set('ACL', $acl);
}

to the following:

$acl = $settings->get('fof-upload.awsS3ACL');
$config->set('ACL', $acl);

This will allow files to be uploaded correctly.

Additional Context
Initially, I thought the issue was with the ACL settings. However, even after following the instructions at https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl, I am still unable to successfully upload. Interestingly, if ACL exists within $config, even if it's empty, uploading is permitted. Although this might not be the best solution, it does provide a temporary workaround and perhaps better solutions can be sought.

@SumiHeart SumiHeart added the bug label Jul 26, 2023
@Javier-Rotelli
Copy link

this is caused by the same problem as #328 . currently there's no way to use a custom s3 endpoint

@hiepvq
Copy link

hiepvq commented Nov 27, 2023

@luceos this code to put where place? https://github.com/FriendsOfFlarum/upload/wiki/aws-s3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants