Skip to content

Provisioning and remote deploy scripts for ZeroLatency Live Player on Debian 12 servers. Multi-tenant: the same script deploys to multiple selectable stadiums/servers (targets).

Scripts

ScriptFeatureWhat it does
deploy.shServer provisioningInstalls Node.js 22, MongoDB 7.0, nginx, PM2, UFW firewall, backup cron, HTTP Basic Auth
deploy-remote.shRemote deployrsync of sources Mac → Server, npm install + build, PM2 restart, nginx reload
backup.shMongoDB backupAutomatic backup every night at 02:30, 7-day retention
restore.shMongoDB restoreRestore from backup

Configurations

FileFeatureWhat it does
nginx-zerolatency.confReverse proxyAPI + WebSocket + static Control Room UI proxy on port 80. Basic Auth on the Control Room
ecosystem.config.cjsPM2Process management: automatic restart, log rotation, cron restart at 3:00
.rsync-excludersync exclusionsExcludes node_modules, .git, zerolatency-live-player-keygen, zerolatency-live-player-app, .env
.env.exampleVariables templatePORT, HOST, MONGODB_URI, LICENSE_KEY, LICENSE_SECRET, SSL paths
targets.confMulti-target registryServers/stadiums with SSH credentials and paths

Quick Start

bash
# 1. Server provisioning (one-time — via SSH)
# From the project root:
scp zerolatency-live-player-deploy/deploy.sh debian@192.168.1.127:/tmp/
ssh debian@192.168.1.127
sudo bash /tmp/deploy.sh /opt/olimpico

# 2. Deploy app (from your Mac, every time)
cd zerolatency-live-player-deploy
bash deploy-remote.sh                     # interactive target selection menu
bash deploy-remote.sh --list              # list available targets
bash deploy-remote.sh --target=olimpico   # direct deploy to a target

Multi-tenant — target selection

Each stadium/server is a target defined in targets.conf (one line per target):

name | user@host | ssh_host_alias | ssh_key | remote_dir | www_dir | nginx_site | db_name

Selection precedence:

  1. --target=NAME or DEPLOY_TARGET=NAME (explicit target from targets.conf)
  2. Legacy OLIMPICO_SERVER/OLIMPICO_USER/... variables (backward compatibility)
  3. Interactive menu (if run from a terminal, without flags)
  4. First target in targets.conf (non-interactive default)

Important notes

  • Debian 12 minimal: deploy.sh automatically installs curl and gnupg before setting up Node.js and MongoDB
  • No git on the server: code arrives via rsync, never via git clone/pull
  • License Key: zerolatency-live-player-keygen/ is excluded from rsync — generate keys on your Mac, not on the server
  • .env: is not synced — edit it directly on the server via SSH
  • PM2: deploy-remote.sh runs pm2 save after every deploy for persistence across reboots

→ See the full Deploy guide for the architecture and pipeline.

© 2026 Zerolatency — All Rights Reserved