flownative / flow-aws-s3

Amazon S3 adaptor for Neos and Flow
MIT License
18 stars 33 forks source link

keyPrefix not added to baseUri #29

Closed Lemmork closed 3 years ago

Lemmork commented 4 years ago

I'm using version 2.0.4 with Neos 4.3.7 and configured it like this:

Flownative:
  Aws:
    S3:
      profiles:
        default:
          credentials:
            key: 'mykey'
            secret: 'mysecret'
          region: 'eu-central-1'
  Flow:
    resource:
      collections:
        persistent:
          target: 'awsPersistentResourcesTarget'
      targets:
        awsPersistentResourcesTarget:
          target: 'Flownative\Aws\S3\S3Target'
          targetOptions:
            bucket: 'klosterfrau-dev-file-storage'
            keyPrefix: 'my_project/persistent/'
            baseUri: 'https://mycloudfront.cloudfront.net/'

I would expect, that the urls will be generated like this: https://mycloudfront.cloudfront.net/my_project/persistent//filename.jpg but the keyPrefix part is missing and the generated path looks like this: https://mycloudfront.cloudfront.net//filename.jpg

I migrated from flow-google-cloudstorage and there the Resource link was created with the keyPrefix.

baschny commented 3 years ago

@Lemmork just add the prefix also to the baseUri. The prefix is only relevant to the location within the bucket, you could have a setup where you map a specific prefix-path to the cloudfront root and such a "magic append" would just be in the way.