Files
agent-desktop/console/src-tauri/tauri.conf.json
T
Pine 280f672ee0 refactor(config): 服务端地址收敛为单一配置 server.config.json
三端统一从仓库根 server.config.json 的 opc_server_base_url 读取 OPC 服务端地址,
改一处即全局生效,消除散落硬编码:

- Python: constant.DEMO_API_BASE_URL 改为启动时读取该文件(缺失/损坏回退生产默认)
- Vite: console/vite.config.ts proxy 4 条 target 由 readOpcServerBaseUrl() 提供
- Rust: updates/remote.rs 编译期 include_str! 注入(打包前改配置即生效),
  更新检查 fallback 由 127.0.0.1:8090 改为该配置
- 清理残留: tauri.conf.json updater endpoint → 生产(与 version.conf 一致);
  im.py fallback 不再硬编码 8090;auth.py 修正过时文档(原声称支持 env 覆盖但未实现)

验证: Python 模块导入 + 配置联动切换测试 ✓;tsc -b ✓;cargo check ✓;8090 残留归零。
2026-09-13 17:01:44 +08:00

92 lines
2.8 KiB
JSON

{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "YunOPC-Hub",
"identifier": "cn.pinesound.opc.hub",
"version": "0.0.1-beta.1",
"build": {
"frontendDist": "../dist-tauri",
"devUrl": "http://localhost:8093/tauri.html",
"beforeDevCommand": "uv run python3 ../scripts/sync_version.py && vite --mode tauri",
"beforeBuildCommand": "uv run python3 ../scripts/sync_version.py && npm run build:tauri-bootstrap"
},
"app": {
"withGlobalTauri": false,
"windows": [],
"security": {
"csp": "default-src 'self'; connect-src 'self' http://127.0.0.1:* ws://127.0.0.1:* ipc: http://ipc.localhost https://opc.pinesound.cn; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' asset: http://asset.localhost blob: data: https:; frame-src 'self' https: http: data:;"
}
},
"bundle": {
"active": true,
"targets": [
"app",
"dmg",
"nsis"
],
"icon": [
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [
"binaries/qwenpaw-backend",
"binaries/python-runtime",
"binaries/node-runtime",
"LICENSE",
"LICENSE_QwenPaw",
"NOTICE"
],
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper",
"silent": true
},
"nsis": {
"installerIcon": "../../scripts/pack/assets/icon.ico",
"uninstallerIcon": "../../scripts/pack/assets/icon.ico",
"installerHooks": "nsis-hooks.nsh",
"languages": [
"English",
"SimpChinese",
"Indonesian",
"Japanese",
"Russian",
"PortugueseBR",
"Vietnamese"
],
"customLanguageFiles": {
"English": "nsis-languages/English.nsh",
"SimpChinese": "nsis-languages/SimpChinese.nsh",
"Indonesian": "nsis-languages/Indonesian.nsh",
"Japanese": "nsis-languages/Japanese.nsh",
"Russian": "nsis-languages/Russian.nsh",
"PortugueseBR": "nsis-languages/PortugueseBR.nsh"
},
"compression": "zlib",
"displayLanguageSelector": false
}
},
"macOS": {
"minimumSystemVersion": "14.0",
"dmg": {
"windowSize": {
"width": 640,
"height": 440
}
}
},
"createUpdaterArtifacts": true
},
"plugins": {
"updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDkwRTBDNDRBRTJENTUxQTIKUldTaVVkWGlTc1Rna0lwZ3MzQ3J2KzFpZG5obExUT3B6SnRoeU4wcVJiZXRrN3B5Nlp4MzlLaWsK",
"endpoints": [
"https://opc.pinesound.cn/desktop-updates/latest.json"
],
"windows": {
"installMode": "passive"
}
}
},
"mainBinaryName": "yunopc-hub"
}