From ad3372005320e02ad2a80723b30f557d523b8116 Mon Sep 17 00:00:00 2001 From: Koala <6156589+Shik3i@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:57:58 +0200 Subject: [PATCH] feat(server): add DEBUG_LOGGING environment variable to suppress verbose console output --- CHANGELOG.md | 7 +++++++ README.md | 2 +- server/.env.example | 2 ++ server/README.md | 13 ++++++++----- server/index.js | 4 ++++ website/www/de/index.html | 6 +++--- website/www/es/index.html | 6 +++--- website/www/fr/index.html | 6 +++--- website/www/index.html | 6 +++--- website/www/pt-BR/index.html | 6 +++--- website/www/ru/index.html | 6 +++--- website/www/version.json | 4 ++-- 12 files changed, 42 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2682493..66b6d28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to the KoalaSync browser extension and relay server. --- +## [v2.0.7] — 2026-06-03 + +### Added +- Added a `DEBUG_LOGGING` environment variable to the relay server (defaulting to `"0"` / disabled) to prevent console spam from verbose connection (`CONN`), room activity (`ROOM`, `DEDUPE`), and `CORS` events under load. Critical logs like `SERVER`, `SECURITY`, `AUTH`, and `ERROR` remain enabled at all times. + +--- + ## [v2.0.6] — 2026-06-03 ### Performance & Security Hardening diff --git a/README.md b/README.md index a9f5e2f..d0c0304 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Chrome Extension

-

New v2.0.6 Release! — See what's changed

+

New v2.0.7 Release! — See what's changed

KoalaSync is a lightweight Browser Extension and Relay Server for synchronized video playback on almost any website with a video element—YouTube, Twitch, Netflix, Emby, Jellyfin, and beyond. Built with a focus on Data Sovereignty and Performance.

diff --git a/server/.env.example b/server/.env.example index 310e833..8f38ee5 100644 --- a/server/.env.example +++ b/server/.env.example @@ -6,3 +6,5 @@ MAX_PEERS_PER_ROOM="25" # Use a long random token, 32+ characters recommended. ADMIN_METRICS_TOKEN="" +# Optional: set to "1" to enable verbose connection, room-join/leave, and CORS logs in the console. Default is "0" (disabled). +DEBUG_LOGGING="0" diff --git a/server/README.md b/server/README.md index 42bc0aa..2db50dd 100644 --- a/server/README.md +++ b/server/README.md @@ -12,13 +12,16 @@ A Node.js relay server for synchronized video playback. ### Environment Copy `.env.example` to `.env` and configure your settings. ```bash -PORT=3000 -MAX_ROOMS=1000 -MAX_PEERS_PER_ROOM=25 -MIN_VERSION=1.0.0 +PORT="3000" +MAX_ROOMS="1000" +MAX_PEERS_PER_ROOM="25" +MIN_VERSION="1.0.0" # Optional: enables aggregate-only admin metrics on /health with Authorization: Bearer # Use a long random token, 32+ characters recommended. -ADMIN_METRICS_TOKEN= +ADMIN_METRICS_TOKEN="" + +# Optional: set to "1" to enable verbose connection, room-join/leave, and CORS logs in the console. Default is "0" (disabled). +DEBUG_LOGGING="0" ``` ### Health & Metrics diff --git a/server/index.js b/server/index.js index 6c2f7e0..698969e 100644 --- a/server/index.js +++ b/server/index.js @@ -116,6 +116,10 @@ const peerToSocket = new Map(); // peerId -> socketId (Global lookup) const roomCreationLocks = new Map(); // roomId -> Promise (prevents race on room creation) function log(type, message, details = '') { + const debugLogging = process.env.DEBUG_LOGGING === '1'; + const isVerbose = type === 'CONN' || type === 'ROOM' || type === 'DEDUPE' || type === 'CORS'; + if (!debugLogging && isVerbose) return; + const timestamp = new Date().toISOString(); console.log(`[${timestamp}] [${type}] ${message}`, details); } diff --git a/website/www/de/index.html b/website/www/de/index.html index f276d19..c48b7b9 100644 --- a/website/www/de/index.html +++ b/website/www/de/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/es/index.html b/website/www/es/index.html index 56f6314..5008330 100644 --- a/website/www/es/index.html +++ b/website/www/es/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/fr/index.html b/website/www/fr/index.html index 9911618..82e55e3 100644 --- a/website/www/fr/index.html +++ b/website/www/fr/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/index.html b/website/www/index.html index a8a33e7..e7a374a 100644 --- a/website/www/index.html +++ b/website/www/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/pt-BR/index.html b/website/www/pt-BR/index.html index c52148b..aa0721d 100644 --- a/website/www/pt-BR/index.html +++ b/website/www/pt-BR/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/ru/index.html b/website/www/ru/index.html index aaf5dfe..78ea775 100644 --- a/website/www/ru/index.html +++ b/website/www/ru/index.html @@ -256,7 +256,7 @@
KoalaSync LogoKoalaSync
- 2.0.5 + 2.0.6
@@ -519,7 +519,7 @@
GitHub Repository -
2.0.5
+
2.0.6
@@ -887,7 +887,7 @@ KoalaSync Logo KoalaSync -
2.0.5
+
2.0.6
diff --git a/website/www/version.json b/website/www/version.json index c07cc8e..6ba36cd 100644 --- a/website/www/version.json +++ b/website/www/version.json @@ -1,4 +1,4 @@ { - "version": "2.0.5", - "date": "2026-06-03T09:34:22Z" + "version": "2.0.6", + "date": "2026-06-03T09:45:12Z" }