Fix busy binary reinstall and add per-node log viewing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 04:31:09 +03:00
co-authored by Cursor
parent 2d8b1d4438
commit 1fb87f5f6c
10 changed files with 222 additions and 19 deletions
+7 -2
View File
@@ -75,6 +75,7 @@ CREATE TABLE IF NOT EXISTS nodes (
install_mode TEXT NOT NULL DEFAULT 'auto',
last_error TEXT NOT NULL DEFAULT '',
install_log TEXT NOT NULL DEFAULT '',
runtime_log TEXT NOT NULL DEFAULT '',
agent_version TEXT NOT NULL DEFAULT '',
last_seen_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
@@ -95,8 +96,12 @@ CREATE TABLE IF NOT EXISTS node_protocols (
CREATE INDEX IF NOT EXISTS idx_node_protocols_protocol ON node_protocols(protocol_id);
`
_, err := db.Exec(schema)
return err
if _, err := db.Exec(schema); err != nil {
return err
}
// Additive migrations for existing deployments.
_, _ = db.Exec(`ALTER TABLE nodes ADD COLUMN IF NOT EXISTS runtime_log TEXT NOT NULL DEFAULT ''`)
return nil
}
func SeedAdmin(db *sql.DB, cfg *config.Config) error {