feat: system service management (gyandoot service install|remove|status)

- Create systemd + launchd service templates in resources/
- Add gyandoot-core/src/service.rs module with full lifecycle
  - systemd: user service, daemon-reload, enable, start, stop, disable
  - launchd: macOS plist, load/unload, start/stop (launchctl)
- Add 'gyandoot service install|remove|status' CLI subcommand
- Update setup wizard: prompts 'Install system service? [y/N]'
- Update install.sh: prompts user for service install after binary
- Browser auto-starts at runtime (browser_manager), no separate service needed
- Camoufox installed via npm, auto-started by GyanDoot agent loop
This commit is contained in:
2026-06-11 23:23:49 +05:30
parent f2d612bd28
commit b2650a569c
8 changed files with 615 additions and 83 deletions

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.gyandoot.agent</string>
<key>ProgramArguments</key>
<array>
<string>%BINARY%</string>
<string>serve</string>
<string>--host</string>
<string>127.0.0.1</string>
<string>--port</string>
<string>8777</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
<key>Crashed</key>
<true/>
</dict>
<key>WatchPaths</key>
<array>
<string>%HOME%/.config/gyandoot/config.toml</string>
</array>
<key>StandardOutPath</key>
<string>%HOME%/.gyandoot/service.log</string>
<key>StandardErrorPath</key>
<string>%HOME%/.gyandoot/service.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>GYANDOOT_CONFIG</key>
<string>%HOME%/.config/gyandoot/config.toml</string>
<key>GYANDOOT_LOG</key>
<string>info</string>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:%HOME%/.local/bin</string>
</dict>
<key>WorkingDirectory</key>
<string>%HOME%/.gyandoot</string>
</dict>
</plist>