From f35ed40a63325b3f8f7700dae14e0462c7887e84 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 31 Mar 2026 19:36:26 -0700 Subject: [PATCH] Fix y-websocket sidecar: use v1 with setupWSConnection y-websocket v2 removed the server binary. Use v1 which includes bin/utils.js with setupWSConnection for the WS relay server. Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c28ce0c..3d5ed6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,7 +52,22 @@ services: container_name: rnotes-yws restart: unless-stopped working_dir: /app - command: ["sh", "-c", "npm install y-websocket && node node_modules/y-websocket/bin/server.cjs"] + command: + - sh + - -c + - | + npm init -y > /dev/null 2>&1 + npm install y-websocket@1 ws > /dev/null 2>&1 + node -e " + const ws = require('ws'); + const Y = require('yjs'); + const {setupWSConnection, docs} = require('y-websocket/bin/utils'); + const host = process.env.HOST || '0.0.0.0'; + const port = parseInt(process.env.PORT || '1234'); + const wss = new ws.Server({ host, port }); + wss.on('connection', setupWSConnection); + console.log('y-websocket server running on ' + host + ':' + port); + " environment: - HOST=0.0.0.0 - PORT=1234