Tag v0.1.0

This commit is contained in:
Ian Gulliver
2026-10-18 16:14:03 -07:00
parent 543d1289e3
commit c4d7a67dad
14 changed files with 349 additions and 103 deletions
+17 -8
View File
@@ -8,6 +8,7 @@ import (
"os/exec"
"path/filepath"
"strings"
"syscall"
"g.fc.run/ai/byre/internal/tailscale"
)
@@ -69,19 +70,27 @@ func installCmd() {
}
fmt.Println("wrote", plistPath)
domain := fmt.Sprintf("gui/%d", os.Getuid())
service := domain + "/" + serviceLabel
if exec.Command("launchctl", "print", service).Run() == nil {
run("launchctl", "bootout", service)
}
run("launchctl", "bootstrap", domain, plistPath)
fmt.Println("started", service, "running", exe)
url, err := tailscale.ServeRoot(context.Background(), "http://"+defaultListen)
if err != nil {
fatal("tailscale serve", "err", err)
}
fmt.Println("byre is at", url)
domain := fmt.Sprintf("gui/%d", os.Getuid())
service := domain + "/" + serviceLabel
if exec.Command("launchctl", "print", service).Run() != nil {
run("launchctl", "bootstrap", domain, plistPath)
fmt.Println("started", service, "running", exe)
return
}
// bootout kills every process the service started, which includes this one when an agent runs it.
reload := exec.Command("/bin/sh", "-c", `launchctl bootout "$1"; launchctl bootstrap "$2" "$3"`, "sh", service, domain, plistPath)
reload.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
err = reload.Start()
if err != nil {
fatal("restart service", "err", err)
}
fmt.Println("restarting", service, "on", exe)
}
func run(name string, args ...string) {