Skip to content

Commit

Permalink
No need to escape slashes in IPFS_IDENTITY_PRIVATE_KEY (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloyan-raev committed Apr 19, 2023
1 parent 39451b7 commit fcc4c59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ docker run --rm -d \
-e STORJ_BUCKET=<storj_bucket> \
-e STORJ_ACCESS=<storj_access_grant> \
-e IPFS_IDENTITY_PEER_ID=<peer_id> \
-e IPFS_IDENTITY_PRIVATE_KEY=<escaped_privkey> \
-e IPFS_IDENTITY_PRIVATE_KEY=<priv_key> \
-e IPFS_GATEWAY_NO_FETCH=true \
-e IPFS_GATEWAY_DOMAIN=<gateway_domain_name> \
-e IPFS_GATEWAY_USE_SUBDOMAINS=false \
Expand Down Expand Up @@ -166,7 +166,7 @@ Docker images are published to https://hub.docker.com/r/storjlabs/ipfs-go-ds-sto

`IPFS_IDENTITY_PEER_ID` can be set optionally to preserve the node identity between runs. The current peer ID can be found under `Identity.PeerID` in the config file.

`IPFS_IDENTITY_PRIVATE_KEY` must be set if `IPFS_IDENTITY_PEER_ID` is set, and the provided private key must match the peer ID. The current private key can be found under `Identity.PrivKey` in the config file. The provided private key must be properly escaped for the `sed` tool, i.e. it must be wrapped with quotation marks and slashes must be escaped with backslashes.
`IPFS_IDENTITY_PRIVATE_KEY` must be set if `IPFS_IDENTITY_PEER_ID` is set, and the provided private key must match the peer ID. The current private key can be found under `Identity.PrivKey` in the config file.

`IPFS_GATEWAY_NO_FETCH` determines if the IPFS gateway is open (if set to false) or restricted (if set to true). Restricted gateways serve files only from the local IPFS node. Open gateways search the IPFS network if the file is not present on the local IPFS node.

Expand Down
2 changes: 1 addition & 1 deletion docker/container_daemon
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
# Set the private key that matches the peer ID, if provided above
if [ ! -z $IPFS_IDENTITY_PRIVATE_KEY ]; then
# We use sed here because `ipfs config` does not allow changing the PrivKey.
sed -i "s/\(\"PrivKey\": \).*/\1\"$IPFS_IDENTITY_PRIVATE_KEY\"/" $repo/config
sed -i "s~\(\"PrivKey\": \).*~\1\"$IPFS_IDENTITY_PRIVATE_KEY\"~" $repo/config
fi

# HTTP API port config
Expand Down

0 comments on commit fcc4c59

Please sign in to comment.