### Manual Server Setup Source: https://github.com/shik3i/koalasync/blob/main/server/README.md Steps for manually installing and starting the KoalaSync server using npm. This involves navigating to the server directory, installing dependencies, and starting the application. ```bash cd server npm install npm start ``` -------------------------------- ### Start Docker Compose Server Source: https://github.com/shik3i/koalasync/blob/main/docs/AI_INIT.md Initiate the server environment using Docker Compose. ```bash docker-compose up --build ``` -------------------------------- ### Install Dependencies and Build Extension Source: https://github.com/shik3i/koalasync/blob/main/CONTRIBUTING.md Clone the repository, install Node.js dependencies, and build the browser extension. Ensure Node.js v18+ is installed. ```bash git clone https://github.com/Shik3i/KoalaSync.git cd KoalaSync npm install node scripts/build-extension.cjs ``` -------------------------------- ### Serve Website Locally (Python) Source: https://github.com/shik3i/koalasync/blob/main/docs/AI_INIT.md Start a local HTTP server using Python 3 to test the website. ```bash python3 -m http.server 8080 -d website/www ``` -------------------------------- ### Build KoalaSync Extension Source: https://github.com/shik3i/koalasync/blob/main/extension/README.md Run this command to prepare the extension for installation. It builds the extension from the repository root. ```bash npm run build:extension ``` -------------------------------- ### Build KoalaSync Extension from Source Source: https://github.com/shik3i/koalasync/blob/main/README.md Installs dependencies and builds the browser extension. Compiled artifacts are placed in the 'dist/' directory. ```bash npm install npm run build:extension ``` -------------------------------- ### Deploy KoalaSync Relay Server with Docker Source: https://github.com/shik3i/koalasync/blob/main/README.md Pulls the latest KoalaSync Docker image and starts a private relay server using a Caddy example compose file. The server will be accessible at ws://localhost:3000. ```bash # Pull the latest image docker pull ghcr.io/shik3i/koalasync:latest # Or use our example compose file cp examples/docker-compose.caddy.example.yml docker-compose.yml docker-compose up -d ``` -------------------------------- ### Website Language Metadata Example Source: https://github.com/shik3i/koalasync/blob/main/docs/TRANSLATION.md When creating a new language for the website, configure the metadata at the top of the JSON file. This includes the language code, HTML class, canonical path, language toggle URL, and text. ```json { "LANG_CODE": "it", "HTML_CLASS": "lang-it", "CANONICAL_PATH": "it/", "LANG_TOGGLE_URL": "../", "LANG_TOGGLE_TEXT": "EN" } ``` -------------------------------- ### Clone Your Fork Source: https://github.com/shik3i/koalasync/blob/main/CONTRIBUTING.md Clone your forked repository to your local machine to start making changes. ```git git clone https://github.com/YOUR-USERNAME/KoalaSync.git ``` -------------------------------- ### Server Environment Configuration Source: https://github.com/shik3i/koalasync/blob/main/server/README.md Configure server settings by copying and modifying the .env.example file. These variables control port, room limits, peer limits, and logging. ```bash 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="" # Optional: set to "1" to enable verbose connection, room-join/leave, and CORS logs in the console. Default is "0" (disabled). DEBUG_LOGGING="0" ``` -------------------------------- ### Run Beta Relay Server with Docker Source: https://github.com/shik3i/koalasync/blob/main/docs/host-control-mode-TESTING.md This snippet shows how to log in to GHCR, pull the beta server image, and run it as a Docker container. Ensure you replace placeholders with your actual user and choose a server salt. ```bash # Log in (the package is private → PAT with read:packages) echo "$GHCR_PAT" | docker login ghcr.io -u --password-stdin # Pull + (re)create — NOTE: `docker restart` does NOT pick up a new image, you must remove and re-run (or use compose / Watchtower). docker pull ghcr.io/shik3i/koalasync:beta docker rm -f koala-beta 2>/dev/null || true docker run -d --name koala-beta -p 3000:3000 \ -e SERVER_SALT='choose-your-own-salt' \ ghcr.io/shik3i/koalasync:beta ``` -------------------------------- ### Build and Serve Website Locally Source: https://github.com/shik3i/koalasync/blob/main/CONTRIBUTING.md Compile the static site and serve it locally using Node.js and Python's http.server. Useful for testing website changes. ```bash node website/build.cjs # Compile static site → www/ python3 -m http.server 8080 -d website/www # Serve locally ``` -------------------------------- ### Serve Compiled Website Locally Source: https://github.com/shik3i/koalasync/blob/main/website/README.md Use this command to serve the compiled `/www` directory using a local development server. This is useful for testing the website before deployment. ```bash npx serve website/www ``` -------------------------------- ### Build Website with Translations Source: https://github.com/shik3i/koalasync/blob/main/docs/TRANSLATION.md This command builds the website, incorporating your new translations. It's essential to run this to verify the final output of your localization efforts. ```bash node website/build.cjs ``` -------------------------------- ### Docker Image Pull and Build Source: https://github.com/shik3i/koalasync/blob/main/server/README.md Instructions for pulling the pre-built KoalaSync server image from GHCR or building it locally from the repository. ```bash # 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 . ``` -------------------------------- ### Run KoalaSync Build Script Source: https://github.com/shik3i/koalasync/blob/main/docs/SYNC_GUIDE.md Execute the Node.js build script from the repository root to synchronize protocol constants and prepare the extension. ```bash node scripts/build-extension.cjs ``` ```bash npm run build:extension ``` -------------------------------- ### Data Flow Summary Diagram Source: https://github.com/shik3i/koalasync/blob/main/docs/HOW_IT_WORKS.md Illustrates the communication path between browser extensions and the relay server for synchronization. ```text ┌─────────────┐ WebSocket ┌──────────────┐ WebSocket ┌─────────────┐ │ Extension │ ←─────────────────→│ Relay Server │←──────────────────→│ Extension │ │ (User A) │ JOIN_ROOM │ (RAM only) │ JOIN_ROOM │ (User B) │ │ │ PLAY/PAUSE/SEEK │ │ PLAY/PAUSE/SEEK │ │ │ │ FORCE_SYNC_* │ Sanitizes & │ FORCE_SYNC_* │ │ │ │ PEER_STATUS │ relays only │ PEER_STATUS │ │ │ │ EPISODE_* │ │ EPISODE_* │ │ └──────┬──────┘ └───────────────┘ └──────┬──────┘ │ │ ┌────┴─────┐ ┌─────┴────┐ │ content │ Listens to