mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-29 13:19:15 +00:00
f599110386
The separate saelix/sencho-mesh sidecar container is gone. The
forwarder logic that previously lived in mesh-sidecar/src/forwarder.ts
moves into the Sencho process as backend/src/services/MeshForwarder.ts,
a thin per-port net.Server lifecycle wrapper. MeshService implements
the host interface and owns resolve plus splice; MeshForwarder owns
listener boilerplate. One container per node, no separate image to
publish, no control WebSocket.
Operator-facing change: the Sencho container now runs in
network_mode: host so the forwarder can bind alias ports on the host
network where meshed containers' extra_hosts host-gateway entries
point. Without host network mode the listeners would land in the
container's namespace and inbound traffic from peers would never
reach them. The 1852:1852 port publish becomes a no-op under host
mode and is commented out in the operator template.
Same-node forward path now dials the target container's bridge IP
via Dockerode (preferring the compose default network for
deterministic selection across daemon versions) instead of 127.0.0.1.
The legacy 127.0.0.1 path only worked when the target service
published its port to the host; the IP path works regardless.
Cross-node mesh routing in this phase is central -> pilot direction
only via PilotTunnelManager.openTcpStream. Pilot -> central and
pilot <-> pilot via central relay land in Phase B with the
tcp_open_reverse frame.
Deletions:
- mesh-sidecar/ package entirely (Dockerfile, package, sources, tests)
- backend/src/websocket/meshControl.ts
- MeshService sidecar lifecycle: spawnSidecar, stopSidecar,
isSidecarRunning, mintSidecarToken, verifySidecarToken,
attachSidecarSocket, handleSidecarResolve, sendSidecar
- POST /api/mesh/nodes/:id/sidecar/restart route
- /api/mesh/control WS dispatch in upgradeHandler
Type cleanup: 'sidecar' literal removed from MeshActivitySource and
MeshProbeResult.where (also the frontend mirror). MeshNodeStatus
sidecarRunning becomes localForwarderListening (boolean | null) so
non-local nodes get a null instead of an unconditional false; the
honest semantic is "this view only knows the local forwarder state;
remote forwarder status lands in Phase B." MeshNodeDiagnostic
sidecar object becomes forwarder { listening, listenerCount }.
Frontend MeshDiagnosticsSheet drops the restart-sidecar action and
sidecar liveness card; surfaces forwarder state plus a "runs
in-process; no separate container" caption.
Resolves audit findings C-1 (data plane non-functional), C-2 (sidecar
control WS not loopback-enforced), C-4 (sidecar lifecycle Dockerode-
on-remote, PR #999 closed), and C-5 (saelix/sencho-mesh:latest
unreachable). C-3 (PR #992) is unchanged. M-12 (PR #994) is
unchanged.
47 lines
2.1 KiB
YAML
47 lines
2.1 KiB
YAML
services:
|
|
sencho:
|
|
image: saelix/sencho:latest
|
|
build: .
|
|
container_name: sencho
|
|
restart: unless-stopped
|
|
# Sencho Mesh listens on host ports for cross-stack alias traffic. Host
|
|
# network mode is required for mesh to function. If you do not use mesh,
|
|
# comment `network_mode: host` out and uncomment the `ports` block below.
|
|
network_mode: host
|
|
# ports:
|
|
# - "1852:1852"
|
|
volumes:
|
|
# Required: Docker Socket for container orchestration
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
# Required: Sencho's internal database for alerts and settings
|
|
# Format is [Host Path]:[Container Path]
|
|
# You can change the left side to anywhere on your server, but leave the right side as /app/data
|
|
- ./data:/app/data
|
|
|
|
# ⚠️ THE 1:1 COMPOSE PATH RULE ⚠️
|
|
# Mount the root folder where all your compose files live.
|
|
# The path on the left (Host) MUST EXACTLY MATCH the path on the right (Container).
|
|
# EXAMPLE: If your compose files are in /opt/docker, use: - /opt/docker:/opt/docker
|
|
- /path/to/your/docker/folder:/path/to/your/docker/folder
|
|
|
|
# (Optional but Recommended) Media/Data Drives
|
|
# Mount your media drives here so Docker Compose inside Sencho can validate paths during deployment.
|
|
- /path/to/your/media/drives:/path/to/your/media/drives
|
|
|
|
environment:
|
|
# ENVIRONMENT VARIABLES FOR INSIDE THE CONTAINER
|
|
|
|
# This points to the Container Path (right side) of your 1:1 mount above
|
|
- COMPOSE_DIR=/path/to/your/docker/folder/compose
|
|
|
|
# This points to the Container Path (right side) of your database mount above. Leave this as /app/data.
|
|
- DATA_DIR=/app/data
|
|
|
|
# ⚠️ GLOBAL ENVIRONMENT VARIABLES ⚠️
|
|
# If your compose files rely on host-level shell variables (like $PUID, $TZ)
|
|
# or a centralized globals.env file, you MUST pass them into Sencho here.
|
|
# Otherwise, Sencho will evaluate your compose files with empty variables.
|
|
# If you do not use a global env file, you can delete these two lines.
|
|
env_file:
|
|
- /path/to/your/docker/folder/env/globals.env |