carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1# The platform STUN/TURN relay (media roadmap stage 4a). Armed only on a
2# box that carries /etc/carlos/relay-masters; ConditionPathExists keeps a
3# box without a master from ever listening. Shares the box with the edge and
4# must lose first: bounded memory, PSI-driven shedding in the process, and
5# the highest OOM adjustment there is.
6[Unit]
7Description=carlos relay (STUN and TURN)
8After=network-online.target
9Wants=network-online.target
10ConditionPathExists=/etc/carlos/relay-masters
11
12[Service]
13EnvironmentFile=-/etc/carlos/host.env
14ExecStart=/opt/carlos/carlos relay serve
15Restart=always
16RestartSec=1
17
18User=carlos
19Group=carlos
20NoNewPrivileges=yes
21ProtectSystem=strict
22ProtectHome=yes
23ReadWritePaths=/data/relay /run/carlos
24PrivateTmp=yes
25PrivateDevices=yes
26ProtectClock=yes
27ProtectHostname=yes
28ProtectKernelTunables=yes
29ProtectKernelModules=yes
30ProtectKernelLogs=yes
31ProtectControlGroups=yes
32ProtectProc=invisible
33RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
34RestrictNamespaces=yes
35RestrictRealtime=yes
36RestrictSUIDSGID=yes
37LockPersonality=yes
38MemoryDenyWriteExecute=yes
39SystemCallFilter=@system-service
40SystemCallErrorNumber=EPERM
41SystemCallArchitectures=native
42MemoryHigh=160M
43MemoryMax=256M
44OOMScoreAdjust=1000
45TasksMax=512
46Nice=5
47CPUWeight=50
48
49[Install]
50WantedBy=multi-user.target
51