IPFS version - banner if the page is not current #6

Open
opened 2022-10-17 14:59:41 +02:00 by tree · 8 comments
Owner

We have a situation where we can't push every release to ENS because of the fees, so we'll only throw important milestones in there.

So it can sometimes happen that an IPFS version is not updated

Here's how I would handle it:

  • The IPFS site could try to download the data from ethbrno.cz and see if it's out of date - in which case it could display a warning banner with a link to ethbrno.cz
We have a situation where we can't push every release to ENS because of the fees, so we'll only throw important milestones in there. So it can sometimes happen that an IPFS version is not updated Here's how I would handle it: - The IPFS site could try to download the data from ethbrno.cz and see if it's out of date - in which case it could display a warning banner with a link to ethbrno.cz
tree changed title from IPFS/ENS version enhancements to IPFS version - banner if the page is not updated 2022-10-17 15:00:39 +02:00
tree changed title from IPFS version - banner if the page is not updated to IPFS version - banner if the page is not current 2022-10-17 15:00:46 +02:00
tree added the
enhancement
label 2022-10-17 15:01:18 +02:00
tree added this to the ETHBrno² Website project 2022-10-17 15:01:26 +02:00
Owner

in JSON we will have a version information that will be compared between ipfs and hosted version, in case of difference we will show a banner

in JSON we will have a version information that will be compared between ipfs and hosted version, in case of difference we will show a banner
Owner

@tree would you add the version info or should I try?

@tree would you add the version info or should I try?
Author
Owner

@tree would you add the version info or should I try?

I've already done some versioning here: https://git.gwei.cz/ethbrno/eb2-website/releases

So I just extended it and added it to package.json

Now it adds the version property to data.json automatically at build time:

3f0633aa81

To regenerate data:

npm run make-data
> @tree would you add the version info or should I try? I've already done some versioning here: https://git.gwei.cz/ethbrno/eb2-website/releases So I just extended it and added it to package.json Now it adds the `version` property to data.json automatically at build time: https://git.gwei.cz/ethbrno/eb2-website/commit/3f0633aa81ee43d5941d85840a80270fa6ba9409 To regenerate data: ``` npm run make-data ```
Author
Owner
> cat src/lib/data.json | jq .version
"v2022-10-16"
```bash > cat src/lib/data.json | jq .version "v2022-10-16" ```
Author
Owner

I added to write the data.json file to static as well, so now it is available directly via http:

> curl https://ethbrno.cz/data.json | jq .version
"v2022-10-16"
I added to write the data.json file to static as well, so now it is available directly via http: ```bash > curl https://ethbrno.cz/data.json | jq .version "v2022-10-16" ```
Owner

Access to fetch at 'https://ethbrno.cz/data.json' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Access to fetch at 'https://ethbrno.cz/data.json' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Author
Owner

Access to fetch at 'https://ethbrno.cz/data.json' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

It should work now, i have added:

access-control-allow-origin: *

> Access to fetch at 'https://ethbrno.cz/data.json' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. > > It should work now, i have added: `access-control-allow-origin: *`
Owner

So :) IPFS version should be updated as long as the client does not disable javascript - I used SWR pattern in the end (lame version). Needs to be tested. I am also suggesting two followups to change footer info and display warning in case of disabled javascript.

So :) IPFS version should be updated as long as the client does not disable javascript - I used SWR pattern in the end (lame version). Needs to be tested. I am also suggesting two followups to change footer info and display warning in case of disabled javascript.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ethbrno/eb2-website#6
No description provided.