(chore) add script to download public file

This commit is contained in:
2026-02-14 10:22:04 +08:00
parent 24808d8f75
commit 6ad452d6ac
3 changed files with 4 additions and 43 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@ dist/
devices.db
.user_data.json
android/
public/
public/
*.zip

View File

@@ -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

2
get_public.ps1 Normal file
View File

@@ -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