A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物
Python agent-memoryfinancial-forecastingfuture-predictionknowledge-graphllmsmulti-agent-simulationpublic-opinion-analysispython3social-predictionswarm-intelligence
fix(security): flask debug mode enabled by default, exposed on 0.0.0.0
ChinhLeee9cac5f8eec8
diff --git a/backend/app/config.py b/backend/app/config.pyindex 953dfa50..f527f028 100644--- a/backend/app/config.py+++ b/backend/app/config.py@@ -1,7 +1,4 @@-"""-配置管理-统一从项目根目录的 .env 文件加载配置-"""+"""\n配置管理\n统一从项目根目录的 .env 文件加载配置\n"""import osfrom dotenv import load_dotenv@@ -22,9 +19,9 @@ class Config:# Flask配置SECRET_KEY = os.environ.get('SECRET_KEY', 'mirofish-secret-key')- DEBUG = os.environ.get('FLASK_DEBUG', 'True').lower() == 'true'+ DEBUG = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'- # JSON配置 - 禁用ASCII转义,让中文直接显示(而不是 \uXXXX 格式)+ # JSON配置 - 禁用ASCII转义,让中文直接显示JSON_AS_ASCII = False# LLM配置(统一使用OpenAI格式)@@ -71,5 +68,7 @@ class Config:errors.append("LLM_API_KEY 未配置")if not cls.ZEP_API_KEY:errors.append("ZEP_API_KEY 未配置")+ if cls.DEBUG:+ import warnings+ warnings.warn("Flask DEBUG mode is enabled. Do not use in production.", RuntimeWarning)return errors-