Giter Site home page Giter Site logo

Comments (6)

oxyno-zeta avatar oxyno-zeta commented on May 27, 2024 1

Hello,

Thanks 😃 . I tried to be reactive on my projects.

Yes this solution can add latency if the list is big enough but it is difficult to put it in place for users. This will be done for all path including files. That's why I said that this solution don't work for your case...

I'm working on the other solution. Code is done, need to add documentation and tests. Hope this will be in the next release !

from s3-proxy.

chiefy avatar chiefy commented on May 27, 2024 1

Awesome, thanks @oxyno-zeta - will definitely test it out when ready, it's working great other than that for us serving up 12 static sites internally!

from s3-proxy.

oxyno-zeta avatar oxyno-zeta commented on May 27, 2024 1

I finally succeeded by releasing a new version ! 3.2.0 is out with the feature you wanted. See in the GET action part. Thanks for your issue !

from s3-proxy.

oxyno-zeta avatar oxyno-zeta commented on May 27, 2024

Hello,

That's another good issue 👍 .

I must confess that I already had this problem but I didn't find any solution just by changing the code... The problem I have is that, I can't know that a path can be a "folder". In S3, folders don't exists. It's a human view if I can say this :). In S3 list results, what we consider as folders are other levels of "prefixes" that are given as "commonPrefixes" list and there are at the end of the paginated list !... To get them, all the paginated results must be fetched... Hope it is more clear about the problem.

But, you give me another idea with your issue.

What I can imagine now is to add an option with a list of glob path that will consider all path under those as a "folder" per se and will be served as served so indexDocument option will be used.
This will force a redirect on client side in order to manage it correctly after.

This will be represented as this for example:

targets:
  - name: first-bucket
    mount:
      host: api.localhost:8080
      path:
        - /v2/
    bucket:
      name: oxyno-test
      region: eu-west-1
    indexDocument: index.html
    forceTrailingSlashPathList:
    - /folder1/**
    - /**

An example of flow will be:

-> http://api.localhost:8080/v2/folder1 -> TEMPORARY REDIRECT 302 http://api.localhost:8080/v2/folder1/ -> match as "folder"

What do you think of this ? Is this idea can solve your problem ?

By the way, this seems to be a good idea to do for me 😄 . I will probably do it for other usages.

Thanks !

EDIT: This solution doesn't work for your case. I'm searching another solution.

EDIT 2: I probably found a way by adding another option to force redirect with trailing slash in case of not found file (specifically file). This is working in your case. I need to develop it better than just a POC in local 😃 .

from s3-proxy.

chiefy avatar chiefy commented on May 27, 2024

Hey, thanks again for your quick reply. I don't know how scalable the forceTralingSlashPathList would be or if it would cause added latency? I do like the force-redirect in the case of 404!

from s3-proxy.

oxyno-zeta avatar oxyno-zeta commented on May 27, 2024

@chiefy Cool to read that ! Awesome ! It is really cool for me to see that this project is used 😃 .

The feature is on the master branch but I discovered a huge bug in the authentication part that must be solved. I will fix this before releasing, sorry for the delay :(

from s3-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.