eleven / ocho Public

Clone
git clone https://amadan.net/eleven/ocho

Plain git — no account needed to clone.

Download

Download this file

1[Unit]
2Description=lchat bot sidecar for %i
3After=network-online.target lchat@%i.service
4Wants=network-online.target
5
6[Service]
7# add-bot writes /data/%i-bot.env (0600) with LCHAT_BASE, the three agent invites,
8# session paths, and (optionally) ANTHROPIC_API_KEY.
9EnvironmentFile=-/data/%i-bot.env
10# The sidecar is the SAME versioned Go binary as its instance: exec the per-host
11# live symlink (/opt/lchat/live/%i → versions/<ver>/lchat) that lchat@%i.service
12# runs, so the bot's code stays in lock-step with the app by construction. `bot run`
13# with no positional args reads LCHAT_BASE + the LCHAT_*_SESSION paths from the
14# EnvironmentFile above, running whichever identities are set (a full trio or an
15# Eleven-only box both work). A deploy/update repoints that symlink and restarts this
16# unit (deployHostVersion → restartBotSidecar), so the bot always tracks the version.
17ExecStart=/opt/lchat/live/%i bot run
18Restart=always
19RestartSec=2
20
21# --- hardening (see docs/instance-router.md § Hardening) ---
22# Pure outbound WebSocket client: no listening socket, no capabilities.
23User=lchat
24Group=lchat
25CapabilityBoundingSet=
26NoNewPrivileges=yes
27ProtectSystem=strict
28ProtectHome=yes
29# Writes only its persisted agent sessions under /data/%i-bot/. HOME lands in the
30# private /tmp so nothing reaches for a real home dir.
31ReadWritePaths=/data
32Environment=HOME=/tmp
33PrivateTmp=yes
34PrivateDevices=yes
35ProtectClock=yes
36ProtectHostname=yes
37ProtectKernelTunables=yes
38ProtectKernelModules=yes
39ProtectKernelLogs=yes
40ProtectControlGroups=yes
41ProtectProc=invisible
42RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
43RestrictNamespaces=yes
44RestrictRealtime=yes
45RestrictSUIDSGID=yes
46LockPersonality=yes
47MemoryDenyWriteExecute=yes
48SystemCallFilter=@system-service
49SystemCallErrorNumber=EPERM
50SystemCallArchitectures=native
51MemoryMax=512M
52TasksMax=512
53
54[Install]
55WantedBy=multi-user.target
56