Skip to content

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

Mask password in log (#4129)

Zhichang Yue38e3bcc3b42
diff --git a/api/utils/__init__.py b/api/utils/__init__.py
index 880afd5fa6..e2163364a6 100644
--- a/api/utils/__init__.py
+++ b/api/utils/__init__.py
@@ -24,6 +24,7 @@ import time
import uuid
import requests
import logging
+import copy
from enum import Enum, IntEnum
import importlib
from Cryptodome.PublicKey import RSA
@@ -65,6 +66,10 @@ CONFIGS = read_config()
def show_configs():
msg = f"Current configs, from {conf_realpath(SERVICE_CONF)}:"
for k, v in CONFIGS.items():
+ if isinstance(v, dict):
+ if "password" in v:
+ v = copy.deepcopy(v)
+ v["password"] = "*" * 8
msg += f"\n\t{k}: {v}"
logging.info(msg)