[Unit] Description=Battleship relay Documentation=https://github.com/agrauf67/battleship After=network-online.target Wants=network-online.target [Service] # Anything else the relay should be told - a certificate, for one - lives in this file, # so turning TLS on does not mean editing a unit that the installer owns. EnvironmentFile=-/etc/battleship-relay/options ExecStart=/usr/bin/python3 /opt/battleship-relay/relay.py --port 8642 --key-file /etc/battleship-relay/key $RELAY_EXTRA User=battleship Group=battleship Restart=on-failure RestartSec=5 # The relay reads its key once, writes nothing and needs no privileges: it opens one # listening socket and copies bytes. Everything else is taken away from it. /etc stays # readable under ProtectSystem=strict, which is all the key file needs. NoNewPrivileges=true PrivateTmp=true PrivateDevices=true ProtectSystem=strict ProtectHome=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true RestrictAddressFamilies=AF_INET AF_INET6 RestrictNamespaces=true RestrictSUIDSGID=true LockPersonality=true MemoryDenyWriteExecute=true SystemCallArchitectures=native CapabilityBoundingSet= AmbientCapabilities= [Install] WantedBy=multi-user.target