Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

disable admin available check (#21335)

Jin Hai721d750a78c1
diff --git a/internal/handler/auth.go b/internal/handler/auth.go
index 9ab7f70982..91d8155c14 100644
--- a/internal/handler/auth.go
+++ b/internal/handler/auth.go
@@ -157,8 +157,8 @@ func (h *AuthHandler) AuthMiddleware() gin.HandlerFunc {
}
if !local.IsAdminAvailable() {
- license := local.GetAdminStatus()
- errMsg := fmt.Sprintf("server license %s", license.Reason)
+ adminStatus := local.GetAdminStatus()
+ errMsg := fmt.Sprintf("server error: %s", adminStatus.Reason)
common.Warn(errMsg)
common.ResponseWithHttpCodeData(c, http.StatusServiceUnavailable, common.CodeUnauthorized, "No", errMsg)
c.Abort()
diff --git a/internal/handler/user.go b/internal/handler/user.go
index 321940a7fb..2204818b33 100644
--- a/internal/handler/user.go
+++ b/internal/handler/user.go
@@ -237,10 +237,10 @@ func (h *UserHandler) LoginByEmail(c *gin.Context) {
operationLog.ResourceName = req.Email
if !local.IsAdminAvailable() {
- license := local.GetAdminStatus()
- common.ResponseWithCodeData(c, common.CodeAuthenticationError, "No", license.Reason)
+ adminStatus := local.GetAdminStatus()
+ common.ResponseWithCodeData(c, common.CodeAuthenticationError, "No", adminStatus.Reason)
operationLog.ErrorCode = uint16(common.CodeAuthenticationError)
- operationLog.Message = license.Reason
+ operationLog.Message = adminStatus.Reason
operationLog.DurationMS = time.Since(startAt).Milliseconds()
return
}
diff --git a/internal/server/local/admin_status.go b/internal/server/local/admin_status.go
index 20e1038f75..37fad5c477 100644
--- a/internal/server/local/admin_status.go
+++ b/internal/server/local/admin_status.go
@@ -93,13 +93,3 @@ func SetAdminStatus(statusCode AdminStatusCode, reason string) {
adminStatus.Status = statusCode
adminStatus.Reason = reason
}
-
-// IsAdminAvailable returns true if admin is valid (Status == 0)
-func IsAdminAvailable() bool {
- adminStatusMu.RLock()
- defer adminStatusMu.RUnlock()
- if adminStatus == nil {
- return false
- }
- return adminStatus.Status == Available
-}
diff --git a/internal/server/local/admin_status_ee.go b/internal/server/local/admin_status_ee.go
new file mode 100644
index 0000000000..d87a61f9a0
--- /dev/null
+++ b/internal/server/local/admin_status_ee.go
@@ -0,0 +1,21 @@
+//
+// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package local
+
+func IsAdminAvailable() bool {
+ return true
+}