From bfc1c73afde566a3967fdbb9c12f5a0491349054 Mon Sep 17 00:00:00 2001 From: Brutus5000 Date: Sun, 14 Jun 2026 10:13:16 +0200 Subject: [PATCH 1/2] feat(lobby): use native WebSocket, drop faf-ws-bridge faf-python-server now speaks WebSocket directly on 8003/ws, so the ws_bridge_rs sidecar is no longer needed. - Point the IngressRoute for ws.{baseDomain} at faf-lobby-server:8003 instead of faf-ws-bridge:8003 (and rename the resource). - Remove the LISTEN block from the lobby config; the new server reads WS_HOST/WS_PORT/WS_PATH and the defaults already produce :8003/ws. - Set WS_FORWARDED_IP_HEADER=CF-Connecting-IP so the real client IP from Cloudflare is preserved. - Bump image to faforever/faf-python-server:feature-websocket for the test deploy. - Delete apps/faf-ws-bridge entirely. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/faf-lobby-server/config/config.yaml | 9 +++--- .../templates/deployment.yaml | 2 +- .../templates/ingress.yaml | 6 ++-- apps/faf-ws-bridge/Chart.yaml | 3 -- apps/faf-ws-bridge/templates/deployment.yaml | 32 ------------------- apps/faf-ws-bridge/templates/service.yaml | 12 ------- 6 files changed, 8 insertions(+), 56 deletions(-) rename apps/{faf-ws-bridge => faf-lobby-server}/templates/ingress.yaml (52%) delete mode 100644 apps/faf-ws-bridge/Chart.yaml delete mode 100644 apps/faf-ws-bridge/templates/deployment.yaml delete mode 100644 apps/faf-ws-bridge/templates/service.yaml diff --git a/apps/faf-lobby-server/config/config.yaml b/apps/faf-lobby-server/config/config.yaml index 882876b2..2dd954cd 100644 --- a/apps/faf-lobby-server/config/config.yaml +++ b/apps/faf-lobby-server/config/config.yaml @@ -1,11 +1,10 @@ CONFIGURATION_REFRESH_TIME: 60 LOG_LEVEL: "INFO" -LISTEN: - - ADDRESS: - PORT: 8003 - PROTOCOL: SimpleJsonProtocol - PROXY: true +# The server speaks WebSocket natively on 8003/ws (the defaults). Traefik +# terminates TLS and forwards directly to this pod, so trust the +# CF-Connecting-IP header that Cloudflare sets to get the real client IP. +WS_FORWARDED_IP_HEADER: "CF-Connecting-IP" DB_SERVER: "mariadb" DB_LOGIN: "faf-python-server" diff --git a/apps/faf-lobby-server/templates/deployment.yaml b/apps/faf-lobby-server/templates/deployment.yaml index a7fec103..2954943d 100644 --- a/apps/faf-lobby-server/templates/deployment.yaml +++ b/apps/faf-lobby-server/templates/deployment.yaml @@ -21,7 +21,7 @@ spec: spec: terminationGracePeriodSeconds: 3600 containers: - - image: faforever/faf-python-server:v1.17.0 + - image: faforever/faf-python-server:feature-websocket imagePullPolicy: Always name: faf-lobby-server envFrom: diff --git a/apps/faf-ws-bridge/templates/ingress.yaml b/apps/faf-lobby-server/templates/ingress.yaml similarity index 52% rename from apps/faf-ws-bridge/templates/ingress.yaml rename to apps/faf-lobby-server/templates/ingress.yaml index 776f7262..5b725ce4 100644 --- a/apps/faf-ws-bridge/templates/ingress.yaml +++ b/apps/faf-lobby-server/templates/ingress.yaml @@ -1,13 +1,13 @@ apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: - name: faf-ws-bridge + name: faf-lobby-server spec: entryPoints: - websecure routes: - - match: Host(`ws.{{.Values.baseDomain}}`) + - match: Host(`lobby.{{.Values.baseDomain}}`) || Host(`ws.{{.Values.baseDomain}}`) kind: Rule services: - - name: faf-ws-bridge + - name: faf-lobby-server port: 8003 diff --git a/apps/faf-ws-bridge/Chart.yaml b/apps/faf-ws-bridge/Chart.yaml deleted file mode 100644 index 648cc860..00000000 --- a/apps/faf-ws-bridge/Chart.yaml +++ /dev/null @@ -1,3 +0,0 @@ -apiVersion: v2 -name: faf-ws-bridge -version: 1.0.0 diff --git a/apps/faf-ws-bridge/templates/deployment.yaml b/apps/faf-ws-bridge/templates/deployment.yaml deleted file mode 100644 index 3cbaa3c2..00000000 --- a/apps/faf-ws-bridge/templates/deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: faf-ws-bridge - name: faf-ws-bridge -spec: - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: faf-ws-bridge - template: - metadata: - labels: - app: faf-ws-bridge - spec: - containers: - - image: faforever/ws_bridge_rs:0.1.5 - args: - - "ws_to_tcp" - - "-vvv" - - "--proxy" - - "0.0.0.0:8003" - - "--proxy-header-name" - - "CF-Connecting-IP" - - "faf-lobby-server:8003" - imagePullPolicy: Always - name: faf-ws-bridge - ports: - - containerPort: 8003 - restartPolicy: Always diff --git a/apps/faf-ws-bridge/templates/service.yaml b/apps/faf-ws-bridge/templates/service.yaml deleted file mode 100644 index 9e23811e..00000000 --- a/apps/faf-ws-bridge/templates/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: faf-ws-bridge - labels: - app: faf-ws-bridge -spec: - selector: - app: faf-ws-bridge - ports: - - port: 8003 - targetPort: 8003 From 6a2de7848c5cd74a23c4517f05afa477f2b98808 Mon Sep 17 00:00:00 2001 From: Brutus5000 Date: Sun, 14 Jun 2026 11:14:04 +0200 Subject: [PATCH 2/2] fix(tilt): drop faf-ws-bridge reference The chart was removed in bfc1c73 but the Tiltfile still referenced it, breaking `Test Using Local Config` with: Error in fail: No objects found for chart apps/faf-ws-bridge Co-Authored-By: Claude Opus 4.7 (1M context) --- Tiltfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Tiltfile b/Tiltfile index ba19ba9c..8a379631 100644 --- a/Tiltfile +++ b/Tiltfile @@ -423,10 +423,6 @@ unitdb_labels = ["unitdb"] unitdb_links = [link("http://unitdb.{}".format(base_domain), "Rackover UnitDB")] proxy_local_service_if_set(service_name="faf-unitdb", service_chart="apps/faf-unitdb", service_namespace="faf-apps", service_labels=unitdb_labels, service_links=unitdb_links) -ws_bridge_deps = ["faf-lobby-server"] -ws_bridge_labels = ["lobby"] -proxy_local_service_if_set(service_name="faf-ws-bridge", service_chart="apps/faf-ws-bridge", service_namespace="faf-apps", service_deps=ws_bridge_deps, service_labels=ws_bridge_labels) - icebreaker_deps = ["faf-db-migrations", "ory-hydra"] + rabbitmq_setup_resources icebreaker_labels = ["api"] icebreaker_patch = {"HYDRA_URL": "http://ory-hydra:4444", "XIRSYS_ENABLED": "false", "XIRSYS_TURN_ENABLED": "false", "CLOUDFLARE_ENABLED": "false"}