From e191336c702326626fec4b7709ca06a2a02c445b Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Sun, 23 Jun 2024 22:55:00 +0800 Subject: [PATCH] fix: some localnet proxy tweaks --- src/algokit/core/sandbox.py | 8 ++++++++ ..._existing_sandbox_with_out_of_date_config.approved.txt | 1 + ...t_localnet_reset_without_existing_sandbox.approved.txt | 1 + .../test_localnet_start.test_localnet_start.approved.txt | 1 + ...art.test_localnet_start_health_bad_status.approved.txt | 1 + ..._start.test_localnet_start_health_failure.approved.txt | 1 + ...alnet_start.test_localnet_start_with_name.approved.txt | 1 + .../test_sandbox.test_get_docker_compose_yml.approved.txt | 1 + .../localnet/test_sandbox.test_proxy_config.approved.txt | 7 +++++++ 9 files changed, 22 insertions(+) diff --git a/src/algokit/core/sandbox.py b/src/algokit/core/sandbox.py index 381d0c1ed..8bc0fd7b9 100644 --- a/src/algokit/core/sandbox.py +++ b/src/algokit/core/sandbox.py @@ -457,7 +457,10 @@ def get_proxy_config(algod_port: int = DEFAULT_ALGOD_PORT, kmd_port: int = 4002) listen {algod_port}; location / {{ + proxy_http_version 1.1; + proxy_read_timeout 120s; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://algod:8080; proxy_pass $target; @@ -468,7 +471,9 @@ def get_proxy_config(algod_port: int = DEFAULT_ALGOD_PORT, kmd_port: int = 4002) listen {kmd_port}; location / {{ + proxy_http_version 1.1; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://algod:7833; proxy_pass $target; @@ -479,7 +484,9 @@ def get_proxy_config(algod_port: int = DEFAULT_ALGOD_PORT, kmd_port: int = 4002) listen 8980; location / {{ + proxy_http_version 1.1; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://indexer:8980; proxy_pass $target; @@ -502,6 +509,7 @@ def get_docker_compose_yml( container_name: "{name}_algod" image: {ALGORAND_IMAGE} ports: + - 7833 - {tealdbg_port}:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt index 92282fa57..cd82de585 100644 --- a/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt +++ b/tests/localnet/test_localnet_reset.test_localnet_reset_with_existing_sandbox_with_out_of_date_config.approved.txt @@ -33,6 +33,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_reset.test_localnet_reset_without_existing_sandbox.approved.txt b/tests/localnet/test_localnet_reset.test_localnet_reset_without_existing_sandbox.approved.txt index 528acd424..015777887 100644 --- a/tests/localnet/test_localnet_reset.test_localnet_reset_without_existing_sandbox.approved.txt +++ b/tests/localnet/test_localnet_reset.test_localnet_reset_without_existing_sandbox.approved.txt @@ -25,6 +25,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_start.test_localnet_start.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start.approved.txt index e43921750..27e527e34 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start.approved.txt @@ -31,6 +31,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt index 9c71a1d29..399f226e4 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_health_bad_status.approved.txt @@ -31,6 +31,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt index 248ea6ee4..7713d42ee 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_health_failure.approved.txt @@ -30,6 +30,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_localnet_start.test_localnet_start_with_name.approved.txt b/tests/localnet/test_localnet_start.test_localnet_start_with_name.approved.txt index d056ce9bf..49a37d87b 100644 --- a/tests/localnet/test_localnet_start.test_localnet_start_with_name.approved.txt +++ b/tests/localnet/test_localnet_start.test_localnet_start_with_name.approved.txt @@ -34,6 +34,7 @@ services: container_name: "algokit_sandbox_test_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_sandbox.test_get_docker_compose_yml.approved.txt b/tests/localnet/test_sandbox.test_get_docker_compose_yml.approved.txt index 4b1f9e28a..c4f461ee5 100644 --- a/tests/localnet/test_sandbox.test_get_docker_compose_yml.approved.txt +++ b/tests/localnet/test_sandbox.test_get_docker_compose_yml.approved.txt @@ -5,6 +5,7 @@ services: container_name: "algokit_sandbox_algod" image: algorand/algod:latest ports: + - 7833 - 9392:9392 environment: START_KMD: 1 diff --git a/tests/localnet/test_sandbox.test_proxy_config.approved.txt b/tests/localnet/test_sandbox.test_proxy_config.approved.txt index c9fdcf841..2168dd64b 100644 --- a/tests/localnet/test_sandbox.test_proxy_config.approved.txt +++ b/tests/localnet/test_sandbox.test_proxy_config.approved.txt @@ -21,7 +21,10 @@ http { listen 4001; location / { + proxy_http_version 1.1; + proxy_read_timeout 120s; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://algod:8080; proxy_pass $target; @@ -32,7 +35,9 @@ http { listen 4002; location / { + proxy_http_version 1.1; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://algod:7833; proxy_pass $target; @@ -43,7 +48,9 @@ http { listen 8980; location / { + proxy_http_version 1.1; proxy_set_header Host $host; + proxy_set_header Connection ""; proxy_pass_header Server; set $target http://indexer:8980; proxy_pass $target;