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