eleven / messenger Public

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

Plain git — no account needed to clone.

Download

Download this file

1[Unit]
2Description=lchat webhook-ingest sidecar for %i
3After=network-online.target lchat@%i.service
4Wants=network-online.target
5
6[Service]
7# add-hooks writes /data/%i-hooks.env (0600) with LCHAT_BASE, the service
8# identity's one-time agent invite, the session path, and the socket path.
9EnvironmentFile=-/data/%i-hooks.env
10# Same versioned Go binary as the instance (the per-host live symlink), so the
11# ingest sidecar's code stays in lock-step with the app by construction —
12# exactly the lchat-bot@ arrangement. `hooks run` reads everything from the
13# EnvironmentFile above.
14ExecStart=/opt/lchat/live/%i hooks run
15Restart=always
16RestartSec=2
17
18# --- hardening (see docs/instance-router.md § Hardening) ---
19# Unlike the bot sidecar this process DOES listen — on a unix socket under
20# /run/lchat that only the router dials; it still binds no TCP port and needs
21# no capabilities. It is the inverse of the bot: inbound requests come in,
22# encrypted posts go out, and nothing here can read a conversation.
23User=lchat
24Group=lchat
25CapabilityBoundingSet=
26NoNewPrivileges=yes
27ProtectSystem=strict
28ProtectHome=yes
29# Writes its service-identity session under /data/%i-hooks/ and its listening
30# socket under /run/lchat. HOME lands in the private /tmp.
31ReadWritePaths=/data /run/lchat
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=256M
52TasksMax=256
53
54[Install]
55WantedBy=multi-user.target
56