Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

2.7 KB
Raw Blame
[Unit]
Description=Pixel Agent host ingress (ODS -> Pixel gateway)
# Wait for the network/filesystem that the ingress and status paths depend on.
After=network.target
Wants=network-online.target

[Service]
# Run as the same unprivileged owner as the Pixel gateway so the service can
# read that owner's mode-0600 token without copying it into ODS state.
Type=simple
User=__PIXEL_SERVICE_USER__
Group=ods-pixel
# Keep access to the owner's private control socket after overriding Group.
SupplementaryGroups=__PIXEL_SERVICE_GID__
ExecStart=/usr/bin/env node /usr/local/libexec/ods-pixel-ingress.mjs
Restart=on-failure
# Model-route reconciliation uses SIGHUP as a narrowly scoped, owner-safe
# request for systemd to replace this process. systemd normally treats SIGHUP
# as a clean termination, so force a restart for that signal while preserving
# ordinary clean-stop behavior.
RestartForceExitStatus=SIGHUP
RestartSec=5
TimeoutStartSec=30
TimeoutStopSec=20

# Nonsecret configuration only. The gateway token is never placed here; it is
# read solely from the restricted PIXEL_GATEWAY_TOKEN_FILE at runtime.
EnvironmentFile=/etc/ods/pixel-agent.env
Environment=NODE_ENV=production

# RuntimeDirectory gives us /run/ods-pixel owned by the Pixel user:ods-pixel.
# Group members may traverse to the known socket path but cannot list entries.
RuntimeDirectory=ods-pixel
RuntimeDirectoryMode=0710
# Docker bind-mounts the runtime directory into pixel-edge. Preserve the
# directory inode across ingress stop/start so the container continues to see a
# newly recreated socket instead of remaining bound to an abandoned directory.
RuntimeDirectoryPreserve=yes

# Delivery acknowledgements and full Portal history survive process reboots.
StateDirectory=ods-pixel-chat
StateDirectoryMode=0700

UMask=0007

# Hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
RestrictNamespaces=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
RestrictRealtime=true
SystemCallArchitectures=native
CapabilityBoundingSet=
# ProtectHome hides every home directory. Bind only the exact owner-private
# source file into the service's private runtime directory; the process never
# receives access to the source home path or any neighboring owner state.
BindReadOnlyPaths=__PIXEL_GATEWAY_TOKEN_SOURCE__:__PIXEL_GATEWAY_TOKEN_FILE__
ReadOnlyPaths=/etc/ods/pixel-agent.env
ReadWritePaths=/run/ods-pixel /var/lib/ods-pixel-chat
# Docker socket is NOT mounted into the service; the status projection probes
# docker only if the CLI is available on the host PATH.
PrivateMounts=true

[Install]
WantedBy=multi-user.target