Initial commit: Production-ready KoalaSync Monorepo with Manifest V3, Socket.IO Relay, and Two-Phase Sync

This commit is contained in:
MacBook
2026-04-21 07:49:37 +02:00
commit 14033244e5
27 changed files with 3068 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# KoalaSync Shared Constants
This directory contains constants and protocol definitions used by both the extension and the server.
## Syncing with the Extension
> [!IMPORTANT]
> Every time this file is modified, you must run `scripts/sync-constants.sh` to keep the extension's copy up to date.
Because Chrome Extensions cannot load files outside their root directory, `constants.js` must be copied to `extension/shared/constants.js` whenever it is modified.
## Security & Versioning Constants
- `OFFICIAL_SERVER_TOKEN`: A 32-byte hex token required to connect to the official relay server.
- `APP_VERSION`: The current version of the extension. Used by the server to enforce minimum version requirements (Revocation). This must always be in sync with `manifest.json`.
- `OFFICIAL_SERVER_URL`: The default endpoint for the official KoalaSync relay.
- `ROOM_DATA`: Server response with current room state (peers).
- `PLAY`: Sync command to start playback.
- `PAUSE`: Sync command to pause playback.
- `SEEK`: Sync command to change the current time.
- `PEER_STATUS`: Heartbeat or join/leave notification for peers.
- `FORCE_SYNC_PREPARE`: Phase 1 of Force Sync (Pause & Seek).
- `FORCE_SYNC_ACK`: Peer confirmation of Phase 1 readiness.
- `FORCE_SYNC_EXECUTE`: Phase 2 of Force Sync (Start Playback).
- `ERROR`: Generic error message from the server.
+46
View File
@@ -0,0 +1,46 @@
/**
* blacklist.js
*
* Domains to be filtered out from the tab selection dropdown to reduce "noise".
* These are typically sites that won't contain shareable video content.
*/
export const BLACKLIST_DOMAINS = [
// Mail Providers
'mail.google.com',
'outlook.live.com',
'outlook.office.com',
'gmx.net',
'web.de',
// Messengers
'web.whatsapp.com',
'web.telegram.org',
'discord.com',
'element.io',
'app.slack.com',
// Productivity & Project Management
'atlassian.net',
'jira',
'trello.com',
'notion.so',
'monday.com',
'asana.com',
'github.com',
'gitlab.com',
'bitbucket.org',
// Social Media
'linkedin.com',
'twitter.com',
'x.com',
'facebook.com',
'instagram.com',
// Development & Utilities
'timer.shik3i.net',
'localhost',
'zoom.us',
'teams.microsoft.com',
'meet.google.com'
];
+31
View File
@@ -0,0 +1,31 @@
/**
* KoalaSync Shared Constants & Protocol Definitions
*/
export const PROTOCOL_VERSION = "1.0.0";
export const APP_VERSION = "1.0.0";
export const OFFICIAL_SERVER_URL = 'wss://sync.shik3i.net';
export const OFFICIAL_SERVER_TOKEN = '39ce48b42aa442a34b80cfe2d7314177d4c725c4316b1f83aa3a1e2f0f5c5bfd';
export const EVENTS = {
// Connection & Room
JOIN_ROOM: "join_room",
LEAVE_ROOM: "leave_room",
ROOM_DATA: "room_data", // Server -> Client: current room state
ERROR: "error",
// Media Control
PLAY: "play",
PAUSE: "pause",
SEEK: "seek",
// Sync Coordination
PEER_STATUS: "peer_status", // Heartbeat from peers
FORCE_SYNC_PREPARE: "force_sync_prepare",
FORCE_SYNC_ACK: "force_sync_ack",
FORCE_SYNC_EXECUTE: "force_sync_execute"
};
export const HEARTBEAT_INTERVAL = 15000; // 15s
export const FORCE_SYNC_TIMEOUT = 5000; // 5s timeout for ACKs