NASA-PDS / s3-browser-cloudfront

Web view for files in S3 buckets
Other
1 stars 0 forks source link

As a manager, I want the S3-browser to be deployable and accessible from a '/some_path' URL #68

Open tloubrieu-jpl opened 3 days ago

tloubrieu-jpl commented 3 days ago

Checked for duplicates

Yes - I've already checked

🧑‍🔬 User Persona(s)

Engineering Node system administration and overall path organization.

💪 Motivation

...so that I can the s3-browser can share a domain name with other applications, e.g.

📖 Additional Details

Currently, the application only works if accessible from / for example https://data.pds.nasa.gov We would like to make the application work from a deployment like https://dwfmsppt3a750.cloudfront.net/data/ (in Dev)

Acceptance Criteria

Given When I perform Then I expect

⚙️ Engineering Details

No response

🎉 I&T

No response

eddiesarevalo commented 2 days ago

@anilnatha @tloubrieu-jpl I added an environment variable to the webpack config so that the string matching will be what is set. For example here:

Screenshot 2024-07-02 at 3.29.14 PM.png

It will get it from the webpack config

Screenshot 2024-07-02 at 3.30.56 PM.png

So in the built code it looks like "/data/"==location.pathname

The problem now is the url itself. For example https://dwfmsppt3a750.cloudfront.net/data/catalina-sky-survey/ Going to this url will attempt to open that location so the javascript will never run. Static website host used to cover this part but now we need a non-javascript solution. We could set a cloudfront function to reroute anything /data/* to /data/ or maybe we can do what @anilnatha mentioned and make some sort of proxy.