Deployment
Live docs URL: https://mrgionsi.github.io/ring-intercom-control/
Docker images
The project publishes two images:
- backend:
ghcr.io/mrgionsi/ring-intercom-control-backend - frontend:
ghcr.io/mrgionsi/ring-intercom-control-frontend
Tags include package version, sha-based tags, and optional manual release tags.
Deploy via Docker Compose
Use docker-compose/docker-compose.yml with docker-compose/.env.
For a complete variable reference, see Environment Variables.
Recommended flow:
- Copy the example env file.
- Fill in the required secrets.
- Start the stack.
cd docker-compose
cp .env.example .env
docker compose up -d
Notes:
- Set
CLIENT_ORIGINto the browser-facing frontend URL, for examplehttp://192.168.1.50:5173. - In the frontend container,
BACKEND_URLshould normally point to the Docker service name, for examplehttp://backend:3001. - Set
TRUST_PROXY=0when the backend is not behind a reverse proxy orTRUST_PROXY=1if you run backend behind proxy (i.e. Traefik) - If you paste
ADMIN_PASSWORD_HASHdirectly into Compose YAML, escape each$as$$.
Deploy via Portainer
Use docker-compose/docker-compose.portainer.yml when deploying behind Traefik
and keeping the backend private on the internal ring-intercom Docker
network.
Recommended flow:
- Create the external Docker networks if they do not already exist:
ring-intercom. - Open Portainer and create a new stack.
- Paste or import
docker-compose/docker-compose.portainer.yml. - Add the environment variables in the Portainer stack UI.
- Deploy the stack.
Notes:
- In Portainer, bcrypt hashes for
ADMIN_PASSWORD_HASHshould also be escaped as$$when they are consumed by the stack. This applies even when you enter the value through Portainer's variables UI. - Set
TRUST_PROXY=1when running behind Traefik or another single trusted reverse proxy hop orTRUST_PROXY=0if you are exposing direct IP. frontendis attached to bothtraefik_defaultandring-intercom.backendis attached only toring-intercomand is not exposed publicly.- Keep
CLIENT_ORIGINset to the frontend URL seen by the browser. - Keep
BACKEND_URLin the frontend container pointed at the internal Docker service, usuallyhttp://backend:3001. traefik_defaultis expected to already exist as the external network used by your Traefik deployment.
Create the networks from the Docker host if needed:
docker network create ring-intercom
Required backend environment
SESSION_SECRETMASTER_KEY(base64, 32-byte decoded key)ADMIN_USERNAMEADMIN_PASSWORD_HASH
Variable details and generation
-
SESSION_SECRET- Purpose: signs and verifies session cookies.
- Generate:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
-
MASTER_KEY- Purpose: encrypts stored Ring refresh tokens (AES-256-GCM).
- Must decode to exactly 32 bytes.
- Generate:
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
- Validate length:
node -e "const k=process.env.MASTER_KEY||''; console.log(Buffer.from(k,'base64').length)"- expected output:
32
-
ADMIN_USERNAME- Purpose: bootstrap administrator login username.
- Example:
admin
-
ADMIN_PASSWORD_HASH- Purpose: bcrypt hash used to verify admin password.
- Generate hash (from backend directory):
npm run hash-password -- yourStrongPassword
- In Docker Compose and Portainer stack deployments, escape each
$as$$when the value is consumed by the stack configuration.
NODE_ENV guidance
-
NODE_ENV=production- Use for real deployments.
- In current releases, this expects secure cookies, so pair it with HTTPS.
-
NODE_ENV=development- Use for local development or plain HTTP testing on a trusted private LAN.
- If you must run the current release over plain
http://, preferNODE_ENV=developmentso authentication cookies work without TLS.
TRUST_PROXY guidance
-
TRUST_PROXY=0- Use when the backend receives requests directly.
- This is the safe default when no reverse proxy is in front of the app, for example a direct Docker Compose deployment.
-
TRUST_PROXY=1- Use when the backend is behind one trusted reverse proxy hop, such as Traefik.
- This affects
req.ip, login audit IP capture, rate limiting, and secure cookie behavior when HTTPS is terminated at the proxy.
Production checklist
- Run behind HTTPS reverse proxy
- Set
CLIENT_ORIGINto real public frontend origin - Protect secrets via secret manager
- Back up SQLite volume regularly
- Monitor logs and failed auth attempts
Logs
Backend request logs, startup output, and runtime errors are written to stdout/stderr. The frontend static/proxy server does the same. In Docker and Docker Compose deployments, inspect them with:
docker logs ring-intercom-backend
docker logs ring-intercom-frontend
or:
cd docker-compose
docker compose logs backend
docker compose logs frontend