ci: Make Relative Script for CI/CD and Decentralization #4

Open
opened 2024-03-22 02:14:38 +00:00 by p1r0 · 1 comment
Owner

The goal is to do a make relative script.

Issues

Currently there is an issue that when the website is decentralized over IPFS, the address is the
directory IPFS CID, usually the build static sites do not have a relative links which is the recomended way to access ipfs websites[1].

Also an specific of some sites the startpage usully directs to index.html as a file but not a path which should be either the domain in case of using something like IPNS poiting to the main directory or perhaps using / instead (but this is still untested).

ToDo

  • Research on all-relative[2] and make-relative[3]: diferences and if they fix the issue with the index.html

  • Make test con changing the index.html to / or look for possible solutions on mdbooks similar to middleman config for ipfs[4].

  • Write the script to build and make relative

  • Document the procedure in the README.md

References

  1. ipfs-tech, static-site-generators, https://docs.ipfs.tech/how-to/websites-on-ipfs/static-site-generators/#static-site-generators , 2024-03-21.
  2. Oli Evans , all-relative, https://github.com/olizilla/all-relative , 2024-03-21.
  3. Tom MacWright, make-relative, https://github.com/tmcw/make-relative , 2024-03-21.
  4. ipfs-tech, middleman, https://docs.ipfs.tech/how-to/websites-on-ipfs/static-site-generators/#middleman , 2024-03-21.
The goal is to do a make relative script. ## Issues Currently there is an issue that when the website is decentralized over IPFS, the address is the directory IPFS CID, usually the build static sites do not have a relative links which is the recomended way to access ipfs websites[1]. Also an specific of some sites the startpage usully directs to index.html as a file but not a path which should be either the domain in case of using something like IPNS poiting to the main directory or perhaps using `/` instead (but this is still untested). ## ToDo - [ ] Research on [all-relative](https://github.com/olizilla/all-relative)[2] and [make-relative](https://github.com/tmcw/make-relative)[3]: diferences and if they fix the issue with the index.html - [ ] Make test con changing the index.html to / or look for possible solutions on mdbooks similar to [middleman config for ipfs](https://docs.ipfs.tech/how-to/websites-on-ipfs/static-site-generators/#middleman)[4]. - [ ] Write the script to build and make relative - [ ] Document the procedure in the `README.md` ## References 1. ipfs-tech, static-site-generators, https://docs.ipfs.tech/how-to/websites-on-ipfs/static-site-generators/#static-site-generators , 2024-03-21. 2. Oli Evans , all-relative, https://github.com/olizilla/all-relative , 2024-03-21. 3. Tom MacWright, make-relative, https://github.com/tmcw/make-relative , 2024-03-21. 4. ipfs-tech, middleman, https://docs.ipfs.tech/how-to/websites-on-ipfs/static-site-generators/#middleman , 2024-03-21.
p1r0 added the
enhancement
label 2024-03-22 02:14:38 +00:00
Author
Owner

it seems that make-relative compared to all-relative can rewrite the index.html path to the domain name and thus the IPNS, which also fixes the issues if other sites that cannot disable redirect to index.html.

The following steps also need to be forefilled:

  1. There is a basic and clean redirect required on the nginx without need to specify.
    server_name docs.deca.eco;
    large_client_header_buffers 16 5120k;

    location / {
        proxy_pass http://ip:8080;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

  1. Dnslink txt record must be set to solve the IPNS.
$ dig +noall +answer TXT _dnslink.docs.deca.eco                                     
_dnslink.docs.deca.eco.	1065	IN	TXT	"dnslink=/ipfs/bafybeib4sxtgjdcermneawetinfbtovec36lfyjn5gavmthyibnufgsyea"

  1. A+ registry to ip where the nginx host lives.
it seems that make-relative compared to all-relative can rewrite the `index.html` path to the domain name and thus the IPNS, which also fixes the issues if other sites that cannot disable redirect to `index.html`. The following steps also need to be forefilled: 1. There is a basic and clean redirect required on the nginx without need to specify. ```nginx server_name docs.deca.eco; large_client_header_buffers 16 5120k; location / { proxy_pass http://ip:8080; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } ``` 2. Dnslink txt record must be set to solve the IPNS. ```sh $ dig +noall +answer TXT _dnslink.docs.deca.eco _dnslink.docs.deca.eco. 1065 IN TXT "dnslink=/ipfs/bafybeib4sxtgjdcermneawetinfbtovec36lfyjn5gavmthyibnufgsyea" ``` 3. A+ registry to ip where the nginx host lives.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 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: DECA/docs#4
No description provided.