sync update from LAN repo (source ji @ 85078a31)
This commit is contained in:
1 parent
5d6627af50
commit
e602d88695
864 files changed
+99150
-6346
No files matched your search
@@ -58,8 +58,8 @@ nohup bash -c '
|
||||
--reload \
|
||||
--reload-dir "app" \
|
||||
--reload-dir "packages" \
|
||||
--reload-exclude "$0/.deer-flow" \
|
||||
--reload-exclude "$0/.runtime"
|
||||
--reload-exclude ".deer-flow" \
|
||||
--reload-exclude ".runtime"
|
||||
' "${BACKEND_DIR}" "${GATEWAY_CORS_ORIGINS}" "${BACKEND_HOST}" "${BACKEND_PORT}" "${BACKEND_VENDOR_DIR}" \
|
||||
>"${LOG_FILE}" 2>&1 &
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts the SSH tunnel required by the local DeerFlow backend's remote MySQL connection.
|
||||
|
||||
.DESCRIPTION
|
||||
The local backend is configured to reach MySQL at 127.0.0.1:13307. This script forwards
|
||||
that port over SSH to the MySQL listener on the remote server. It deliberately does not
|
||||
store the SSH password; OpenSSH prompts for it when the tunnel starts.
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$RemoteHost = "119.254.86.251",
|
||||
[int]$SshPort = 22322,
|
||||
[string]$SshUser = "root",
|
||||
[int]$LocalPort = 13307,
|
||||
[int]$RemoteMySqlPort = 3307
|
||||
)
|
||||
|
||||
$existing = Get-NetTCPConnection -State Listen -LocalPort $LocalPort -ErrorAction SilentlyContinue
|
||||
if ($existing) {
|
||||
Write-Host "本地端口 $LocalPort 已在监听;SSH 隧道应已启动。" -ForegroundColor Yellow
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-Host "正在建立 MySQL SSH 隧道:127.0.0.1:$LocalPort -> $RemoteHost`:$RemoteMySqlPort"
|
||||
Write-Host "请保持此窗口运行;按 Ctrl+C 可关闭隧道。"
|
||||
|
||||
ssh -N `
|
||||
-o ExitOnForwardFailure=yes `
|
||||
-o ServerAliveInterval=30 `
|
||||
-o ServerAliveCountMax=3 `
|
||||
-L "${LocalPort}:127.0.0.1:${RemoteMySqlPort}" `
|
||||
-p $SshPort `
|
||||
"${SshUser}@${RemoteHost}"
|
||||
@@ -7,6 +7,8 @@ IMAGE_TAG="${IMAGE_TAG:-deerflow-backend-offline:20260505}"
|
||||
CONTAINER_NAME="${CONTAINER_NAME:-deerflow-backend}"
|
||||
HOST_PORT="${HOST_PORT:-2026}"
|
||||
IMAGE_TAR="${IMAGE_TAR:-${SCRIPT_DIR}/deerflow-backend-offline-image-20260505.tar}"
|
||||
EXTENSIONS_CONFIG_TEMPLATE="${SCRIPT_DIR}/extensions_config.json"
|
||||
RUNTIME_EXTENSIONS_CONFIG="${SCRIPT_DIR}/data/config/extensions_config.json"
|
||||
# Default timezone for the container. The offline image is built from a base
|
||||
# layer that ships with UTC, which made scheduled tasks fire at the wrong wall
|
||||
# clock and made log timestamps confusing for ops. ``Asia/Shanghai`` keeps the
|
||||
@@ -60,7 +62,7 @@ require_env_key "AUTH_JWT_SECRET"
|
||||
require_env_key "SCHEDULED_TASKS_ENABLED"
|
||||
require_env_key "ELEMENT_ENABLED"
|
||||
require_file "${SCRIPT_DIR}/config.yaml"
|
||||
require_file "${SCRIPT_DIR}/extensions_config.json"
|
||||
require_file "${EXTENSIONS_CONFIG_TEMPLATE}"
|
||||
require_file "${SCRIPT_DIR}/backend/pyproject.toml"
|
||||
require_file "${SCRIPT_DIR}/backend/app/gateway/app.py"
|
||||
require_file "${SCRIPT_DIR}/backend/packages/harness/deerflow/runtime/scheduler/element.py"
|
||||
@@ -68,7 +70,14 @@ require_dir "${SCRIPT_DIR}/skills"
|
||||
require_dir "${SCRIPT_DIR}/wheelhouse"
|
||||
# Knowledge base directory, mounted into the container at /mnt/knowledge_base.
|
||||
require_dir "${SCRIPT_DIR}/backend/knowledge/knowledge_base"
|
||||
mkdir -p "${SCRIPT_DIR}/data"
|
||||
mkdir -p "$(dirname "${RUNTIME_EXTENSIONS_CONFIG}")"
|
||||
if [ -e "${RUNTIME_EXTENSIONS_CONFIG}" ] && [ ! -f "${RUNTIME_EXTENSIONS_CONFIG}" ]; then
|
||||
die "runtime extensions config is not a regular file: ${RUNTIME_EXTENSIONS_CONFIG}"
|
||||
fi
|
||||
if [ ! -e "${RUNTIME_EXTENSIONS_CONFIG}" ]; then
|
||||
cp -a "${EXTENSIONS_CONFIG_TEMPLATE}" "${RUNTIME_EXTENSIONS_CONFIG}"
|
||||
echo "Initialized writable extensions config at ${RUNTIME_EXTENSIONS_CONFIG}"
|
||||
fi
|
||||
|
||||
if ! docker image inspect "${IMAGE_TAG}" >/dev/null 2>&1; then
|
||||
require_file "${IMAGE_TAR}"
|
||||
@@ -91,7 +100,7 @@ docker run -d \
|
||||
-e DEER_FLOW_PROJECT_ROOT=/app \
|
||||
-e DEER_FLOW_HOME=/app/backend/.deer-flow \
|
||||
-e DEER_FLOW_CONFIG_PATH=/app/config.yaml \
|
||||
-e DEER_FLOW_EXTENSIONS_CONFIG_PATH=/app/extensions_config.json \
|
||||
-e DEER_FLOW_EXTENSIONS_CONFIG_PATH=/app/backend/.deer-flow/config/extensions_config.json \
|
||||
-e DEER_FLOW_SKILLS_PATH=/app/skills \
|
||||
-e UV_LINK_MODE=copy \
|
||||
-v "${SCRIPT_DIR}/backend/app:/app/backend/app" \
|
||||
@@ -102,11 +111,10 @@ docker run -d \
|
||||
-v "${SCRIPT_DIR}/backend/langgraph.json:/app/backend/langgraph.json:ro" \
|
||||
-v "${SCRIPT_DIR}/config.yaml:/app/config.yaml:ro" \
|
||||
-v "${SCRIPT_DIR}/skill_evolution.json:/app/skill_evolution.json:rw" \
|
||||
-v "${SCRIPT_DIR}/extensions_config.json:/app/extensions_config.json:rw" \
|
||||
-v "${SCRIPT_DIR}/skills:/app/skills:rw" \
|
||||
-v "${SCRIPT_DIR}/wheelhouse:/app/wheelhouse:ro" \
|
||||
-v "${SCRIPT_DIR}/backend/knowledge/knowledge_base:/mnt/knowledge_base:ro" \
|
||||
-v "${SCRIPT_DIR}/data:/app/backend/.deer-flow" \
|
||||
-v "${SCRIPT_DIR}/data:/app/backend/.deer-flow:rw" \
|
||||
"${IMAGE_TAG}" \
|
||||
sh -c 'cd backend
|
||||
# Apply timezone inside the container. ``TZ`` alone is enough for Python /
|
||||
|
||||
Reference in new issue
Block a user