Skip to content

TASK: Add MinIO compatibility #37

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Classes/S3Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ protected function getRelativePublicationPathAndFilename(ResourceMetaDataInterfa
{
if ($object->getRelativePublicationPath() !== '') {
$pathAndFilename = $object->getRelativePublicationPath() . $object->getFilename();
} elseif (isset($this->s3DefaultProfile['minio']) && $this->s3DefaultProfile['minio']) {
// If MinIO is used we have to change to url style. Creating an object beneath an object is not supported
$pathAndFilename = $object->getSha1() . '_folder/' . $object->getFilename();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etlam Can you point to the Minio document discussing this limititation ? I use Minio for a few project with Flow ... don't know if i'm lucky but it work with just the path style configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@kdambekalns kdambekalns Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a valid discussion, but is it actually failing for you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we use Sitegeist.Kaleidoscope in our project. I do not know if it would fail without Kaleidoscope.

} else {
$pathAndFilename = $object->getSha1() . '/' . $object->getFilename();
}
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,32 @@ Flownative:
secret: 'abcdefgHIJKLMNOP1234567890QRSTUVWXYZabcd'
endpoint: 'https://storage.googleapis.com/mybucket.flownative.net'
```

## Using MinIO

[MinIO](https://min.io/) is a S3 compatible cloud storage server.
You can also use it to store your assets.

You can then use your key and secret in the settings of the S3 connector.
Additionally you need to specify a custom endpoint which refers to your MinIO instance.
AWS S3 is going to prepend the bucket name to your custom endpoints hostname by default.
Activating the `use_path_style_endpoint` option, the bucket name gets appended to the custom endpoint.
Please do not miss the minio flag, otherwise you may encounter errors with resources stored beneath other resources.

```yaml
Flownative:
Aws:
S3:
profiles:
# Default credentials and client options
# Override these in your settings with real values
default:
credentials:
key: 'QD2AD2B134LQ9SF1CAJB'
secret: 'ak1KJAnotasecret9JamNkwYY188872MyljWJ'
endpoint: 'http://your-minio.com:9000/'
# Prevents the aws client to prepend the bucket name to the hostname
# e.g. http://bucket.your-minio.com:9000/:
use_path_style_endpoint: true
minio: true
```