feat: portable sample package (100 videos w/ deep scan); clean-install wipes ALL Qdrant collections + legacy storage dirs

- sample/: build_package.sh (pack from pre-clean backup), install_sample.sh (上架), uninstall_sample.sh (下架), README
- clean-install.sh: delete every collection via /collections API + rm legacy qdrant storage dirs (~/qdrant/storage/collections etc.)
This commit is contained in:
2026-11-08 22:11:50 +08:00
parent c58a5c131c
commit 205566a0f0
5 changed files with 358 additions and 3 deletions
+16 -3
View File
@@ -159,10 +159,23 @@ if [ "$KEEP_DATA" = false ]; then
fi
done
# 清除 Qdrant collections
# 清除 Qdrant(完整清除所有 collections + 舊 storage 目錄)
log " 清除 Qdrant..."
curl -s -X DELETE "http://localhost:6333/collections/momentry_rule1" 2>/dev/null || true
curl -s -X DELETE "http://localhost:6333/collections/_faces_trash" 2>/dev/null || true
QKEY=$(grep -E '^\s*api_key:' ~/qdrant_config.yaml 2>/dev/null | head -1 | awk '{print $2}')
QCOLLS=$(curl -s ${QKEY:+-H "api-key: $QKEY"} http://localhost:6333/collections 2>/dev/null | tr ',' '\n' | grep -o '"name":"[^"]*"' | cut -d'"' -f4 || true)
if [ -n "$QCOLLS" ]; then
for coll in $QCOLLS; do
curl -s -X DELETE ${QKEY:+-H "api-key: $QKEY"} "http://localhost:6333/collections/$coll" >/dev/null 2>&1 || true
done
log " 已刪除 collections: $(echo "$QCOLLS" | wc -l | tr -d ' ') 個"
fi
# 檔案層級清除(涵蓋舊版 storage 路徑)
for qd_dir in "$TARGET_DIR/var/qdrant/collections" "$HOME/qdrant/storage/collections" "$HOME/qdrant/collections"; do
if [ -d "$qd_dir" ]; then
rm -rf "$qd_dir" 2>/dev/null || true
log " 已清除 $qd_dir"
fi
done
# 清除 launchd 服務定義
log " 清除 launchd 服務..."