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
| Script | Feature | What it does |
|---|---|---|
| deploy.sh | Server provisioning | Installs Node.js 22, MongoDB 7.0, nginx, PM2, UFW firewall, backup cron, HTTP Basic Auth |
| deploy-remote.sh | Remote deploy | rsync of sources Mac → Server, npm install + build, PM2 restart, nginx reload |
| backup.sh | MongoDB backup | Automatic backup every night at 02:30, 7-day retention |
| restore.sh | MongoDB restore | Restore from backup |
Configurations
| File | Feature | What it does |
|---|---|---|
| nginx-zerolatency.conf | Reverse proxy | API + WebSocket + static Control Room UI proxy on port 80. Basic Auth on the Control Room |
| ecosystem.config.cjs | PM2 | Process management: automatic restart, log rotation, cron restart at 3:00 |
| .rsync-exclude | rsync exclusions | Excludes node_modules, .git, zerolatency-live-player-keygen, zerolatency-live-player-app, .env |
| .env.example | Variables template | PORT, HOST, MONGODB_URI, LICENSE_KEY, LICENSE_SECRET, SSL paths |
| targets.conf | Multi-target registry | Servers/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 targetMulti-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_nameSelection precedence:
--target=NAMEorDEPLOY_TARGET=NAME(explicit target fromtargets.conf)- Legacy
OLIMPICO_SERVER/OLIMPICO_USER/... variables (backward compatibility) - Interactive menu (if run from a terminal, without flags)
- First target in
targets.conf(non-interactive default)
Important notes
- Debian 12 minimal:
deploy.shautomatically installscurlandgnupgbefore setting up Node.js and MongoDB - No git on the server: code arrives via
rsync, never viagit 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.shrunspm2 saveafter every deploy for persistence across reboots
→ See the full Deploy guide for the architecture and pipeline.