You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our repository UI (h5ai-nginx) is a simple interface on top of our repository filesystem. It both gives an interface to explore the files, view .json and .sol files and other text files, plus to download the individual files as static files.
We actually don't want people to access files over this endpoint but people started using it this way and there's no going back 😬
With #1328 when we get rid of the repoV1, it will no longer be possible to simply mount the filesystem and give access to these files to the users, because there won't be the same filesystem existing anymore. Since we can't remove this file access method overnight, we need to work around this.
The changes in #1328 will entail doing the workarounds and keeping the API the same for the Server's file access methods. E.g. the repoV1 will be removed but the worked-around endpoints internally will send the exact same API response but this time using repoV2 or the DB (TBD). So for the repo.sourcify.dev static file endpoints we can just redirect people to these server endpoints and the workaround will be handled there.
Since setting up the redirect is independent from actually removing the repoV1 and implementing the workarounds, we can already do this.
The Task
In short, the repo.sourcify.dev static file access endpoints should be redirected to the /server/repository endpoints through its nginx config.
In a PHP script or directly inside the nginx config, we can simply redirect the requests accessing static files to the /server/repository (for staging and production).
The text was updated successfully, but these errors were encountered:
Our repository UI (h5ai-nginx) is a simple interface on top of our repository filesystem. It both gives an interface to explore the files, view .json and .sol files and other text files, plus to download the individual files as static files.
Example:
https://repo.sourcify.dev/contracts/full_match/11155111/0x2738d13E81e30bC615766A0410e7cF199FD59A83/metadata.json
https://repo.sourcify.dev/contracts/full_match/11155111/0x2738d13E81e30bC615766A0410e7cF199FD59A83/sources/contracts/1_Storage.sol
We actually don't want people to access files over this endpoint but people started using it this way and there's no going back 😬
With #1328 when we get rid of the repoV1, it will no longer be possible to simply mount the filesystem and give access to these files to the users, because there won't be the same filesystem existing anymore. Since we can't remove this file access method overnight, we need to work around this.
The changes in #1328 will entail doing the workarounds and keeping the API the same for the Server's file access methods. E.g. the repoV1 will be removed but the worked-around endpoints internally will send the exact same API response but this time using repoV2 or the DB (TBD). So for the repo.sourcify.dev static file endpoints we can just redirect people to these server endpoints and the workaround will be handled there.
Since setting up the redirect is independent from actually removing the repoV1 and implementing the workarounds, we can already do this.
The Task
In short, the repo.sourcify.dev static file access endpoints should be redirected to the
/server/repository
endpoints through its nginx config.Right now the nginx instance will first try to directly access a file given in the URI and return that:
https://github.com/sourcifyeth/h5ai-nginx/blob/aa211ecb4454be61547c9723617e61f7dd5b4fc7/h5ai-nginx.conf#L15-L17
Otherwise it will let the h5ai handle the request: https://github.com/sourcifyeth/h5ai-nginx/blob/aa211ecb4454be61547c9723617e61f7dd5b4fc7/formatAddress.php#L50
In a PHP script or directly inside the nginx config, we can simply redirect the requests accessing static files to the
/server/repository
(for staging and production).The text was updated successfully, but these errors were encountered: