+ {categorizedList?.length <= 0 && (
+
+ {t('setting.sourceEmptyTip')}
+
+ )}
{categorizedList.map((item, index) => (
))}
@@ -127,9 +132,9 @@ const DataSource = () => {
{/* */}
-
+
{t('setting.availableSources')}
-
+
{t('setting.availableSourcesDescription')}
diff --git a/web/src/pages/user-setting/setting-model/components/system-setting.tsx b/web/src/pages/user-setting/setting-model/components/system-setting.tsx
index a8714b998..97906a421 100644
--- a/web/src/pages/user-setting/setting-model/components/system-setting.tsx
+++ b/web/src/pages/user-setting/setting-model/components/system-setting.tsx
@@ -161,6 +161,7 @@ const SystemSetting = ({ onOk, loading }: IProps) => {
options={options}
onChange={(value) => handleFieldChange(id, value)}
placeholder={t('selectModelPlaceholder')}
+ emptyData={t('modelEmptyTip')}
/>
);
diff --git a/web/src/pages/user-setting/sidebar/hooks.tsx b/web/src/pages/user-setting/sidebar/hooks.tsx
index fcfedcfca..47415a4ea 100644
--- a/web/src/pages/user-setting/sidebar/hooks.tsx
+++ b/web/src/pages/user-setting/sidebar/hooks.tsx
@@ -1,12 +1,19 @@
import { useLogout } from '@/hooks/login-hooks';
import { Routes } from '@/routes';
-import { useCallback, useState } from 'react';
-import { useNavigate } from 'umi';
+import { useCallback, useEffect, useState } from 'react';
+import { useLocation, useNavigate } from 'umi';
export const useHandleMenuClick = () => {
const navigate = useNavigate();
const [active, setActive] = useState();
const { logout } = useLogout();
+ const location = useLocation();
+ useEffect(() => {
+ const path = (location.pathname.split('/')?.[2] || '') as Routes;
+ if (path) {
+ setActive(('/' + path) as Routes);
+ }
+ }, [location]);
const handleMenuClick = useCallback(
(key: Routes) => () => {
@@ -20,5 +27,5 @@ export const useHandleMenuClick = () => {
[logout, navigate],
);
- return { handleMenuClick, active };
+ return { handleMenuClick, active, setActive };
};
From 10098198019db58c73b0830c751ff56ea86eb747 Mon Sep 17 00:00:00 2001
From: Billy Bao
Date: Mon, 24 Nov 2025 12:21:33 +0800
Subject: [PATCH 5/7] Fix: coroutine object has no attribute get (#11472)
### What problem does this PR solve?
Fix: coroutine object has no attribute get
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
---
api/apps/file_app.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/apps/file_app.py b/api/apps/file_app.py
index 8b5383a66..e262b3d7b 100644
--- a/api/apps/file_app.py
+++ b/api/apps/file_app.py
@@ -125,8 +125,8 @@ async def upload():
@validate_request("name")
async def create():
req = await request.json
- pf_id = await request.json.get("parent_id")
- input_file_type = await request.json.get("type")
+ pf_id = req.get("parent_id")
+ input_file_type = req.get("type")
if not pf_id:
root_folder = FileService.get_root_folder(current_user.id)
pf_id = root_folder["id"]
From 4d8698624c9bb65ff590685ff4c2c5a55cc6f48d Mon Sep 17 00:00:00 2001
From: writinwaters <93570324+writinwaters@users.noreply.github.com>
Date: Mon, 24 Nov 2025 17:38:04 +0800
Subject: [PATCH 6/7] Docs: Updated use_kg and toc_enhance switch descriptions
(#11485)
### What problem does this PR solve?
### Type of change
- [x] Documentation Update
---
docs/references/http_api_reference.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.md
index 253745432..3c73cf58c 100644
--- a/docs/references/http_api_reference.md
+++ b/docs/references/http_api_reference.md
@@ -2122,9 +2122,9 @@ curl --request POST \
- `"top_k"`: (*Body parameter*), `integer`
The number of chunks engaged in vector cosine computation. Defaults to `1024`.
- `"use_kg"`: (*Body parameter*), `boolean`
- The search includes text chunks related to the knowledge graph of the selected dataset to handle complex multi-hop queries. Defaults to `False`.
+ Whether to search chunks related to the generated knowledge graph for multi-hop queries. Defaults to `False`. Before enabling this, ensure you have successfully constructed a knowledge graph for the specified datasets. See [here](https://ragflow.io/docs/dev/construct_knowledge_graph) for details.
- `"toc_enhance"`: (*Body parameter*), `boolean`
- The search includes table of content enhancement in order to boost rank of relevant chunks. Files parsed with `TOC Enhance` enabled is prerequisite. Defaults to `False`.
+ Whether to search chunks with extracted table of content. Defaults to `False`. Before enabling this, ensure you have enabled `TOC_Enhance` and successfully extracted table of contents for the specified datasets. See [here](https://ragflow.io/docs/dev/enable_table_of_contents) for details.
- `"rerank_id"`: (*Body parameter*), `integer`
The ID of the rerank model.
- `"keyword"`: (*Body parameter*), `boolean`
@@ -2140,8 +2140,8 @@ curl --request POST \
- `"metadata_condition"`: (*Body parameter*), `object`
The metadata condition used for filtering chunks:
- `"logic"`: (*Body parameter*), `string`
- - `"and"` Intersection of the result from each condition (default).
- - `"or"` union of the result from each condition.
+ - `"and"`: Return only results that satisfy *every* condition (default).
+ - `"or"`: Return results that satisfy *any* condition.
- `"conditions"`: (*Body parameter*), `array`
A list of metadata filter conditions.
- `"name"`: `string` - The metadata field name to filter by, e.g., `"author"`, `"company"`, `"url"`. Ensure this parameter before use. See [Set metadata](../guides/dataset/set_metadata.md) for details.
From d5f85482005ce5d798609ef228a782e5361c24cb Mon Sep 17 00:00:00 2001
From: zhipeng <5310853+Ox0400@users.noreply.github.com>
Date: Mon, 24 Nov 2025 19:02:08 +0800
Subject: [PATCH 7/7] Allow create super user when start rag server. (#10634)
### What problem does this PR solve?
New options for rag server scripts to create the super admin user when
start server.
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
---------
Co-authored-by: Zhichang Yu
Co-authored-by: Jin Hai
---
api/db/init_data.py | 15 +++++++++------
api/ragflow_server.py | 7 ++++++-
docker/entrypoint.sh | 9 ++++++++-
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/api/db/init_data.py b/api/db/init_data.py
index 4a9ad067a..d4873d332 100644
--- a/api/db/init_data.py
+++ b/api/db/init_data.py
@@ -34,14 +34,17 @@ from common.file_utils import get_project_base_directory
from common import settings
from api.common.base64 import encode_to_base64
+DEFAULT_SUPERUSER_NICKNAME = os.getenv("DEFAULT_SUPERUSER_NICKNAME", "admin")
+DEFAULT_SUPERUSER_EMAIL = os.getenv("DEFAULT_SUPERUSER_EMAIL", "admin@ragflow.io")
+DEFAULT_SUPERUSER_PASSWORD = os.getenv("DEFAULT_SUPERUSER_PASSWORD", "admin")
-def init_superuser():
+def init_superuser(nickname=DEFAULT_SUPERUSER_NICKNAME, email=DEFAULT_SUPERUSER_EMAIL, password=DEFAULT_SUPERUSER_PASSWORD, role=UserTenantRole.OWNER):
user_info = {
"id": uuid.uuid1().hex,
- "password": encode_to_base64("admin"),
- "nickname": "admin",
+ "password": encode_to_base64(password),
+ "nickname": nickname,
"is_superuser": True,
- "email": "admin@ragflow.io",
+ "email": email,
"creator": "system",
"status": "1",
}
@@ -58,7 +61,7 @@ def init_superuser():
"tenant_id": user_info["id"],
"user_id": user_info["id"],
"invited_by": user_info["id"],
- "role": UserTenantRole.OWNER
+ "role": role
}
tenant_llm = get_init_tenant_llm(user_info["id"])
@@ -70,7 +73,7 @@ def init_superuser():
UserTenantService.insert(**usr_tenant)
TenantLLMService.insert_many(tenant_llm)
logging.info(
- "Super user initialized. email: admin@ragflow.io, password: admin. Changing the password after login is strongly recommended.")
+ f"Super user initialized. email: {email}, password: {password}. Changing the password after login is strongly recommended.")
chat_mdl = LLMBundle(tenant["id"], LLMType.CHAT, tenant["llm_id"])
msg = chat_mdl.chat(system="", history=[
diff --git a/api/ragflow_server.py b/api/ragflow_server.py
index 852372d0b..a2d9d6a6e 100644
--- a/api/ragflow_server.py
+++ b/api/ragflow_server.py
@@ -37,7 +37,7 @@ from api.db.services.document_service import DocumentService
from common.file_utils import get_project_base_directory
from common import settings
from api.db.db_models import init_database_tables as init_web_db
-from api.db.init_data import init_web_data
+from api.db.init_data import init_web_data, init_superuser
from common.versions import get_ragflow_version
from common.config_utils import show_configs
from common.mcp_tool_call_conn import shutdown_all_mcp_sessions
@@ -109,11 +109,16 @@ if __name__ == '__main__':
parser.add_argument(
"--debug", default=False, help="debug mode", action="store_true"
)
+ parser.add_argument(
+ "--init-superuser", default=False, help="init superuser", action="store_true"
+ )
args = parser.parse_args()
if args.version:
print(get_ragflow_version())
sys.exit(0)
+ if args.init_superuser:
+ init_superuser()
RuntimeConfig.DEBUG = args.debug
if RuntimeConfig.DEBUG:
logging.info("run on debug mode")
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index cfde08d0c..a5942c5b8 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -13,6 +13,7 @@ function usage() {
echo " --disable-datasync Disables synchronization of datasource workers."
echo " --enable-mcpserver Enables the MCP server."
echo " --enable-adminserver Enables the Admin server."
+ echo " --init-superuser Initializes the superuser."
echo " --consumer-no-beg= Start range for consumers (if using range-based)."
echo " --consumer-no-end= End range for consumers (if using range-based)."
echo " --workers= Number of task executors to run (if range is not used)."
@@ -24,6 +25,7 @@ function usage() {
echo " $0 --disable-webserver --workers=2 --host-id=myhost123"
echo " $0 --enable-mcpserver"
echo " $0 --enable-adminserver"
+ echo " $0 --init-superuser"
exit 1
}
@@ -32,6 +34,7 @@ ENABLE_TASKEXECUTOR=1 # Default to enable task executor
ENABLE_DATASYNC=1
ENABLE_MCP_SERVER=0
ENABLE_ADMIN_SERVER=0 # Default close admin server
+INIT_SUPERUSER_ARGS="" # Default to not initialize superuser
CONSUMER_NO_BEG=0
CONSUMER_NO_END=0
WORKERS=1
@@ -83,6 +86,10 @@ for arg in "$@"; do
ENABLE_ADMIN_SERVER=1
shift
;;
+ --init-superuser)
+ INIT_SUPERUSER_ARGS="--init-superuser"
+ shift
+ ;;
--mcp-host=*)
MCP_HOST="${arg#*=}"
shift
@@ -240,7 +247,7 @@ if [[ "${ENABLE_WEBSERVER}" -eq 1 ]]; then
echo "Starting ragflow_server..."
while true; do
- "$PY" api/ragflow_server.py &
+ "$PY" api/ragflow_server.py ${INIT_SUPERUSER_ARGS} &
wait;
sleep 1;
done &