From 34e244951e81afdf427289c15e8c64841f3a8394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A1=D0=B0?= =?UTF-8?q?=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 31 Oct 2025 21:56:02 +0300 Subject: [PATCH] revert trash --- config/name | 2 +- config/version | 2 +- web/controller/inbound.go | 52 ++++++++++++++++++--------------------- web/service/inbound.go | 1 - 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/config/name b/config/name index 94dd87f9..491114af 100644 --- a/config/name +++ b/config/name @@ -1 +1 @@ -x-ui:multi-server-support \ No newline at end of file +x-ui \ No newline at end of file diff --git a/config/version b/config/version index 13d683cc..f3ac133c 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -3.0.1 \ No newline at end of file +2.9.0 \ No newline at end of file diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 53513118..c9820723 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -1,15 +1,11 @@ package controller import ( - "bytes" "encoding/json" "fmt" - "io" - "runtime/debug" "strconv" "github.com/mhsanaei/3x-ui/v2/database/model" - "github.com/mhsanaei/3x-ui/v2/logger" "github.com/mhsanaei/3x-ui/v2/web/service" "github.com/mhsanaei/3x-ui/v2/web/session" @@ -31,34 +27,34 @@ func NewInboundController(g *gin.RouterGroup) *InboundController { // initRouter initializes the routes for inbound-related operations. func (a *InboundController) initRouter(g *gin.RouterGroup) { - g.Use(func(c *gin.Context) { - defer func() { - if rec := recover(); rec != nil { - logger.Errorf("PANIC: %v\nStack: %s", rec, debug.Stack()) - c.AbortWithStatusJSON(500, gin.H{"msg": fmt.Sprintf("panic: %v", rec)}) - } - }() - c.Next() - }) + // g.Use(func(c *gin.Context) { + // defer func() { + // if rec := recover(); rec != nil { + // logger.Errorf("PANIC: %v\nStack: %s", rec, debug.Stack()) + // c.AbortWithStatusJSON(500, gin.H{"msg": fmt.Sprintf("panic: %v", rec)}) + // } + // }() + // c.Next() + // }) - g.Use(func(c *gin.Context) { - // Заголовки - logger.Debug("=== REQUEST INFO ===") - logger.Debug(fmt.Sprintf("%s %s", c.Request.Method, c.Request.URL.String())) - logger.Debug("Headers:") - for k, v := range c.Request.Header { - logger.Debug(fmt.Sprintf(" %s: %v", k, v)) - } + // g.Use(func(c *gin.Context) { + // // Заголовки + // logger.Debug("=== REQUEST INFO ===") + // logger.Debug(fmt.Sprintf("%s %s", c.Request.Method, c.Request.URL.String())) + // logger.Debug("Headers:") + // for k, v := range c.Request.Header { + // logger.Debug(fmt.Sprintf(" %s: %v", k, v)) + // } - // Тело (прочитаем и восстановим) - bodyBytes, _ := io.ReadAll(c.Request.Body) - logger.Debug(fmt.Sprintf("\nBody:\n%s\n", string(bodyBytes))) - logger.Debug("====================") + // // Тело (прочитаем и восстановим) + // bodyBytes, _ := io.ReadAll(c.Request.Body) + // logger.Debug(fmt.Sprintf("\nBody:\n%s\n", string(bodyBytes))) + // logger.Debug("====================") - // Обязательно восстановить тело, чтобы Gin потом смог его обработать - c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes)) + // // Обязательно восстановить тело, чтобы Gin потом смог его обработать + // c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes)) - }) + // }) g.GET("/list", a.getInbounds) g.GET("/get/:id", a.getInbound) diff --git a/web/service/inbound.go b/web/service/inbound.go index c4a303b1..d4ab0fc5 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -2521,7 +2521,6 @@ func (s *InboundService) syncWithSlaves(method string, path string, contentType bodyBytes, _ := io.ReadAll(resp.Body) logger.Warningf("Failed to sync with server %s. Status: %s, Body: %s", server.Name, resp.Status, string(bodyBytes)) } - //logger.Infof("Synced inbound %v to server %v (%v)", bodyData.(*model.Inbound).Tag, server.Name, resp.Status) } }