[GH-ISSUE #189] Extract s3 base domain into a config to use DigitalOcean Spaces or Minio #80

Closed
opened 2026-02-25 22:34:18 +03:00 by kerem · 10 comments
Owner

Originally created by @exfriend on GitHub (Sep 12, 2018).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/189

Originally assigned to: @sadok-f on GitHub.

Something along those lines

       $this->registerS3ServiceProvider($app, $s3Params);
        $app['flysystems']['file_path_resolver'] = function () use ($s3Params) {
            return sprintf('https://s3.%s.%s/%s/', $s3Params['region'], $s3Params['base_domain'], $s3Params['bucket_name']).'%s';
        };
Originally created by @exfriend on GitHub (Sep 12, 2018). Original GitHub issue: https://github.com/flyimg/flyimg/issues/189 Originally assigned to: @sadok-f on GitHub. Something along those lines ``` $this->registerS3ServiceProvider($app, $s3Params); $app['flysystems']['file_path_resolver'] = function () use ($s3Params) { return sprintf('https://s3.%s.%s/%s/', $s3Params['region'], $s3Params['base_domain'], $s3Params['bucket_name']).'%s'; }; ```
kerem 2026-02-25 22:34:18 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@sadok-f commented on GitHub (Sep 12, 2018):

@exfriend thanks for opening this issue.
I'm not sure if I get you right but if you wan to another storage provider such as DigitalOcean Spaces you should write a new StorageProvide class.
Flyimg uses FlySystem as storage provider and they have an Adapter for DigitalOcean:
https://flysystem.thephpleague.com/docs/adapter/digitalocean-spaces/

I hope this'll be helpfull!

<!-- gh-comment-id:420638175 --> @sadok-f commented on GitHub (Sep 12, 2018): @exfriend thanks for opening this issue. I'm not sure if I get you right but if you wan to another storage provider such as `DigitalOcean Spaces` you should write a new `StorageProvide` class. Flyimg uses FlySystem as storage provider and they have an Adapter for DigitalOcean: https://flysystem.thephpleague.com/docs/adapter/digitalocean-spaces/ I hope this'll be helpfull!
Author
Owner

@martinbertinat commented on GitHub (Sep 4, 2019):

Hello! I'm needing the Digital Ocean Storage Provider too..

I know how to do it. It is almost the same as the S3 Adapter, but it is a little different here:

return sprintf('https://s3.%s.amazonaws.com/%s/', $s3Params['region'], $s3Params['bucket_name']).'%s';

I don't know much about Docker, so I don't really know how to start coding so for example: If my container stops I don't want to loose anything!

Can anyone guide me a bit?

Thank you and as you see English is not my primary language.

<!-- gh-comment-id:527700469 --> @martinbertinat commented on GitHub (Sep 4, 2019): Hello! I'm needing the Digital Ocean Storage Provider too.. I know how to do it. It is almost the same as the S3 Adapter, but it is a little different here: return sprintf('https://s3.%s.amazonaws.com/%s/', $s3Params['region'], $s3Params['bucket_name']).'%s'; I don't know much about Docker, so I don't really know how to start coding so for example: If my container stops I don't want to loose anything! Can anyone guide me a bit? Thank you and as you see English is not my primary language.
Author
Owner

@sadok-f commented on GitHub (Sep 5, 2019):

Hi @martinbertinat ,

Thank you for your request, the DigitalOcean API are compatible with those of S3, from Flysystem’s perspective this means you can use the league/flysystem-aws-s3-v3 adapter.
so you can change, the storage_system option in parameters.yml and you put the necessary credentials for DO.

<!-- gh-comment-id:528249241 --> @sadok-f commented on GitHub (Sep 5, 2019): Hi @martinbertinat , Thank you for your request, the DigitalOcean API are compatible with those of S3, from Flysystem’s perspective this means you can use the league/flysystem-aws-s3-v3 adapter. so you can change, the storage_system option in parameters.yml and you put the necessary credentials for DO.
Author
Owner

@martinbertinat commented on GitHub (Sep 6, 2019):

Hello @sadok-f .

Yes I know they are compatible but Digital ocean requires an 'endpoint' parameter, please see my fork: https://github.com/martinbertinat/flyimg/blob/master/src/Core/StorageProvider/S3StorageProvider.php#L50

In line 33 I have to change to not say anything related to amazon. https://github.com/martinbertinat/flyimg/blob/master/src/Core/StorageProvider/S3StorageProvider.php#L33

Thanks

<!-- gh-comment-id:528853335 --> @martinbertinat commented on GitHub (Sep 6, 2019): Hello @sadok-f . Yes I know they are compatible but Digital ocean requires an 'endpoint' parameter, please see my fork: https://github.com/martinbertinat/flyimg/blob/master/src/Core/StorageProvider/S3StorageProvider.php#L50 In line 33 I have to change to not say anything related to amazon. https://github.com/martinbertinat/flyimg/blob/master/src/Core/StorageProvider/S3StorageProvider.php#L33 Thanks
Author
Owner

@ahmadalli commented on GitHub (May 10, 2020):

@exfriend thanks for opening this issue.
I'm not sure if I get you right but if you wan to another storage provider such as DigitalOcean Spaces you should write a new StorageProvide class.
Flyimg uses FlySystem as storage provider and they have an Adapter for DigitalOcean:
https://flysystem.thephpleague.com/docs/adapter/digitalocean-spaces/

I hope this'll be helpfull!

there's an option named endpoint on the url you provided. it's basically using the same s3 provider with extra option

<!-- gh-comment-id:626269735 --> @ahmadalli commented on GitHub (May 10, 2020): > @exfriend thanks for opening this issue. > I'm not sure if I get you right but if you wan to another storage provider such as `DigitalOcean Spaces` you should write a new `StorageProvide` class. > Flyimg uses FlySystem as storage provider and they have an Adapter for DigitalOcean: > https://flysystem.thephpleague.com/docs/adapter/digitalocean-spaces/ > > I hope this'll be helpfull! there's an option named `endpoint` on the url you provided. it's basically using the same s3 provider with extra option
Author
Owner

@github-actions[bot] commented on GitHub (Aug 26, 2023):

This issue is stale because it has been open for 30 days with no activity.

<!-- gh-comment-id:1694113926 --> @github-actions[bot] commented on GitHub (Aug 26, 2023): This issue is stale because it has been open for 30 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 9, 2023):

This issue was closed because it has been inactive for 14 days since being marked as stale.

<!-- gh-comment-id:1712384220 --> @github-actions[bot] commented on GitHub (Sep 9, 2023): This issue was closed because it has been inactive for 14 days since being marked as stale.
Author
Owner

@jonathanlundstrom commented on GitHub (Feb 16, 2024):

I've also created a PR that attempts to solve this by adding support for the endpoint parameter. Hopefully this can be tested soon by the maintainer and merged to the base repository. See PR here: https://github.com/flyimg/flyimg/pull/409

<!-- gh-comment-id:1948176488 --> @jonathanlundstrom commented on GitHub (Feb 16, 2024): I've also created a PR that attempts to solve this by adding support for the `endpoint` parameter. Hopefully this can be tested soon by the maintainer and merged to the base repository. See PR here: https://github.com/flyimg/flyimg/pull/409
Author
Owner

@sadok-f commented on GitHub (Feb 16, 2024):

Hey @jonathanlundstrom,

Thank you for submitting the PR, I'll check it out asap.

<!-- gh-comment-id:1948179610 --> @sadok-f commented on GitHub (Feb 16, 2024): Hey @jonathanlundstrom, Thank you for submitting the PR, I'll check it out asap.
Author
Owner

@sadok-f commented on GitHub (Feb 18, 2024):

Fixed in #409

<!-- gh-comment-id:1951378295 --> @sadok-f commented on GitHub (Feb 18, 2024): Fixed in #409
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#80
No description provided.