From 61c97de9a55cb42c352a3483fd738dd8a0f359f5 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Mon, 20 Apr 2020 16:15:30 +0200 Subject: [PATCH] add config option for ip address of whirlpool rpc api --- docker/my-dojo/conf/docker-whirlpool.conf.tpl | 8 ++++++++ docker/my-dojo/dojo.sh | 5 +++++ docker/my-dojo/overrides/whirlpool.install.yaml | 2 ++ 3 files changed, 15 insertions(+) diff --git a/docker/my-dojo/conf/docker-whirlpool.conf.tpl b/docker/my-dojo/conf/docker-whirlpool.conf.tpl index 271fd48..748b979 100644 --- a/docker/my-dojo/conf/docker-whirlpool.conf.tpl +++ b/docker/my-dojo/conf/docker-whirlpool.conf.tpl @@ -6,3 +6,11 @@ # Value: on | off WHIRLPOOL_INSTALL=off +# IP address used to expose the RPC API of whirlpool-cli to external apps +# Warning: Do not expose your RPC API to internet! +# Recommended value: +# if whirlpool-gui runs on the machine hosting dojo: 172.30.1.8 (default) +# otherwise: IP address on the LAN of the machine running dojo +# Type: string +WHIRLPOOL_RPC_EXTERNAL_IP=172.30.1.8 + diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index 365f8dc..a7cb363 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -23,6 +23,7 @@ source_file "$DIR/.env" # Export some variables for compose export BITCOIND_RPC_EXTERNAL_IP +export WHIRLPOOL_RPC_EXTERNAL_IP # Select YAML files select_yaml_files() { @@ -314,6 +315,10 @@ upgrade() { # Load env vars for compose files source_file "$DIR/conf/docker-bitcoind.conf" export BITCOIND_RPC_EXTERNAL_IP + if [ "$WHIRLPOOL_INSTALL" == "on" ]; then + source_file "$DIR/conf/docker-whirlpool.conf" + export WHIRLPOOL_RPC_EXTERNAL_IP + fi # Rebuild the images (with or without cache) if [ $noCache -eq 0 ]; then eval "docker-compose $yamlFiles build --no-cache" diff --git a/docker/my-dojo/overrides/whirlpool.install.yaml b/docker/my-dojo/overrides/whirlpool.install.yaml index 647ba51..e879dbe 100644 --- a/docker/my-dojo/overrides/whirlpool.install.yaml +++ b/docker/my-dojo/overrides/whirlpool.install.yaml @@ -15,6 +15,8 @@ services: command: "/wait-for-it.sh nginx:80 --timeout=720 --strict -- /restart.sh" expose: - "8899" + ports: + - "${WHIRLPOOL_RPC_EXTERNAL_IP}:8899:8899" volumes: - data-whirlpool:/home/whirlpool depends_on: