Merge branch 'copilot/vcard-api-integraciones-anlisis'
This commit is contained in:
@@ -161,13 +161,13 @@ func CoolifyApplicationEnvDelete(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodDelete, "/applications/"+c.Params("uuid")+"/envs/"+c.Params("env_id"))
|
||||
}
|
||||
func CoolifyApplicationStart(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodGet, "/applications/"+c.Params("uuid")+"/start")
|
||||
return coolifyProxy(c, http.MethodPost, "/applications/"+c.Params("uuid")+"/start")
|
||||
}
|
||||
func CoolifyApplicationStop(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodGet, "/applications/"+c.Params("uuid")+"/stop")
|
||||
return coolifyProxy(c, http.MethodPost, "/applications/"+c.Params("uuid")+"/stop")
|
||||
}
|
||||
func CoolifyApplicationRestart(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodGet, "/applications/"+c.Params("uuid")+"/restart")
|
||||
return coolifyProxy(c, http.MethodPost, "/applications/"+c.Params("uuid")+"/restart")
|
||||
}
|
||||
func CoolifyApplicationDeployments(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodGet, "/applications/"+c.Params("uuid")+"/deployments")
|
||||
@@ -256,3 +256,25 @@ func CoolifyCurrentTeam(c *fiber.Ctx) error {
|
||||
func CoolifyTeamMembers(c *fiber.Ctx) error {
|
||||
return coolifyProxy(c, http.MethodGet, "/teams/current/members")
|
||||
}
|
||||
|
||||
// CoolifyWebhook recibe notificaciones push de Coolify (deployment events, etc.)
|
||||
// Configura en Coolify UI → Settings → Notifications → Webhook → URL: https://admin.u-site.app/app/coolify/webhook
|
||||
func CoolifyWebhook(c *fiber.Ctx) error {
|
||||
var payload map[string]interface{}
|
||||
if err := c.BodyParser(&payload); err != nil {
|
||||
// acepta también body vacío o texto plano
|
||||
payload = map[string]interface{}{"raw": string(c.Body())}
|
||||
}
|
||||
|
||||
// Log del evento para debug
|
||||
eventType := ""
|
||||
if t, ok := payload["type"].(string); ok {
|
||||
eventType = t
|
||||
} else if t, ok := payload["event"].(string); ok {
|
||||
eventType = t
|
||||
}
|
||||
|
||||
_ = eventType // en el futuro: guardar en DB, enviar push, etc.
|
||||
|
||||
return c.JSON(fiber.Map{"ok": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user