Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run build
name: Run

on:
push:
Expand All @@ -8,19 +8,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
sha256_wasm: ${{ steps.build_wasm.outputs.sha256_wasm }}
sha256_js: ${{ steps.build_wasm.outputs.sha256_js }}
cidv0: ${{ steps.build_webapp.outputs.cidv0 }}
cidv1: ${{ steps.build_webapp.outputs.cidv1 }}
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Run node tests
- name: Node tests
run: |
npm --prefix javascript/ install
npm --prefix javascript/ run test
Expand Down Expand Up @@ -78,3 +73,47 @@ jobs:
with:
name: dist
path: dist/

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
id: build
run: |
docker buildx build --platform=linux/amd64 -t ipfs-boot .
docker run --rm -i --platform=linux/amd64 -v ./dist:/root/dist ipfs-boot | tee out.txt

- name: Check CIDv0
run: |
a=$(cat out.txt | grep CIDv0 | awk '{print $3}')
b=$(cat README.md | grep CIDv0 | awk '{print $4}')
bash -c '[ "$a" == "$b" ]' || exit 1
echo "CIDv0 ok"
echo "$a $b"

- name: Check CIDv1
run: |
a=$(cat out.txt | grep CIDv1 | awk '{print $3}')
b=$(cat README.md | grep CIDv1 | awk '{print $4}')
bash -c '[ "$a" == "$b" ]' || exit 1
echo "CIDv1 ok"
echo "$a $b"

- name: Check Href 1
run: |
a=$(cat README.md | grep dweb.link | grep done | awk '{print $3}')
b=$(cat out.txt | grep CIDv1 | awk '{print $3}')
b="https://$b.ipfs.dweb.link"
bash -c '[ "$a" == "$b" ]' || exit 1
echo "Href 1 ok"
echo "$a $b"

- name: Check Href 2
run: |
a=$(cat README.md | grep dweb.link | grep choo | awk '{print $3}')
b=$(cat out.txt | grep CIDv1 | awk '{print $3}')
b="https://$b.ipfs.dweb.link"
bash -c '[ "$a" == "$b" ]' || exit 1
echo "Href 2 ok"
echo "$a $b"
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The HTML and CSS which IPFS-boot uses can be seen in [javascript/src/view.js](ht
Include in your update /_static/boot.css with rules which target the HTML elements

### What to do before prod
Search [javascript/src/index.js](https://github.com/rhodey/IPFS-boot/blob/master/javascript/src/index.js) for todo:, there are like three
Search [javascript/src/index.js](https://github.com/rhodey/IPFS-boot/blob/master/javascript/src/index.js) and [javascript/src/sw.js](https://github.com/rhodey/IPFS-boot/blob/master/javascript/src/sw.js) for "todo"

### Downsides
This could have been figured out sooner!
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repo contains a sort of web bootloader, you will style this repo as you lik

It is intended that you share the source of your fork of IPFS-boot and IPFS-boot-react or IPFS-boot-choo. The sources allow users to build and see the IPFS CID (a hash) you publish is the same as what they get from source. The CID of IPFS-boot will be the URL of your app, the CID of each version of your app goes in versions.json, and the bootloader reads this file.

The bootloader only gets published once but your app updates can include CSS which styles the bootloader. This all actually works, give it a try.
The bootloader only gets published once but your app updates can include CSS which styles the bootloader. This all actually works, and it works offline(!), give it a try.

## Build
The aim is reproducible builds so docker is involved
Expand All @@ -23,10 +23,10 @@ Read [the guide](https://github.com/rhodey/IPFS-boot/blob/master/PIN.md) on choo
cp example.env .env
docker buildx build --platform=linux/amd64 -f Dockerfile.pin -t ipfs-pin .
docker run --rm -i --platform=linux/amd64 -v ./dist:/root/dist --env-file .env ipfs-pin
> CIDv0 = QmTSfk5dc1M63qgwaTowQUUXV2UincuBoAPDEQM2DFLkyP
> CIDv1 = bafybeicl2ullgshkftj4xy3q5rcxptg6sv3v4rhvyqvhvc6slv7cdno6ni
> upload: ../dist.car to s3://bucket-name/bafybeicl2ullgshkftj4xy3q5rcxptg6sv3v4rhvyqvhvc6slv7cdno6ni
> done: https://bafybeicl2ullgshkftj4xy3q5rcxptg6sv3v4rhvyqvhvc6slv7cdno6ni.ipfs.dweb.link
> CIDv0 = QmSZhisqURkj49tSw8FWxfPATb7CFZTNgtBMZeRW169Fma
> CIDv1 = bafybeib6y22jev7ajjjdwg4brw6xhncs5ijjcn3tdx73iwbzefmkyxx24e
> upload: ../dist.car to s3://bucket-name/bafybeib6y22jev7ajjjdwg4brw6xhncs5ijjcn3tdx73iwbzefmkyxx24e
> done: https://bafybeib6y22jev7ajjjdwg4brw6xhncs5ijjcn3tdx73iwbzefmkyxx24e.ipfs.dweb.link
```

Your bootloader is now live and discoverable with v0 and v1 CIDs, see [gateways](https://ipfs.github.io/public-gateway-checker/)
Expand Down Expand Up @@ -59,8 +59,8 @@ Please if you want to style the default bootloader, open a PR ^.^

If you clicked "boot!" without reading: you can return to boot list anytime by add #boot to the url

+ react https://bafybeicsc2oep22nalyt5dbsjioqb2mvg5ma2ih3igx3v2xfkpaws7shrm.ipfs.dweb.link
+ choo https://bafybeicl2ullgshkftj4xy3q5rcxptg6sv3v4rhvyqvhvc6slv7cdno6ni.ipfs.dweb.link
+ react https://bafybeidrgpkjit2lyvido5nv2niw3vfgcp3jvrtewbqxrvghdvbkl6wv4e.ipfs.dweb.link
+ choo https://bafybeib6y22jev7ajjjdwg4brw6xhncs5ijjcn3tdx73iwbzefmkyxx24e.ipfs.dweb.link

## FAQ
[FAQ](https://github.com/rhodey/IPFS-boot/blob/master/FAQ.md)
Expand Down
Loading