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" {