Download this file
| 1 | [Unit] |
| 2 | Description=lchat public-web fetch service (unfurl + signed image proxy) |
| 3 | After=network-online.target |
| 4 | Wants=network-online.target |
| 5 | |
| 6 | [Service] |
| 7 | # The service's own secrets (preview salt + image-signing key) mint themselves |
| 8 | # into its DB on first boot (fetch.go). The optional env file carries exactly |
| 9 | # one thing: LCHAT_GIPHY_KEY, the platform Giphy key that turns /api/gif on. |
| 10 | EnvironmentFile=-/data/fetch.env |
| 11 | ExecStart=/opt/lchat/lchat fetch run --socket /run/lchat/fetch.sock --db /data/fetch.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=/run/lchat /data |
| 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=512M |
| 42 | TasksMax=256 |
| 43 | |
| 44 | [Install] |
| 45 | WantedBy=multi-user.target |
| 46 | |