|
|
@@ -0,0 +1,44 @@
|
|
|
+[Unit]
|
|
|
+Description=Smartbotic VectorAPI Service
|
|
|
+Documentation=https://git.smartbotics.ai/fszontagh/smartbotic-vectorapi
|
|
|
+After=network-online.target smartbotic-database.service
|
|
|
+Wants=network-online.target
|
|
|
+
|
|
|
+[Service]
|
|
|
+# The binary calls sd_notify(READY=1) after the HTTP listener is up (when built
|
|
|
+# with libsystemd). Type=notify makes dependents block until we're actually
|
|
|
+# serving. If built without libsystemd, sd_notify is a no-op — in that case
|
|
|
+# change Type to "exec".
|
|
|
+Type=notify
|
|
|
+NotifyAccess=main
|
|
|
+User=smartbotic-vectorapi
|
|
|
+Group=smartbotic-vectorapi
|
|
|
+ExecStart=/usr/bin/smartbotic-vectorapi --config /etc/smartbotic-vectorapi/config.json
|
|
|
+Restart=on-failure
|
|
|
+RestartSec=3
|
|
|
+WorkingDirectory=/var/lib/smartbotic-vectorapi
|
|
|
+LimitNOFILE=65536
|
|
|
+
|
|
|
+# Secrets (optional): seed the admin key / OpenAI key on first boot.
|
|
|
+EnvironmentFile=-/etc/smartbotic-vectorapi/vectorapi.env
|
|
|
+
|
|
|
+# Security hardening (mirrors callerai-webapi). Outbound network is allowed
|
|
|
+# (needed for OpenAI embeddings); only writes to the data dir are permitted.
|
|
|
+NoNewPrivileges=true
|
|
|
+ProtectSystem=strict
|
|
|
+ProtectHome=true
|
|
|
+PrivateTmp=true
|
|
|
+PrivateDevices=true
|
|
|
+ProtectKernelTunables=true
|
|
|
+ProtectKernelModules=true
|
|
|
+ProtectControlGroups=true
|
|
|
+RestrictRealtime=true
|
|
|
+RestrictSUIDSGID=true
|
|
|
+RestrictNamespaces=true
|
|
|
+LockPersonality=true
|
|
|
+ReadWritePaths=/var/lib/smartbotic-vectorapi
|
|
|
+SystemCallFilter=@system-service
|
|
|
+SystemCallErrorNumber=EPERM
|
|
|
+
|
|
|
+[Install]
|
|
|
+WantedBy=multi-user.target
|