From 7466916e0206d55826d74f37c251bb5e40182c00 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sun, 19 Apr 2026 22:24:24 +0300 Subject: Add custom geosite/geoip URL sources (#3980) * feat: add custom geosite/geoip URL sources Register DB model, panel API, index/xray UI, and i18n. * fix --- web/controller/api.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'web/controller/api.go') diff --git a/web/controller/api.go b/web/controller/api.go index 1a39f8ed..57d2e4cb 100644 --- a/web/controller/api.go +++ b/web/controller/api.go @@ -18,9 +18,9 @@ type APIController struct { } // NewAPIController creates a new APIController instance and initializes its routes. -func NewAPIController(g *gin.RouterGroup) *APIController { +func NewAPIController(g *gin.RouterGroup, customGeo *service.CustomGeoService) *APIController { a := &APIController{} - a.initRouter(g) + a.initRouter(g, customGeo) return a } @@ -35,7 +35,7 @@ func (a *APIController) checkAPIAuth(c *gin.Context) { } // initRouter sets up the API routes for inbounds, server, and other endpoints. -func (a *APIController) initRouter(g *gin.RouterGroup) { +func (a *APIController) initRouter(g *gin.RouterGroup, customGeo *service.CustomGeoService) { // Main API group api := g.Group("/panel/api") api.Use(a.checkAPIAuth) @@ -48,6 +48,8 @@ func (a *APIController) initRouter(g *gin.RouterGroup) { server := api.Group("/server") a.serverController = NewServerController(server) + NewCustomGeoController(api.Group("/custom-geo"), customGeo) + // Extra routes api.GET("/backuptotgbot", a.BackuptoTgbot) } -- cgit v1.2.3