Skip to content

Commit

Permalink
Set CLUSTER_SECRET from shell
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
  • Loading branch information
hsanjuan committed Oct 24, 2018
1 parent 2a62edd commit 0bab730
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ docker:
docker exec tmp-make-cluster-test sh -c "ipfs-cluster-service -v"
docker kill tmp-make-cluster-test


docker-compose:
docker-compose up -d
CLUSTER_SECRET=$(shell od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n') docker-compose up -d
sleep 20
docker exec cluster0 ipfs-cluster-ctl peers ls | grep -o "Sees 1 other peers" | uniq -c | grep 2
docker exec cluster1 ipfs-cluster-ctl peers ls | grep -o "Sees 1 other peers" | uniq -c | grep 2
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ services:
depends_on:
- ipfs0
environment:
# Change this! Same for all peers!
CLUSTER_SECRET: adc72159e0ce63350c13de6a5e4d3b2f500232a770cb8c3e7829fc514d89d109
CLUSTER_SECRET: ${CLUSTER_SECRET} # From shell variable
IPFS_API: /dns4/ipfs0/tcp/5001
ports:
- "127.0.0.1:9094:9094" # API
Expand Down Expand Up @@ -69,8 +68,7 @@ services:
- cluster0
- ipfs1
environment:
# Change this! Same for all peers!
CLUSTER_SECRET: adc72159e0ce63350c13de6a5e4d3b2f500232a770cb8c3e7829fc514d89d109
CLUSTER_SECRET: ${CLUSTER_SECRET} # From shell variable
IPFS_API: /dns4/ipfs1/tcp/5001
ports:
- "127.0.0.1:9194:9094" # API
Expand Down

0 comments on commit 0bab730

Please sign in to comment.