From 4cdf6e0e539d1acf5d6b24cd7042501469a7fc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 25 Mar 2021 12:53:33 +0100 Subject: [PATCH] rename geth_aliases to geth_rpc_vhosts, add geth_cont_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes 403 Forbidden errors on connections between containers. Signed-off-by: Jakub SokoĊ‚owski --- defaults/main.yml | 17 +++++++++-------- templates/docker-compose.yml.j2 | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index a5f76cc..dd9f75f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -32,19 +32,20 @@ geth_rpc_addr: '127.0.0.1' geth_rpc_port: 8545 # Available: admin, clique, debug, eth, les, miner, net, personal, rpc, txpool, web3 geth_rcp_api: 'eth,net,web3,personal,admin' +# useful for linking containers +geth_rpc_extra_vhost: geth +geth_rpc_vhosts: + - 'localhost' + - '{{ geth_cont_name }}' + - '{{ geth_rpc_extra_vhost }}' + - '{{ hostname }}' + - '{{ hostname }}.tinc' + - '{{ ansible_local.tinc.vpn_ip }}' # Web Sockets API geth_websocket_enabled: true geth_websocket_port: '{{ geth_rpc_port + 1 | int }}' geth_websocket_api: 'eth,net,web3,personal,admin' geth_websocket_origins: 'localhost' -# useful for linking containers -geth_extra_alias: geth -geth_aliases: - - 'localhost' - - '{{ geth_extra_alias }}' - - '{{ hostname }}' - - '{{ hostname }}.tinc' - - '{{ ansible_local.tinc.vpn_ip }}' # Sync mode: full, fast, light geth_sync_mode: 'light' diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index a822b0e..e63e117 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -55,7 +55,7 @@ services: --http --http.addr=0.0.0.0 --http.port={{ geth_rpc_port }} - --http.vhosts={{ geth_aliases | join(",") }} + --http.vhosts={{ geth_rpc_vhosts | join(",") }} --http.api={{ geth_rcp_api }} --ipcpath=/data/geth.ipc {% endif %} @@ -70,7 +70,7 @@ services: --bootnodes="{{ geth_bootnodes | join(',') }}" {% endif %} --nousb - --verbosity={{ geth_log_level_id }} + --verbosity={{ geth_log_level_id }} --maxpeers={{ geth_max_peers }} --maxpendpeers="{{ geth_max_pend_peers }}" --port={{ geth_port }}