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

otevřený
otevřeno 2022-10-17 14:59:41 +02:00 uživatelem tree · 8 komentářů
Vlastník

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 změnil/a název z IPFS/ENS version enhancements na IPFS version - banner if the page is not updated 2022-10-17 15:00:39 +02:00
tree změnil/a název z IPFS version - banner if the page is not updated na IPFS version - banner if the page is not current 2022-10-17 15:00:46 +02:00
tree přidal/a
enhancement
štítek 2022-10-17 15:01:18 +02:00
tree přidal/a toto do projektu ETHBrno² Website 2022-10-17 15:01:26 +02:00
Vlastník

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
Vlastník

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

@tree would you add the version info or should I try?
Autor
Vlastník

@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 ```
Autor
Vlastník
> cat src/lib/data.json | jq .version
"v2022-10-16"
```bash > cat src/lib/data.json | jq .version "v2022-10-16" ```
Autor
Vlastník

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" ```
Vlastník

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.
Autor
Vlastník

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: *`
Vlastník

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.
Přihlaste se pro zapojení do konverzace.
Bez milníku
Žádný projekt
Bez zpracovatelů
2 účastníků
Oznámení
Termín dokončení
Termín dokončení není platný nebo je mimo rozsah. Použijte prosím formát „rrrr-mm-dd“.

Žádný termín dokončení.

Závislosti

Nejsou nastaveny žádné závislosti.

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