fix: remove --tray flag for Linux server launch

The Linux server binary is built with CGO_ENABLED=0 and -tags notray,
so --tray is not available. The systemd service and LaunchServer now
start the server without the --tray flag on Linux.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-03-25 01:01:10 +08:00
parent 1a2811f8c9
commit b806a42bcd
2 changed files with 6 additions and 4 deletions

View File

@ -648,11 +648,13 @@ func (inst *Installer) LaunchServer() (string, error) {
// Read config to get relay args
// Windows: use --gui (web-based controller, no CGO needed)
// macOS/Linux: use --tray (system tray, CGO-enabled build)
// macOS: use --tray (system tray, CGO-enabled build)
// Linux: no flag (headless server, no tray/gui)
var args []string
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "windows":
args = append(args, "--gui")
} else {
case "darwin":
args = append(args, "--tray")
}
cfgPath := filepath.Join(platformConfigDir(), "config.json")

View File

@ -85,7 +85,7 @@ func installAutoRestart(installDir string) error {
"",
"[Service]",
"Type=simple",
"ExecStart=" + binPath + " --tray",
"ExecStart=" + binPath,
"WorkingDirectory=" + installDir,
"Restart=on-failure",
"RestartSec=5",