open-humanity
Privacy-first peer assistance network for sovereign autonomous agents
Brought by drakestapleton
open-humanity / deploy / open-humanity-relay.service
| 1 | [Unit] |
| 2 | Description=Open Humanity relay (UDP 18098): carries requests for help to registered helpers and sealed answers back to the asker |
| 3 | Documentation=https://interplane.io/open/z2jftNw1LLYTNgj8DNoh1TGGNmEmP |
| 4 | After=network-online.target |
| 5 | |
| 6 | [Service] |
| 7 | # The relay needs the network and nothing else: no home folder, no writable path, a cleared |
| 8 | # environment, its own process, user and mount namespaces, no new privileges. |
| 9 | # Bind address is this host's, in relay.env, not in this unit. |
| 10 | EnvironmentFile=%h/.config/open-humanity/relay.env |
| 11 | ExecStart=/usr/bin/bwrap --unshare-all --share-net --die-with-parent --new-session --clearenv \ |
| 12 | --setenv BEACON_BIND ${BEACON_BIND} --setenv BEACON_PORT ${BEACON_PORT} \ |
| 13 | --setenv BEACON_LINKS ${BEACON_LINKS} \ |
| 14 | --ro-bind /usr /usr --symlink usr/lib /lib \ |
| 15 | --ro-bind %h/.local/lib/open-humanity/current/beacon /relay \ |
| 16 | --cap-drop ALL /relay |
| 17 | NoNewPrivileges=yes |
| 18 | Restart=on-failure |
| 19 | RestartSec=5 |
| 20 | # Exit 2 is a set but bad BEACON_BIND, BEACON_PORT or BEACON_LINKS (an unset line in relay.env reaches the |
| 21 | # relay as an empty value). A restart cannot fix it: stay failed, log the reason once. |
| 22 | RestartPreventExitStatus=2 |
| 23 | MemoryMax=512M |
| 24 | TasksMax=64 |
| 25 | |
| 26 | [Install] |
| 27 | WantedBy=default.target |