From 72109c040e43016b7fb2569bdf2053207f55fa98 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: Tue, 28 Oct 2025 09:30:41 +0300 Subject: [PATCH] fix bud with add new apikey every install --- install.sh | 2 +- web/controller/inbound.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a9d878bf..c35ad1f4 100644 --- a/install.sh +++ b/install.sh @@ -141,7 +141,7 @@ config_after_install() { /usr/local/x-ui/x-ui migrate - local existing_apiKey=$(/usr/local/x-ui/x-ui setting -show true | grep -oP 'ApiKey: \K.*') + local existing_apiKey=$(/usr/local/x-ui/x-ui setting -show true | grep -oP 'apiKey: \K.*') if [[ -z "$existing_apiKey" ]]; then local config_apiKey=$(gen_random_string 32) /usr/local/x-ui/x-ui setting -apiKey "${config_apiKey}" diff --git a/web/controller/inbound.go b/web/controller/inbound.go index aebcefb9..53513118 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -87,6 +87,7 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) { // getInbounds retrieves the list of inbounds for the logged-in user. func (a *InboundController) getInbounds(c *gin.Context) { user := session.GetLoginUser(c) + // TODO: need to rethink how to check the user in this place and other likes or leave it as is @MHSanaei if user == nil { user = &model.User{} user.Id = 1 @@ -151,7 +152,6 @@ func (a *InboundController) addInbound(c *gin.Context) { if user == nil { inbound.UserId = 1 } else { - inbound.UserId = user.Id } if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {