Skip to content

Commit

Permalink
build: billboard names
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-ko committed Nov 9, 2023
1 parent 219b65f commit 88cfe7b
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 39 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/deploy-billboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion docker/billboard/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
100 changes: 100 additions & 0 deletions docker/billboard/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}


}
}
43 changes: 9 additions & 34 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}


}
}
2 changes: 1 addition & 1 deletion packages/billboard-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dm3-billboard-widget",
"version": "0.3.2",
"version": "0.3.3",
"files": [
"dist"
],
Expand Down

0 comments on commit 88cfe7b

Please sign in to comment.