Skip to content

Commit

Permalink
feat: setup ci ipns map
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Apr 7, 2023
1 parent 9fd3ab5 commit 66a3982
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ jobs:
run: |
ipfs init;
./gateway-conformance/kubo-config.example.sh;
IPFS_NS_MAP=$(cat ./fixtures/dnslinks.json | jq -r 'to_entries | map("\(.key).example.com:\(.value)") | join(",")')
echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV
- uses: ipfs/start-ipfs-daemon-action@v1
env:
IPFS_NS_MAP: 12 # TODO
# note: the IPFS_NS_MAP set above will be passed to this action.
- name: Provision Kubo Gateway
run: |
find ./fixtures -name '*.car' -exec ipfs dag import {} \;
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provision-cargateway: ./fixtures.car
# cd go-libipfs/examples/car && go install
car -c ./fixtures.car &

provision-kubo:
provision-kubo: fixtures.car
find ./fixtures -name '*.car' -exec ipfs dag import {} \;

fixtures.car: gateway-conformance
Expand Down
7 changes: 1 addition & 6 deletions cmd/gateway-conformance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ func main() {
if err != nil {
return err
}

err = dnslink.AsEnv(fxs.ConfigFiles, filepath.Join(directory, "dnslinks.env"))
if err != nil {
return err
}
} else {
err = copyFiles(fxs.CarFiles, directory)
if err != nil {
Expand All @@ -206,7 +201,7 @@ func main() {
return err
}

err = dnslink.AsEnv(fxs.ConfigFiles, filepath.Join(directory, "dnslinks.env"))
err := dnslink.Merge(fxs.ConfigFiles, filepath.Join(directory, "dnslinks.json"))
if err != nil {
return err
}
Expand Down
7 changes: 6 additions & 1 deletion kubo-config.example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ ipfs config --json Gateway.PublicGateways '{
"InlineDNSLink": true,
"Paths": ["/ipfs", "/ipns", "/api"]
}
}'
}'

IPFS_NS_MAP=$(cat ./dnslinks.json | jq -r 'to_entries | map("\(.key).example.com:\(.value)") | join(",")')

echo "Set the following IPFS_NS_MAP before starting the kubo daemon:"
echo "IPFS_NS_MAP=${IPFS_NS_MAP}"

0 comments on commit 66a3982

Please sign in to comment.