From 70777e932e82373d246a00cc5c4c6f950aa9fef5 Mon Sep 17 00:00:00 2001 From: Zir0h Date: Sat, 21 Oct 2023 13:05:36 +0200 Subject: [PATCH] Feat add tzproxy (#344) * added tzproxy middleware --- .github/workflows/nginx.conf | 10 +++++++- .github/workflows/tzproxy.yaml | 43 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 10 +++++--- 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/tzproxy.yaml diff --git a/.github/workflows/nginx.conf b/.github/workflows/nginx.conf index 9c739e33a..9c0d828cf 100644 --- a/.github/workflows/nginx.conf +++ b/.github/workflows/nginx.conf @@ -153,7 +153,7 @@ server { } location ^~ /rpc/ { - proxy_pass http://rpc_nodes/; + proxy_pass http://tzproxy:8080/; } location = /status { @@ -166,6 +166,14 @@ server { } } +server { + listen 0.0.0.0:8000; + access_log off; + location / { + proxy_pass http://rpc_nodes/; + } +} + server { listen 8080; root /usr/local/openresty/nginx/html; diff --git a/.github/workflows/tzproxy.yaml b/.github/workflows/tzproxy.yaml new file mode 100644 index 000000000..1055faf67 --- /dev/null +++ b/.github/workflows/tzproxy.yaml @@ -0,0 +1,43 @@ +cache: + disabled_routes: + - /monitor/.* + enabled: true + size_mb: 128 + ttl: 10 +cors: + enabled: false +deny_list: + enabled: false + values: [] +deny_routes: + enabled: true + values: + - /injection/block + - /injection/protocol + - /network.* + - /workers.* + - /worker.* + - /stats.* + - /config + - /chains/main/blocks/.*/helpers/baking_rights + - /chains/main/blocks/.*/helpers/endorsing_rights + - /helpers/baking_rights + - /helpers/endorsing_rights + - /chains/main/blocks/.*/context/contracts(/?)$ +gc: + percent: 20 +gzip: + enabled: false +host: 0.0.0.0:8080 # is used inside nginx config, tzproxy:8080 +logger: + bunch_size: 1000 + pool_interval_seconds: 10 +metrics: + enabled: false + host: 0.0.0.0:9000 + pprof: false +rate_limit: + enabled: false + max: 300 + minutes: 1 +tezos_host: teia-ui:8000 # references docker-compose.yml service name diff --git a/docker-compose.yml b/docker-compose.yml index 82e3d9fef..622144827 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,10 @@ services: restart: unless-stopped ports: - 0.0.0.0:8080:80 -# volumes: -# - ./.github/workflows/nginx.conf:/etc/nginx/conf.d/default.conf -# - ./.github/workflows/previews.lua:/lua/previews.lua + volumes: + - ./.github/workflows/nginx.conf:/etc/nginx/conf.d/default.conf + tzproxy: + image: ghcr.io/marigold-dev/tzproxy:latest-2f58f3c-1697469392 + restart: unless-stopped + volumes: + - ./.github/workflows/tzproxy.yaml:/tzproxy.yaml