mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
f7829bbebb
Server Security (S-1 through S-8): - S-1: Type-check and clamp peerId, protocolVersion, password - S-2: Validate numeric/boolean/enum fields in relay peerData - S-3: Construct explicit relay payload (stop spreading raw data) - S-4: Type-check targetId and actionTimestamp in EVENT_ACK - S-5: Restrict room IDs to [a-zA-Z0-9-] only - S-7: Add eventCounts periodic cleanup alongside connectionCounts - S-8: Guard version parsing against NaN bypass Documentation (P-1, R-1 through R-6): - P-1: Fix PRIVACY.md typo, document all in-memory data maps - R-1/R-5: Fix stale sync-constants.bat references in shared/ - R-2: Fix stale lastTargetState ref in ARCHITECTURE.md - R-3: Extension README title reflects cross-browser support - R-6: Document content injection markers in scripts/README.md
KoalaSync Relay Server
A high-performance Node.js relay server for synchronized video playback.
Key Features
- Zero-Persistence: No database. All state is held in RAM.
- Privacy First: No tracking, no logging of user data.
- WebSocket Only: High performance with minimal overhead.
Setup
Environment
Copy .env.example to .env and configure your settings.
PORT=3000
MAX_ROOMS=100
MAX_PEERS_PER_ROOM=20
MIN_VERSION=1.0.0
Docker (Recommended)
The server is available as a pre-built image on GHCR.
# Pull from GHCR
docker pull ghcr.io/shik3i/koalasync:latest
# Or build from the repository root
docker build -t koala-sync-server -f server/Dockerfile .
See docker-compose.example.yml in the root directory for a ready-to-use configuration.
Manual Setup
cd server
npm install
npm start
Security
- Rate Limiting: IP-based connection limits and socket-based event limits.
- Token Handshake: Requires a valid token defined in the root
shared/constants.js. - Single Source of Truth: The server imports constants directly from the root
shared/directory. - In-Memory: Rooms are automatically pruned after 2 hours of inactivity.