From f8b5569867e5fff066f669b05899a5b039876be8 Mon Sep 17 00:00:00 2001 From: langcaiye Date: Thu, 4 Jun 2026 10:50:02 +0800 Subject: [PATCH] fix(dev): use writable local storage path --- scripts/dev.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/dev.sh b/scripts/dev.sh index ba75fa9f..f435d53f 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -352,6 +352,16 @@ start_app() { export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 export NEO4J_URI=bolt://localhost:7687 export QDRANT_HOST=localhost + + # .env.example uses /data/files for the Docker app container, where a + # volume is mounted at that path. When the backend runs directly on the + # host via dev-app, /data is often read-only or missing, so use a repo-local + # writable directory unless the developer explicitly configured another + # local storage path. + if [ -z "${LOCAL_STORAGE_BASE_DIR:-}" ] || [ "$LOCAL_STORAGE_BASE_DIR" = "/data/files" ]; then + export LOCAL_STORAGE_BASE_DIR="$PROJECT_ROOT/.local-data/files" + fi + mkdir -p "$LOCAL_STORAGE_BASE_DIR" # 确保必要的环境变量已设置 if [ -z "$DB_DRIVER" ]; then