From 88cfe7bb04414bb92571b769125dc1172d4c3a95 Mon Sep 17 00:00:00 2001 From: Heiko Burkhardt Date: Thu, 9 Nov 2023 15:25:19 +0100 Subject: [PATCH] build: billboard names --- .github/workflows/deploy-billboard.yml | 7 +- docker/billboard/docker-compose.yml | 2 +- docker/billboard/nginx.conf | 100 +++++++++++++++++++++++++ docker/nginx.conf | 43 +++-------- packages/billboard-widget/package.json | 2 +- 5 files changed, 115 insertions(+), 39 deletions(-) create mode 100644 docker/billboard/nginx.conf diff --git a/.github/workflows/deploy-billboard.yml b/.github/workflows/deploy-billboard.yml index cc6a68913..35bfbd3ac 100644 --- a/.github/workflows/deploy-billboard.yml +++ b/.github/workflows/deploy-billboard.yml @@ -50,10 +50,11 @@ jobs: echo "ENCRYPTION_PUBLIC_KEY=${{ secrets.ENCRYPTION_PUBLIC_KEY }}" >> ./.env echo "ENCRYPTION_PRIVATE_KEY=${{ secrets.ENCRYPTION_PRIVATE_KEY }}" >> ./.env echo "RPC=${{ secrets.STAGING_RPC }}" >> ./.env - echo "BILLBOARD_PRIVATE_KEY=${{ secrets.BILLBOARD_PRIVATE_KEY}}" >> ./.env - echo "interceptor=${{ secrets.INTERCEPTOR}}" >> ./.env + echo "BILLBOARD_PRIVATE_KEY=${{ secrets.BILLBOARD_PRIVATE_KEY }}" >> ./.env + echo "interceptor=${{ secrets.INTERCEPTOR }}" >> ./.env echo "DISABLE_SESSION_CHECK='true'" >> ./.env - envsubst '${SSL_CERTIFICATE_BASE_LOC} ${TLS_CERTIFICATE_LOCATION} ${TARGET_HOST}' < ./docker/nginx.conf > ./nginx.conf + echo "BILLBOARD_NAMES=${{ secrets.BILLBOARD_NAMES }}" >> ./.env + envsubst '${SSL_CERTIFICATE_BASE_LOC} ${TLS_CERTIFICATE_LOCATION} ${TARGET_HOST}' < ./docker/billboard/nginx.conf > ./nginx.conf cat ./.env - name: Build docker image run: | diff --git a/docker/billboard/docker-compose.yml b/docker/billboard/docker-compose.yml index d3e9b0b12..24bfb91e5 100644 --- a/docker/billboard/docker-compose.yml +++ b/docker/billboard/docker-compose.yml @@ -45,7 +45,7 @@ services: PORT: 8083 time: 0 privateKey: ${BILLBOARD_PRIVATE_KEY} - ensNames: '["billboard1.bb.dm3.eth"]' + ensNames: ${BILLBOARD_NAMES} mediators: '[]' REDIS_URL: redis://db:6379 RPC: ${RPC} diff --git a/docker/billboard/nginx.conf b/docker/billboard/nginx.conf new file mode 100644 index 000000000..9f0ade838 --- /dev/null +++ b/docker/billboard/nginx.conf @@ -0,0 +1,100 @@ +events { + worker_connections 1024; +} + +http { + keepalive_timeout 65; + limit_req_zone $binary_remote_addr zone=standardlimit:10m rate=3r/s; + limit_req_zone $binary_remote_addr zone=legacylimit:10m rate=2r/s; + + server { + listen 80; + server_name ${TARGET_HOST}; + + # location / { + # limit_req zone=standardlimit burst=50; + # proxy_pass http://web:8080; + # proxy_set_header Host $host; + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Proto $scheme; + + # proxy_redirect off; + # } + + location /resolver { + rewrite ^/resolver(.*)$ $1 break; + limit_req zone=standardlimit burst=50; + proxy_pass http://ccip-resolver:8181; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_redirect off; + } + + location /resolver-handler { + rewrite ^/resolver-handler(.*)$ $1 break; + limit_req zone=standardlimit burst=50; + proxy_pass http://offchain-resolver:8082; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_redirect off; + } + + location /api { + rewrite ^/api(.*)$ $1 break; + limit_req zone=standardlimit burst=50; + proxy_pass http://backend:8081; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_redirect off; + } + + location /bb-client { + rewrite ^/bb-client(.*)$ $1 break; + limit_req zone=standardlimit burst=50; + proxy_pass http://billboard-client:8083; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_redirect off; + } + + location /socket.io { + proxy_pass http://backend:8081/socket.io; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_redirect off; + proxy_set_header Host $host; + } + + location /bb-client/socket.io { + rewrite ^/bb-client(.*)$ $1 break; + proxy_pass http://billboard-client:8083/socket.io; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_redirect off; + proxy_set_header Host $host; + } + + + } +} \ No newline at end of file diff --git a/docker/nginx.conf b/docker/nginx.conf index 9f0ade838..24bda6032 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -11,16 +11,16 @@ http { listen 80; server_name ${TARGET_HOST}; - # location / { - # limit_req zone=standardlimit burst=50; - # proxy_pass http://web:8080; - # proxy_set_header Host $host; - # proxy_set_header X-Real-IP $remote_addr; - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # proxy_set_header X-Forwarded-Proto $scheme; + location / { + limit_req zone=standardlimit burst=50; + proxy_pass http://web:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; - # proxy_redirect off; - # } + proxy_redirect off; + } location /resolver { rewrite ^/resolver(.*)$ $1 break; @@ -58,18 +58,6 @@ http { proxy_redirect off; } - location /bb-client { - rewrite ^/bb-client(.*)$ $1 break; - limit_req zone=standardlimit burst=50; - proxy_pass http://billboard-client:8083; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - proxy_redirect off; - } - location /socket.io { proxy_pass http://backend:8081/socket.io; proxy_http_version 1.1; @@ -82,19 +70,6 @@ http { proxy_set_header Host $host; } - location /bb-client/socket.io { - rewrite ^/bb-client(.*)$ $1 break; - proxy_pass http://billboard-client:8083/socket.io; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_redirect off; - proxy_set_header Host $host; - } - } } \ No newline at end of file diff --git a/packages/billboard-widget/package.json b/packages/billboard-widget/package.json index 88b5d55d8..c6c40a1f9 100644 --- a/packages/billboard-widget/package.json +++ b/packages/billboard-widget/package.json @@ -1,6 +1,6 @@ { "name": "dm3-billboard-widget", - "version": "0.3.2", + "version": "0.3.3", "files": [ "dist" ],