chore: 批量更新v6.5.21版本,整合多项功能修复与优化
主要变更: 1. 新增多风格音效资源与管理文档 2. 修复翻译服务空响应处理与Dio日志异常捕获 3. 完善Web端平台适配与路径获取Stub 4. 优化设备配对与文件传输功能 5. 新增角色命名常量与摇一摇检测器 6. 修复Riverpod dispose与鸿蒙导航路由 7. 新增每日通知服务与流体着色器 8. 优化备份服务与数据管理页面 9. 新增隐私设置附近设备发现选项 10. 重构诗词提供者支持历史记录 11. 完善桌面端构建配置与开发脚本 12. 清理旧版工具部署脚本
This commit is contained in:
63
docs/toolsapi/scripts/deploy_signaling.js
Normal file
63
docs/toolsapi/scripts/deploy_signaling.js
Normal file
@@ -0,0 +1,63 @@
|
||||
// ============================================================
|
||||
// 闲言APP — 信令服务器部署脚本
|
||||
// 创建时间: 2026-05-20
|
||||
// 更新时间: 2026-05-20
|
||||
// 作用: 上传index.js到服务器并重启PM2
|
||||
// 上次更新: 初始创建
|
||||
// ============================================================
|
||||
|
||||
const { NodeSSH } = require('node-ssh');
|
||||
const path = require('path');
|
||||
|
||||
const HOST = '123.207.67.197';
|
||||
const USER = 'root';
|
||||
const PASS = '520Kiss123';
|
||||
const REMOTE_BASE = '/www/wwwroot/tools.wktyl.com/signaling';
|
||||
const LOCAL_FILE = path.resolve(__dirname, '..', '..', '..', 'server', 'index.js');
|
||||
|
||||
async function deploy() {
|
||||
const ssh = new NodeSSH();
|
||||
|
||||
console.log(`Connecting to ${HOST}...`);
|
||||
await ssh.connect({
|
||||
host: HOST,
|
||||
username: USER,
|
||||
password: PASS,
|
||||
});
|
||||
console.log('[OK] Connected');
|
||||
|
||||
console.log(`Uploading index.js to ${REMOTE_BASE}/index.js...`);
|
||||
|
||||
await ssh.execCommand(`cp ${REMOTE_BASE}/index.js ${REMOTE_BASE}/index.js.bak 2>/dev/null || true`);
|
||||
console.log('[OK] Backup created');
|
||||
|
||||
await ssh.putFile(LOCAL_FILE, `${REMOTE_BASE}/index.js`);
|
||||
console.log('[OK] index.js uploaded');
|
||||
|
||||
console.log('\nRestarting PM2 signaling process...');
|
||||
const restartResult = await ssh.execCommand(
|
||||
`cd ${REMOTE_BASE} && pm2 restart signaling`
|
||||
);
|
||||
if (restartResult.stdout) console.log(restartResult.stdout);
|
||||
if (restartResult.stderr) console.log('STDERR:', restartResult.stderr.slice(0, 300));
|
||||
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
|
||||
console.log('\nChecking PM2 status...');
|
||||
const listResult = await ssh.execCommand('pm2 list');
|
||||
const listOut = listResult.stdout || '';
|
||||
console.log(listOut.length > 500 ? listOut.slice(-500) : listOut);
|
||||
|
||||
console.log('\nChecking signaling logs (last 10 lines)...');
|
||||
const logsResult = await ssh.execCommand('pm2 logs signaling --lines 10 --nostream');
|
||||
const logsOut = logsResult.stdout || '';
|
||||
console.log(logsOut.length > 500 ? logsOut.slice(-500) : logsOut);
|
||||
|
||||
ssh.dispose();
|
||||
console.log('\nDeployment complete!');
|
||||
}
|
||||
|
||||
deploy().catch(err => {
|
||||
console.error('Deployment failed:', err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user