qoomon / aws-s3-bucket-browser

Single page application to browse AWS S3 bucket content
https://qoomon.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.amazonaws.com/spacenet-dataset#
MIT License
246 stars 85 forks source link

index.html isn't being excluded #46

Closed antaenc closed 1 year ago

antaenc commented 1 year ago

Using the current index.html, the keyExcludePatterns: [/^index.html$/] doesn't appear to be working. I'm getting the index.html in the listing of objects.

qoomon commented 1 year ago

which version do you use? For me it seems to work as expected see https://data.payless.health/ the bucket contains an index.html see https://s3-external-1.amazonaws.com/payless.health/?list-type=2&delimiter=/&prefix=&max-keys=10

antaenc commented 1 year ago

Version = 1.11.6 You can see it here: https://senzing-production-yum.s3.amazonaws.com/x86_64/index.html

qoomon commented 1 year ago

Ah I see. In your case you need to set keyExcludePatterns: [/^x86_64/index\.html$/]

antaenc commented 1 year ago

Many thanks, I had to modify it to /^x86_64\/index\.html$/to escape the slash. I can't seem to work out how to exclude the repodata/ folder that is also there, I've tried a few combinations but no joy. What should the exclude pattern look like to also hide repodata/ ?

qoomon commented 1 year ago

Many thanks, I had to modify it to /^x86_64\/index.html$/ to escape the slash.

Sure my bad.

I can't seem to work out how to exclude the repodata/ folder that is also there, I've tried a few combinations but no joy.

Unfortunately this is not possible at the moment because a folder is just a common prefix and is not filtered by keyExcludePatternsthese are only filters for fully qualified keys e.g. `repodata/assets/foo.zip´

However I'll try to make it work also e.g. keyExcludePatterns: [/^repodata\//]

qoomon commented 1 year ago

I was wrong it is working already you just need to find the right key prefix. your excludes should look like these keyExcludePatterns: [/^x86_64\/index\.html$/, /^x86_64\/repodata\// ]

qoomon commented 1 year ago

maybe I should change the behaviour so that exclude patterns are based on rootPrefix : ...

qoomon commented 1 year ago

done. feel free to try version 2.0.0