mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
fix: support configurable bind host for HTTP API and fix Windows sherpa-onnx PATH
- fix(#547): HTTP API server now supports configurable bind host (default 127.0.0.1) Docker/N8N users can set host to 0.0.0.0 in settings to allow container access. Adds httpApiHost config key, UI input in settings, and passes host through IPC chain (preload -> main -> httpService). - fix(#546): Add Windows PATH injection for sherpa-onnx native module buildTranscribeWorkerEnv() now adds the sherpa-onnx-win-x64 directory to PATH on Windows, fixing 'Could not find sherpa-onnx-node' errors caused by missing DLL search path in forked worker processes.
This commit is contained in:
@@ -75,6 +75,14 @@ export class VoiceTranscribeService {
|
||||
if (candidates.length === 0) {
|
||||
console.warn(`[VoiceTranscribe] 未找到 ${platformPkg} 目录,可能导致语音引擎加载失败`)
|
||||
}
|
||||
} else if (process.platform === 'win32') {
|
||||
// Windows: 把 sherpa-onnx DLL 所在目录加到 PATH,否则 native module 找不到依赖
|
||||
const existing = env['PATH'] || ''
|
||||
const merged = [...candidates, ...existing.split(';').filter(Boolean)]
|
||||
env['PATH'] = Array.from(new Set(merged)).join(';')
|
||||
if (candidates.length === 0) {
|
||||
console.warn(`[VoiceTranscribe] 未找到 ${platformPkg} 目录,可能导致语音引擎加载失败`)
|
||||
}
|
||||
}
|
||||
|
||||
return env
|
||||
|
||||
Reference in New Issue
Block a user