Skip to content

Commit

Permalink
fix: kubo provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Jun 13, 2023
1 parent 87e1fa5 commit cac4ffc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ jobs:
- name: Configure Kubo Gateway
run: |
ipfs init;
source ./gateway-conformance/kubo-config.example.sh;
IPFS_NS_MAP=$(cat ./fixtures/dnslinks.json | jq -r 'to_entries | map("\(.key).example.com:\(.value)") | join(",")')
source ./gateway-conformance/kubo-config.example.sh "$(pwd)/fixtures"
echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV
# note: the IPFS_NS_MAP set above will be passed the daemon
- uses: ipfs/start-ipfs-daemon-action@v1
Expand Down
8 changes: 5 additions & 3 deletions kubo-config.example.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#! /usr/bin/env bash

FIXTURES_PATH=${1:-$(pwd)}

ipfs config --json Gateway.PublicGateways '{
"example.com": {
"UseSubdomains": true,
Expand All @@ -12,9 +15,8 @@ ipfs config --json Gateway.PublicGateways '{
}
}'

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

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

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

0 comments on commit cac4ffc

Please sign in to comment.