diff options
| author | Adam Malczewski <[email protected]> | 2026-05-22 16:19:35 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-05-22 16:19:35 +0900 |
| commit | 45a4890031192f4e7409443f98e824dad17ba175 (patch) | |
| tree | a28e1b0618f682476b0b57ba70e8ba26a1939a49 /packaging/dispatch-api.service | |
| parent | 9ecaabd87c0e51b8a7408dabb0133a9344586859 (diff) | |
| download | dispatch-45a4890031192f4e7409443f98e824dad17ba175.tar.gz dispatch-45a4890031192f4e7409443f98e824dad17ba175.zip | |
feat: Arch Linux packaging with Electron frontend, systemd backend service, and Windows exe build
- Add Electron wrapper (main.cjs, preload.cjs) for desktop frontend
- Add systemd service unit, env config, and sysusers for backend API
- Add PKGBUILD and .install for Arch package (makepkg -si)
- Add desktop entry, SVG/PNG icon, and wrapper scripts
- Add bin/build-pkg, bin/install-pkg, bin/windows-pkg scripts
- Make API port configurable via PORT env var (default 3000, prod 18390)
- Add electron-builder config for Windows exe cross-compilation
- Set vite base to './' for Electron file:// loading
Diffstat (limited to 'packaging/dispatch-api.service')
| -rw-r--r-- | packaging/dispatch-api.service | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packaging/dispatch-api.service b/packaging/dispatch-api.service new file mode 100644 index 0000000..ccbb727 --- /dev/null +++ b/packaging/dispatch-api.service @@ -0,0 +1,33 @@ +[Unit] +Description=Dispatch API Backend +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=dispatch +Group=dispatch +WorkingDirectory=/opt/dispatch +ExecStart=/usr/bin/bun packages/api/src/index.ts +EnvironmentFile=-/etc/dispatch/dispatch-api.conf +Restart=on-failure +RestartSec=5 +StandardOutput=journal +StandardError=journal + +# Data directory: systemd creates /var/lib/dispatch owned by dispatch:dispatch +StateDirectory=dispatch + +# Tell the app to store its SQLite DB under /var/lib/dispatch/ +Environment=XDG_DATA_HOME=/var/lib + +# Security hardening +ProtectSystem=strict +ProtectHome=true +NoNewPrivileges=true +PrivateTmp=true +PrivateDevices=true +RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX + +[Install] +WantedBy=multi-user.target |
