GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - reneleban/sentry-bridge

BranchesTags
Open more actions menu

Latest commit

 

History

221 Commits
221 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
config
config
 
 
docs
docs
 
 
frontend
frontend
 
 
scripts
scripts
 
 
src
src
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.gitleaks.toml
.gitleaks.toml
 
 
.prettierrc
.prettierrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
docker-compose.dev.yml
docker-compose.dev.yml
 
 
docker-compose.yml
docker-compose.yml
 
 
docker-entrypoint.sh
docker-entrypoint.sh
 
 
jest.config.ts
jest.config.ts
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
run.mjs
run.mjs
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.test.json
tsconfig.test.json
 
 

Repository files navigation

SentryBridge

CI License: MIT Docker Image Version Node.js 26 CodeRabbit Pull Request Reviews

Standalone Docker service that connects Prusa Core One printers (via PrusaLink) to Obico (self-hosted or cloud). Runs as an Obico agent — no modifications to Obico or PrusaLink required. One container = one printer.

  • Setup wizard: PrusaLink credentials → camera test → Obico pairing
  • Live status forwarding (temperatures, job progress, state)
  • MJPEG snapshot upload for AI failure detection
  • WebRTC live stream via Janus in the Obico control panel
  • Pause / resume / cancel from Obico

Warning

No login. LAN or VPN only. The web UI and REST API have no authentication. Anyone who can reach the port has full control of the bridge and the printer. Never expose it to the internet: no port forwarding, no public IP, no reverse proxy without its own authentication. See SECURITY.md.

What it does

The bridge acts as a translator between your Prusa Core One printer and Obico. It polls the printer's PrusaLink HTTP API for status and job data, captures the RTSP camera stream via ffmpeg, and forwards everything to Obico over WebSocket. The Obico control panel then shows your printer's state, lets you watch the live stream, and can pause or cancel a print if the AI detects a failure.

Requirements

  • Docker (20.10+) with Docker Compose v2
  • A Prusa Core One with PrusaLink enabled and reachable on your LAN
  • PrusaLink credentials (username + password from the printer's network settings)
  • RTSP camera stream from the printer (rtsp://[printer-ip]/live) — mandatory, Obico requires a live stream for AI failure detection
  • An Obico account (self-hosted or https://app.obico.io)
  • The Docker host's LAN IP (needed for WebRTC — see JANUS_HOST_IP below)

Quick Start

Pull the image and run it with your Docker host's LAN IP:

docker run -d \
  -p 192.168.1.x:3000:3000 \
  -p 192.168.1.x:10100-10200:10100-10200/udp \
  -v ./config:/config \
  -e JANUS_HOST_IP=192.168.1.x \
  rleban/sentry-bridge:latest
# Open http://192.168.1.x:3000 → follow setup wizard

Replace 192.168.1.x (three places) with the LAN IP of the machine running Docker. It is used for WebRTC and as the only address the ports are published on, so the bridge is not reachable on other interfaces. Because of this, http://localhost:3000 does not work on the Docker host; use the LAN IP.

Note

Docker-published ports bypass host firewalls such as ufw or firewalld (Docker manages its own iptables rules). Binding to the LAN IP, as above, is what keeps the port off other interfaces; a firewall rule on the host does not. For VPN access when the VPN runs on the Docker host itself, see Access through a VPN.

For the full guide → docs/guide/

Docker Compose

For persistent setups, use the included docker-compose.yml at the repo root, or copy this block:

services:
  bridge:
    image: rleban/sentry-bridge:latest
    container_name: sentry-bridge
    ports:
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:3000:3000"
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:10100-10200:10100-10200/udp" # WebRTC ICE media (browser ↔ Janus)
    volumes:
      - ./config:/config
    environment:
      - PORT=3000
      - CONFIG_PATH=/config/config.json
      - JANUS_MODE=bundled
      - JANUS_DEBUG_LEVEL=2
      - JANUS_HOST_IP=${JANUS_HOST_IP:-}
      - CIRCUIT_BREAKER_THRESHOLD=5
      - CIRCUIT_BREAKER_RESET_TIMEOUT_MS=60000
      - RETRY_BASE_DELAY_MS=1000
      - RETRY_MAX_DELAY_MS=30000
      - HEALTHCHECK_CRITICAL_TIMEOUT_MS=120000
    healthcheck:
      test:
        [
          "CMD-SHELL",
          'node -e "fetch(''http://localhost:3000/api/health/live'').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"',
        ]
      interval: 30s
      timeout: 5s
      start_period: 10s
      retries: 3
    restart: unless-stopped
    stop_grace_period: 30s
# JANUS_HOST_IP must be set (shell or .env file); compose fails with an error if it is missing
JANUS_HOST_IP=192.168.1.x docker compose up -d
# Open http://192.168.1.x:3000 → follow setup wizard

The repo includes a ready-to-use docker-compose.yml — just clone and run.

Multiple printers

One SentryBridge container serves exactly one printer. For several printers, run one container per printer. Each container needs its own:

  • container_name
  • host web port (the container side stays 3000)
  • config volume (./config-<name>)
  • Janus UDP range via JANUS_RTP_PORT_RANGE, published with the same numbers on host and container side (10300-10400:10300-10400/udp). Remapping such as 10300-10400:10100-10200/udp does not work, because Janus advertises its container-internal ports to the browser.

JANUS_HOST_IP is the same for all containers (the Docker host's LAN IP). The Janus-internal ports 8188 (WebSocket) and 17732/udp (RTP from ffmpeg) stay inside each container and need no change.

services:
  bridge-core-one:
    image: rleban/sentry-bridge:latest
    container_name: sentry-bridge-core-one
    ports:
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:3000:3000"
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:10100-10200:10100-10200/udp"
    volumes:
      - ./config-core-one:/config
    environment:
      - JANUS_HOST_IP=${JANUS_HOST_IP:-}
      - JANUS_RTP_PORT_RANGE=10100-10200
    restart: unless-stopped

  bridge-core-one-l:
    image: rleban/sentry-bridge:latest
    container_name: sentry-bridge-core-one-l
    ports:
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:3001:3000"
      - "${JANUS_HOST_IP:?set JANUS_HOST_IP to the Docker host LAN IP}:10300-10400:10300-10400/udp"
    volumes:
      - ./config-core-one-l:/config
    environment:
      - JANUS_HOST_IP=${JANUS_HOST_IP:-}
      - JANUS_RTP_PORT_RANGE=10300-10400
    restart: unless-stopped

Open http://<JANUS_HOST_IP>:3000 and http://<JANUS_HOST_IP>:3001 and run the Setup Wizard once per printer.

Footprint per container (measured): about 150 MB RAM and about 10–15 % of one CPU core, mostly ffmpeg converting camera frames to JPEG (measured on a Core One, v2.1.0). The image (~625 MB) is stored once on disk and shared by all containers.

Configuration

Environment Variables

Variable Default Required / Optional Description
PORT 3000 Optional HTTP port
CONFIG_PATH /config/config.json Optional Config file path
ALLOWED_HOSTS (unset) Optional Comma-separated extra hostnames the bridge answers to (reverse proxy, Tailscale MagicDNS). IPs, localhost, single-label and *.local names are always allowed; other hosts get 403.
JANUS_HOST_IP (unset) Required (for WebRTC) LAN IP of the Docker host. Janus advertises this as its ICE candidate so the browser can reach it. Without this, the live stream falls back to MJPEG snapshots.
JANUS_RTP_PORT_RANGE 10100-10200 Optional UDP range for Janus WebRTC media (MIN-MAX, 1024–65535). Publish it with host port = container port. Use a distinct range per container when running several on one host.
JANUS_MODE auto Optional bundled — bridge manages Janus binary; hosted — external/sidecar; auto — detect
JANUS_DEBUG_LEVEL 2 Optional Janus log verbosity: 0=Fatal 1=Err 2=Warn 3=Info 4=Verbose 5=Huge
CIRCUIT_BREAKER_THRESHOLD 5 Optional Consecutive PrusaLink failures before circuit opens
CIRCUIT_BREAKER_RESET_TIMEOUT_MS 60000 Optional Time (ms) before retrying after circuit opens
RETRY_BASE_DELAY_MS 1000 Optional Initial retry delay (ms)
RETRY_MAX_DELAY_MS 30000 Optional Maximum retry delay (ms)
HEALTHCHECK_CRITICAL_TIMEOUT_MS 120000 Optional Time (ms) a critical component can stay DOWN before /api/health/ready returns 503

config.json

The wizard writes /config/config.json on the mounted volume. All fields can also be set manually:

{
  "prusalink": {
    "url": "http://192.168.1.x",
    "username": "maker",
    "password": "your-prusalink-password"
  },
  "camera": {
    "rtspUrl": "rtsp://192.168.1.x/live",
    "frameIntervalSeconds": 10
  },
  "obico": {
    "serverUrl": "https://app.obico.io",
    "apiKey": ""
  },
  "polling": {
    "statusIntervalMs": 5000
  }
}
  • prusalink — printer URL, username, and password for HTTP Digest Auth access to PrusaLink
  • camera — RTSP stream URL and snapshot interval in seconds
  • obico — server URL and pairing token (apiKey is empty until the wizard completes pairing)
  • polling — polling interval in milliseconds (default: 5000)

Setup Wizard

On first start the bridge serves a 4-step wizard at http://<JANUS_HOST_IP>:3000:

  1. PrusaLink — enter printer URL (e.g. http://192.168.x.x), username (maker), and password. The wizard performs a live connection test before continuing.
  2. Camera — the wizard probes rtsp://[printer-ip]/live and shows a preview frame. This step is mandatory — it blocks until a frame is received.
  3. Obico Pairing — enter your Obico server URL (https://app.obico.io or your self-hosted instance). The wizard displays a 6-digit pairing code. Confirm it in Obico's "Link Printer" dialog.
  4. Done — redirect to the dashboard. The bridge starts forwarding status and frames.

Known Limitations

These are intentional product decisions, not bugs:

  • One container = one printer. Simplifies config, isolation, and restarts. Run multiple containers on different ports for multiple printers.
  • RTSP camera is mandatory. Obico's AI failure detection requires a live stream — there is no "disable camera" mode.
  • Built for the LAN, without authentication. The web UI and the REST API have no login. Anyone who can reach port 3000 can change the config, pause or cancel prints, start and delete files. Do not expose port 3000 to the internet or to networks you don't trust. For remote access, put the bridge behind a VPN (e.g. Tailscale or WireGuard) or a reverse proxy with its own authentication.
  • Manual printer controls are limited. Besides pause / resume / cancel, the bridge can list, upload (POST /api/files/upload), start and delete G-code files. It does not offer filament load/unload or print queue management.

Troubleshooting

If a startup check fails (PrusaLink, credentials, camera, Obico, pairing), the dashboard shows which one and how to fix it, with a Re-check button. The checks never stop the bridge from starting.

1. PrusaLink auth fails (401)

  • Symptom: Wizard step 1 fails with 401 Unauthorized
  • Check URL has no trailing slash: http://<printer-ip> not http://<printer-ip>/
  • Verify credentials in PrusaLink: Settings → Network → API Key / User Password
  • Test from host: curl -u <username>:<password> --digest http://<printer-ip>/api/v1/status

2. Camera RTSP unreachable

  • Symptom: Wizard step 2 blocks, no frame preview
  • Confirm printer has a camera (Buddy3D board) and RTSP is enabled
  • In Prusa Connect, open the printer details → Camera → camera settings and set the field Streaming to RTSP (options: Disable / RTSP / WebRTC). Re-check after every firmware update — newer firmware may switch it back to WebRTC
  • Test from host: ffmpeg -rtsp_transport tcp -i rtsp://<printer-ip>/live -frames:v 1 -f image2 test.jpg
  • Check LAN: printer and Docker host on the same subnet, no VLAN isolation

3. Obico pairing never confirms

  • Symptom: Wizard step 3 shows pairing code but Obico never confirms
  • Verify the server URL (https://app.obico.io or your self-hosted URL) — no trailing slash
  • Check firewall between bridge and Obico server (WebSocket on 443/80)
  • Container logs: docker logs <container> | grep obico

4. WebRTC live stream is black in Obico

  • Symptom: Obico control panel loads but video is black / spinning
  • JANUS_HOST_IP must be set to the Docker host's LAN IP, not 127.0.0.1 or 0.0.0.0
  • Confirm UDP ports 10100-10200 are published and reachable from the browser
  • Test: docker exec <container> env | grep JANUS_HOST_IP
  • Restart after change: docker compose up -d --force-recreate

5. Obico live view stays black after a bridge restart

  • Symptom: after the bridge container restarts (the bundled Janus restarts with it), an Obico live view that was already open stays black
  • Reload the Obico page — the web client does not re-establish the WebRTC session on its own; this is how Obico's web client behaves with the official agents too
  • The dashboard MJPEG view is not affected

6. Obico's "OctoPrint" button shows an error

  • Symptom: the button shows error 484 ("Failed to create a new tunnel")
  • The self-hosted Obico server needs a tunnel port range (OCTOPRINT_TUNNEL_PORT_RANGE) or subdomain tunnels; '0-0' disables tunnels. See Obico's tunnel guide
  • With tunnels working, the button shows a page that links to the bridge on your LAN — the bridge UI itself is not served through Obico, since it has no login

Building from Source

For local development or custom builds:

Prerequisites

  • Node.js 26+
  • ffmpeg 5 or newer (in ffmpeg 4, -timeout switches RTSP to listen mode, so the camera test hangs)
  • Docker Desktop (for Janus sidecar on Mac)

Setup

git clone https://github.com/reneleban/sentry-bridge.git
cd sentry-bridge
npm run install:all

Run (dev)

npm run dev:all          # backend (tsx watch) + frontend (Vite)

Frontend proxies /api/* to the backend automatically.

Janus WebRTC sidecar (Mac / dev only)

On Mac, Janus cannot be installed natively. Run it as a Docker sidecar:

docker compose -f docker-compose.dev.yml up -d

This starts Janus with:

  • WS on port 8188 (bridge relay)
  • RTP input on port 17732/udp (from ffmpeg)
  • ICE media on ports 10100–10200/udp (WebRTC)

For WebRTC to work during local development, set nat_1_1_mapping in config/janus/janus.jcfg to your Mac's LAN IP (e.g. 192.168.1.x). This tells Janus which IP to advertise for ICE so the browser can reach it.

The bridge auto-detects a running Janus on ws://127.0.0.1:8188 before looking for a local binary.

In production (Docker image), Janus runs natively inside the container — set JANUS_HOST_IP in the environment instead of editing the config file directly.

Test

npm run test:backend

Build

npm run build:all           # TypeScript + Vite → dist/ + frontend/dist/
npm run build:docker        # Docker image (single platform)

Architecture

Prusa Core One
  ├── PrusaLink HTTP  →  Bridge (status poll, pause/resume/cancel)
  └── RTSP /live      →  ffmpeg → H.264 RTP → Janus (WebRTC)
                                                   ↕ WS relay
Browser  ←  Obico Server  ←  /ws/janus/{id}/  ←  Bridge
  • Config module — reads/writes JSON from mounted volume
  • PrusaLink client — HTTP Digest Auth, polls status + job
  • Camera module — RTSP → JPEG frames (MJPEG) + H.264 RTP (WebRTC)
  • Janus manager — spawns/detects Janus WebRTC gateway
  • Janus relay — bidirectional WS relay: local Janus ↔ Obico
  • Obico agent — WebSocket to Obico, pairing flow, status + frame forwarding

About

No description or website provided.

Topics

3d-printingdockerobicoprusatypescript

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.