From d6e92c30878f780cac80c480ccabc5d350fb8eb6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 9 Apr 2026 07:13:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20API=20Key=20?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=90=8E=E6=9C=AA=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_neo4j_ubuntu.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/install_neo4j_ubuntu.sh b/scripts/install_neo4j_ubuntu.sh index 51c8bb2..35d60d7 100755 --- a/scripts/install_neo4j_ubuntu.sh +++ b/scripts/install_neo4j_ubuntu.sh @@ -216,16 +216,22 @@ if [ "$1" = "--run" ] || [ "$1" = "-r" ]; then echo "========================================" echo "启动 OpenClaw 对话 Demo..." echo "========================================" - echo "请设置 DEEPSEEK_API_KEY 后按回车继续..." - read -p "输入 API Key (或直接回车跳过): " user_api_key + read -p "输入 API Key: " user_api_key + # 导出环境变量供 Python 使用 if [ -n "$user_api_key" ]; then export DEEPSEEK_API_KEY="$user_api_key" fi - - # 导出 Neo4j 密码 export NEO4J_PASSWORD="$NEO4J_PASSWORD" + # 写入 .env 文件保存 + cat > "$PROJECT_DIR/.env" << ENVEOF +DEEPSEEK_API_KEY=${user_api_key} +NEO4J_URI=bolt://localhost:7687 +NEO4J_USER=neo4j +NEO4J_PASSWORD=${NEO4J_PASSWORD} +ENVEOF + source venv/bin/activate cd /home/program/graph_enable_ability python openclaw_neo4j_demo.py