Download this file
| 1 | [Unit] |
| 2 | Description=lchat connect broker (OAuth relay + token exchange) |
| 3 | After=network-online.target |
| 4 | Wants=network-online.target |
| 5 | |
| 6 | [Service] |
| 7 | # /data/connect.env holds LCHAT_ADMIN_TOKEN + the DNSimple OAuth client_id/secret |
| 8 | # + the registered redirect_uri. Required (no leading '-'): a misconfigured broker |
| 9 | # breaks connecting services fleet-wide, so it must fail to boot rather than start |
| 10 | # silently broken. |
| 11 | EnvironmentFile=/data/connect.env |
| 12 | ExecStart=/opt/lchat/connect --addr /run/lchat/connect.sock --db /data/connect.db |
| 13 | Restart=always |
| 14 | RestartSec=1 |
| 15 | |
| 16 | # --- hardening (see docs/instance-router.md § Hardening) --- |
| 17 | User=lchat |
| 18 | Group=lchat |
| 19 | CapabilityBoundingSet= |
| 20 | NoNewPrivileges=yes |
| 21 | ProtectSystem=strict |
| 22 | ProtectHome=yes |
| 23 | ReadWritePaths=/data /run/lchat |
| 24 | PrivateTmp=yes |
| 25 | PrivateDevices=yes |
| 26 | ProtectClock=yes |
| 27 | ProtectHostname=yes |
| 28 | ProtectKernelTunables=yes |
| 29 | ProtectKernelModules=yes |
| 30 | ProtectKernelLogs=yes |
| 31 | ProtectControlGroups=yes |
| 32 | ProtectProc=invisible |
| 33 | RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX |
| 34 | RestrictNamespaces=yes |
| 35 | RestrictRealtime=yes |
| 36 | RestrictSUIDSGID=yes |
| 37 | LockPersonality=yes |
| 38 | MemoryDenyWriteExecute=yes |
| 39 | SystemCallFilter=@system-service |
| 40 | SystemCallErrorNumber=EPERM |
| 41 | SystemCallArchitectures=native |
| 42 | MemoryMax=256M |
| 43 | TasksMax=256 |
| 44 | |
| 45 | [Install] |
| 46 | WantedBy=multi-user.target |
| 47 | |