feat: Added package management
Server Deploy / deploy (push) Successful in 3m44s
Agent Release / build (push) Successful in 10m21s

This commit is contained in:
domrichardson
2026-06-24 16:31:51 +01:00
parent fab87c82c6
commit 5c91db0d4c
16 changed files with 976 additions and 799 deletions
+16
View File
@@ -33,6 +33,7 @@ func RegisterRoutes(r *gin.Engine) {
apiGroup.DELETE("/servers/:id", deleteServer)
apiGroup.POST("/servers/:id/generate-key", generateKey)
apiGroup.POST("/servers/:id/update-agent", updateAgent)
apiGroup.POST("/servers/:id/apply-updates", applyUpdates)
apiGroup.GET("/agent/latest-version", getLatestAgentVersion)
@@ -290,6 +291,21 @@ func updateAgent(c *gin.Context) {
})
}
func applyUpdates(c *gin.Context) {
id := c.Param("id")
s, err := services.GetServer(id)
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "server not found"})
return
}
if err := services.DispatchApplyUpdates(s.ServerID); err != nil {
c.JSON(http.StatusServiceUnavailable, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusAccepted, gin.H{"message": "apply updates command sent to agent"})
}
func handleUpdateScript(c *gin.Context) {
giteaHost := os.Getenv("GITEA_HOST")
if giteaHost == "" {