diff --git a/.claude/worktrees/feat-8635/changelog.d/features/8635-systemd-autostart-linux.md b/.claude/worktrees/feat-8635/changelog.d/features/8635-systemd-autostart-linux.md new file mode 100644 index 0000000000..5388099604 --- /dev/null +++ b/.claude/worktrees/feat-8635/changelog.d/features/8635-systemd-autostart-linux.md @@ -0,0 +1 @@ +- **feat(infra):** add systemd autostart unit for Linux ([#8635](https://github.com/diegosouzapw/OmniRoute/issues/8635)) diff --git a/.claude/worktrees/feat-8635/contrib/systemd/omniroute.service b/.claude/worktrees/feat-8635/contrib/systemd/omniroute.service new file mode 100644 index 0000000000..c2dae17631 --- /dev/null +++ b/.claude/worktrees/feat-8635/contrib/systemd/omniroute.service @@ -0,0 +1,19 @@ +[Unit] +Description=OmniRoute AI Proxy +After=network.target network-online.target +Wants=network-online.target + +[Service] +Type=simple +ExecStart=$(which omniroute) start +Restart=on-failure +RestartSec=5 +Environment=NODE_ENV=production + +# Security hardening +NoNewPrivileges=true +ProtectSystem=full +PrivateTmp=true + +[Install] +WantedBy=default.target diff --git a/.claude/worktrees/feat-8635/tests/unit/systemd-autostart.test.ts b/.claude/worktrees/feat-8635/tests/unit/systemd-autostart.test.ts new file mode 100644 index 0000000000..0dca17303f --- /dev/null +++ b/.claude/worktrees/feat-8635/tests/unit/systemd-autostart.test.ts @@ -0,0 +1,23 @@ +import { describe, it } from "node:test"; +import { ok } from "node:assert/strict"; +import { readFileSync, existsSync } from "node:fs"; + +describe("Systemd autostart (#8635)", () => { + const svcPath = "contrib/systemd/omniroute.service"; + const content = readFileSync(svcPath, "utf-8"); + + it("service file exists", () => { + ok(existsSync(svcPath)); + ok(content.length > 200); + }); + + it("defines required systemd sections", () => { + ok(content.includes("[Unit]")); + ok(content.includes("[Service]")); + ok(content.includes("[Install]")); + }); + + it("specifies WantedBy=default.target", () => { + ok(content.includes("WantedBy=default.target")); + }); +});