Skip to content

Commit ec59a7a

Browse files
committed
Merge branch 'cf-envoy-websockets' into 'master'
fix(ui): enable logs using websockets for CloudFormation installations See merge request postgres-ai/database-lab!623
2 parents 506ede8 + 5c9e2a1 commit ec59a7a

File tree

7 files changed

+11
-2
lines changed

7 files changed

+11
-2
lines changed

packer/envoy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ static_resources:
254254
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
255255
codec_type: AUTO
256256
stat_prefix: ingress_http
257+
upgrade_configs:
258+
- upgrade_type: websocket
257259
route_config:
258260
name: local_route
259261
virtual_hosts:

ui/packages/ce/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
PORT=3001
22
# REACT_APP_API_URL_PREFIX
3+
# REACT_APP_WS_URL_PREFIX

ui/packages/ce/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN npm ci -ws
1010
ARG API_URL_PREFIX
1111
ENV REACT_APP_API_URL_PREFIX ${API_URL_PREFIX}
1212

13+
ARG WS_URL_PREFIX
14+
ENV REACT_APP_WS_URL_PREFIX ${WS_URL_PREFIX}
15+
1316
RUN npm run build -w @postgres.ai/ce
1417

1518
# Run phase.

ui/packages/ce/ci_docker_build_push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for tag in "${ADDR[@]}"; do
2424
done
2525

2626
set -x
27-
docker build --build-arg API_URL_PREFIX=/api $tags_build --file ./ui/packages/ce/Dockerfile .
27+
docker build --build-arg API_URL_PREFIX=/api --build-arg WS_URL_PREFIX=/ws $tags_build --file ./ui/packages/ce/Dockerfile .
2828
set +x
2929

3030
echo -e "$tags_push" | while read -r tag; do

ui/packages/ce/src/api/engine/initWS.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { InitWS } from "@postgres.ai/shared/types/api/endpoints/initWS";
2+
import { WS_URL_PREFIX } from 'config/env'
23

34
export const initWS: InitWS = (path: string, token: string): WebSocket => {
4-
let url = new URL('/ws' + path, window.location.href);
5+
let url = new URL(WS_URL_PREFIX + path, window.location.href);
56
url.protocol = url.protocol.replace('http', 'ws');
67
const wsAddr = url.href + '?token=' + token;
78

ui/packages/ce/src/config/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const NODE_ENV = process.env.NODE_ENV
22
export const API_URL_PREFIX = process.env.REACT_APP_API_URL_PREFIX ?? ''
3+
export const WS_URL_PREFIX = process.env.REACT_APP_WS_URL_PREFIX ?? ''
34
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP

ui/packages/ce/src/react-app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
declare namespace NodeJS {
55
interface ProcessEnv {
66
readonly REACT_APP_API_URL_PREFIX?: string
7+
readonly REACT_APP_WS_URL_PREFIX?: string
78
readonly BUILD_TIMESTAMP: number
89
}
910
}

0 commit comments

Comments
 (0)