From 03bbff03969b4bd7d3448a77e0046129493a74a4 Mon Sep 17 00:00:00 2001 From: nullun Date: Thu, 1 Aug 2024 10:36:40 +0100 Subject: [PATCH 1/3] Enable PNA headers --- images/algod/setup.py | 4 ++-- images/indexer/start.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/images/algod/setup.py b/images/algod/setup.py index 2bed049a..f4537f6d 100755 --- a/images/algod/setup.py +++ b/images/algod/setup.py @@ -117,9 +117,9 @@ def configure_data_dir(network_dir, token, algod_port, kmd_port, bootstrap_url, node_config_path = join(node_dir, "config.json") archival = 'true' if archival else 'false' if has_follower: - node_config = f'{{ "Version": 27, "GossipFanout": 1, "EndpointAddress": "0.0.0.0:{algod_port}", "Archival":{archival}, "EnableDeveloperAPI":true, "NetAddress": "127.0.0.1:0", "DNSBootstrapID": "{bootstrap_url}", "EnableTxnEvalTracer": true, "MaxAcctLookback": 256}}' + node_config = f'{{ "Version": 34, "GossipFanout": 1, "EndpointAddress": "0.0.0.0:{algod_port}", "EnablePrivateNetworkAccessHeader": true, "Archival":{archival}, "EnableDeveloperAPI":true, "NetAddress": "127.0.0.1:0", "DNSBootstrapID": "{bootstrap_url}", "EnableTxnEvalTracer": true, "MaxAcctLookback": 256}}' else: - node_config = f'{{ "Version": 12, "GossipFanout": 1, "EndpointAddress": "0.0.0.0:{algod_port}", "DNSBootstrapID": "{bootstrap_url}", "IncomingConnectionsLimit": 0, "Archival":{archival}, "EnableDeveloperAPI":true, "EnableTxnEvalTracer": true, "MaxAcctLookback": 256}}' + node_config = f'{{ "Version": 34, "GossipFanout": 1, "EndpointAddress": "0.0.0.0:{algod_port}", "EnablePrivateNetworkAccessHeader": true, "DNSBootstrapID": "{bootstrap_url}", "IncomingConnectionsLimit": 0, "Archival":{archival}, "EnableDeveloperAPI":true, "EnableTxnEvalTracer": true, "MaxAcctLookback": 256}}' print(f"writing to node_config_path=[{node_config_path}] config json: {node_config}") with open(node_config_path, "w") as f: f.write(node_config) diff --git a/images/indexer/start.sh b/images/indexer/start.sh index 59819ddb..d87b58ec 100755 --- a/images/indexer/start.sh +++ b/images/indexer/start.sh @@ -30,6 +30,7 @@ elif [ ! -f /tmp/algorand-indexer ]; then else /tmp/algorand-indexer daemon \ --dev-mode \ + --enable-private-network-access-header \ --server ":$PORT" \ -P "$CONNECTION_STRING" fi From f14f41928f6f4266617c1ae6ae5e2f9c74650b27 Mon Sep 17 00:00:00 2001 From: nullun Date: Thu, 1 Aug 2024 10:41:31 +0100 Subject: [PATCH 2/3] Enable PNA on KMD by default --- images/algod/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/algod/setup.py b/images/algod/setup.py index f4537f6d..482ade0d 100755 --- a/images/algod/setup.py +++ b/images/algod/setup.py @@ -125,7 +125,7 @@ def configure_data_dir(network_dir, token, algod_port, kmd_port, bootstrap_url, f.write(node_config) kmd_config_path = join(kmd_dir, 'kmd_config.json') - kmd_config = f'{{ "address":"0.0.0.0:{kmd_port}", "allowed_origins":["*"] }}' + kmd_config = f'{{ "address":"0.0.0.0:{kmd_port}", "allowed_origins":["*"], "enable_private_network_access_header": true }}' print(f"writing to kmd_config_path=[{kmd_config_path}] config json: {kmd_config}") with open(kmd_config_path, 'w') as f: f.write(kmd_config) From 71f2fe0200e199d6037ced15c2cfb21a676c4eac Mon Sep 17 00:00:00 2001 From: nullun Date: Fri, 4 Oct 2024 11:40:38 +0100 Subject: [PATCH 3/3] rename kmd pna config --- images/algod/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/algod/setup.py b/images/algod/setup.py index 482ade0d..2788e6e0 100755 --- a/images/algod/setup.py +++ b/images/algod/setup.py @@ -125,7 +125,7 @@ def configure_data_dir(network_dir, token, algod_port, kmd_port, bootstrap_url, f.write(node_config) kmd_config_path = join(kmd_dir, 'kmd_config.json') - kmd_config = f'{{ "address":"0.0.0.0:{kmd_port}", "allowed_origins":["*"], "enable_private_network_access_header": true }}' + kmd_config = f'{{ "address":"0.0.0.0:{kmd_port}", "allowed_origins":["*"], "allow_header_pna": true }}' print(f"writing to kmd_config_path=[{kmd_config_path}] config json: {kmd_config}") with open(kmd_config_path, 'w') as f: f.write(kmd_config)