feat(update): add update deployment via web UI

- Deploy exe to alternate port 5033
- Current instance keeps running
- Add parallel mode and addr flag
- Add update panel to web UI
- Update OpenAPI spec and CLI
This commit is contained in:
2026-09-01 20:17:06 +03:00
parent 2318684e93
commit 1bba2c6b51
13 changed files with 338 additions and 16 deletions
+11 -5
View File
@@ -29,10 +29,15 @@ func main() {
background := flag.Bool("background", false, "spawn detached agent and exit")
ensure := flag.Bool("ensure", false, "start the agent if it is not already running")
foreground := flag.Bool("foreground", false, "keep console visible (dev only)")
skipInstall := flag.Bool("skip-install", false, "do not copy exe into the install directory")
parallel := flag.Bool("parallel", false, "allow running beside another agent instance")
addr := flag.String("addr", "", "listen address host:port (overrides AGENT_ADDR)")
flag.Parse()
if err := install.Ensure(); err != nil {
die(err, *foreground)
if !*skipInstall {
if err := install.Ensure(); err != nil {
die(err, *foreground)
}
}
if *ensure {
@@ -58,8 +63,9 @@ func main() {
_ = helpers.AttachLogFile()
}
cfg := agent.Config{ListenAddr: *addr, Parallel: *parallel}
for {
err := runAgent()
err := runAgent(cfg)
if err == nil {
return
}
@@ -72,7 +78,7 @@ func main() {
}
}
func runAgent() (err error) {
func runAgent(cfg agent.Config) (err error) {
defer func() {
if r := recover(); r != nil {
crashlog.RecordPanic(r)
@@ -80,7 +86,7 @@ func runAgent() (err error) {
}
}()
a, err := agent.New()
a, err := agent.New(cfg)
if err != nil {
if strings.Contains(err.Error(), "already running") {
return errAlreadyRunning