fix: 完成 B-1, B-2, B-4(proxy 硬编码移除 + re-scan 端点)
B-1: 移除 proxy 硬编码路径 - 移除 API_KEY 常量,改为 get_api_key() 从环境变量读取 - 移除 PROFILE_DIRS,改为 get_output_dir() 从环境变量读取 - 移除 output_bases (identity_matches, trace_profile),改为环境变量驱动 - 移除 ADMIN_CONFIG_PATH,改为 get_admin_config_path() 从环境变量读取 - 添加 dev fallback 支持开发环境 B-2: API key 改为环境变量 - MOMENTRY_API_KEY 环境变量必须设置 - 未设置时会明确报错启动 B-4: 改用 re-scan 端点 - 简化 doReprocess 函数从 92 行减少到 32 行 - 改用单一 POST /api/v1/re-scan API - 显式传 auto_pipeline: true - 移除 unregister → register → process 手动串接 - 原子性操作,避免中间失败留下不一致状态 环境变量: - MOMENTRY_API_KEY (必需) - MOMENTRY_OUTPUT_DIR (可选,默认 /Users/accusys/momentry/output) - MOMENTRY_DATA_DIR (可选,默认 /Users/accusys/momentry/data) - MOMENTRY_ADMIN_CONFIG (可选,默认 /Users/accusys/momentry/config/admin_config.json)
This commit is contained in:
@@ -536,6 +536,9 @@ case 'search_keyword': {
|
||||
case 'process_file': {
|
||||
return { url: `/api/v1/file/${a.fileUuid}/process`, method: 'POST', body: { processors: a.processors } }
|
||||
}
|
||||
case 're_scan_file': {
|
||||
return { url: `/api/v1/re-scan`, method: 'POST', body: { file_uuid: a.fileUuid, auto_pipeline: a.autoPipeline ?? true } }
|
||||
}
|
||||
case 'get_identity_matches': {
|
||||
return { url: `/api/v1/identity-matches?file_hash=${a.fileHash}`, method: 'GET' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user