Set CLUSTER_SECRET from shell

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
Hector Sanjuan 2018-10-24 21:20:53 +02:00
parent 2a62edd32a
commit 0bab730030
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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
@ -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