feat: Docker 独立部署版 v1.1.0 + OCR 图片文字搜索

上游 ZangXincz/FlyPic 已归档停更、飞牛应用商店下架,本提交使其脱离
飞牛应用框架,以普通 Docker 容器继续运行。

- ✨ Docker 独立部署:多阶段 Dockerfile + docker-compose.yml,一键构建
- ✨ OCR 图片内文字搜索:扫描时 tesseract(chi_sim+eng) 提取文字入 ocr_text 列,
  搜索同时匹配文件名与图片内容
- 🐛 修复 LibraryService 缺少 logger 引用导致添加素材库 500
- 🐛 移除写权限校验,支持只读挂载素材目录
- 📝 容器内路径与宿主机一致(中文路径直接可用)
- 🎨 保持原交互:单击选中、Ctrl/Shift 多选、双击放大
- 🔒 config/(JWT 密钥)加入 gitignore
This commit is contained in:
Hermes Agent committed 2026-10-22 12:25:20 +08:00
1 parent 7359937892
commit d96986ec79
11 files changed
+254 -118

No files matched your search

+9 -8
View File
@@ -65,8 +65,8 @@ class ImageModel extends BaseModel {
const query = `
INSERT OR REPLACE INTO images
(path, filename, folder, size, width, height, format, file_type,
created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at, ocr_text)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`;
return this.execute(query, [
@@ -83,7 +83,8 @@ class ImageModel extends BaseModel {
data.fileHash,
data.thumbnailPath,
data.thumbnailSize,
Date.now()
Date.now(),
data.ocrText || ''
]);
}
@@ -94,8 +95,8 @@ class ImageModel extends BaseModel {
const query = `
INSERT OR REPLACE INTO images
(path, filename, folder, size, width, height, format, file_type,
created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at, ocr_text)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`;
return this.transaction(() => {
@@ -105,7 +106,7 @@ class ImageModel extends BaseModel {
data.path, data.filename, data.folder, data.size,
data.width, data.height, data.format, data.fileType || 'image',
data.createdAt, data.modifiedAt, data.fileHash,
data.thumbnailPath, data.thumbnailSize, Date.now()
data.thumbnailPath, data.thumbnailSize, Date.now(), data.ocrText || ''
);
}
});
@@ -168,8 +169,8 @@ class ImageModel extends BaseModel {
if (filters.keywords) {
const terms = filters.keywords.trim().split(/\s+/);
terms.forEach(term => {
query += ' AND filename LIKE ?';
params.push(`%${term}%`);
query += ' AND (filename LIKE ? OR ocr_text LIKE ?)';
params.push(`%${term}%`, `%${term}%`);
});
}