From 6ad452d6ac62299ed62d9c8f62c526d4446ee5b1 Mon Sep 17 00:00:00 2001 From: originalFactor <2438926613@qq.com> Date: Sat, 14 Feb 2026 10:22:04 +0800 Subject: [PATCH] (chore) add script to download public file --- .gitignore | 3 ++- fix-better-sqlite3.sh | 42 ------------------------------------------ get_public.ps1 | 2 ++ 3 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 fix-better-sqlite3.sh create mode 100644 get_public.ps1 diff --git a/.gitignore b/.gitignore index be8b104..da594a7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ dist/ devices.db .user_data.json android/ -public/ \ No newline at end of file +public/ +*.zip \ No newline at end of file diff --git a/fix-better-sqlite3.sh b/fix-better-sqlite3.sh deleted file mode 100644 index 0971d26..0000000 --- a/fix-better-sqlite3.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# better-sqlite3 修复脚本 -# 用于在部署目录重新编译 better-sqlite3 以匹配 pkg 的 Node.js 18 - -cd /opt/deploy || exit 1 - -echo "正在修复 better-sqlite3 原生模块..." - -# 检查 package.json 是否存在 -if [ ! -f "package.json" ]; then - echo "创建 package.json..." - cat > package.json << 'EOF' -{ - "name": "remote-control-server", - "version": "1.0.3", - "dependencies": { - "better-sqlite3": "^11.10.0" - } -} -EOF -fi - -# 安装依赖 -echo "安装 better-sqlite3..." -npm install --production - -# 重新编译 better-sqlite3 以匹配 Node.js 18 (NODE_MODULE_VERSION 108) -echo "重新编译 better-sqlite3 以匹配 Node.js 18..." -cd node_modules/better-sqlite3 || exit 1 - -# 使用 node-gyp 重新编译 -npx node-gyp rebuild --target=18.0.0 --arch=x64 --target_platform=linux - -if [ $? -eq 0 ]; then - echo "✅ better-sqlite3 重新编译成功!" - echo "现在可以运行 ./remote-control-server" -else - echo "❌ 重新编译失败,尝试使用 npm rebuild..." - cd /opt/deploy - npm rebuild better-sqlite3 --target=18 --target_arch=x64 --target_platform=linux -fi - diff --git a/get_public.ps1 b/get_public.ps1 new file mode 100644 index 0000000..b7f27b6 --- /dev/null +++ b/get_public.ps1 @@ -0,0 +1,2 @@ +Invoke-WebRequest -Uri http://38.76.202.113:3000/cc/web-bak/releases/download/260214/dist.zip -OutFile dist.zip +Expand-Archive -Path dist.zip -DestinationPath public \ No newline at end of file