commit f69efb67ada4e739af7778c701b2634db50ce85a Author: arthur_chen Date: Fri May 15 09:06:10 2026 +0800 Initial commit: abyssVpn project - Tauri desktop app (apps/desktop) - Python Django API service (services/api) - Deployment scripts and docs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9876587 --- /dev/null +++ b/.gitignore @@ -0,0 +1,62 @@ +# Dependencies +node_modules/ +.pnpm-store/ + +# Build outputs +dist/ +dist-ssr/ +build/ +*.tsbuildinfo + +# Rust / Tauri +target/ +src-tauri/target/ + +# Python +.venv/ +venv/ +__pycache__/ +*.py[cod] +*.egg-info/ +*.sqlite3 + +# Environment files +.env +.env.* +!.env.example + +# Secrets / Keys +codex.pem +*.pem +*.key + +# IDE +.vscode/* +!.vscode/extensions.json +.idea/ +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# Logs +logs/ +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +# Temporary files +tmp-*.html +tmp-*.js +tmp-*.headers +query +start +stop + +# Claude +.claude/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..21b0e73 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# AbyssInfo Home VPN + +AbyssInfo Home VPN 是一个 Tauri + Vue 桌面客户端,配套 Django 后端,用于实现飞书登录后通过 Netmaker 一键连接 VPN。 + +## 目录 + +```text +apps/desktop Tauri + Vue + Vite 客户端 +services/api Django 后端服务 +docs 架构和接口文档 +``` + +## 本地启动 + +后端依赖安装: + +```powershell +cd services/api +.venv/Scripts/Activate.ps1 +pip install -r requirements.txt +python manage.py migrate +python manage.py runserver 127.0.0.1:8000 +``` + +前端启动: + +```powershell +cd apps/desktop +npm run tauri:dev +``` + +## 桌面常驻 + +客户端使用 Tauri 跨平台托盘能力: + +- Windows:显示在右下角系统托盘。 +- macOS:显示在顶部菜单栏状态区。 +- 点击窗口关闭按钮时隐藏窗口,不退出进程。 +- 托盘/菜单栏菜单提供“显示窗口”“隐藏到托盘/菜单栏”“退出”。 diff --git a/apps/desktop/.env.example b/apps/desktop/.env.example new file mode 100644 index 0000000..737b9f9 --- /dev/null +++ b/apps/desktop/.env.example @@ -0,0 +1,2 @@ +VITE_API_BASE_URL=https://vpn-api.nm.101-96-214-81.sslip.io +VITE_VPN_NETWORK_NAME=homevpn diff --git a/apps/desktop/.gitignore b/apps/desktop/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/apps/desktop/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/desktop/.vscode/extensions.json b/apps/desktop/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/apps/desktop/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/apps/desktop/README.md b/apps/desktop/README.md new file mode 100644 index 0000000..1511959 --- /dev/null +++ b/apps/desktop/README.md @@ -0,0 +1,5 @@ +# Vue 3 + Vite + +This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + + diff --git a/apps/desktop/package-lock.json b/apps/desktop/package-lock.json new file mode 100644 index 0000000..8075798 --- /dev/null +++ b/apps/desktop/package-lock.json @@ -0,0 +1,1440 @@ +{ + "name": "abyssinfo-vpn", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "abyssinfo-vpn", + "version": "0.0.0", + "dependencies": { + "@tauri-apps/api": "^2.10.1", + "@tauri-apps/plugin-deep-link": "^2.4.3", + "@tauri-apps/plugin-opener": "^2.5.3", + "vue": "^3.5.32" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.10.1", + "@vitejs/plugin-vue": "^5.2.4", + "vite": "^5.4.21" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.2.tgz", + "integrity": "sha512-dnlp69efPPg6Uaw2dVqzWRfAWRnYVb1XJ8CyyhIbZeaq4CA5/mLeZ1IEt9QqQxmbdvagjLIm2ZL8BxXv5lH4Yw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.2.tgz", + "integrity": "sha512-OqZTwDRDchGRHHm/hwLOL7uVPB9aUvI0am/eQuWMNyFHf5PSEQmyEeYYheA0EPPKUO/l0uigCp+iaTjoLjVoHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.2.tgz", + "integrity": "sha512-UwRE7CGpvSVEQS8gUMBe1uADWjNnVgP3Iusyda1nSRwNDCsRjnGc7w6El6WLQsXmZTbLZx9cecegumcitNfpmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.2.tgz", + "integrity": "sha512-gjEtURKLCC5VXm1I+2i1u9OhxFsKAQJKTVB8WvDAHF+oZlq0GTVFOlTlO1q3AlCTE/DF32c16ESvfgqR7343/g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.2.tgz", + "integrity": "sha512-Bcl6CYDeAgE70cqZaMojOi/eK63h5Me97ZqAQoh77VPjMysA/4ORQBRGo3rRy45x4MzVlU9uZxs8Uwy7ZaKnBw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.2.tgz", + "integrity": "sha512-LU+TPda3mAE2QB0/Hp5VyeKJivpC6+tlOXd1VMoXV/YFMvk/MNk5iXeBfB4MQGRWyOYVJ01625vjkr0Az98OJQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.2.tgz", + "integrity": "sha512-2QxQrM+KQ7DAW4o22j+XZ6RKdxjLD7BOWTP0Bv0tmjdyhXSsr2Ul1oJDQqh9Zf5qOwTuTc7Ek83mOFaKnodPjg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.2.tgz", + "integrity": "sha512-TbziEu2DVsTEOPif2mKWkMeDMLoYjx95oESa9fkQQK7r/Orta0gnkcDpzwufEcAO2BLBsD7mZkXGFqEdMRRwfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.2.tgz", + "integrity": "sha512-bO/rVDiDUuM2YfuCUwZ1t1cP+/yqjqz+Xf2VtkdppefuOFS2OSeAfgafaHNkFn0t02hEyXngZkxtGqXcXwO8Rg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.2.tgz", + "integrity": "sha512-hr26p7e93Rl0Za+JwW7EAnwAvKkehh12BU1Llm9Ykiibg4uIr2rbpxG9WCf56GuvidlTG9KiiQT/TXT1yAWxTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.2.tgz", + "integrity": "sha512-pOjB/uSIyDt+ow3k/RcLvUAOGpysT2phDn7TTUB3n75SlIgZzM6NKAqlErPhoFU+npgY3/n+2HYIQVbF70P9/A==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.2.tgz", + "integrity": "sha512-2/w+q8jszv9Ww1c+6uJT3OwqhdmGP2/4T17cu8WuwyUuuaCDDJ2ojdyYwZzCxx0GcsZBhzi3HmH+J5pZNXnd+Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.2.tgz", + "integrity": "sha512-11+aL5vKheYgczxtPVVRhdptAM2H7fcDR5Gw4/bTcteuZBlH4oP9f5s9zYO9aGZvoGeBpqXI/9TZZihZ609wKw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.2.tgz", + "integrity": "sha512-i16fokAGK46IVZuV8LIIwMdtqhin9hfYkCh8pf8iC3QU3LpwL+1FSFGej+O7l3E/AoknL6Dclh2oTdnRMpTzFQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.2.tgz", + "integrity": "sha512-49FkKS6RGQoriDSK/6E2GkAsAuU5kETFCh7pG4yD/ylj9rKhTmO3elsnmBvRD4PgJPds5W2PkhC82aVwmUcJ7A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.2.tgz", + "integrity": "sha512-mjYNkHPfGpUR00DuM1ZZIgs64Hpf4bWcz9Z41+4Q+pgDx73UwWdAYyf6EG/lRFldmdHHzgrYyge5akFUW0D3mQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.2.tgz", + "integrity": "sha512-ALyvJz965BQk8E9Al/JDKKDLH2kfKFLTGMlgkAbbYtZuJt9LU8DW3ZoDMCtQpXAltZxwBHevXz5u+gf0yA0YoA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.2.tgz", + "integrity": "sha512-UQjrkIdWrKI626Du8lCQ6MJp/6V1LAo2bOK9OTu4mSn8GGXIkPXk/Vsp4bLHCd9Z9Iz2OTEaokUE90VweJgIYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.2.tgz", + "integrity": "sha512-bTsRGj6VlSdn/XD4CGyzMnzaBs9bsRxy79eTqTCBsA8TMIEky7qg48aPkvJvFe1HyzQ5oMZdg7AnVlWQSKLTnw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.2.tgz", + "integrity": "sha512-6d4Z3534xitaA1FcMWP7mQPq5zGwBmGbhphh2DwaA1aNIXUu3KTOfwrWpbwI4/Gr0uANo7NTtaykFyO2hPuFLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.2.tgz", + "integrity": "sha512-NetAg5iO2uN7eB8zE5qrZ3CSil+7IJt4WDFLcC75Ymywq1VZVD6qJ6EvNLjZ3rEm6gB7XW5JdT60c6MN35Z85Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.2.tgz", + "integrity": "sha512-NCYhOotpgWZ5kdxCZsv6Iudx0wX8980Q/oW4pNFNihpBKsDbEA1zpkfxJGC0yugsUuyDZ7gL37dbzwhR0VI7pQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.2.tgz", + "integrity": "sha512-RXsaOqXxfoUBQoOgvmmijVxJnW2IGB0eoMO7F8FAjaj0UTywUO/luSqimWBJn04WNgUkeNhh7fs7pESXajWmkg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.2.tgz", + "integrity": "sha512-qdAzEULD+/hzObedtmV6iBpdL5TIbKVztGiK7O3/KYSf+HIzU257+MX1EXJcyIiDbMAqmbwaufcYPvyRryeZtA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.2.tgz", + "integrity": "sha512-Nd/SgG27WoA9e+/TdK74KnHz852TLa94ovOYySo/yMPuTmpckK/jIF2jSwS3g7ELSKXK13/cVdmg1Z/DaCWKxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tauri-apps/api": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/api/-/api-2.10.1.tgz", + "integrity": "sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw==", + "license": "Apache-2.0 OR MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + } + }, + "node_modules/@tauri-apps/cli": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli/-/cli-2.10.1.tgz", + "integrity": "sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g==", + "dev": true, + "license": "Apache-2.0 OR MIT", + "bin": { + "tauri": "tauri.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + }, + "optionalDependencies": { + "@tauri-apps/cli-darwin-arm64": "2.10.1", + "@tauri-apps/cli-darwin-x64": "2.10.1", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.10.1", + "@tauri-apps/cli-linux-arm64-gnu": "2.10.1", + "@tauri-apps/cli-linux-arm64-musl": "2.10.1", + "@tauri-apps/cli-linux-riscv64-gnu": "2.10.1", + "@tauri-apps/cli-linux-x64-gnu": "2.10.1", + "@tauri-apps/cli-linux-x64-musl": "2.10.1", + "@tauri-apps/cli-win32-arm64-msvc": "2.10.1", + "@tauri-apps/cli-win32-ia32-msvc": "2.10.1", + "@tauri-apps/cli-win32-x64-msvc": "2.10.1" + } + }, + "node_modules/@tauri-apps/cli-darwin-arm64": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.10.1.tgz", + "integrity": "sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-darwin-x64": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.10.1.tgz", + "integrity": "sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.10.1.tgz", + "integrity": "sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-gnu": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.10.1.tgz", + "integrity": "sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-musl": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.10.1.tgz", + "integrity": "sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.10.1.tgz", + "integrity": "sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-gnu": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.10.1.tgz", + "integrity": "sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-musl": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.10.1.tgz", + "integrity": "sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-arm64-msvc": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.10.1.tgz", + "integrity": "sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-ia32-msvc": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.10.1.tgz", + "integrity": "sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-x64-msvc": { + "version": "2.10.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.10.1.tgz", + "integrity": "sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/plugin-deep-link": { + "version": "2.4.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/plugin-deep-link/-/plugin-deep-link-2.4.3.tgz", + "integrity": "sha512-yVCZpVG1ZrtfCvE7K5LRSrGqlyPlCrqlKgoREJHnfjyYdDtUhFmZqScOXpL8XL2PizJHDsoahEweuTaUPEokPA==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@tauri-apps/api": "^2.8.0" + } + }, + "node_modules/@tauri-apps/plugin-opener": { + "version": "2.5.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/@tauri-apps/plugin-opener/-/plugin-opener-2.5.3.tgz", + "integrity": "sha512-CCcUltXMOfUEArbf3db3kCE7Ggy1ExBEBl51Ko2ODJ6GDYHRp1nSNlQm5uNCFY5k7/ufaK5Ib3Du/Zir19IYQQ==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@tauri-apps/api": "^2.8.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://mirrors.cloud.tencent.com/npm/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", + "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-core/-/compiler-core-3.5.33.tgz", + "integrity": "sha512-3PZLQwFw4Za3TC8t0FvTy3wI16Kt+pmwcgNZca4Pj9iWL2E72a/gZlpBtAJvEdDMdCxdG/qq0C7PN0bsJuv0Rw==", + "dependencies": { + "@babel/parser": "^7.29.2", + "@vue/shared": "3.5.33", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-dom/-/compiler-dom-3.5.33.tgz", + "integrity": "sha512-PXq0yrfCLzzL07rbXO4awtXY1Z06LG2eu6Adg3RJFa/j3Cii217XxxLXG22N330gw7GmALCY0Z8RgXEviwgpjA==", + "dependencies": { + "@vue/compiler-core": "3.5.33", + "@vue/shared": "3.5.33" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-sfc/-/compiler-sfc-3.5.33.tgz", + "integrity": "sha512-UTUvRO9cY+rROrx/pvN9P5Z7FgA6QGfokUCfhQE4EnmUj3rVnK+CHI0LsEO1pg+I7//iRYMUfcNcCPe7tg0CoA==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.2", + "@vue/compiler-core": "3.5.33", + "@vue/compiler-dom": "3.5.33", + "@vue/compiler-ssr": "3.5.33", + "@vue/shared": "3.5.33", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.10", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-ssr/-/compiler-ssr-3.5.33.tgz", + "integrity": "sha512-IErjYdnj1qIupG5xxiVIYiiRvDhGWV4zuh/RCrwfYpuL+HWQzeU6lCk/nF9r7olWMnjKxCAkOctT2qFWFkzb1A==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.33", + "@vue/shared": "3.5.33" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/reactivity/-/reactivity-3.5.33.tgz", + "integrity": "sha512-p8UfIqyIhb0rYGlSgSBV+lPhF2iUSBcRy7enhTmPqKWadHy9kcOFYF1AejYBP9P+avnd3OBbD49DU4pLWX/94A==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.33" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/runtime-core/-/runtime-core-3.5.33.tgz", + "integrity": "sha512-UpFF45RI9//a7rvq7RdOQblb4tup7hHG9QsmIrxkFQLzQ7R8/iNQ5LE15NhLZ1/WcHMU2b47u6P33CPUelHyIQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.33", + "@vue/shared": "3.5.33" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/runtime-dom/-/runtime-dom-3.5.33.tgz", + "integrity": "sha512-IOxMsAOwquhfITgmOgaPYl7/j8gKUxUFoflRc+u4LxyD3+783xne8vNta1PONVCvCV9A0w7hkyEepINDqfO0tw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.33", + "@vue/runtime-core": "3.5.33", + "@vue/shared": "3.5.33", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/server-renderer/-/server-renderer-3.5.33.tgz", + "integrity": "sha512-0xylq/8/h44lVG0pZFknv1XIdEgymq2E9n59uTWJBG+dIgiT0TMCSsxrN7nO16Z0MU0MPjFcguBbZV8Itk52Hw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.33", + "@vue/shared": "3.5.33" + }, + "peerDependencies": { + "vue": "3.5.33" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/@vue/shared/-/shared-3.5.33.tgz", + "integrity": "sha512-5vR2QIlmaLG77Ygd4pMP6+SGQ5yox9VhtnbDWTy9DzMzdmeLxZ1QqxrywEZ9sa1AVubfIJyaCG3ytyWU81ufcQ==" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://mirrors.cloud.tencent.com/npm/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://mirrors.cloud.tencent.com/npm/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.12", + "resolved": "https://mirrors.cloud.tencent.com/npm/postcss/-/postcss-8.5.12.tgz", + "integrity": "sha512-W62t/Se6rA0Az3DfCL0AqJwXuKwBeYg6nOaIgzP+xZ7N5BFCI7DYi1qs6ygUYT6rvfi6t9k65UMLJC+PHZpDAA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.60.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/rollup/-/rollup-4.60.2.tgz", + "integrity": "sha512-J9qZyW++QK/09NyN/zeO0dG/1GdGfyp9lV8ajHnRVLfo/uFsbji5mHnDgn/qYdUHyCkM2N+8VyspgZclfAh0eQ==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.2", + "@rollup/rollup-android-arm64": "4.60.2", + "@rollup/rollup-darwin-arm64": "4.60.2", + "@rollup/rollup-darwin-x64": "4.60.2", + "@rollup/rollup-freebsd-arm64": "4.60.2", + "@rollup/rollup-freebsd-x64": "4.60.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.2", + "@rollup/rollup-linux-arm-musleabihf": "4.60.2", + "@rollup/rollup-linux-arm64-gnu": "4.60.2", + "@rollup/rollup-linux-arm64-musl": "4.60.2", + "@rollup/rollup-linux-loong64-gnu": "4.60.2", + "@rollup/rollup-linux-loong64-musl": "4.60.2", + "@rollup/rollup-linux-ppc64-gnu": "4.60.2", + "@rollup/rollup-linux-ppc64-musl": "4.60.2", + "@rollup/rollup-linux-riscv64-gnu": "4.60.2", + "@rollup/rollup-linux-riscv64-musl": "4.60.2", + "@rollup/rollup-linux-s390x-gnu": "4.60.2", + "@rollup/rollup-linux-x64-gnu": "4.60.2", + "@rollup/rollup-linux-x64-musl": "4.60.2", + "@rollup/rollup-openbsd-x64": "4.60.2", + "@rollup/rollup-openharmony-arm64": "4.60.2", + "@rollup/rollup-win32-arm64-msvc": "4.60.2", + "@rollup/rollup-win32-ia32-msvc": "4.60.2", + "@rollup/rollup-win32-x64-gnu": "4.60.2", + "@rollup/rollup-win32-x64-msvc": "4.60.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://mirrors.cloud.tencent.com/npm/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.33", + "resolved": "https://mirrors.cloud.tencent.com/npm/vue/-/vue-3.5.33.tgz", + "integrity": "sha512-1AgChhx5w3ALgT4oK3acm2Es/7jyZhWSVUfs3rOBlGQC0rjEDkS7G4lWlJJGGNQD+BV3reCwbQrOe1mPNwKHBQ==", + "dependencies": { + "@vue/compiler-dom": "3.5.33", + "@vue/compiler-sfc": "3.5.33", + "@vue/runtime-dom": "3.5.33", + "@vue/server-renderer": "3.5.33", + "@vue/shared": "3.5.33" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + } + } +} diff --git a/apps/desktop/package.json b/apps/desktop/package.json new file mode 100644 index 0000000..ffdb39f --- /dev/null +++ b/apps/desktop/package.json @@ -0,0 +1,24 @@ +{ + "name": "abyssinfo-vpn", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "tauri:dev": "tauri dev", + "tauri:build": "tauri build" + }, + "dependencies": { + "@tauri-apps/api": "^2.10.1", + "@tauri-apps/plugin-deep-link": "^2.4.3", + "@tauri-apps/plugin-opener": "^2.5.3", + "vue": "^3.5.32" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.10.1", + "@vitejs/plugin-vue": "^5.2.4", + "vite": "^5.4.21" + } +} diff --git a/apps/desktop/public/app-icon.png b/apps/desktop/public/app-icon.png new file mode 100644 index 0000000..b07d241 Binary files /dev/null and b/apps/desktop/public/app-icon.png differ diff --git a/apps/desktop/public/favicon.svg b/apps/desktop/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/apps/desktop/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/desktop/public/icons.svg b/apps/desktop/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/apps/desktop/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/desktop/src-tauri/.gitignore b/apps/desktop/src-tauri/.gitignore new file mode 100644 index 0000000..502406b --- /dev/null +++ b/apps/desktop/src-tauri/.gitignore @@ -0,0 +1,4 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ +/gen/schemas diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock new file mode 100644 index 0000000..8a22c7f --- /dev/null +++ b/apps/desktop/src-tauri/Cargo.lock @@ -0,0 +1,5903 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_log-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" + +[[package]] +name = "android_logger" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb4e440d04be07da1f1bf44fb4495ebd58669372fe0cffa6e48595ac5bd88a3" +dependencies = [ + "android_log-sys", + "env_filter", + "log", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "app" +version = "0.1.0" +dependencies = [ + "log", + "md5", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-deep-link", + "tauri-plugin-log", + "tauri-plugin-opener", + "tokio", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "borsh" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" +dependencies = [ + "once_cell", + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "brotli" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byte-unit" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6d47a4e2961fb8721bcfc54feae6455f2f64e7054f9bc67e875f0e77f4c58d" +dependencies = [ + "rust_decimal", + "schemars 1.2.1", + "serde", + "utf8-width", +] + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.11.1", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml 0.9.12+spec-1.1.0", +] + +[[package]] +name = "cc" +version = "1.2.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link 0.2.1", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.11.1", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.11.1", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.29.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "matches", + "phf 0.10.1", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf 0.13.1", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.117", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.11.1", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + +[[package]] +name = "dom_query" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" +dependencies = [ + "bit-set", + "cssparser 0.36.0", + "foldhash 0.2.0", + "html5ever 0.38.0", + "precomputed-hash", + "selectors 0.36.1", + "tendril 0.5.0", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "embed-resource" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31a88c8d26de40ed18fe748c547845aa39de1db3afd958f8cb91579f3644bcb" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.2+spec-1.1.0", + "vswhom", + "winreg", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "fern" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" +dependencies = [ + "log", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.11.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever 0.14.1", + "match_token", +] + +[[package]] +name = "html5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" +dependencies = [ + "log", + "markup5ever 0.38.0", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +dependencies = [ + "cfb", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "js-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.11.1", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.8-speedreader" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" +dependencies = [ + "cssparser 0.29.6", + "html5ever 0.29.1", + "indexmap 2.14.0", + "selectors 0.24.0", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +dependencies = [ + "value-bag", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen 0.11.3", + "string_cache 0.8.9", + "string_cache_codegen 0.5.4", + "tendril 0.4.3", +] + +[[package]] +name = "markup5ever" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" +dependencies = [ + "log", + "tendril 0.5.0", + "web_atoms", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "muda" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c9fec5a4e89860383d778d10563a605838f8f0b2f9303868937e5ff32e86177" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.18", + "windows-sys 0.60.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.11.1", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.11.1", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags 2.11.1", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.11.1", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.11.1", + "block2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.11.1", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.11.1", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.11.1", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.11.1", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "open" +version = "5.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3bab717c29a857abf75fcef718d441ec7cb2725f937343c734740a985d37fd" +dependencies = [ + "dunce", + "is-wsl", + "libc", + "pathdiff", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared 0.8.0", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros 0.13.1", + "phf_shared 0.13.1", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.6", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.6", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.2", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher 1.0.2", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "plist" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092791278e026273c1b65bbdcfbba3a300f2994c896bd01ab01da613c29c46f1" +dependencies = [ + "base64 0.22.1", + "indexmap 2.14.0", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.11+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quick-xml" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.11.1", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 2.0.18", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rkyv" +version = "0.7.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust-ini" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + +[[package]] +name = "rust_decimal" +version = "1.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce901f9a19d251159075a4c37af514c3b8ef99c22e02dd8c19161cf397ee94a" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand 0.8.6", + "rkyv", + "serde", + "serde_json", + "wasm-bindgen", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.11.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.117", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "selectors" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416" +dependencies = [ + "bitflags 1.3.2", + "cssparser 0.29.6", + "derive_more 0.99.20", + "fxhash", + "log", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc 0.2.0", + "smallvec", +] + +[[package]] +name = "selectors" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" +dependencies = [ + "bitflags 2.11.1", + "cssparser 0.36.0", + "derive_more 2.1.1", + "log", + "new_debug_unreachable", + "phf 0.13.1", + "phf_codegen 0.13.1", + "precomputed-hash", + "rustc-hash", + "servo_arc 0.4.3", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_with" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.0", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "servo_arc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.13.1", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "swift-rs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.34.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20" +dependencies = [ + "bitflags 2.11.1", + "block2", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "parking_lot", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.18", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows", +] + +[[package]] +name = "tauri-build" +version = "2.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bbc990d1dbf57a8e1c7fa2327f2a614d8b757805603c1b9ba5c81bade09fd4d" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "toml 0.9.12+spec-1.1.0", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a24476afd977c5d5d169f72425868613d82747916dd29e0a357c84c4bd6d29" +dependencies = [ + "base64 0.22.1", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "syn 2.0.117", + "tauri-utils", + "thiserror 2.0.18", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d39b349a98dadaffebb73f0a40dcd1f23c999211e5a2e744403db384d0c33de7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddde7d51c907b940fb573006cdda9a642d6a7c8153657e88f8a5c3c9290cd4aa" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri-utils", + "toml 0.9.12+spec-1.1.0", + "walkdir", +] + +[[package]] +name = "tauri-plugin-deep-link" +version = "2.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94deb2e2e4641514ac496db2cddcfc850d6fc9d51ea17b82292a0490bd20ba5b" +dependencies = [ + "dunce", + "plist", + "rust-ini", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.18", + "tracing", + "url", + "windows-registry", + "windows-result 0.3.4", +] + +[[package]] +name = "tauri-plugin-log" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7545bd67f070a4500432c826e2e0682146a1d6712aee22a2786490156b574d93" +dependencies = [ + "android_logger", + "byte-unit", + "fern", + "log", + "objc2", + "objc2-foundation", + "serde", + "serde_json", + "serde_repr", + "swift-rs", + "tauri", + "tauri-plugin", + "thiserror 2.0.18", + "time", +] + +[[package]] +name = "tauri-plugin-opener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc624469b06f59f5a29f874bbc61a2ed737c0f9c23ef09855a292c389c42e83f" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.18", + "url", + "windows", + "zbus", +] + +[[package]] +name = "tauri-runtime" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e" +dependencies = [ + "gtk", + "http", + "jni", + "log", + "objc2", + "objc2-app-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219a1f983a2af3653f75b5747f76733b0da7ff03069c7a41901a5eb3ace4557d" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dunce", + "glob", + "html5ever 0.29.1", + "http", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.3", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.18", + "toml 0.9.12+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" +dependencies = [ + "dunce", + "embed-resource", + "toml 1.1.2+spec-1.1.0", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "tendril" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24" +dependencies = [ + "new_debug_unreachable", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap 2.14.0", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +dependencies = [ + "indexmap 2.14.0", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.2", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.14.0", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.2", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.2", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags 2.11.1", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tray-icon" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e85aa143ceb072062fc4d6356c1b520a51d636e7bc8e77ec94be3608e5e80c" +dependencies = [ + "crossbeam-channel", + "dirs", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.18", + "windows-sys 0.60.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlpattern" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +dependencies = [ + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "value-bag" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.14.0", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.1", + "hashbrown 0.15.5", + "indexmap 2.14.0", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7cff6eef815df1834fd250e3a2ff436044d82a9f1bc1980ca1dbdf07effc538" +dependencies = [ + "phf 0.13.1", + "phf_codegen 0.13.1", + "string_cache 0.9.0", + "string_cache_codegen 0.6.1", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core 0.61.2", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "webview2-com-sys" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" +dependencies = [ + "thiserror 2.0.18", + "windows", + "windows-core 0.61.2", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "raw-window-handle", + "windows-sys 0.59.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-registry" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" +dependencies = [ + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "winnow" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.55.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" +dependencies = [ + "cfg-if", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck 0.5.0", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck 0.5.0", + "indexmap 2.14.0", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.1", + "indexmap 2.14.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.14.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "wry" +version = "0.54.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc" +dependencies = [ + "base64 0.22.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "once_cell", + "percent-encoding", + "raw-window-handle", + "sha2", + "soup3", + "tao-macros", + "thiserror 2.0.18", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core 0.61.2", + "windows-version", + "x11-dl", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.2", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d" +dependencies = [ + "serde", + "winnow 1.0.2", + "zvariant", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zvariant" +version = "5.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db0ecb8987cf5e92653c57c098f7f0e39a03112edb796f4fe089fb7eaa14ff" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow 1.0.2", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b949b639ab1b4bed763aa7481ba0e368af68d8b55532f8ed4bec86a59f2ca98" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.117", + "winnow 1.0.2", +] diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml new file mode 100644 index 0000000..e52e5b0 --- /dev/null +++ b/apps/desktop/src-tauri/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "app" +version = "0.1.0" +description = "A Tauri App" +authors = ["you"] +license = "" +repository = "" +edition = "2021" +rust-version = "1.77.2" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +name = "app_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2.5.6", features = [] } + +[dependencies] +serde_json = "1.0" +serde = { version = "1.0", features = ["derive"] } +log = "0.4" +tauri = { version = "2.10.3", features = ["tray-icon"] } +tokio = { version = "1", features = ["rt-multi-thread"] } +tauri-plugin-log = "2" +tauri-plugin-deep-link = "2.4.3" +tauri-plugin-opener = "2.5.3" +md5 = "0.7" diff --git a/apps/desktop/src-tauri/build.rs b/apps/desktop/src-tauri/build.rs new file mode 100644 index 0000000..4d680fe --- /dev/null +++ b/apps/desktop/src-tauri/build.rs @@ -0,0 +1,40 @@ +fn main() { + let mut windows = tauri_build::WindowsAttributes::new(); + + if !tauri_build::is_dev() { + windows = windows.app_manifest( + r#" + + + + + + + + + + + + + + + + true/pm + PerMonitorV2 + + + +"#, + ); + } + + tauri_build::try_build(tauri_build::Attributes::new().windows_attributes(windows)) + .expect("failed to run build script"); +} diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.json new file mode 100644 index 0000000..de2a769 --- /dev/null +++ b/apps/desktop/src-tauri/capabilities/default.json @@ -0,0 +1,25 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "enables the default permissions", + "windows": [ + "main", + "logs" + ], + "permissions": [ + "core:default", + "core:event:default", + "core:window:allow-hide", + "core:window:allow-minimize", + "core:window:allow-start-dragging", + "core:window:allow-create", + "core:window:allow-close", + "core:window:allow-set-focus", + "core:webview:allow-create-webview-window", + "deep-link:default", + "deep-link:allow-is-registered", + "deep-link:allow-register", + "opener:default", + "opener:allow-open-url" + ] +} diff --git a/apps/desktop/src-tauri/icons/128x128.png b/apps/desktop/src-tauri/icons/128x128.png new file mode 100644 index 0000000..7299266 Binary files /dev/null and b/apps/desktop/src-tauri/icons/128x128.png differ diff --git a/apps/desktop/src-tauri/icons/128x128@2x.png b/apps/desktop/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..46ed22f Binary files /dev/null and b/apps/desktop/src-tauri/icons/128x128@2x.png differ diff --git a/apps/desktop/src-tauri/icons/32x32.png b/apps/desktop/src-tauri/icons/32x32.png new file mode 100644 index 0000000..7a795f6 Binary files /dev/null and b/apps/desktop/src-tauri/icons/32x32.png differ diff --git a/apps/desktop/src-tauri/icons/Square107x107Logo.png b/apps/desktop/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..afdb36f Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square107x107Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square142x142Logo.png b/apps/desktop/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..9f0437a Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square142x142Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square150x150Logo.png b/apps/desktop/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..41b1d15 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square150x150Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square284x284Logo.png b/apps/desktop/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..9eb7e93 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square284x284Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square30x30Logo.png b/apps/desktop/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..c877492 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square30x30Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square310x310Logo.png b/apps/desktop/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..09138d3 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square310x310Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square44x44Logo.png b/apps/desktop/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..c7b5ff2 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square44x44Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square71x71Logo.png b/apps/desktop/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..31946dc Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square71x71Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square89x89Logo.png b/apps/desktop/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..a495086 Binary files /dev/null and b/apps/desktop/src-tauri/icons/Square89x89Logo.png differ diff --git a/apps/desktop/src-tauri/icons/StoreLogo.png b/apps/desktop/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..6657b71 Binary files /dev/null and b/apps/desktop/src-tauri/icons/StoreLogo.png differ diff --git a/apps/desktop/src-tauri/icons/icon.icns b/apps/desktop/src-tauri/icons/icon.icns new file mode 100644 index 0000000..a1650ac Binary files /dev/null and b/apps/desktop/src-tauri/icons/icon.icns differ diff --git a/apps/desktop/src-tauri/icons/icon.ico b/apps/desktop/src-tauri/icons/icon.ico new file mode 100644 index 0000000..8af5514 Binary files /dev/null and b/apps/desktop/src-tauri/icons/icon.ico differ diff --git a/apps/desktop/src-tauri/icons/icon.png b/apps/desktop/src-tauri/icons/icon.png new file mode 100644 index 0000000..b07d241 Binary files /dev/null and b/apps/desktop/src-tauri/icons/icon.png differ diff --git a/apps/desktop/src-tauri/resources/app.manifest b/apps/desktop/src-tauri/resources/app.manifest new file mode 100644 index 0000000..0ecbcdd --- /dev/null +++ b/apps/desktop/src-tauri/resources/app.manifest @@ -0,0 +1,21 @@ + + + + + + + + + + + + true/pm + PerMonitorV2 + + + + + + + + diff --git a/apps/desktop/src-tauri/resources/app.rc b/apps/desktop/src-tauri/resources/app.rc new file mode 100644 index 0000000..ada1fa8 --- /dev/null +++ b/apps/desktop/src-tauri/resources/app.rc @@ -0,0 +1 @@ +1 24 "resources/app.manifest" diff --git a/apps/desktop/src-tauri/resources/netclient/README.md b/apps/desktop/src-tauri/resources/netclient/README.md new file mode 100644 index 0000000..c5be499 --- /dev/null +++ b/apps/desktop/src-tauri/resources/netclient/README.md @@ -0,0 +1,14 @@ +# Netclient assets + +Run `scripts/download-netclient-assets.bat` on Windows or `pwsh scripts/download-netclient-assets.ps1` before building the desktop app. + +Expected files: + +- `windows/netclientbundle.exe` +- `windows/netclient-windows-amd64.exe` +- `macos/Netclient-M1.pkg` +- `macos/Netclient-Intel.pkg` +- `macos/netclient-darwin-arm64` +- `macos/netclient-darwin-amd64` + +The app first looks for an installed `netclient`, then falls back to the bundled binary. If `netclient` is missing, the install button starts the bundled installer with administrator privileges. diff --git a/apps/desktop/src-tauri/resources/netclient/macos/Netclient-Intel.pkg b/apps/desktop/src-tauri/resources/netclient/macos/Netclient-Intel.pkg new file mode 100644 index 0000000..c95f4e6 Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/macos/Netclient-Intel.pkg differ diff --git a/apps/desktop/src-tauri/resources/netclient/macos/Netclient-M1.pkg b/apps/desktop/src-tauri/resources/netclient/macos/Netclient-M1.pkg new file mode 100644 index 0000000..7f24dfa Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/macos/Netclient-M1.pkg differ diff --git a/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-amd64 b/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-amd64 new file mode 100644 index 0000000..54e229f Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-amd64 differ diff --git a/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-arm64 b/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-arm64 new file mode 100644 index 0000000..eca7991 Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/macos/netclient-darwin-arm64 differ diff --git a/apps/desktop/src-tauri/resources/netclient/windows/netclient-windows-amd64.exe b/apps/desktop/src-tauri/resources/netclient/windows/netclient-windows-amd64.exe new file mode 100644 index 0000000..21ea2ba Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/windows/netclient-windows-amd64.exe differ diff --git a/apps/desktop/src-tauri/resources/netclient/windows/winsw.exe b/apps/desktop/src-tauri/resources/netclient/windows/winsw.exe new file mode 100644 index 0000000..9eb3759 Binary files /dev/null and b/apps/desktop/src-tauri/resources/netclient/windows/winsw.exe differ diff --git a/apps/desktop/src-tauri/src/commands/mod.rs b/apps/desktop/src-tauri/src/commands/mod.rs new file mode 100644 index 0000000..ad4f497 --- /dev/null +++ b/apps/desktop/src-tauri/src/commands/mod.rs @@ -0,0 +1,2 @@ +pub mod vpn; + diff --git a/apps/desktop/src-tauri/src/commands/vpn.rs b/apps/desktop/src-tauri/src/commands/vpn.rs new file mode 100644 index 0000000..d5b6775 --- /dev/null +++ b/apps/desktop/src-tauri/src/commands/vpn.rs @@ -0,0 +1,1403 @@ +use serde::Serialize; +use std::{ + env, fs, + path::{Path, PathBuf}, + process::Command, + time::{SystemTime, UNIX_EPOCH}, +}; +use tauri::{path::BaseDirectory, AppHandle, Manager}; + +#[derive(Serialize)] +pub struct VpnStatus { + installed: bool, + connected: bool, + command: String, + output: String, + error: String, + version: String, +} + +impl VpnStatus { + fn not_installed(command: &str, error: &str) -> Self { + Self { + installed: false, + connected: false, + command: command.to_string(), + output: String::new(), + error: error.to_string(), + version: "not installed".to_string(), + } + } + + fn with_version(mut self, netclient: Option<&Path>) -> Self { + self.version = netclient + .map(resolve_netclient_version) + .unwrap_or_else(|| "not installed".to_string()); + self + } +} + +const NETCLIENT_VERSION_MAP: &[(&str, &str)] = &[ + ("166B00C37F3C742F489F53C0A6F450D7", "v1.5.1"), + ("B057F90C9C2DC0194BB20EDDFAC46600", "unknown (pre-v1.5.1)"), +]; + +fn resolve_netclient_version(netclient: &Path) -> String { + match compute_file_md5(netclient) { + Ok(md5) => { + for (hash, version) in NETCLIENT_VERSION_MAP { + if hash.eq_ignore_ascii_case(&md5) { + return version.to_string(); + } + } + format!("unknown (md5: {})", &md5[..16]) + } + Err(error) => format!("error: {}", error), + } +} + +fn compute_file_md5(path: &Path) -> Result { + let bytes = fs::read(path).map_err(|e| format!("读取文件失败: {}", e))?; + let digest = md5::compute(&bytes); + Ok(format!("{:X}", digest)) +} + +#[tauri::command] +pub async fn connect_vpn(app: AppHandle, token: String) -> Result { + log::info!("[vpn] connect_vpn 开始, token 长度={}", token.len()); + tokio::task::spawn_blocking(move || { + let netclient = resolve_netclient_command(&app)?; + log::info!("[vpn] netclient 路径: {}", netclient.display()); + #[cfg(target_os = "windows")] + { + return run_windows_connect(&netclient, &token); + } + + #[cfg(not(target_os = "windows"))] + run_netclient_action(&netclient, &["join".to_string(), "-t".to_string(), token]) + }) + .await + .map_err(|e| format!("连接任务执行失败: {e}"))??; + + if cfg!(target_os = "windows") { + Ok("已通过管理员权限执行 VPN 连接,请稍后刷新状态".to_string()) + } else { + Ok("VPN connected".to_string()) + } +} + +#[tauri::command] +pub async fn reset_vpn(app: AppHandle, token: String) -> Result { + log::info!("[vpn] reset_vpn 开始, token 长度={}", token.len()); + tokio::task::spawn_blocking(move || { + let netclient = resolve_netclient_command(&app)?; + log::info!("[vpn] netclient 路径: {}", netclient.display()); + #[cfg(target_os = "windows")] + { + return run_windows_reset(&netclient, &token); + } + + #[cfg(not(target_os = "windows"))] + { + run_netclient_action(&netclient, &["leave".to_string(), "-f".to_string()]).ok(); + run_netclient_action(&netclient, &["join".to_string(), "-t".to_string(), token]) + } + }) + .await + .map_err(|e| format!("重置任务执行失败: {e}"))??; + + if cfg!(target_os = "windows") { + Ok("已通过管理员权限重置 VPN,请稍后刷新状态".to_string()) + } else { + Ok("VPN reset".to_string()) + } +} + +#[tauri::command] +pub async fn disconnect_vpn(app: AppHandle, network: String) -> Result { + log::info!("[vpn] disconnect_vpn 开始, network={}", network); + if network.trim().is_empty() { + return Err("缺少 Netmaker 网络名".to_string()); + } + let network = network.trim().to_string(); + + tokio::task::spawn_blocking(move || { + let netclient = resolve_netclient_command(&app)?; + log::info!("[vpn] netclient 路径: {}", netclient.display()); + #[cfg(target_os = "windows")] + { + return run_windows_disconnect(&netclient, &network); + } + + #[cfg(not(target_os = "windows"))] + run_netclient_action(&netclient, &["disconnect".to_string(), network]) + }) + .await + .map_err(|e| format!("断开任务执行失败: {e}"))??; + + if cfg!(target_os = "windows") { + Ok("已通过管理员权限执行 VPN 断开,请稍后刷新状态".to_string()) + } else { + Ok("VPN disconnected".to_string()) + } +} + +#[tauri::command] +pub async fn install_netclient(app: AppHandle) -> Result { + tokio::task::spawn_blocking(move || { + #[cfg(target_os = "windows")] + { + let netclient = resolve_netclient_command(&app)?; + let winsw = resolve_winsw_command(&app)?; + return run_windows_install(&netclient, &winsw); + } + + #[cfg(not(target_os = "windows"))] + { + let installer = resolve_netclient_installer(&app)?; + run_netclient_installer(&installer) + } + }) + .await + .map_err(|e| format!("安装任务执行失败: {e}"))? +} + +#[tauri::command] +pub fn vpn_status() -> VpnStatus { + #[cfg(target_os = "windows")] + if let Some(status) = windows_vpn_status() { + return status; + } + + match run_netclient(&["list"]) { + Ok(status) => status, + Err(list_error) => { + if !list_error.installed { + let netclient = resolve_system_netclient_command().ok(); + VpnStatus::not_installed( + "netclient list", + "未检测到 netclient,请点击安装内置 Netmaker netclient", + ) + .with_version(netclient.as_deref()) + } else { + list_error + } + } + } +} + +#[cfg(target_os = "windows")] +fn windows_vpn_status() -> Option { + let netclient = match resolve_system_netclient_command() { + Ok(command) => command, + Err(error) => { + return Some( + VpnStatus::not_installed("windows netclient status", &error) + ); + } + }; + + let install_dir = netclient.parent().unwrap_or_else(|| Path::new(r"C:\Program Files (x86)\Netclient")); + let node = read_windows_node_status(install_dir); + let interface_ip = read_windows_netmaker_ip(); + let connected = interface_ip + .as_deref() + .map(|ip| !ip.trim().is_empty() && !ip.starts_with("169.254.")) + .unwrap_or(false); + + let mut lines = Vec::new(); + lines.push(format!("netclient: {}", netclient.display())); + lines.push(format!("version: {}", resolve_netclient_version(&netclient))); + if let Some(network) = node.network.as_deref() { + lines.push(format!("network: {network}")); + } + if let Some(host_id) = node.host_id.as_deref() { + lines.push(format!("host_id: {host_id}")); + } + if let Some(node_id) = node.node_id.as_deref() { + lines.push(format!("node_id: {node_id}")); + } + if let Some(address) = node.address.as_deref() { + lines.push(format!("assigned_ip: {address}")); + } + if let Some(ip) = interface_ip.as_deref() { + lines.push(format!("interface_ip: {ip}")); + } + if node.connected { + lines.push("node_config: connected".to_string()); + } + + let error = if connected { + String::new() + } else if node.network.is_some() { + "Netclient 已入网,但 netmaker 网卡还没有拿到 VPN 内网 IP".to_string() + } else { + "未检测到 Netmaker 网络配置,请先连接 VPN".to_string() + }; + + Some(VpnStatus { + installed: true, + connected, + command: "Get-NetIPAddress -InterfaceAlias netmaker".to_string(), + output: lines.join("\n"), + error, + version: resolve_netclient_version(&netclient), + }) +} + +#[cfg(target_os = "windows")] +#[derive(Default)] +struct WindowsNodeStatus { + network: Option, + host_id: Option, + node_id: Option, + address: Option, + connected: bool, +} + +#[cfg(target_os = "windows")] +fn read_windows_node_status(install_dir: &Path) -> WindowsNodeStatus { + let path = install_dir.join("nodes.json"); + let Ok(raw) = fs::read_to_string(path) else { + return WindowsNodeStatus::default(); + }; + let Ok(value) = serde_json::from_str::(&raw) else { + return WindowsNodeStatus::default(); + }; + let Some(nodes) = value.as_object() else { + return WindowsNodeStatus::default(); + }; + let Some((network, node)) = nodes.iter().next() else { + return WindowsNodeStatus::default(); + }; + + let address = node + .get("address") + .and_then(|address| address.get("IP").or_else(|| address.get("ip"))) + .and_then(|ip| ip.as_str()) + .filter(|ip| !ip.trim().is_empty()) + .map(ToString::to_string); + let host_id = node + .get("hostid") + .or_else(|| node.get("host_id")) + .and_then(|value| value.as_str()) + .filter(|value| !value.trim().is_empty()) + .map(ToString::to_string); + let node_id = node + .get("id") + .or_else(|| node.get("nodeid")) + .or_else(|| node.get("node_id")) + .and_then(|value| value.as_str()) + .filter(|value| !value.trim().is_empty()) + .map(ToString::to_string); + + WindowsNodeStatus { + network: Some(network.to_string()), + host_id, + node_id, + address, + connected: node.get("connected").and_then(|value| value.as_bool()).unwrap_or(false), + } +} + +#[cfg(target_os = "windows")] +fn read_windows_netmaker_ip() -> Option { + let script = "(Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | Select-Object -First 1 -ExpandProperty IPAddress)"; + let output = Command::new("powershell") + .args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", script]) + .output() + .ok()?; + + let stdout = String::from_utf8_lossy(&output.stdout).trim().to_string(); + if output.status.success() && !stdout.is_empty() { + Some(stdout) + } else { + None + } +} + +fn run_netclient(args: &[&str]) -> Result { + let netclient = resolve_system_netclient_command().map_err(|error| { + VpnStatus::not_installed( + &format!("netclient {}", args.join(" ")), + &error, + ) + })?; + let version = resolve_netclient_version(&netclient); + let command_text = format!("{} {}", netclient.display(), args.join(" ")); + let output = Command::new(&netclient) + .args(args) + .output() + .map_err(|error| VpnStatus { + installed: true, + connected: false, + command: command_text.clone(), + output: String::new(), + error: format!("netclient 启动失败:{error}"), + version: version.clone(), + })?; + + let stdout = String::from_utf8_lossy(&output.stdout).trim().to_string(); + let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string(); + let combined = format!("{stdout}\n{stderr}"); + let connected = output.status.success() && looks_connected(&combined); + let status = VpnStatus { + installed: true, + connected, + command: command_text, + output: stdout, + error: stderr, + version, + }; + + if output.status.success() { + Ok(status) + } else { + Err(status) + } +} + +fn resolve_netclient_command(app: &AppHandle) -> Result { + if let Ok(command) = resolve_system_netclient_command() { + return Ok(command); + } + + for candidate in resource_netclient_candidates(app) { + if candidate.is_file() { + return Ok(candidate); + } + } + + Err("未检测到 netclient,请先安装内置 Netmaker netclient".to_string()) +} + +fn resolve_system_netclient_command() -> Result { + for candidate in system_netclient_candidates() { + if candidate.is_file() { + return Ok(candidate); + } + } + + Err("未检测到 netclient,请先安装内置 Netmaker netclient".to_string()) +} + +fn resolve_netclient_installer(app: &AppHandle) -> Result { + for candidate in resource_netclient_installer_candidates(app) { + if candidate.is_file() { + return Ok(candidate); + } + } + + Err("内置 netclient 安装包不存在,请先运行 scripts/download-netclient-assets.ps1 下载资源".to_string()) +} + +fn system_netclient_candidates() -> Vec { + let mut candidates = Vec::new(); + + #[cfg(target_os = "windows")] + { + candidates.extend([ + PathBuf::from(r"C:\Program Files\Netmaker\netclient.exe"), + PathBuf::from(r"C:\Program Files (x86)\Netmaker\netclient.exe"), + PathBuf::from(r"C:\Program Files\Netclient\netclient.exe"), + PathBuf::from(r"C:\Program Files (x86)\Netclient\netclient.exe"), + PathBuf::from(r"C:\Program Files\Netmaker\netclient\netclient.exe"), + PathBuf::from(r"C:\Program Files (x86)\Netmaker\netclient\netclient.exe"), + ]); + candidates.extend(find_in_path(&["netclient.exe", "netclient"])); + } + + #[cfg(target_os = "macos")] + { + candidates.extend([ + PathBuf::from("/usr/local/bin/netclient"), + PathBuf::from("/opt/homebrew/bin/netclient"), + PathBuf::from("/usr/bin/netclient"), + ]); + candidates.extend(find_in_path(&["netclient"])); + } + + #[cfg(not(any(target_os = "windows", target_os = "macos")))] + { + candidates.extend(find_in_path(&["netclient"])); + } + + candidates +} + +fn resource_netclient_candidates(app: &AppHandle) -> Vec { + resource_candidates(app, platform_netclient_resource_names()) +} + +fn resource_netclient_installer_candidates(app: &AppHandle) -> Vec { + resource_candidates(app, platform_netclient_installer_names()) +} + +fn resource_candidates(app: &AppHandle, names: &[&str]) -> Vec { + let mut candidates = Vec::new(); + + for name in names { + if let Ok(path) = app.path().resolve(name, BaseDirectory::Resource) { + candidates.push(path); + } + candidates.push(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("resources").join(name)); + } + + candidates +} + +fn platform_netclient_resource_names() -> &'static [&'static str] { + #[cfg(target_os = "windows")] + { + &[ + "netclient/windows/netclient.exe", + "netclient/windows/netclient-windows-amd64.exe", + ] + } + + #[cfg(all(target_os = "macos", target_arch = "aarch64"))] + { + &["netclient/macos/netclient-darwin-arm64"] + } + + #[cfg(all(target_os = "macos", target_arch = "x86_64"))] + { + &["netclient/macos/netclient-darwin-amd64"] + } + + #[cfg(not(any( + target_os = "windows", + all(target_os = "macos", target_arch = "aarch64"), + all(target_os = "macos", target_arch = "x86_64") + )))] + { + &[] + } +} + +fn platform_netclient_installer_names() -> &'static [&'static str] { + #[cfg(target_os = "windows")] + { + &["netclient/windows/netclientbundle.exe"] + } + + #[cfg(all(target_os = "macos", target_arch = "aarch64"))] + { + &["netclient/macos/Netclient-M1.pkg"] + } + + #[cfg(all(target_os = "macos", target_arch = "x86_64"))] + { + &["netclient/macos/Netclient-Intel.pkg"] + } + + #[cfg(not(any( + target_os = "windows", + all(target_os = "macos", target_arch = "aarch64"), + all(target_os = "macos", target_arch = "x86_64") + )))] + { + &[] + } +} + +fn platform_winsw_resource_names() -> &'static [&'static str] { + #[cfg(target_os = "windows")] + { + &["netclient/windows/winsw.exe"] + } + + #[cfg(not(target_os = "windows"))] + { + &[] + } +} + +fn resource_winsw_candidates(app: &AppHandle) -> Vec { + resource_candidates(app, platform_winsw_resource_names()) +} + +fn resolve_winsw_command(app: &AppHandle) -> Result { + for candidate in resource_winsw_candidates(app) { + if candidate.is_file() { + return Ok(candidate); + } + } + + Err("内置 winsw 不存在,请先运行 scripts/download-netclient-assets.ps1 下载资源".to_string()) +} + +fn find_in_path(names: &[&str]) -> Vec { + let mut candidates = Vec::new(); + let Some(path_value) = env::var_os("PATH") else { + return candidates; + }; + + for dir in env::split_paths(&path_value) { + for name in names { + candidates.push(dir.join(name)); + } + } + + candidates +} + +#[cfg(target_os = "windows")] +fn run_windows_connect(netclient: &Path, token: &str) -> Result<(), String> { + let working_dir = netclient.parent().unwrap_or_else(|| Path::new(r"C:\")); + let output_path = env::temp_dir().join(format!("abyssinfo-netclient-connect-{}.log", unique_suffix())); + let code_path = env::temp_dir().join(format!("abyssinfo-netclient-connect-{}.code", unique_suffix())); + let script = windows_connect_script(netclient, token, &output_path, &code_path); + + run_elevated_windows_script(&script, working_dir, &output_path, &code_path) +} + +#[cfg(target_os = "windows")] +fn run_windows_disconnect(netclient: &Path, network: &str) -> Result<(), String> { + let working_dir = netclient.parent().unwrap_or_else(|| Path::new(r"C:\")); + let output_path = env::temp_dir().join(format!("abyssinfo-netclient-disconnect-{}.log", unique_suffix())); + let code_path = env::temp_dir().join(format!("abyssinfo-netclient-disconnect-{}.code", unique_suffix())); + let script = windows_disconnect_script(netclient, network, &output_path, &code_path); + + run_elevated_windows_script(&script, working_dir, &output_path, &code_path) +} + +#[cfg(target_os = "windows")] +fn run_windows_reset(netclient: &Path, token: &str) -> Result<(), String> { + let working_dir = netclient.parent().unwrap_or_else(|| Path::new(r"C:\")); + let output_path = env::temp_dir().join(format!("abyssinfo-netclient-reset-{}.log", unique_suffix())); + let code_path = env::temp_dir().join(format!("abyssinfo-netclient-reset-{}.code", unique_suffix())); + let script = windows_reset_script(netclient, token, &output_path, &code_path); + + run_elevated_windows_script(&script, working_dir, &output_path, &code_path) +} + +#[cfg(target_os = "windows")] +fn run_windows_install(netclient: &Path, winsw: &Path) -> Result { + let output_path = env::temp_dir().join(format!("abyssinfo-netclient-install-{}.log", unique_suffix())); + let code_path = env::temp_dir().join(format!("abyssinfo-netclient-install-{}.code", unique_suffix())); + let script = windows_install_script(netclient, winsw, &output_path, &code_path); + + run_elevated_windows_script(&script, netclient.parent().unwrap_or_else(|| Path::new(r"C:\")), &output_path, &code_path)?; + Ok("netclient 安装流程已完成,请刷新状态后连接 VPN".to_string()) +} + +#[cfg(target_os = "windows")] +fn windows_disconnect_script(netclient: &Path, network: &str, output_path: &Path, code_path: &Path) -> String { + let script = r#" +$ErrorActionPreference = 'Continue' +$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +$outPath = '__OUTPUT_PATH__' +$codePath = '__CODE_PATH__' +function Log($m) { [System.IO.File]::AppendAllText($outPath, "$(Get-Date -Format o) $m`r`n", [System.Text.UTF8Encoding]::new($false)) } +function Finish($code) { + [System.IO.File]::WriteAllText($codePath, [string]$code, [System.Text.UTF8Encoding]::new($false)) + exit $code +} +function Get-NetmakerVpnIp { + try { + return (Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | + Select-Object -First 1 -ExpandProperty IPAddress) + } catch { + return $null + } +} +function Clear-NetmakerInterface { + Log 'clear netmaker interface routes, dns and ip' + try { + Get-NetRoute -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Get-NetRoute -InterfaceAlias 'netmaker' -AddressFamily IPv6 -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + } catch { + Log "route cleanup failed: $($_.Exception.Message)" + } + try { + Set-DnsClientServerAddress -InterfaceAlias 'netmaker' -ResetServerAddresses -ErrorAction SilentlyContinue + } catch { + Log "dns cleanup failed: $($_.Exception.Message)" + } + try { + Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | + Remove-NetIPAddress -Confirm:$false -ErrorAction SilentlyContinue + } catch { + Log "ip cleanup failed: $($_.Exception.Message)" + } +} + +$exe = '__NETCLIENT__' +$dir = Split-Path -Parent $exe +$network = '__NETWORK__' +Set-Location -LiteralPath $dir +Log "disconnect start network=$network" + +try { + $stdoutPath = "$outPath.stdout" + $stderrPath = "$outPath.stderr" + Remove-Item -LiteralPath $stdoutPath, $stderrPath -Force -ErrorAction SilentlyContinue + $p = Start-Process -FilePath $exe -ArgumentList @('disconnect', $network) -WorkingDirectory $dir -WindowStyle Hidden -RedirectStandardOutput $stdoutPath -RedirectStandardError $stderrPath -PassThru + if ($null -ne $p) { + try { + Wait-Process -Id $p.Id -Timeout 20 -ErrorAction Stop + $p.Refresh() + Log "netclient disconnect exit=$($p.ExitCode)" + } catch { + Log 'netclient disconnect timeout; continue local cleanup' + try { Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue } catch {} + } + if (Test-Path $stdoutPath) { + Get-Content -LiteralPath $stdoutPath -ErrorAction SilentlyContinue | ForEach-Object { Log $_ } + } + if (Test-Path $stderrPath) { + Get-Content -LiteralPath $stderrPath -ErrorAction SilentlyContinue | ForEach-Object { Log $_ } + } + Remove-Item -LiteralPath $stdoutPath, $stderrPath -Force -ErrorAction SilentlyContinue + } +} catch { + Log "netclient disconnect failed: $($_.Exception.Message)" +} + +Log 'keep netclient service running for faster reconnect' +Clear-NetmakerInterface +Start-Sleep -Seconds 2 +Clear-NetmakerInterface +$ip = Get-NetmakerVpnIp +if ($ip) { + Log "disconnect cleanup finished but VPN IP still exists: $ip" +} else { + Log 'disconnect cleanup finished, VPN IP removed' +} +Finish 0 +"#; + + script + .replace("__OUTPUT_PATH__", &ps_single_quoted_path(output_path)) + .replace("__CODE_PATH__", &ps_single_quoted_path(code_path)) + .replace("__NETCLIENT__", &ps_single_quoted_path(netclient)) + .replace("__NETWORK__", &ps_single_quoted_value(network)) +} + +#[cfg(target_os = "windows")] +fn windows_reset_script(netclient: &Path, token: &str, output_path: &Path, code_path: &Path) -> String { + let script = r#" +$ErrorActionPreference = 'Continue' +$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +$outPath = '__OUTPUT_PATH__' +$codePath = '__CODE_PATH__' +function Log($m) { [System.IO.File]::AppendAllText($outPath, "$(Get-Date -Format o) $m`r`n", [System.Text.UTF8Encoding]::new($false)) } +function Finish($code) { + [System.IO.File]::WriteAllText($codePath, [string]$code, [System.Text.UTF8Encoding]::new($false)) + exit $code +} +function Get-NetmakerVpnIp { + try { + return (Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | + Select-Object -First 1 -ExpandProperty IPAddress) + } catch { + return $null + } +} +function Wait-NetmakerVpnIp($seconds, $label) { + $deadline = (Get-Date).AddSeconds($seconds) + while ((Get-Date) -lt $deadline) { + $ip = Get-NetmakerVpnIp + if ($ip) { + Log "$label ip=$ip" + return $ip + } + Start-Sleep -Seconds 2 + } + return $null +} +function Set-NetmakerInternalOnly { + Log 'apply internal-only network policy for netmaker' + try { + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix '::/0' -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Set-NetIPInterface -InterfaceAlias 'netmaker' -AddressFamily IPv4 -InterfaceMetric 5000 -ErrorAction SilentlyContinue + Set-NetIPInterface -InterfaceAlias 'netmaker' -AddressFamily IPv6 -InterfaceMetric 5000 -ErrorAction SilentlyContinue + } catch { + Log "route policy failed: $($_.Exception.Message)" + } + try { + $prefix = $null + $nodesPath = Join-Path $dir 'nodes.json' + if (Test-Path $nodesPath) { + $nodes = Get-Content $nodesPath -Raw -Encoding UTF8 | ConvertFrom-Json + $nodeProp = $nodes.PSObject.Properties | Select-Object -First 1 + if ($nodeProp -and $nodeProp.Value.networkrange -and $nodeProp.Value.networkrange.IP) { + $prefix = "$($nodeProp.Value.networkrange.IP)/24" + } + } + if (-not $prefix) { + $prefix = '100.88.0.0/24' + } + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix $prefix -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + New-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix $prefix -NextHop '0.0.0.0' -RouteMetric 1 -ErrorAction SilentlyContinue | Out-Null + Log "internal route ensured: $prefix" + } catch { + Log "internal route ensure failed: $($_.Exception.Message)" + } + try { + Set-DnsClientServerAddress -InterfaceAlias 'netmaker' -ResetServerAddresses -ErrorAction SilentlyContinue + } catch { + Log "dns reset failed: $($_.Exception.Message)" + } +} +function Confirm-NetmakerInternalOnly { + Start-Sleep -Seconds 3 + Set-NetmakerInternalOnly + Start-Sleep -Seconds 2 + Set-NetmakerInternalOnly +} +function Clear-NetmakerInterface { + Log 'clear netmaker interface routes, dns and ip' + try { + Get-NetRoute -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Get-NetRoute -InterfaceAlias 'netmaker' -AddressFamily IPv6 -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + } catch { + Log "route cleanup failed: $($_.Exception.Message)" + } + try { + Set-DnsClientServerAddress -InterfaceAlias 'netmaker' -ResetServerAddresses -ErrorAction SilentlyContinue + } catch { + Log "dns cleanup failed: $($_.Exception.Message)" + } + try { + Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | + Remove-NetIPAddress -Confirm:$false -ErrorAction SilentlyContinue + } catch { + Log "ip cleanup failed: $($_.Exception.Message)" + } +} + +$exe = '__NETCLIENT__' +$dir = Split-Path -Parent $exe +$token = '__TOKEN__' +Set-Location -LiteralPath $dir +Log 'reset start' + +try { Stop-Service netclient -Force -ErrorAction SilentlyContinue } catch { Log "stop failed: $($_.Exception.Message)" } +Start-Sleep -Seconds 2 + +Clear-NetmakerInterface +Start-Sleep -Seconds 2 +Clear-NetmakerInterface + +foreach ($file in @('netclient.json','netclient.json.bak','servers.json','servers.json.bak','nodes.json','nodes.json.bak','.serverctx')) { + $path = Join-Path $dir $file + if (Test-Path $path) { + try { Remove-Item $path -Force -ErrorAction SilentlyContinue; Log "removed $file" } catch { Log "remove $file failed: $($_.Exception.Message)" } + } +} + +Log 'performing join after reset' +$joinOut = & $exe join -t $token 2>&1 +$joinCode = $LASTEXITCODE +Log "join exit=$joinCode" +foreach ($line in $joinOut) { Log $line.ToString() } +if ($joinCode -ne 0) { + Finish $joinCode +} + +$joinedIp = Wait-NetmakerVpnIp 150 'connected after reset' +if ($joinedIp) { + Confirm-NetmakerInternalOnly + Finish 0 +} +Log 'reset join completed but VPN IP not detected yet' +Finish 0 +"#; + + script + .replace("__OUTPUT_PATH__", &ps_single_quoted_path(output_path)) + .replace("__CODE_PATH__", &ps_single_quoted_path(code_path)) + .replace("__NETCLIENT__", &ps_single_quoted_path(netclient)) + .replace("__TOKEN__", &ps_single_quoted_value(token)) +} + +#[cfg(target_os = "windows")] +fn windows_install_script(netclient: &Path, winsw: &Path, output_path: &Path, code_path: &Path) -> String { + let install_dir = r"C:\Program Files (x86)\Netclient"; + let script = format!(r#" +$ErrorActionPreference = 'Continue' +$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +$outPath = '__OUTPUT_PATH__' +$codePath = '__CODE_PATH__' +function Log($m) {{ [System.IO.File]::AppendAllText($outPath, "$(Get-Date -Format o) $m`r`n", [System.Text.UTF8Encoding]::new($false)) }} +function Finish($code) {{ + [System.IO.File]::WriteAllText($codePath, [string]$code, [System.Text.UTF8Encoding]::new($false)) + exit $code +}} + +$installDir = '{install_dir}' +$netclientSource = '__NETCLIENT__' +$winswSource = '__WINSW__' + +Log 'install start' + +# 1. 停止并删除现有服务 +try {{ sc stop netclient | Out-Null }} catch {{}} +Start-Sleep -Seconds 2 +try {{ sc delete netclient | Out-Null }} catch {{}} +Start-Sleep -Seconds 1 + +# 2. 清理现有目录 +if (Test-Path $installDir) {{ + try {{ Remove-Item $installDir -Recurse -Force -ErrorAction SilentlyContinue }} catch {{}} +}} + +# 3. 创建目录 +New-Item -ItemType Directory -Force -Path $installDir | Out-Null +Log "created directory: $installDir" + +# 4. 复制文件 +try {{ + Copy-Item -LiteralPath $netclientSource -Destination (Join-Path $installDir 'netclient.exe') -Force + Log "copied netclient.exe" +}} catch {{ + Log "failed to copy netclient.exe: $($_.Exception.Message)" + Finish 1 +}} + +try {{ + Copy-Item -LiteralPath $winswSource -Destination (Join-Path $installDir 'winsw.exe') -Force + Log "copied winsw.exe" +}} catch {{ + Log "failed to copy winsw.exe: $($_.Exception.Message)" + Finish 1 +}} + +# 5. 创建 winsw.xml +$winswXml = @' + netclient + Netclient + Manages Windows Netclient on one or more Netmaker networks. + %BASE%\netclient.exe + daemon + %BASE% + %BASE%\logs + + Automatic + true + 30sec + 1 hour + + + + + + +'@ +Set-Content -LiteralPath (Join-Path $installDir 'winsw.xml') -Value $winswXml -Encoding UTF8 -Force +Log "created winsw.xml" + +# 6. 安装服务 +Set-Location -LiteralPath $installDir +$winswInstall = & (Join-Path $installDir 'winsw.exe') install 2>&1 +$installCode = $LASTEXITCODE +Log "winsw install exit=$installCode" +foreach ($line in $winswInstall) {{ Log $line.ToString() }} +if ($installCode -ne 0) {{ + Log "winsw install failed" + Finish $installCode +}} + +# 7. 启动服务 +Start-Sleep -Seconds 1 +$winswStart = & (Join-Path $installDir 'winsw.exe') start 2>&1 +$startCode = $LASTEXITCODE +Log "winsw start exit=$startCode" +foreach ($line in $winswStart) {{ Log $line.ToString() }} + +# 8. 等待服务启动 +Start-Sleep -Seconds 5 +$svc = Get-Service netclient -ErrorAction SilentlyContinue +if ($svc -and $svc.Status -eq 'Running') {{ + Log 'netclient service is running' + Finish 0 +}} else {{ + Log 'netclient service did not start' + Finish 1 +}} +Finish 0 +"#, + install_dir = ps_single_quoted_path(Path::new(install_dir)), + ); + + script + .replace("__OUTPUT_PATH__", &ps_single_quoted_path(output_path)) + .replace("__CODE_PATH__", &ps_single_quoted_path(code_path)) + .replace("__NETCLIENT__", &ps_single_quoted_path(netclient)) + .replace("__WINSW__", &ps_single_quoted_path(winsw)) +} + +#[cfg(target_os = "windows")] +fn windows_connect_script(netclient: &Path, token: &str, output_path: &Path, code_path: &Path) -> String { + let script = r#" +$ErrorActionPreference = 'Continue' +$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +$outPath = '__OUTPUT_PATH__' +$codePath = '__CODE_PATH__' +function Log($m) { [System.IO.File]::AppendAllText($outPath, "$(Get-Date -Format o) $m`r`n", [System.Text.UTF8Encoding]::new($false)) } +function Finish($code) { + [System.IO.File]::WriteAllText($codePath, [string]$code, [System.Text.UTF8Encoding]::new($false)) + exit $code +} +function Get-NetmakerVpnIp { + try { + return (Get-NetIPAddress -InterfaceAlias 'netmaker' -AddressFamily IPv4 -ErrorAction SilentlyContinue | + Where-Object { $_.IPAddress -and $_.IPAddress -notlike '169.254.*' } | + Select-Object -First 1 -ExpandProperty IPAddress) + } catch { + return $null + } +} +function Wait-NetmakerVpnIp($seconds, $label) { + $deadline = (Get-Date).AddSeconds($seconds) + while ((Get-Date) -lt $deadline) { + $ip = Get-NetmakerVpnIp + if ($ip) { + Log "$label ip=$ip" + return $ip + } + Start-Sleep -Seconds 2 + } + return $null +} +function Set-NetmakerInternalOnly { + Log 'apply internal-only network policy for netmaker' + try { + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix '::/0' -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + Set-NetIPInterface -InterfaceAlias 'netmaker' -AddressFamily IPv4 -InterfaceMetric 5000 -ErrorAction SilentlyContinue + Set-NetIPInterface -InterfaceAlias 'netmaker' -AddressFamily IPv6 -InterfaceMetric 5000 -ErrorAction SilentlyContinue + } catch { + Log "route policy failed: $($_.Exception.Message)" + } + try { + $prefix = $null + $nodesPath = Join-Path $dir 'nodes.json' + if (Test-Path $nodesPath) { + $nodes = Get-Content $nodesPath -Raw -Encoding UTF8 | ConvertFrom-Json + $nodeProp = $nodes.PSObject.Properties | Select-Object -First 1 + if ($nodeProp -and $nodeProp.Value.networkrange -and $nodeProp.Value.networkrange.IP) { + $prefix = "$($nodeProp.Value.networkrange.IP)/24" + } + } + if (-not $prefix) { + $prefix = '100.88.0.0/24' + } + Get-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix $prefix -ErrorAction SilentlyContinue | + Remove-NetRoute -Confirm:$false -ErrorAction SilentlyContinue + New-NetRoute -InterfaceAlias 'netmaker' -DestinationPrefix $prefix -NextHop '0.0.0.0' -RouteMetric 1 -ErrorAction SilentlyContinue | Out-Null + Log "internal route ensured: $prefix" + } catch { + Log "internal route ensure failed: $($_.Exception.Message)" + } + try { + Set-DnsClientServerAddress -InterfaceAlias 'netmaker' -ResetServerAddresses -ErrorAction SilentlyContinue + } catch { + Log "dns reset failed: $($_.Exception.Message)" + } +} +function Confirm-NetmakerInternalOnly { + Start-Sleep -Seconds 3 + Set-NetmakerInternalOnly + Start-Sleep -Seconds 2 + Set-NetmakerInternalOnly +} +function Quote-ProcessArgument($value) { + if ($null -eq $value) { + return '""' + } + $text = [string]$value + if ($text.Length -eq 0) { + return '""' + } + if ($text -notmatch '[\s"]') { + return $text + } + return '"' + ($text -replace '"', '\"') + '"' +} +function Invoke-NetclientCommand { + param( + [string[]]$arguments, + [string]$label, + [int]$timeoutSeconds = 15 + ) + if (-not $arguments -or $arguments.Count -eq 0) { + Log "$label skipped: no arguments" + return + } + Log "$label start: netclient $($arguments -join ' ')" + $p = $null + try { + $psi = [System.Diagnostics.ProcessStartInfo]::new() + $psi.FileName = $exe + $psi.WorkingDirectory = $dir + $psi.UseShellExecute = $false + $psi.CreateNoWindow = $true + $psi.RedirectStandardOutput = $true + $psi.RedirectStandardError = $true + $psi.Arguments = ($arguments | ForEach-Object { Quote-ProcessArgument $_ }) -join ' ' + $p = [System.Diagnostics.Process]::new() + $p.StartInfo = $psi + if (-not $p.Start()) { + Log "$label process was not started" + return + } + if ($p.WaitForExit([int]($timeoutSeconds * 1000))) { + $stdout = $p.StandardOutput.ReadToEnd() + $stderr = $p.StandardError.ReadToEnd() + Log "$label exit=$($p.ExitCode)" + if ($stdout) { $stdout -split "`r?`n" | Where-Object { $_ } | ForEach-Object { Log $_ } } + if ($stderr) { $stderr -split "`r?`n" | Where-Object { $_ } | ForEach-Object { Log $_ } } + } else { + Log "$label timeout after $timeoutSeconds seconds; continue with local VPN status" + try { $p.Kill() } catch {} + } + } catch { + Log "$label failed: $($_.Exception.Message)" + } finally { + if ($null -ne $p) { + try { $p.Dispose() } catch {} + } + } +} +function Start-NetclientCommandAsync { + param( + [string[]]$arguments, + [string]$label + ) + if (-not $arguments -or $arguments.Count -eq 0) { + Log "$label skipped: no arguments" + return $null + } + Log "$label start async: netclient $($arguments -join ' ')" + try { + $p = Start-Process -FilePath $exe -ArgumentList $arguments -WorkingDirectory $dir -WindowStyle Hidden -PassThru + if ($null -eq $p) { + Log "$label process was not started" + return $null + } + Log "$label pid=$($p.Id)" + return $p + } catch { + Log "$label failed to start: $($_.Exception.Message)" + return $null + } +} +function Sync-NetclientPeers($timeoutSeconds) { + if (-not $timeoutSeconds) { + $timeoutSeconds = 15 + } + Invoke-NetclientCommand -arguments @('pull') -label 'pull' -timeoutSeconds $timeoutSeconds +} + +$exe = '__NETCLIENT__' +$dir = Split-Path -Parent $exe +$token = '__TOKEN__' +Set-Location -LiteralPath $dir +Log 'connect start' + +$existingConfigChecked = $false +try { + $netPath = Join-Path $dir 'netclient.json' + $serversPath = Join-Path $dir 'servers.json' + $nodesPath = Join-Path $dir 'nodes.json' + if ((Test-Path $netPath) -and (Test-Path $serversPath) -and (Test-Path $nodesPath)) { + $serversRaw = Get-Content $serversPath -Raw -Encoding UTF8 + $nodesRaw = Get-Content $nodesPath -Raw -Encoding UTF8 + if ($serversRaw.Trim().Length -gt 3 -and $nodesRaw.Trim().Length -gt 3) { + $servers = $serversRaw | ConvertFrom-Json + $nodes = $nodesRaw | ConvertFrom-Json + $serverProp = $servers.PSObject.Properties | Select-Object -First 1 + $nodeProp = $nodes.PSObject.Properties | Select-Object -First 1 + if ($serverProp -and $nodeProp) { + $server = $serverProp.Value + $node = $nodeProp.Value + if ($node.hostid) { + $net = Get-Content $netPath -Raw -Encoding UTF8 | ConvertFrom-Json + $existingConfigChecked = $true + $networkName = $nodeProp.Name + if ($net.id -ne $node.hostid) { + Log "local host id mismatch: netclient=$($net.id), node=$($node.hostid); please reset VPN" + Finish 2 + } else { + Log 'existing host id matches node config; start service' + try { Start-Service netclient -ErrorAction SilentlyContinue } catch {} + $ip = Wait-NetmakerVpnIp 8 'existing connection is up' + if ($ip) { + Confirm-NetmakerInternalOnly + Finish 0 + } + if ($networkName) { + Start-NetclientCommandAsync -arguments @('connect', $networkName) -label "connect existing network $networkName" | Out-Null + } + $ip = Wait-NetmakerVpnIp 75 'existing network connected' + if ($ip) { + Confirm-NetmakerInternalOnly + Finish 0 + } + Sync-NetclientPeers 15 + $ip = Wait-NetmakerVpnIp 25 'existing connection is up after pull' + if ($ip) { + Confirm-NetmakerInternalOnly + Finish 0 + } + } + } + } + } + } +} catch { + Log "existing config check failed: $($_.Exception.Message)" +} + +if ($existingConfigChecked) { + Log 'existing config did not get VPN IP; skip automatic service restart to avoid slow double reconnect' + Sync-NetclientPeers 15 + $ip = Wait-NetmakerVpnIp 35 'connected after final pull' + if ($ip) { + Confirm-NetmakerInternalOnly + Finish 0 + } + Log 'ERROR: VPN service recovery failed after restart. Consider using Reset VPN.' + Finish 2 +} + +Log 'no existing config, fall back to netclient join' +$joinOut = & $exe join -t $token 2>&1 +$joinCode = $LASTEXITCODE +Log "join exit=$joinCode" +foreach ($line in $joinOut) { Log $line.ToString() } +if ($joinCode -ne 0) { + Finish $joinCode +} + +$joinedIp = Wait-NetmakerVpnIp 150 'connected after join' +if ($joinedIp) { + Confirm-NetmakerInternalOnly + Finish 0 +} +Log 'join completed but VPN IP not detected yet' +Finish 0 +"#; + + script + .replace("__OUTPUT_PATH__", &ps_single_quoted_path(output_path)) + .replace("__CODE_PATH__", &ps_single_quoted_path(code_path)) + .replace("__NETCLIENT__", &ps_single_quoted_path(netclient)) + .replace("__TOKEN__", &ps_single_quoted_value(token)) +} + +#[cfg(not(target_os = "windows"))] +fn run_netclient_action(netclient: &Path, args: &[String]) -> Result<(), String> { + let output = Command::new(netclient) + .args(args) + .output() + .map_err(|error| format!("netclient 启动失败:{error}"))?; + + if output.status.success() { + Ok(()) + } else { + Err(command_error(&output.stderr, &output.stdout)) + } +} + +#[cfg(target_os = "windows")] +fn run_elevated_windows(program: &Path, args: &[String]) -> Result<(), String> { + let temp_dir = env::temp_dir(); + let prefix = format!("abyssinfo-netclient-{}", unique_suffix()); + let output_path = temp_dir.join(format!("{prefix}.log")); + let code_path = temp_dir.join(format!("{prefix}.code")); + let working_dir = program.parent().unwrap_or_else(|| Path::new("C:\\")); + let child_args = args + .iter() + .map(|arg| format!("'{}'", ps_single_quoted_value(arg))) + .collect::>() + .join(" "); + let child_script = format!( + "$ErrorActionPreference = 'Continue'\n\ + $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n\ + Set-Location -LiteralPath '{}'\n\ + & '{}' {} *> '{}'\n\ + $code = if ($null -ne $LASTEXITCODE) {{ $LASTEXITCODE }} elseif ($?) {{ 0 }} else {{ 1 }}\n\ + Set-Content -LiteralPath '{}' -Value $code -Encoding UTF8\n\ + exit $code\n", + ps_single_quoted_path(working_dir), + ps_single_quoted_path(program), + child_args, + ps_single_quoted_path(&output_path), + ps_single_quoted_path(&code_path) + ); + log::info!("[vpn] 启动提权 PowerShell: program={}, args={:?}", program.display(), args); + + run_elevated_windows_script(&child_script, working_dir, &output_path, &code_path) +} + +#[cfg(target_os = "windows")] +fn run_elevated_windows_script( + child_script: &str, + working_dir: &Path, + output_path: &Path, + code_path: &Path, +) -> Result<(), String> { + let script_path = env::temp_dir().join(format!("abyssinfo-netclient-{}.ps1", unique_suffix())); + log::info!("[vpn] 子脚本路径: {}", script_path.display()); + fs::write(&script_path, child_script).map_err(|error| format!("创建提权脚本失败:{error}"))?; + + let script = format!( + "$codePath = '{}'; $outPath = '{}'; Remove-Item -LiteralPath $codePath -Force -ErrorAction SilentlyContinue; $p = Start-Process -FilePath 'powershell' -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-NonInteractive','-WindowStyle','Hidden','-File','{}') -WorkingDirectory '{}' -WindowStyle Hidden -Verb RunAs -PassThru; if ($null -eq $p) {{ exit 1223 }}; $deadline = (Get-Date).AddSeconds(300); while ((Get-Date) -lt $deadline) {{ if (Test-Path -LiteralPath $codePath) {{ $raw = Get-Content -LiteralPath $codePath -Raw -Encoding UTF8; $raw = $raw -replace '^\\uFEFF',''; $exitCode = 1; if ([int]::TryParse($raw.Trim(), [ref]$exitCode)) {{ exit $exitCode }}; exit 1 }}; Start-Sleep -Milliseconds 500 }}; Add-Content -LiteralPath $outPath -Value \"$(Get-Date -Format o) parent timeout waiting for elevated netclient script\" -Encoding UTF8; try {{ Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue }} catch {{}}; exit 124", + ps_single_quoted_path(code_path), + ps_single_quoted_path(output_path), + ps_single_quoted_path(&script_path), + ps_single_quoted_path(working_dir) + ); + log::debug!("[vpn] 父命令: {}", script); + + let output = Command::new("powershell") + .args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &script]) + .output() + .map_err(|error| format!("管理员权限执行 netclient 失败:{error}"))?; + + let parent_stdout = String::from_utf8_lossy(&output.stdout).trim().to_string(); + let parent_stderr = String::from_utf8_lossy(&output.stderr).trim().to_string(); + log::info!("[vpn] 父进程退出码: {:?}", output.status.code()); + log::info!("[vpn] 父进程 stdout: {}", parent_stdout); + log::info!("[vpn] 父进程 stderr: {}", parent_stderr); + + if output.status.success() { + log::info!("[vpn] 提权执行成功,清理临时文件"); + cleanup_temp_files(&[&script_path, &output_path, &code_path]); + Ok(()) + } else { + let child_output = fs::read_to_string(&output_path).unwrap_or_default(); + let child_code = clean_powershell_text(&fs::read_to_string(&code_path).unwrap_or_default()); + let parent_message = command_error(&output.stderr, &output.stdout); + log::error!("[vpn] 提权执行失败"); + log::error!("[vpn] 子进程输出: {}", child_output); + log::error!("[vpn] 子进程退出码: {}", child_code); + log::error!("[vpn] 父进程错误: {}", parent_message); + log::error!("[vpn] 临时日志: {}", output_path.display()); + let _ = fs::remove_file(&script_path); + + let err_msg = if !child_output.trim().is_empty() { + child_output.trim().to_string() + } else if child_code == "2" { + "VPN 服务恢复失败,本地配置可能已损坏,请使用「重置 VPN」功能重新加入网络".to_string() + } else if !child_code.is_empty() { + format!("管理员权限执行 netclient 失败,退出码:{child_code}。临时日志:{}", output_path.display()) + } else if output.status.code() == Some(124) { + format!("管理员权限执行 netclient 超时,请检查 UAC 授权窗口或 netclient 是否卡住。临时日志:{}", output_path.display()) + } else if parent_message == "netclient 命令执行失败" { + format!("管理员权限执行 netclient 失败,可能是取消了 UAC 授权。临时日志:{}", output_path.display()) + } else { + format!("{parent_message}。临时日志:{}", output_path.display()) + }; + Err(err_msg) + } +} + +#[cfg(target_os = "windows")] +fn run_netclient_installer(installer: &Path) -> Result { + run_elevated_windows(installer, &[])?; + Ok("netclient 安装流程已完成,请刷新状态后连接 VPN".to_string()) +} + +#[cfg(target_os = "macos")] +fn run_netclient_installer(installer: &Path) -> Result { + let install_command = format!("installer -pkg {} -target /", shell_single_quoted_path(installer)); + let apple_script = format!( + "do shell script {} with administrator privileges", + apple_script_string(&install_command) + ); + let output = Command::new("osascript") + .args(["-e", &apple_script]) + .output() + .map_err(|error| format!("安装器启动失败:{error}"))?; + + if output.status.success() { + Ok("netclient 安装流程已完成,请刷新状态后连接 VPN".to_string()) + } else { + Err(command_error(&output.stderr, &output.stdout)) + } +} + +#[cfg(not(any(target_os = "windows", target_os = "macos")))] +fn run_netclient_installer(_installer: &Path) -> Result { + Err("当前系统暂不支持内置安装 netclient".to_string()) +} + +#[cfg(target_os = "windows")] +fn unique_suffix() -> u128 { + SystemTime::now() + .duration_since(UNIX_EPOCH) + .map(|duration| duration.as_millis()) + .unwrap_or_default() +} + +#[cfg(target_os = "windows")] +fn cleanup_temp_files(paths: &[&Path]) { + for path in paths { + let _ = fs::remove_file(path); + } +} + +#[cfg(target_os = "windows")] +fn clean_powershell_text(value: &str) -> String { + value + .trim_matches(|ch: char| ch.is_whitespace() || ch == '\u{feff}') + .to_string() +} + +#[cfg(target_os = "windows")] +fn ps_single_quoted_path(path: &Path) -> String { + path.to_string_lossy().replace('\'', "''") +} + +#[cfg(target_os = "windows")] +fn ps_single_quoted_value(value: &str) -> String { + value.replace('\'', "''") +} + +#[cfg(target_os = "macos")] +fn shell_single_quoted_path(path: &Path) -> String { + format!("'{}'", path.to_string_lossy().replace('\'', "'\\''")) +} + +#[cfg(target_os = "macos")] +fn apple_script_string(value: &str) -> String { + format!("\"{}\"", value.replace('\\', "\\\\").replace('"', "\\\"")) +} + +fn command_error(stderr: &[u8], stdout: &[u8]) -> String { + let stderr_text = String::from_utf8_lossy(stderr).trim().to_string(); + if !stderr_text.is_empty() { + return stderr_text; + } + + let stdout_text = String::from_utf8_lossy(stdout).trim().to_string(); + if !stdout_text.is_empty() { + return stdout_text; + } + + "netclient 命令执行失败".to_string() +} + +fn looks_connected(output: &str) -> bool { + let text = output.to_lowercase(); + text.contains("connected") || text.contains("running") || text.contains("interface") +} diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs new file mode 100644 index 0000000..716242f --- /dev/null +++ b/apps/desktop/src-tauri/src/lib.rs @@ -0,0 +1,32 @@ +mod commands; +mod tray; + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_opener::init()) + .plugin(tauri_plugin_deep_link::init()) + .invoke_handler(tauri::generate_handler![ + commands::vpn::connect_vpn, + commands::vpn::disconnect_vpn, + commands::vpn::reset_vpn, + commands::vpn::install_netclient, + commands::vpn::vpn_status + ]) + .setup(|app| { + tray::setup_tray(app)?; + if cfg!(debug_assertions) { + app.handle().plugin( + tauri_plugin_log::Builder::default() + .level(log::LevelFilter::Info) + .build(), + )?; + } + Ok(()) + }) + .on_window_event(|window, event| { + tray::handle_window_event(window, event); + }) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs new file mode 100644 index 0000000..ad5fe83 --- /dev/null +++ b/apps/desktop/src-tauri/src/main.rs @@ -0,0 +1,6 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + app_lib::run(); +} diff --git a/apps/desktop/src-tauri/src/tray.rs b/apps/desktop/src-tauri/src/tray.rs new file mode 100644 index 0000000..633a9cd --- /dev/null +++ b/apps/desktop/src-tauri/src/tray.rs @@ -0,0 +1,69 @@ +use tauri::{ + menu::{Menu, MenuItem}, + tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}, + App, AppHandle, Manager, Runtime, WindowEvent, +}; + +const MENU_SHOW: &str = "show"; +const MENU_HIDE: &str = "hide"; +const MENU_QUIT: &str = "quit"; + +pub fn setup_tray(app: &mut App) -> tauri::Result<()> { + let show = MenuItem::with_id(app, MENU_SHOW, "显示窗口", true, None::<&str>)?; + let hide = MenuItem::with_id(app, MENU_HIDE, "隐藏到托盘/菜单栏", true, None::<&str>)?; + let quit = MenuItem::with_id(app, MENU_QUIT, "退出", true, None::<&str>)?; + let menu = Menu::with_items(app, &[&show, &hide, &quit])?; + + let mut builder = TrayIconBuilder::new() + .tooltip("AbyssInfo VPN") + .menu(&menu) + .show_menu_on_left_click(false) + .on_menu_event(|app, event| match event.id.as_ref() { + MENU_SHOW => show_main_window(app), + MENU_HIDE => hide_main_window(app), + MENU_QUIT => app.exit(0), + _ => {} + }) + .on_tray_icon_event(|tray, event| match event { + TrayIconEvent::Click { + button: MouseButton::Left, + button_state: MouseButtonState::Up, + .. + } + | TrayIconEvent::DoubleClick { + button: MouseButton::Left, + .. + } => show_main_window(tray.app_handle()), + _ => {} + }); + + if let Some(icon) = app.default_window_icon() { + builder = builder.icon(icon.clone()); + } + + builder.build(app)?; + Ok(()) +} + +pub fn handle_window_event(window: &tauri::Window, event: &WindowEvent) { + if let WindowEvent::CloseRequested { api, .. } = event { + api.prevent_close(); + let _ = window.hide(); + let _ = window.set_skip_taskbar(true); + } +} + +fn show_main_window(app: &AppHandle) { + if let Some(window) = app.get_webview_window("main") { + let _ = window.set_skip_taskbar(false); + let _ = window.show(); + let _ = window.set_focus(); + } +} + +fn hide_main_window(app: &AppHandle) { + if let Some(window) = app.get_webview_window("main") { + let _ = window.hide(); + let _ = window.set_skip_taskbar(true); + } +} diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json new file mode 100644 index 0000000..1ba4a37 --- /dev/null +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -0,0 +1,54 @@ +{ + "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", + "productName": "AbyssInfo VPN", + "version": "0.1.0", + "identifier": "com.abyssinfo.homevpn", + "build": { + "frontendDist": "../dist", + "devUrl": "http://localhost:5173", + "beforeDevCommand": "npm run dev", + "beforeBuildCommand": "npm run build" + }, + "app": { + "windows": [ + { + "title": "AbyssInfo VPN", + "width": 390, + "height": 760, + "minWidth": 360, + "minHeight": 640, + "maxWidth": 430, + "resizable": true, + "decorations": false, + "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36", + "fullscreen": false + } + ], + "security": { + "csp": null + } + }, + "plugins": { + "deep-link": { + "desktop": { + "schemes": [ + "myvpn" + ] + } + } + }, + "bundle": { + "active": true, + "targets": "all", + "resources": [ + "resources/**/*" + ], + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue new file mode 100644 index 0000000..44510a2 --- /dev/null +++ b/apps/desktop/src/App.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/desktop/src/api/auth.js b/apps/desktop/src/api/auth.js new file mode 100644 index 0000000..a4525a8 --- /dev/null +++ b/apps/desktop/src/api/auth.js @@ -0,0 +1,34 @@ +import { request } from './http' + +export function getFeishuLoginUrl() { + return request('/auth/feishu/login-url') +} + +export function getFeishuQrConfig() { + return request('/auth/feishu/qr-config') +} + +export function createDesktopLoginSession() { + return request('/auth/desktop-session', { + method: 'POST', + body: JSON.stringify({}), + }) +} + +export function getDesktopLoginSession(sessionId) { + return request(`/auth/desktop-session/${encodeURIComponent(sessionId)}`) +} + +export function completeDesktopLoginSession(sessionId, tmpCode) { + return request(`/auth/desktop-session/${encodeURIComponent(sessionId)}/complete`, { + method: 'POST', + body: JSON.stringify({ tmp_code: tmpCode }), + }) +} + +export function exchangeLoginCode(code, state) { + return request('/auth/exchange', { + method: 'POST', + body: JSON.stringify({ code, state }), + }) +} diff --git a/apps/desktop/src/api/http.js b/apps/desktop/src/api/http.js new file mode 100644 index 0000000..27337fd --- /dev/null +++ b/apps/desktop/src/api/http.js @@ -0,0 +1,29 @@ +export const apiBaseUrl = import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:8000' + +export async function request(path, options = {}) { + const controller = new AbortController() + const timeout = window.setTimeout(() => controller.abort(), options.timeoutMs || 30000) + + try { + const response = await fetch(`${apiBaseUrl}${path}`, { + ...options, + signal: options.signal || controller.signal, + headers: { + 'Content-Type': 'application/json', + ...(options.headers || {}), + }, + }) + const data = await response.json() + if (!response.ok) { + throw new Error(data.error || `请求失败:${response.status}`) + } + return data + } catch (error) { + if (error.name === 'AbortError') { + throw new Error('请求超时,请检查后端服务或网络连接') + } + throw error + } finally { + window.clearTimeout(timeout) + } +} diff --git a/apps/desktop/src/api/vpn.js b/apps/desktop/src/api/vpn.js new file mode 100644 index 0000000..6d2a0e2 --- /dev/null +++ b/apps/desktop/src/api/vpn.js @@ -0,0 +1,49 @@ +import { request } from './http' + +export function getConnectToken(jwt, device) { + return request('/vpn/connect-token', { + method: 'POST', + headers: { + Authorization: `Bearer ${jwt}`, + }, + body: JSON.stringify(device), + }) +} + +export function getVpnStatus(jwt) { + return request('/vpn/status', { + headers: { + Authorization: `Bearer ${jwt}`, + }, + }) +} + +export function revokeDevice(jwt, deviceId) { + return request('/vpn/revoke-device', { + method: 'POST', + headers: { + Authorization: `Bearer ${jwt}`, + }, + body: JSON.stringify({ device_id: deviceId }), + }) +} + +export function registerNode(jwt, device) { + return request('/vpn/register-node', { + method: 'POST', + headers: { + Authorization: `Bearer ${jwt}`, + }, + body: JSON.stringify(device), + }) +} + +export function recordDisconnect(jwt, device) { + return request('/vpn/disconnect-log', { + method: 'POST', + headers: { + Authorization: `Bearer ${jwt}`, + }, + body: JSON.stringify(device), + }) +} diff --git a/apps/desktop/src/assets/hero.png b/apps/desktop/src/assets/hero.png new file mode 100644 index 0000000..02251f4 Binary files /dev/null and b/apps/desktop/src/assets/hero.png differ diff --git a/apps/desktop/src/assets/vite.svg b/apps/desktop/src/assets/vite.svg new file mode 100644 index 0000000..5101b67 --- /dev/null +++ b/apps/desktop/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/apps/desktop/src/assets/vue.svg b/apps/desktop/src/assets/vue.svg new file mode 100644 index 0000000..770e9d3 --- /dev/null +++ b/apps/desktop/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/desktop/src/components/Drawer.vue b/apps/desktop/src/components/Drawer.vue new file mode 100644 index 0000000..d977518 --- /dev/null +++ b/apps/desktop/src/components/Drawer.vue @@ -0,0 +1,81 @@ + + + diff --git a/apps/desktop/src/components/HelloWorld.vue b/apps/desktop/src/components/HelloWorld.vue new file mode 100644 index 0000000..f91553d --- /dev/null +++ b/apps/desktop/src/components/HelloWorld.vue @@ -0,0 +1,95 @@ + + + diff --git a/apps/desktop/src/components/Modal.vue b/apps/desktop/src/components/Modal.vue new file mode 100644 index 0000000..e8277a6 --- /dev/null +++ b/apps/desktop/src/components/Modal.vue @@ -0,0 +1,90 @@ + + + diff --git a/apps/desktop/src/main.js b/apps/desktop/src/main.js new file mode 100644 index 0000000..2425c0f --- /dev/null +++ b/apps/desktop/src/main.js @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import './style.css' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/apps/desktop/src/services/deepLink.js b/apps/desktop/src/services/deepLink.js new file mode 100644 index 0000000..44c6382 --- /dev/null +++ b/apps/desktop/src/services/deepLink.js @@ -0,0 +1,49 @@ +import { getCurrent, isRegistered, onOpenUrl, register } from '@tauri-apps/plugin-deep-link' + +const SCHEME = 'myvpn' + +export function parseLoginDeepLink(url) { + try { + const parsed = new URL(url) + if (parsed.protocol !== `${SCHEME}:`) { + return null + } + if (parsed.hostname !== 'login-success') { + return null + } + return { + code: parsed.searchParams.get('code') || '', + state: parsed.searchParams.get('state') || '', + } + } catch (_error) { + return null + } +} + +export async function ensureDeepLinkRegistered() { + try { + if (!(await isRegistered(SCHEME))) { + await register(SCHEME) + } + } catch (_error) { + // macOS/Linux 打包注册和浏览器预览场景可能不支持运行时注册。 + } +} + +export async function readInitialDeepLinks() { + try { + return (await getCurrent()) || [] + } catch (_error) { + return [] + } +} + +export async function listenDeepLinks(handler) { + try { + return await onOpenUrl((urls) => { + urls.forEach(handler) + }) + } catch (_error) { + return () => {} + } +} diff --git a/apps/desktop/src/services/device.js b/apps/desktop/src/services/device.js new file mode 100644 index 0000000..6452104 --- /dev/null +++ b/apps/desktop/src/services/device.js @@ -0,0 +1,7 @@ +export function getDeviceInfo() { + return { + device_name: window.navigator.userAgent.includes('Windows') ? 'windows-desktop' : 'desktop', + device_fingerprint: window.navigator.userAgent, + } +} + diff --git a/apps/desktop/src/stores/session.js b/apps/desktop/src/stores/session.js new file mode 100644 index 0000000..beb0275 --- /dev/null +++ b/apps/desktop/src/stores/session.js @@ -0,0 +1,33 @@ +const TOKEN_KEY = 'home_vpn_jwt' +const USER_KEY = 'abyssinfo_vpn_user' + +export function loadToken() { + return localStorage.getItem(TOKEN_KEY) || '' +} + +export function saveToken(token) { + localStorage.setItem(TOKEN_KEY, token) +} + +export function clearToken() { + localStorage.removeItem(TOKEN_KEY) +} + +export function loadUser() { + try { + return JSON.parse(localStorage.getItem(USER_KEY) || '{}') + } catch (_error) { + return {} + } +} + +export function saveUser(user) { + if (!user || typeof user !== 'object') { + return + } + localStorage.setItem(USER_KEY, JSON.stringify(user)) +} + +export function clearUser() { + localStorage.removeItem(USER_KEY) +} diff --git a/apps/desktop/src/style.css b/apps/desktop/src/style.css new file mode 100644 index 0000000..64631d4 --- /dev/null +++ b/apps/desktop/src/style.css @@ -0,0 +1,1085 @@ +:root { + --bg: #f5f6f7; + --surface: #ffffff; + --surface-soft: #f1f3fc; + --border: #dee0e3; + --text: #1f2329; + --muted: #646a73; + --primary: #3370ff; + --primary-strong: #0050d6; + --primary-soft: #e8efff; + --success: #00b42a; + --success-soft: #e8ffea; + --warning: #c64f00; + --warning-soft: #fff3e8; + --danger: #f53f3f; + --danger-soft: #ffece8; + --shadow: 0 18px 42px rgba(31, 35, 41, 0.08); + font-family: Inter, "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; + color: var(--text); + background: var(--bg); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + min-width: 0; + width: 100%; + height: 100%; + overflow: hidden; + background: var(--bg); +} + +button { + min-height: 42px; + border: 1px solid var(--border); + border-radius: 8px; + padding: 0 16px; + background: var(--surface); + color: var(--text); + font: inherit; + font-size: 14px; + font-weight: 600; + cursor: pointer; + transition: + border-color 160ms ease, + background 160ms ease, + box-shadow 160ms ease, + transform 160ms ease; +} + +button:hover:not(:disabled) { + border-color: var(--primary); + box-shadow: 0 6px 18px rgba(51, 112, 255, 0.14); +} + +button:active:not(:disabled) { + transform: translateY(1px); +} + +button.primary { + border-color: var(--primary); + background: var(--primary); + color: #ffffff; +} + +button:disabled { + cursor: not-allowed; + opacity: 0.52; +} + +h1, +h2, +p { + margin: 0; +} + +h1 { + font-size: 26px; + font-weight: 700; + line-height: 34px; +} + +h2 { + font-size: 17px; + font-weight: 700; +} + +#app, +.workspace { + width: 100%; + height: 100vh; + min-height: 0; + background: + radial-gradient(circle at 50% -8%, rgba(51, 112, 255, 0.16), transparent 34%), + linear-gradient(180deg, #fbfcff 0%, #f5f6f7 58%, #edf2ff 100%); +} + +.workspace { + display: flex; + flex-direction: column; + min-height: 0; +} + +.login-shell { + flex: 1 1 auto; + min-height: 0; + display: flex; + align-items: stretch; + justify-content: center; + padding: 0; + overflow-y: auto; + overflow-x: hidden; +} + +.login-card { + width: 100%; + min-height: 100%; + display: flex; + flex-direction: column; + justify-content: flex-start; + padding: 18px 24px 22px; + border: 0; + border-radius: 0; + background: transparent; + box-shadow: none; + text-align: center; +} + +.login-logo { + width: 78px; + height: 78px; + display: block; + margin: 0 auto 14px; + border-radius: 18px; + box-shadow: 0 10px 26px rgba(31, 35, 41, 0.1); +} + +.login-copy span { + display: block; + color: var(--primary-strong); + font-size: 13px; + font-weight: 700; +} + +.login-copy h1 { + margin-top: 6px; + font-size: 24px; + line-height: 31px; +} + +.login-copy p { + margin-top: 8px; + color: var(--muted); + font-size: 14px; + line-height: 22px; +} + +.qr-login-panel { + margin-top: 18px; +} + +.qr-login-box { + width: 278px; + height: 278px; + display: grid; + place-items: center; + margin: 0 auto; + border: 1px solid rgba(222, 224, 227, 0.95); + border-radius: 18px; + background: #ffffff; + box-shadow: 0 14px 32px rgba(31, 35, 41, 0.08); + overflow: hidden; +} + +.qr-login-box iframe { + display: block; + width: 260px; + height: 260px; + border: 0; + overflow: hidden; +} + +.qr-login-box span { + padding: 0 20px; + color: var(--primary-strong); + font-size: 13px; + font-weight: 700; + line-height: 21px; +} + +.qr-login-box small { + display: block; + max-width: 210px; + color: var(--muted); + font-size: 12px; + line-height: 20px; +} + +.external-qr { + gap: 8px; + background: + linear-gradient(180deg, rgba(232, 239, 255, 0.78), #ffffff 62%), + #ffffff; +} + +.qr-login-box.loading { + background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%); +} + +.qr-refresh { + width: 100%; + margin-top: 12px; +} + +.login-button { + width: 100%; + margin-top: 12px; +} + +.login-status { + min-height: 22px; + margin-top: 12px; + color: var(--muted); + font-size: 13px; + line-height: 22px; +} + +.login-meta { + margin-top: 12px; + padding: 12px; + border: 1px solid #ccdbff; + border-radius: 12px; + background: var(--primary-soft); + text-align: left; +} + +.login-meta span, +.info-card span { + display: block; + color: var(--muted); + font-size: 12px; + font-weight: 700; +} + +.login-meta strong, +.info-card strong { + display: block; + margin-top: 6px; + color: var(--text); + font-size: 14px; + line-height: 22px; + overflow-wrap: anywhere; +} + +.topbar { + position: sticky; + top: 0; + z-index: 10; + display: flex; + align-items: center; + justify-content: space-between; + min-height: 62px; + padding: 10px 16px; + border-bottom: 1px solid rgba(222, 224, 227, 0.85); + background: rgba(255, 255, 255, 0.94); + backdrop-filter: blur(14px); +} + +.brand { + display: flex; + align-items: center; + min-width: 0; + gap: 12px; +} + +.brand-icon { + width: 40px; + height: 40px; + flex: 0 0 auto; + border-radius: 10px; +} + +.brand strong, +.brand span { + display: block; +} + +.brand strong { + font-size: 16px; +} + +.brand span { + color: var(--muted); + font-size: 12px; +} + +.topbar-actions { + display: flex; + align-items: center; + gap: 8px; +} + +.ghost-button { + background: var(--surface-soft); +} + +.icon-button { + width: 42px; + padding: 0; + font-size: 18px; +} + +.app-shell { + width: 100%; + flex: 1 1 auto; + display: flex; + flex-direction: column; + min-height: 0; + overflow-y: auto; + overflow-x: hidden; +} + +.connection-card, +.info-card, +.warning-card, +.management-card { + border: 1px solid rgba(222, 224, 227, 0.9); + border-radius: 18px; + background: rgba(255, 255, 255, 0.96); + box-shadow: 0 8px 24px rgba(31, 35, 41, 0.06); +} + +.connection-card { + position: relative; + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 24px 18px; + overflow: hidden; + border: 0; + border-radius: 0; + box-shadow: none; + background: rgba(255, 255, 255, 0.96); +} + +.connection-main { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + gap: 8px; +} + +.status-title-row { + position: relative; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + gap: 10px; +} + +.status-title-row h1 { + font-size: 26px; + font-weight: 700; + line-height: 34px; +} + +.refresh-status-btn { + width: 32px; + min-height: 32px; + padding: 0; + border: 0; + border-radius: 8px; + background: transparent; + color: var(--muted); + font-size: 18px; + font-weight: 400; + line-height: 1; + cursor: pointer; + transition: background 160ms ease, color 160ms ease; +} + +.refresh-status-btn:hover:not(:disabled) { + background: var(--surface-soft); + color: var(--primary); +} + +.refresh-status-btn:disabled { + cursor: not-allowed; + opacity: 0.4; +} + +.refresh-status-btn.spinning { + animation: spin 0.8s linear infinite; + color: var(--primary); +} + +.connection-footer { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + width: 100%; +} + +.network-header { + position: relative; + z-index: 1; + display: flex; + align-items: center; + gap: 12px; + width: 100%; + margin-bottom: 5px; + padding: 0 4px; +} + +.network-header img { + width: 40px; + height: 40px; + border-radius: 10px; + flex-shrink: 0; +} + +.network-info { + flex: 1 1 auto; + min-width: 0; + display: flex; + flex-direction: column; + gap: 2px; +} + +.network-info h2 { + font-size: 17px; + font-weight: 700; + line-height: 24px; +} + +.network-info span { + color: var(--muted); + font-size: 12px; + line-height: 18px; +} + +.network-menu { + flex-shrink: 0; +} + +.network-menu > button { + width: 36px; + min-height: 36px; + padding: 0; + border: 0; + border-radius: 8px; + background: transparent; + color: var(--muted); + font-size: 20px; + line-height: 1; +} + +.network-menu > button:hover:not(:disabled) { + background: #f1f3fc; + border-color: transparent; + box-shadow: none; +} + +.user-greeting { + position: relative; + z-index: 1; + width: 100%; + display: flex; + align-items: center; + gap: 12px; + margin: 4px 0 10px; + padding: 12px 14px; + border: 1px solid rgba(222, 224, 227, 0.78); + border-radius: 16px; + background: rgba(255, 255, 255, 0.72); + box-shadow: 0 10px 26px rgba(31, 35, 41, 0.05); +} + +.user-avatar { + width: 42px; + height: 42px; + border-radius: 999px; + display: grid; + place-items: center; + flex-shrink: 0; + background: linear-gradient(135deg, #3370ff 0%, #0050d6 100%); + color: #ffffff; + font-size: 17px; + font-weight: 700; +} + +.user-copy { + min-width: 0; + display: flex; + flex-direction: column; + gap: 2px; +} + +.user-copy span { + color: var(--muted); + font-size: 12px; + line-height: 18px; +} + +.user-copy strong { + max-width: 220px; + color: var(--text); + font-size: 18px; + font-weight: 700; + line-height: 24px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.menu-dropdown { + z-index: 999; + display: flex; + flex-direction: column; + align-items: stretch; + width: auto; + min-width: max-content; + padding: 6px; + border: 1px solid rgba(222, 224, 227, 0.95); + border-radius: 12px; + background: rgba(255, 255, 255, 0.98); + box-shadow: 0 12px 32px rgba(31, 35, 41, 0.12); +} + +.menu-dropdown button { + width: 100%; + min-height: 38px; + padding: 0 12px; + border: 0; + border-radius: 8px; + background: transparent; + color: var(--text); + font-size: 13px; + font-weight: 600; + text-align: left; +} + +.menu-dropdown button:hover:not(:disabled) { + background: var(--primary-soft); + color: var(--primary-strong); + border-color: transparent; + box-shadow: none; +} + +.menu-dropdown button.menu-danger { + color: var(--danger); +} + +.menu-dropdown button.menu-danger:hover:not(:disabled) { + background: var(--danger-soft); + color: #b42318; +} + +.connection-card::before { + content: ""; + position: absolute; + inset: 48px 12px auto; + height: 220px; + background: radial-gradient(circle, rgba(51, 112, 255, 0.14), transparent 62%); + pointer-events: none; +} + +.connection-card.connected::before { + background: radial-gradient(circle, rgba(0, 180, 42, 0.14), transparent 62%); +} + +.connect-orb { + position: relative; + z-index: 1; + width: 172px; + height: 172px; + margin: 0 0 20px; + padding: 0; + border: 0; + border-radius: 999px; + background: transparent; + display: grid; + place-items: center; + box-shadow: none; +} + +.connect-orb:hover:not(:disabled) { + box-shadow: none; +} + +.orb-ring { + position: absolute; + inset: 0; + border-radius: 999px; + background: conic-gradient(var(--primary) 0 78deg, #ecf0f8 78deg 360deg); + box-shadow: + 0 0 22px rgba(51, 112, 255, 0.2), + 0 18px 48px rgba(31, 35, 41, 0.12), + inset 0 0 14px rgba(255, 255, 255, 0.74); +} + +.connect-orb.connected .orb-ring { + background: conic-gradient(var(--success) 0 360deg); + box-shadow: + 0 0 18px rgba(0, 180, 42, 0.32), + 0 0 46px rgba(0, 180, 42, 0.18), + 0 18px 48px rgba(0, 180, 42, 0.12), + inset 0 0 14px rgba(255, 255, 255, 0.7); +} + +.connect-orb.loading .orb-ring { + animation: spin 1.1s linear infinite; + box-shadow: + 0 0 18px rgba(51, 112, 255, 0.34), + 0 0 44px rgba(51, 112, 255, 0.2), + 0 18px 48px rgba(31, 35, 41, 0.12), + inset 0 0 14px rgba(255, 255, 255, 0.74); +} + +.orb-core { + position: relative; + width: 138px; + height: 138px; + border: 10px solid #ffffff; + border-radius: 999px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 6px; + background: #ffffff; + color: var(--primary-strong); + box-shadow: inset 0 0 0 1px rgba(222, 224, 227, 0.8); +} + +.connect-orb.connected .orb-core { + color: #007317; +} + +.orb-core strong, +.orb-core small { + display: block; +} + +.orb-core strong { + max-width: 104px; + font-size: 16px; + font-weight: 200; + line-height: 22px; + text-align: center; + white-space: nowrap; +} + +.orb-core small { + color: var(--muted); + font-size: 13px; + font-weight: 700; +} + +.fade-enter-active, +.fade-leave-active { + transition: opacity 200ms ease, transform 200ms ease; +} + +.fade-enter-from, +.fade-leave-to { + opacity: 0; + transform: translateY(6px); +} + +.connection-card > h1, +.connection-card > p { + position: relative; + z-index: 1; + text-align: center; +} + +.connection-card > p { + margin-top: 8px; + color: var(--muted); + font-size: 14px; + line-height: 22px; +} + +.vpn-ip-row { + display: inline-flex; + align-items: center; + gap: 8px; + min-height: 28px; + margin-top: -2px; + padding: 4px 10px; + border: 1px solid rgba(0, 180, 42, 0.16); + border-radius: 999px; + background: rgba(0, 180, 42, 0.08); + color: var(--muted); + font-size: 12px; + line-height: 18px; +} + +.vpn-ip-row strong { + color: #007317; + font-size: 13px; + font-weight: 600; +} + +.device-bar { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; +} + +.device-bar span { + color: var(--text); + font-weight: 600; +} + +.device-bar button { + min-height: 30px; + padding: 0 12px; + border-color: var(--primary); + background: var(--primary-soft); + color: var(--primary-strong); + font-size: 12px; +} + +.version-bar { + margin: 0; + color: var(--muted); + font-size: 11px; + line-height: 16px; + text-align: center; +} + +.logout-button { + width: 100%; + margin-top: 14px; + border-color: var(--danger); + background: var(--danger); + color: #ffffff; +} + +.logout-button:hover:not(:disabled) { + border-color: #d92b2b; + background: #d92b2b; + box-shadow: 0 6px 18px rgba(245, 63, 63, 0.2); +} + +.status-stack, +.device-list, +.audit-list { + display: grid; + gap: 12px; +} + +.status-stack, +.warning-card, +.management-card { + margin-top: 14px; +} + +.info-card, +.warning-card, +.management-card { + padding: 16px; +} + +.warning-card { + border-color: #ffb8b0; + background: var(--danger-soft); +} + +.warning-card strong { + display: block; + margin-bottom: 6px; +} + +.warning-card p { + color: var(--muted); + font-size: 14px; + line-height: 22px; +} + +.warning-card button { + width: 100%; + margin-top: 12px; +} + + +.section-heading { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + margin-bottom: 14px; +} + +.section-heading button, +.device-actions button { + min-width: 76px; + min-height: 34px; +} + +.device-row, +.audit-row, +.empty-state { + display: flex; + gap: 12px; + min-height: 72px; + padding: 14px; + border: 1px solid #edf0f5; + border-radius: 12px; + background: #ffffff; +} + +.device-row { + align-items: stretch; + flex-direction: column; +} + +.device-row span, +.audit-row span, +.audit-row time, +.empty-state { + color: var(--muted); + font-size: 13px; +} + +.device-row strong, +.device-row span, +.audit-row strong, +.audit-row span, +.audit-row time { + display: block; +} + +.audit-row { + align-items: flex-start; + flex-direction: column; +} + +.device-actions { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} + +.badge { + min-width: 68px; + padding: 5px 10px; + border-radius: 999px; + background: var(--success-soft); + color: #007317; + text-align: center; + font-size: 12px; + font-weight: 700; +} + +.badge.revoked { + background: var(--danger-soft); + color: #b42318; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +.log-window-body { + flex: 1 1 auto; + display: flex; + flex-direction: column; + min-height: 0; + padding: 14px 14px 20px; + overflow-y: auto; + overflow-x: hidden; +} + +.log-window-body .audit-list { + display: flex; + flex-direction: column; + gap: 10px; + width: 100%; +} + +.log-window-body .audit-row { + width: 100%; + box-sizing: border-box; +} + +.drawer-overlay { + position: fixed; + inset: 0; + z-index: 100; + display: flex; + justify-content: flex-end; + background: rgba(31, 35, 41, 0.32); + backdrop-filter: blur(4px); +} + +.drawer-panel { + width: 100%; + max-width: 360px; + height: 100%; + display: flex; + flex-direction: column; + border-left: 1px solid rgba(222, 224, 227, 0.9); + border-radius: 18px 0 0 18px; + background: rgba(255, 255, 255, 0.98); + box-shadow: -8px 0 32px rgba(31, 35, 41, 0.1); +} + +.drawer-enter-active, +.drawer-leave-active { + transition: opacity 200ms ease; +} + +.drawer-enter-active .drawer-panel, +.drawer-leave-active .drawer-panel { + transition: transform 260ms ease; +} + +.drawer-enter-from, +.drawer-leave-to { + opacity: 0; +} + +.drawer-enter-from .drawer-panel, +.drawer-leave-to .drawer-panel { + transform: translateX(40px); +} + +.drawer-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + flex-shrink: 0; + padding: 12px 16px; + border-bottom: 1px solid rgba(222, 224, 227, 0.8); +} + +.drawer-header h2 { + font-size: 16px; + font-weight: 700; +} + +.drawer-actions { + display: flex; + align-items: center; + gap: 4px; +} + +.drawer-actions button { + width: 34px; + min-height: 34px; + padding: 0; + border: 0; + border-radius: 8px; + background: transparent; + color: var(--muted); + font-size: 18px; + font-weight: 400; + line-height: 1; +} + +.drawer-actions button:last-child { + font-size: 22px; +} + +.drawer-actions button:hover:not(:disabled) { + background: #f1f3fc; + border-color: transparent; + box-shadow: none; +} + +.drawer-body { + flex: 1 1 auto; + min-height: 0; + overflow-y: auto; + padding: 12px 16px 20px; +} + +.modal-overlay { + position: fixed; + inset: 0; + z-index: 200; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + background: rgba(31, 35, 41, 0.52); + backdrop-filter: blur(8px); +} + +.modal-box { + width: 100%; + max-width: 340px; + border: 1px solid rgba(222, 224, 227, 0.95); + border-radius: 18px; + background: rgba(255, 255, 255, 0.98); + box-shadow: 0 24px 64px rgba(31, 35, 41, 0.2); +} + +.modal-body { + display: flex; + flex-direction: column; + align-items: center; + gap: 14px; + padding: 28px 24px; + text-align: center; +} + +.modal-body strong { + font-size: 18px; + font-weight: 700; +} + +.modal-body p { + color: var(--muted); + font-size: 14px; + line-height: 22px; +} + +.modal-body button { + width: 100%; + margin-top: 4px; +} + +.modal-confirm .modal-body { + gap: 12px; +} + +.modal-actions { + display: flex; + gap: 10px; + width: 100%; + margin-top: 8px; +} + +.modal-actions button { + flex: 1; + margin-top: 0; +} + +.danger-button { + border-color: var(--danger); + background: var(--danger); + color: #ffffff; +} + +.danger-button:hover:not(:disabled) { + border-color: #d92b2b; + background: #d92b2b; + box-shadow: 0 6px 18px rgba(245, 63, 63, 0.2); +} + +.modal-enter-active, +.modal-leave-active { + transition: opacity 200ms ease; +} + +.modal-enter-from, +.modal-leave-to { + opacity: 0; +} diff --git a/apps/desktop/src/views/HomeView.vue b/apps/desktop/src/views/HomeView.vue new file mode 100644 index 0000000..dd0e52b --- /dev/null +++ b/apps/desktop/src/views/HomeView.vue @@ -0,0 +1,896 @@ + + + diff --git a/apps/desktop/src/views/LogWindow.vue b/apps/desktop/src/views/LogWindow.vue new file mode 100644 index 0000000..4f3beaf --- /dev/null +++ b/apps/desktop/src/views/LogWindow.vue @@ -0,0 +1,76 @@ + + + diff --git a/apps/desktop/vite.config.js b/apps/desktop/vite.config.js new file mode 100644 index 0000000..bbcf80c --- /dev/null +++ b/apps/desktop/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [vue()], +}) diff --git a/deploy/00_check_server.bat b/deploy/00_check_server.bat new file mode 100644 index 0000000..0ca88cb --- /dev/null +++ b/deploy/00_check_server.bat @@ -0,0 +1,14 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Checking server %SERVER_USER%@%SERVER_HOST% ... +%SSH_BASE% "whoami && hostname && cat /etc/os-release && echo --- tools --- && (command -v docker || true) && (docker --version || true) && (docker compose version || true) && (command -v git || true) && (command -v nginx || true)" + +if errorlevel 1 ( + echo [AbyssInfo] Server check failed. + exit /b 1 +) + +echo [AbyssInfo] Server check completed. + diff --git a/deploy/01_install_env.bat b/deploy/01_install_env.bat new file mode 100644 index 0000000..7fe979d --- /dev/null +++ b/deploy/01_install_env.bat @@ -0,0 +1,20 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Uploading environment installer ... +%SCP_BASE% "%~dp0remote\install_env.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_install_env.sh +if errorlevel 1 ( + echo [AbyssInfo] Upload failed. + exit /b 1 +) + +echo [AbyssInfo] Installing server environment ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_install_env.sh && /tmp/abyssinfo_install_env.sh" +if errorlevel 1 ( + echo [AbyssInfo] Environment installation failed. + exit /b 1 +) + +echo [AbyssInfo] Environment installation completed. + diff --git a/deploy/02_deploy_netmaker.bat b/deploy/02_deploy_netmaker.bat new file mode 100644 index 0000000..46e3d25 --- /dev/null +++ b/deploy/02_deploy_netmaker.bat @@ -0,0 +1,23 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Uploading Netmaker installer and cached assets ... +%SCP_BASE% "%~dp0vendor\nm-quick.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/nm-quick.sh +if errorlevel 1 exit /b 1 + +%SCP_BASE% -r "%~dp0vendor\netmaker-assets" %SERVER_USER%@%SERVER_HOST%:/tmp/netmaker-assets +if errorlevel 1 exit /b 1 + +%SCP_BASE% "%~dp0remote\deploy_netmaker.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_deploy_netmaker.sh +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Deploying Netmaker ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_deploy_netmaker.sh && /tmp/abyssinfo_deploy_netmaker.sh" +if errorlevel 1 ( + echo [AbyssInfo] Netmaker deployment failed. + exit /b 1 +) + +echo [AbyssInfo] Netmaker deployment completed. + diff --git a/deploy/03_check_netmaker.bat b/deploy/03_check_netmaker.bat new file mode 100644 index 0000000..f5ab5ed --- /dev/null +++ b/deploy/03_check_netmaker.bat @@ -0,0 +1,14 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Checking Netmaker containers and endpoints ... +%SSH_BASE% "cd /root/netmaker 2>/dev/null || cd /root; docker compose ps || true; echo --- containers ---; docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'; echo --- health ---; curl -kIs --connect-timeout 10 https://api.nm.101-96-214-81.nip.io | head || true; curl -kIs --connect-timeout 10 https://dashboard.nm.101-96-214-81.nip.io | head || true" + +if errorlevel 1 ( + echo [AbyssInfo] Netmaker check failed. + exit /b 1 +) + +echo [AbyssInfo] Netmaker check completed. + diff --git a/deploy/04_probe_netmaker_api.bat b/deploy/04_probe_netmaker_api.bat new file mode 100644 index 0000000..563690b --- /dev/null +++ b/deploy/04_probe_netmaker_api.bat @@ -0,0 +1,16 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Uploading Netmaker API probe ... +%SCP_BASE% "%~dp0remote\netmaker_api_probe.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_netmaker_api_probe.sh +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Probing Netmaker API ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_netmaker_api_probe.sh && /tmp/abyssinfo_netmaker_api_probe.sh" +if errorlevel 1 ( + echo [AbyssInfo] Netmaker API probe failed. + exit /b 1 +) + +echo [AbyssInfo] Netmaker API probe completed. diff --git a/deploy/05_init_netmaker_network.bat b/deploy/05_init_netmaker_network.bat new file mode 100644 index 0000000..d56dd74 --- /dev/null +++ b/deploy/05_init_netmaker_network.bat @@ -0,0 +1,16 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Uploading Netmaker network initializer ... +%SCP_BASE% "%~dp0remote\init_netmaker_network.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_init_netmaker_network.sh +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Initializing Netmaker network ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_init_netmaker_network.sh && /tmp/abyssinfo_init_netmaker_network.sh" +if errorlevel 1 ( + echo [AbyssInfo] Netmaker network initialization failed. + exit /b 1 +) + +echo [AbyssInfo] Netmaker network initialization completed. diff --git a/deploy/06_configure_api_env.bat b/deploy/06_configure_api_env.bat new file mode 100644 index 0000000..06241ce --- /dev/null +++ b/deploy/06_configure_api_env.bat @@ -0,0 +1,17 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Configuring Django API .env ... +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\configure_api_env.ps1" ^ + -ServerHost "%SERVER_HOST%" ^ + -ServerUser "%SERVER_USER%" ^ + -SshKey "%SSH_KEY%" ^ + -ProjectRoot "%~dp0.." + +if errorlevel 1 ( + echo [AbyssInfo] Django API .env configuration failed. + exit /b 1 +) + +echo [AbyssInfo] Django API .env configured. diff --git a/deploy/07_deploy_api.bat b/deploy/07_deploy_api.bat new file mode 100644 index 0000000..7ec779b --- /dev/null +++ b/deploy/07_deploy_api.bat @@ -0,0 +1,27 @@ +@echo off +setlocal +call "%~dp0config.bat" + +set "API_ZIP=%TEMP%\abyssinfo-api.zip" + +echo [AbyssInfo] Packaging Django API ... +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\package_api.ps1" ^ + -ProjectRoot "%~dp0.." ^ + -OutputZip "%API_ZIP%" +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Uploading Django API package and deploy script ... +%SCP_BASE% "%API_ZIP%" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo-api.zip +if errorlevel 1 exit /b 1 + +%SCP_BASE% "%~dp0remote\deploy_api.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_deploy_api.sh +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Deploying Django API ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_deploy_api.sh && REMOTE_APP_DIR=%REMOTE_APP_DIR% API_DOMAIN=%API_DOMAIN% API_LEGACY_DOMAIN=%API_LEGACY_DOMAIN% NETMAKER_BASE_DOMAIN=%NETMAKER_BASE_DOMAIN% /tmp/abyssinfo_deploy_api.sh" +if errorlevel 1 ( + echo [AbyssInfo] Django API deployment failed. + exit /b 1 +) + +echo [AbyssInfo] Django API deployment completed. diff --git a/deploy/08_check_api.bat b/deploy/08_check_api.bat new file mode 100644 index 0000000..e3817e2 --- /dev/null +++ b/deploy/08_check_api.bat @@ -0,0 +1,13 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Checking Django API service and endpoint ... +%SSH_BASE% "systemctl is-active --quiet abyssinfo-api && curl -fsS http://127.0.0.1:8000/health/ && echo && curl -kfsS https://%API_DOMAIN%/health/" +if errorlevel 1 ( + echo [AbyssInfo] Django API check failed. + exit /b 1 +) + +echo. +echo [AbyssInfo] Django API check completed. diff --git a/deploy/09_setup_vpn_admin_access.bat b/deploy/09_setup_vpn_admin_access.bat new file mode 100644 index 0000000..22d7014 --- /dev/null +++ b/deploy/09_setup_vpn_admin_access.bat @@ -0,0 +1,20 @@ +@echo off +setlocal +chcp 65001 >nul + +call "%~dp0config.bat" + +if not exist "%SSH_KEY%" ( + echo [AbyssInfo] SSH key not found: %SSH_KEY% + exit /b 1 +) + +echo [AbyssInfo] Uploading VPN-only Netmaker admin setup script... +%SCP_BASE% "%~dp0remote\setup_vpn_admin_access.sh" "%SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_setup_vpn_admin_access.sh" +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Configuring VPN-only Netmaker admin entry... +%SSH_BASE% "chmod +x /tmp/abyssinfo_setup_vpn_admin_access.sh && NETMAKER_BASE_DOMAIN=%NETMAKER_BASE_DOMAIN% NETMAKER_NETWORK_ID=homevpn VPN_ADMIN_PORT=9090 /tmp/abyssinfo_setup_vpn_admin_access.sh" +if errorlevel 1 exit /b 1 + +echo [AbyssInfo] Done. diff --git a/deploy/10_setup_gitea_public_access.bat b/deploy/10_setup_gitea_public_access.bat new file mode 100644 index 0000000..2feea43 --- /dev/null +++ b/deploy/10_setup_gitea_public_access.bat @@ -0,0 +1,19 @@ +@echo off +setlocal +call "%~dp0config.bat" + +echo [AbyssInfo] Uploading Gitea public access setup script ... +%SCP_BASE% "%~dp0remote\setup_gitea_public_access.sh" %SERVER_USER%@%SERVER_HOST%:/tmp/abyssinfo_setup_gitea_public_access.sh +if errorlevel 1 ( + echo [AbyssInfo] Upload failed. + exit /b 1 +) + +echo [AbyssInfo] Configuring Gitea public access ... +%SSH_BASE% "chmod +x /tmp/abyssinfo_setup_gitea_public_access.sh && GITEA_DOMAIN=%GITEA_DOMAIN% GITEA_WEB_UPSTREAM=%GITEA_WEB_UPSTREAM% GITEA_OIDC_UPSTREAM=%GITEA_OIDC_UPSTREAM% /tmp/abyssinfo_setup_gitea_public_access.sh" +if errorlevel 1 ( + echo [AbyssInfo] Gitea public access setup failed. + exit /b 1 +) + +echo [AbyssInfo] Gitea public access setup completed. diff --git a/deploy/config.bat b/deploy/config.bat new file mode 100644 index 0000000..b7c0813 --- /dev/null +++ b/deploy/config.bat @@ -0,0 +1,13 @@ +@echo off +set "SERVER_HOST=101.96.214.81" +set "SERVER_USER=root" +set "SSH_KEY=%~dp0..\codex.pem" +set "REMOTE_APP_DIR=/opt/abyssinfo-home-vpn" +set "API_DOMAIN=vpn.abyssinfo.com" +set "API_LEGACY_DOMAIN=vpn-api.nm.101-96-214-81.nip.io" +set "NETMAKER_BASE_DOMAIN=vpn.abyssinfo.com" +set "GITEA_DOMAIN=gitea.abyssinfo.com" +set "GITEA_WEB_UPSTREAM=100.88.0.1:3001" +set "GITEA_OIDC_UPSTREAM=100.88.0.1:3080" +set "SSH_BASE=ssh -o StrictHostKeyChecking=accept-new -i %SSH_KEY% %SERVER_USER%@%SERVER_HOST%" +set "SCP_BASE=scp -o StrictHostKeyChecking=accept-new -i %SSH_KEY%" diff --git a/deploy/remote/deploy_api.sh b/deploy/remote/deploy_api.sh new file mode 100644 index 0000000..c6329e1 --- /dev/null +++ b/deploy/remote/deploy_api.sh @@ -0,0 +1,157 @@ +#!/usr/bin/env bash +set -euo pipefail + +APP_DIR="${REMOTE_APP_DIR:-/opt/abyssinfo-home-vpn}" +API_DIR="${APP_DIR}/api" +VENV_DIR="${APP_DIR}/.venv-api" +ZIP_FILE="${API_ZIP_FILE:-/tmp/abyssinfo-api.zip}" +API_DOMAIN="${API_DOMAIN:-vpn-api.nm.101-96-214-81.sslip.io}" +API_LEGACY_DOMAIN="${API_LEGACY_DOMAIN:-vpn-api.nm.101-96-214-81.nip.io}" +API_PORT="${API_PORT:-8000}" +NETMAKER_DOMAIN="${NETMAKER_BASE_DOMAIN:-nm.101-96-214-81.nip.io}" + +echo "[AbyssInfo] Deploying Django API" +echo "[AbyssInfo] API domain: ${API_DOMAIN}" + +if [[ "$(id -u)" != "0" ]]; then + echo "[AbyssInfo] Please run as root." >&2 + exit 1 +fi + +if [[ ! -f "${ZIP_FILE}" ]]; then + echo "[AbyssInfo] Missing ${ZIP_FILE}" >&2 + exit 1 +fi + +echo "[AbyssInfo] Installing Python runtime ..." +dnf install -y python3.12 python3.12-pip unzip + +mkdir -p "${API_DIR}" +PREVIOUS_ENV="/tmp/abyssinfo-api.previous.env" +if [[ -f "${API_DIR}/.env" ]]; then + cp "${API_DIR}/.env" "${PREVIOUS_ENV}" +else + rm -f "${PREVIOUS_ENV}" +fi + +find "${API_DIR}" -mindepth 1 \ + ! -name db.sqlite3 \ + ! -path "${API_DIR}/db.sqlite3" \ + -exec rm -rf {} + + +echo "[AbyssInfo] Extracting API package ..." +set +e +unzip -q "${ZIP_FILE}" -d "${API_DIR}" +UNZIP_EXIT=$? +set -e +if [[ "${UNZIP_EXIT}" -gt 1 ]]; then + echo "[AbyssInfo] Failed to unzip API package. Exit code ${UNZIP_EXIT}" >&2 + exit "${UNZIP_EXIT}" +fi + +if [[ ! -f "${API_DIR}/.env" ]]; then + echo "[AbyssInfo] Missing ${API_DIR}/.env" >&2 + exit 1 +fi + +echo "[AbyssInfo] Normalizing production env ..." +python3.12 - </etc/systemd/system/abyssinfo-api.service <&2 + exit 1 +fi + +if ! grep -q "https://${API_DOMAIN}" "${CADDYFILE}"; then + cat >>"${CADDYFILE}" </dev/null +curl -kfsS "https://${API_DOMAIN}/health/" >/dev/null + +echo "[AbyssInfo] Django API deployed:" +echo " https://${API_DOMAIN}/health/" diff --git a/deploy/remote/deploy_netmaker.sh b/deploy/remote/deploy_netmaker.sh new file mode 100644 index 0000000..15b93e0 --- /dev/null +++ b/deploy/remote/deploy_netmaker.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_DOMAIN="${NETMAKER_BASE_DOMAIN:-nm.101-96-214-81.nip.io}" +ADMIN_EMAIL="${NETMAKER_ADMIN_EMAIL:-admin@abyssinfo.local}" +ASSET_PORT="${NETMAKER_ASSET_PORT:-18080}" +ASSET_DIR="/tmp/netmaker-assets" +QUICK_SCRIPT="/tmp/nm-quick.sh" + +echo "[AbyssInfo] Deploying Netmaker CE" +echo "[AbyssInfo] Base domain: ${BASE_DOMAIN}" + +if [[ "$(id -u)" != "0" ]]; then + echo "[AbyssInfo] Please run as root." >&2 + exit 1 +fi + +if [[ ! -f "${QUICK_SCRIPT}" ]]; then + echo "[AbyssInfo] Missing ${QUICK_SCRIPT}" >&2 + exit 1 +fi + +if [[ ! -d "${ASSET_DIR}" ]]; then + echo "[AbyssInfo] Missing ${ASSET_DIR}" >&2 + exit 1 +fi + +echo "[AbyssInfo] Installing Netmaker quick-install dependencies ..." +dnf install -y wget jq bind-utils gawk wireguard-tools python3 + +echo "[AbyssInfo] Ensuring Docker is running ..." +mkdir -p /etc/docker +cat >/etc/docker/daemon.json <<'JSON' +{ + "registry-mirrors": [ + "https://docker.1ms.run", + "https://docker.m.daocloud.io", + "https://hub-mirror.c.163.com" + ] +} +JSON +systemctl daemon-reload +systemctl restart docker +systemctl enable --now docker + +echo "[AbyssInfo] Stopping Nginx to free ports 80/443 for Netmaker Caddy ..." +systemctl disable --now nginx 2>/dev/null || true + +health_check() { + local dashboard_url="https://dashboard.${BASE_DOMAIN}" + + if [[ ! -f /root/netmaker/docker-compose.yml ]]; then + echo "[AbyssInfo] Missing /root/netmaker/docker-compose.yml" >&2 + return 1 + fi + + echo "[AbyssInfo] Netmaker containers:" + (cd /root/netmaker && docker compose ps) + + echo "[AbyssInfo] Checking dashboard endpoint: ${dashboard_url}" + curl -kfsSI --connect-timeout 15 "${dashboard_url}" >/dev/null +} + +apply_internal_only_defaults() { + local env_file="/root/netmaker/netmaker.env" + if [[ ! -f "${env_file}" ]]; then + return 0 + fi + + echo "[AbyssInfo] Applying internal-only Netmaker client defaults ..." + python3 - <<'PY' +from pathlib import Path + +env_path = Path("/root/netmaker/netmaker.env") +values = {} +order = [] +for line in env_path.read_text(encoding="utf-8").splitlines(): + if not line or line.startswith("#") or "=" not in line: + continue + key, value = line.split("=", 1) + if key not in values: + order.append(key) + values[key] = value + +for key, value in { + "DNS_MODE": "off", + "MANAGE_DNS": "false", +}.items(): + if key not in values: + order.append(key) + values[key] = value + +env_path.write_text("\n".join(f"{key}={values[key]}" for key in order) + "\n", encoding="utf-8") +PY +} + +if [[ "${NETMAKER_FORCE_REINSTALL:-0}" == "1" ]]; then + echo "[AbyssInfo] Force reinstall requested. Removing previous Netmaker deployment ..." + if [[ -f /root/netmaker/docker-compose.yml ]]; then + (cd /root/netmaker && docker compose down --volumes || true) + fi + rm -rf /root/netmaker /etc/netmaker /etc/netclient +elif [[ -f /root/netmaker/docker-compose.yml ]]; then + echo "[AbyssInfo] Existing Netmaker deployment found. Starting services and running health check ..." + apply_internal_only_defaults + (cd /root/netmaker && docker compose up -d) + if health_check; then + echo "[AbyssInfo] Existing Netmaker deployment is healthy." + echo "[AbyssInfo] URLs:" + echo " Dashboard: https://dashboard.${BASE_DOMAIN}" + echo " API: https://api.${BASE_DOMAIN}" + echo " Broker: wss://broker.${BASE_DOMAIN}" + exit 0 + fi + + echo "[AbyssInfo] Existing deployment is not healthy. Set NETMAKER_FORCE_REINSTALL=1 to rebuild it." >&2 + exit 1 +fi + +echo "[AbyssInfo] Preparing quick installer ..." +mkdir -p /root +cp "${QUICK_SCRIPT}" /root/nm-quick.sh +chmod +x /root/nm-quick.sh + +# Use uploaded cached assets instead of pulling compose files from GitHub on the server. +sed -i "s|local BASE_URL=\"https://raw.githubusercontent.com/gravitl/netmaker/\$BRANCH\"|local BASE_URL=\"http://127.0.0.1:${ASSET_PORT}\"|g" /root/nm-quick.sh + +echo "[AbyssInfo] Starting temporary local asset server ..." +pkill -f "python3 -m http.server ${ASSET_PORT}" 2>/dev/null || true +cd "${ASSET_DIR}" +python3 -m http.server "${ASSET_PORT}" --bind 127.0.0.1 >/tmp/abyssinfo-netmaker-assets.log 2>&1 & +ASSET_PID=$! +trap 'kill ${ASSET_PID} 2>/dev/null || true' EXIT +sleep 2 +curl -fsS "http://127.0.0.1:${ASSET_PORT}/compose/docker-compose.yml" >/dev/null + +echo "[AbyssInfo] Running Netmaker quick installer ..." +cd /root +export NM_DOMAIN="${BASE_DOMAIN}" +export NM_EMAIL="${ADMIN_EMAIL}" +export NM_SKIP_DEPS=1 + +# Input sequence for nm-quick CE: +# 1 = use auto/generated domain, email, y = confirm settings. +set +e +printf "1\n%s\ny\n" "${ADMIN_EMAIL}" | /root/nm-quick.sh -c +QUICK_EXIT=$? +set -e + +echo "[AbyssInfo] Netmaker files:" +ls -la /root/netmaker + +if ! health_check; then + echo "[AbyssInfo] Netmaker health check failed after quick installer exit code ${QUICK_EXIT}." >&2 + exit 1 +fi + +if [[ "${QUICK_EXIT}" != "0" ]]; then + echo "[AbyssInfo] Quick installer exited with ${QUICK_EXIT}, but Netmaker services are healthy. Continuing." +fi + +apply_internal_only_defaults +(cd /root/netmaker && docker compose up -d) + +echo "[AbyssInfo] URLs:" +echo " Dashboard: https://dashboard.${BASE_DOMAIN}" +echo " API: https://api.${BASE_DOMAIN}" +echo " Broker: wss://broker.${BASE_DOMAIN}" diff --git a/deploy/remote/init_netmaker_network.sh b/deploy/remote/init_netmaker_network.sh new file mode 100644 index 0000000..e470058 --- /dev/null +++ b/deploy/remote/init_netmaker_network.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_DOMAIN="${NETMAKER_BASE_DOMAIN:-nm.101-96-214-81.nip.io}" +ENV_FILE="${NETMAKER_ENV_FILE:-/root/netmaker/netmaker.env}" +NETWORK_ID="${NETMAKER_NETWORK_ID:-homevpn}" +NETWORK_RANGE="${NETMAKER_NETWORK_RANGE:-100.88.0.0/24}" + +if [[ ! -f "${ENV_FILE}" ]]; then + echo "[AbyssInfo] Missing ${ENV_FILE}" >&2 + exit 1 +fi + +set -a +# shellcheck source=/dev/null +. "${ENV_FILE}" +set +a + +if [[ -z "${MASTER_KEY:-}" ]]; then + echo "[AbyssInfo] MASTER_KEY is missing in ${ENV_FILE}" >&2 + exit 1 +fi + +api_url="https://api.${BASE_DOMAIN}" +auth_header="Authorization: Bearer ${MASTER_KEY}" + +echo "[AbyssInfo] Checking Netmaker network: ${NETWORK_ID}" +networks_json="$(curl -ksS -H "${auth_header}" "${api_url}/api/networks")" +if echo "${networks_json}" | jq -e --arg id "${NETWORK_ID}" '.[]? | select(.netid == $id)' >/dev/null; then + echo "[AbyssInfo] Network already exists: ${NETWORK_ID}" +else + echo "[AbyssInfo] Creating Netmaker network: ${NETWORK_ID} (${NETWORK_RANGE})" + payload="$(jq -n \ + --arg netid "${NETWORK_ID}" \ + --arg addressrange "${NETWORK_RANGE}" \ + '{ + netid: $netid, + addressrange: $addressrange, + defaultacl: "yes", + defaultmtu: 1420, + defaultlistenport: 51821, + defaultkeepalive: 20, + auto_join: true + }')" + + response_file="$(mktemp)" + code="$(curl -ksS -o "${response_file}" -w "%{http_code}" \ + -X POST "${api_url}/api/networks" \ + -H "${auth_header}" \ + -H "Content-Type: application/json" \ + --data "${payload}" || true)" + + if [[ "${code}" -lt 200 || "${code}" -ge 300 ]]; then + echo "[AbyssInfo] Failed to create network. HTTP ${code}" >&2 + head -c 500 "${response_file}" >&2 || true + echo >&2 + rm -f "${response_file}" + exit 1 + fi + rm -f "${response_file}" +fi + +echo "[AbyssInfo] Current networks:" +curl -ksS -H "${auth_header}" "${api_url}/api/networks" \ + | jq -r '.[] | "- \(.netid) \(.addressrange // "")"' + +echo "[AbyssInfo] Backend config:" +echo "NETMAKER_BASE_URL=${api_url}" +echo "NETMAKER_NETWORK_ID=${NETWORK_ID}" diff --git a/deploy/remote/install_env.sh b/deploy/remote/install_env.sh new file mode 100644 index 0000000..1823814 --- /dev/null +++ b/deploy/remote/install_env.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "[AbyssInfo] Server environment installer" +echo "[AbyssInfo] User: $(whoami)" +echo "[AbyssInfo] OS:" +cat /etc/os-release + +if [[ "$(id -u)" != "0" ]]; then + echo "[AbyssInfo] Please run as root." >&2 + exit 1 +fi + +echo "[AbyssInfo] Installing base packages ..." +dnf install -y dnf-plugins-core ca-certificates curl git tar gzip unzip policycoreutils-python-utils + +if ! command -v docker >/dev/null 2>&1; then + echo "[AbyssInfo] Adding Docker CE repository ..." + rm -f /etc/yum.repos.d/docker-ce.repo + dnf clean all + if ! dnf config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo; then + echo "[AbyssInfo] Aliyun Docker repository failed, using official repository ..." + dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + fi + dnf clean all + dnf makecache --disablerepo='*' --enablerepo='docker-ce-stable' || true + echo "[AbyssInfo] Installing Docker Engine and Compose plugin ..." + dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +else + echo "[AbyssInfo] Docker already installed." +fi + +systemctl enable --now docker + +if ! command -v nginx >/dev/null 2>&1; then + echo "[AbyssInfo] Installing Nginx ..." + dnf install -y nginx +else + echo "[AbyssInfo] Nginx already installed." +fi + +mkdir -p /opt/abyssinfo-home-vpn + +if systemctl is-active --quiet firewalld; then + echo "[AbyssInfo] Configuring running firewalld ..." + firewall-cmd --permanent --add-service=ssh + firewall-cmd --permanent --add-service=http + firewall-cmd --permanent --add-service=https + firewall-cmd --reload +else + echo "[AbyssInfo] firewalld is not running; skipping OS firewall changes." +fi + +echo "[AbyssInfo] Versions:" +docker --version +docker compose version +git --version +nginx -v + +echo "[AbyssInfo] Environment ready." diff --git a/deploy/remote/netmaker_api_probe.sh b/deploy/remote/netmaker_api_probe.sh new file mode 100644 index 0000000..229ab7a --- /dev/null +++ b/deploy/remote/netmaker_api_probe.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_DOMAIN="${NETMAKER_BASE_DOMAIN:-nm.101-96-214-81.nip.io}" +ENV_FILE="${NETMAKER_ENV_FILE:-/root/netmaker/netmaker.env}" + +if [[ ! -f "${ENV_FILE}" ]]; then + echo "[AbyssInfo] Missing ${ENV_FILE}" >&2 + exit 1 +fi + +set -a +# shellcheck source=/dev/null +. "${ENV_FILE}" +set +a + +if [[ -z "${MASTER_KEY:-}" ]]; then + echo "[AbyssInfo] MASTER_KEY is missing in ${ENV_FILE}" >&2 + exit 1 +fi + +echo "[AbyssInfo] Probing Netmaker API routes" +for path in \ + /api/networks \ + /api/v1/networks \ + /api/v1/enrollment-keys \ + /api/server/getserverinfo \ + /api/users/adm/hasadmin \ + /api/v1/server/getserverinfo +do + response_file="$(mktemp)" + code="$(curl -ksS -o "${response_file}" -w "%{http_code}" \ + -H "Authorization: Bearer ${MASTER_KEY}" \ + "https://api.${BASE_DOMAIN}${path}" || true)" + printf "%s %s " "${code}" "${path}" + head -c 180 "${response_file}" | tr '\n' ' ' + echo + rm -f "${response_file}" +done diff --git a/deploy/remote/setup_gitea_public_access.sh b/deploy/remote/setup_gitea_public_access.sh new file mode 100644 index 0000000..f09e950 --- /dev/null +++ b/deploy/remote/setup_gitea_public_access.sh @@ -0,0 +1,107 @@ +#!/usr/bin/env bash +set -euo pipefail + +GITEA_DOMAIN="${GITEA_DOMAIN:-gitea.abyssinfo.com}" +GITEA_WEB_UPSTREAM="${GITEA_WEB_UPSTREAM:-100.88.0.1:3001}" +GITEA_OIDC_UPSTREAM="${GITEA_OIDC_UPSTREAM:-100.88.0.1:3080}" +NETMAKER_DIR="${NETMAKER_DIR:-/root/netmaker}" +CADDYFILE="${CADDYFILE:-${NETMAKER_DIR}/Caddyfile}" + +echo "[AbyssInfo] Configuring public Gitea reverse proxy" +echo "[AbyssInfo] Domain: ${GITEA_DOMAIN}" +echo "[AbyssInfo] Web upstream: http://${GITEA_WEB_UPSTREAM}" +echo "[AbyssInfo] OIDC upstream: http://${GITEA_OIDC_UPSTREAM}" + +if [[ "$(id -u)" != "0" ]]; then + echo "[AbyssInfo] Please run as root." >&2 + exit 1 +fi + +if [[ ! -f "${CADDYFILE}" ]]; then + echo "[AbyssInfo] Missing ${CADDYFILE}" >&2 + exit 1 +fi + +echo "[AbyssInfo] Checking upstreams from server ..." +curl -fsS --connect-timeout 3 --max-time 8 "http://${GITEA_OIDC_UPSTREAM}/oidc/.well-known/openid-configuration" >/dev/null \ + && echo "[AbyssInfo] OIDC upstream OK" \ + || echo "[AbyssInfo] WARN: OIDC upstream is not reachable from server" + +curl -fsSI --connect-timeout 3 --max-time 8 "http://${GITEA_WEB_UPSTREAM}/user/login" >/dev/null \ + && echo "[AbyssInfo] Gitea web upstream OK" \ + || echo "[AbyssInfo] WARN: Gitea web upstream is not reachable from server" + +python3 - </dev/null \ + && echo "[AbyssInfo] Public OIDC endpoint OK" \ + || echo "[AbyssInfo] WARN: Public OIDC endpoint is not ready. Check DNS and upstream reachability." + +curl -kfsSI --connect-timeout 5 --max-time 12 "https://${GITEA_DOMAIN}/user/login" >/dev/null \ + && echo "[AbyssInfo] Public Gitea login endpoint OK" \ + || echo "[AbyssInfo] WARN: Public Gitea login endpoint is not ready. Check DNS and upstream reachability." + +echo "[AbyssInfo] Gitea public access configured:" +echo " https://${GITEA_DOMAIN}/oidc/.well-known/openid-configuration -> http://${GITEA_OIDC_UPSTREAM}" +echo " https://${GITEA_DOMAIN}/user/login -> http://${GITEA_WEB_UPSTREAM}" diff --git a/deploy/remote/setup_vpn_admin_access.sh b/deploy/remote/setup_vpn_admin_access.sh new file mode 100644 index 0000000..1318e51 --- /dev/null +++ b/deploy/remote/setup_vpn_admin_access.sh @@ -0,0 +1,227 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_DOMAIN="${NETMAKER_BASE_DOMAIN:-vpn.abyssinfo.com}" +NETWORK_ID="${NETMAKER_NETWORK_ID:-homevpn}" +ENV_FILE="${NETMAKER_ENV_FILE:-/root/netmaker/netmaker.env}" +INSTALL_DIR="${NETCLIENT_INSTALL_DIR:-/usr/local/bin}" +NETCLIENT_VERSION="${NETCLIENT_VERSION:-v1.5.1}" +ADMIN_PORT="${VPN_ADMIN_PORT:-9090}" +NETMAKER_DIR="${NETMAKER_DIR:-/root/netmaker}" +CADDY_FILE="${NETMAKER_DIR}/Caddyfile" +COMPOSE_FILE="${NETMAKER_DIR}/docker-compose.yml" + +if [[ "$(id -u)" != "0" ]]; then + echo "[AbyssInfo] Please run as root." >&2 + exit 1 +fi + +if [[ ! -f "${ENV_FILE}" ]]; then + echo "[AbyssInfo] Missing ${ENV_FILE}" >&2 + exit 1 +fi + +if [[ ! -f "${CADDY_FILE}" || ! -f "${COMPOSE_FILE}" ]]; then + echo "[AbyssInfo] Missing Netmaker compose files in ${NETMAKER_DIR}" >&2 + exit 1 +fi + +set -a +# shellcheck source=/dev/null +. "${ENV_FILE}" +set +a + +if [[ -z "${MASTER_KEY:-}" ]]; then + echo "[AbyssInfo] MASTER_KEY is missing in ${ENV_FILE}" >&2 + exit 1 +fi + +api_url="https://api.${BASE_DOMAIN}" +auth_header="Authorization: Bearer ${MASTER_KEY}" + +install_netclient() { + if command -v netclient >/dev/null 2>&1; then + return 0 + fi + + echo "[AbyssInfo] Installing netclient ${NETCLIENT_VERSION} ..." + dnf install -y wget jq wireguard-tools >/dev/null + + local arch + arch="$(uname -m)" + case "${arch}" in + x86_64|amd64) arch="amd64" ;; + aarch64|arm64) arch="arm64" ;; + *) + echo "[AbyssInfo] Unsupported architecture: ${arch}" >&2 + exit 1 + ;; + esac + + mkdir -p "${INSTALL_DIR}" + wget -qO "${INSTALL_DIR}/netclient" "https://github.com/gravitl/netclient/releases/download/${NETCLIENT_VERSION}/netclient-linux-${arch}" + chmod +x "${INSTALL_DIR}/netclient" + "${INSTALL_DIR}/netclient" install +} + +current_vpn_ip() { + if [[ -f /etc/netclient/nodes.json ]]; then + jq -r --arg network "${NETWORK_ID}" '.[$network].address.IP // empty' /etc/netclient/nodes.json 2>/dev/null | + awk 'NF && $1 !~ /^169\.254\./ { print; exit }' + fi +} + +create_server_join_token() { + local key_name response_file code token + key_name="abyssinfo-server-admin-$(date +%Y%m%d%H%M%S)" + response_file="$(mktemp)" + + local payload + payload="$(jq -n \ + --arg name "${key_name}" \ + --arg network "${NETWORK_ID}" \ + '{ + name: $name, + tags: ["abyssinfo-server-admin"], + type: 2, + uses_remaining: 1, + unlimited: false, + expiration: 0, + networks: [$network], + groups: ["homevpn", "server", "admin"], + auto_egress: false, + auto_assign_gw: false + }')" + + code="$(curl -ksS -o "${response_file}" -w "%{http_code}" \ + -X POST "${api_url}/api/v1/enrollment-keys" \ + -H "${auth_header}" \ + -H "Content-Type: application/json" \ + --data "${payload}" || true)" + + if [[ "${code}" -lt 200 || "${code}" -ge 300 ]]; then + echo "[AbyssInfo] Failed to create server enrollment token. HTTP ${code}" >&2 + head -c 500 "${response_file}" >&2 || true + echo >&2 + rm -f "${response_file}" + exit 1 + fi + + token="$(jq -r '.token // .data.token // empty' "${response_file}")" + rm -f "${response_file}" + if [[ -z "${token}" || "${token}" == "null" ]]; then + echo "[AbyssInfo] Netmaker did not return an enrollment token." >&2 + exit 1 + fi + + printf "%s" "${token}" +} + +join_server_to_vpn() { + local ip token + ip="$(current_vpn_ip || true)" + if [[ -n "${ip}" ]]; then + echo "[AbyssInfo] Server is already in ${NETWORK_ID}: ${ip}" + systemctl enable --now netclient >/dev/null 2>&1 || true + return 0 + fi + + echo "[AbyssInfo] Joining server to Netmaker network ${NETWORK_ID} ..." + token="$(create_server_join_token)" + netclient join -t "${token}" >/tmp/abyssinfo-server-netclient-join.log 2>&1 || { + echo "[AbyssInfo] netclient join failed. Last log lines:" >&2 + tail -n 80 /tmp/abyssinfo-server-netclient-join.log >&2 || true + exit 1 + } + systemctl enable --now netclient >/dev/null 2>&1 || true + + for _ in $(seq 1 90); do + ip="$(current_vpn_ip || true)" + if [[ -n "${ip}" ]]; then + echo "[AbyssInfo] Server VPN IP: ${ip}" + return 0 + fi + sleep 2 + done + + echo "[AbyssInfo] Server joined, but VPN IP was not detected." >&2 + exit 1 +} + +configure_caddy_vpn_admin() { + local vpn_ip="$1" + echo "[AbyssInfo] Configuring Caddy VPN-only admin entry on ${vpn_ip}:${ADMIN_PORT} ..." + + cp -a "${CADDY_FILE}" "${CADDY_FILE}.bak.$(date +%Y%m%d%H%M%S)" + cp -a "${COMPOSE_FILE}" "${COMPOSE_FILE}.bak.$(date +%Y%m%d%H%M%S)" + + VPN_IP="${vpn_ip}" VPN_ADMIN_PORT="${ADMIN_PORT}" python3 - <<'PY' +from pathlib import Path +import os +import re + +caddy_path = Path("/root/netmaker/Caddyfile") +compose_path = Path("/root/netmaker/docker-compose.yml") +vpn_ip = os.environ["VPN_IP"] +port = os.environ["VPN_ADMIN_PORT"] + +block = f""" + +# AbyssInfo VPN-only Netmaker Dashboard +:{port} {{ +\theader {{ +\t\tX-Robots-Tag "none" +\t\t-Server +\t}} +\treverse_proxy http://netmaker-ui +}} +""" + +caddy = caddy_path.read_text(encoding="utf-8") +caddy = re.sub( + r"\n# AbyssInfo VPN-only Netmaker Dashboard\n:\d+ \{.*?\n\}\n?", + "\n", + caddy, + flags=re.S, +).rstrip() + block +caddy_path.write_text(caddy, encoding="utf-8") + +compose = compose_path.read_text(encoding="utf-8") +mapping = f' - "{vpn_ip}:{port}:{port}/tcp"' +lines = [] +inserted = False +for line in compose.splitlines(): + if f":{port}:{port}/tcp" in line: + if not inserted: + lines.append(mapping) + inserted = True + continue + lines.append(line) + if '"50051:50051"' in line and not inserted: + lines.append(mapping) + inserted = True + +if not inserted: + raise SystemExit("failed to insert caddy port mapping after 50051") + +compose_path.write_text("\n".join(lines) + "\n", encoding="utf-8") +PY + + (cd "${NETMAKER_DIR}" && docker compose up -d caddy) + sleep 2 + curl -fsSI --connect-timeout 10 "http://${vpn_ip}:${ADMIN_PORT}" >/dev/null +} + +main() { + install_netclient + join_server_to_vpn + local vpn_ip + vpn_ip="$(current_vpn_ip)" + configure_caddy_vpn_admin "${vpn_ip}" + + echo "[AbyssInfo] VPN-only Netmaker dashboard:" + echo " http://${vpn_ip}:${ADMIN_PORT}" + echo "[AbyssInfo] Only VPN clients with route to ${NETWORK_ID} should be able to reach this address." +} + +main "$@" diff --git a/deploy/scripts/configure_api_env.ps1 b/deploy/scripts/configure_api_env.ps1 new file mode 100644 index 0000000..fb35b5e --- /dev/null +++ b/deploy/scripts/configure_api_env.ps1 @@ -0,0 +1,62 @@ +param( + [Parameter(Mandatory = $true)][string]$ServerHost, + [Parameter(Mandatory = $true)][string]$ServerUser, + [Parameter(Mandatory = $true)][string]$SshKey, + [Parameter(Mandatory = $true)][string]$ProjectRoot +) + +$ErrorActionPreference = "Stop" + +function New-Secret { + -join (1..64 | ForEach-Object { "{0:x}" -f (Get-Random -Minimum 0 -Maximum 16) }) +} + +$apiDir = Join-Path $ProjectRoot "services\api" +$envPath = Join-Path $apiDir ".env" +$remote = "${ServerUser}@${ServerHost}" + +$existing = @{} +if (Test-Path -LiteralPath $envPath) { + Get-Content -LiteralPath $envPath | ForEach-Object { + if ($_ -and -not $_.StartsWith("#") -and $_.Contains("=")) { + $parts = $_.Split("=", 2) + $existing[$parts[0].TrimStart([char]0xFEFF)] = $parts[1] + } + } +} + +$masterKey = (& ssh.exe -i $SshKey $remote "grep '^MASTER_KEY=' /root/netmaker/netmaker.env | cut -d= -f2-").Trim() +if (-not $masterKey) { + throw "MASTER_KEY was not found on the Netmaker server." +} + +$djangoSecret = New-Secret +$jwtSecret = New-Secret +$feishuAppId = $existing["FEISHU_APP_ID"] +$feishuAppSecret = $existing["FEISHU_APP_SECRET"] + +$content = @" +DJANGO_SECRET_KEY=$djangoSecret +DJANGO_DEBUG=true +DJANGO_ALLOWED_HOSTS=127.0.0.1,localhost,$ServerHost +CORS_ALLOWED_ORIGINS=http://localhost:5173,tauri://localhost + +FEISHU_APP_ID=$feishuAppId +FEISHU_APP_SECRET=$feishuAppSecret +FEISHU_REDIRECT_URI=http://127.0.0.1:8000/auth/feishu/callback +TAURI_DEEP_LINK_SCHEME=myvpn + +JWT_SECRET=$jwtSecret +JWT_EXPIRES_SECONDS=600 +OAUTH_STATE_EXPIRES_SECONDS=300 +LOGIN_CODE_EXPIRES_SECONDS=120 + +NETMAKER_BASE_URL=https://api.vpn.abyssinfo.com +NETMAKER_API_TOKEN=$masterKey +NETMAKER_NETWORK_ID=homevpn +NETMAKER_ENROLLMENT_TAGS=homevpn,desktop,vpn +NETMAKER_ENROLLMENT_TTL_SECONDS=600 +"@ + +[System.IO.File]::WriteAllText($envPath, $content, [System.Text.UTF8Encoding]::new($false)) +Write-Host "[AbyssInfo] Wrote services\api\.env" diff --git a/deploy/scripts/package_api.ps1 b/deploy/scripts/package_api.ps1 new file mode 100644 index 0000000..b5e2f3a --- /dev/null +++ b/deploy/scripts/package_api.ps1 @@ -0,0 +1,34 @@ +param( + [Parameter(Mandatory = $true)][string]$ProjectRoot, + [Parameter(Mandatory = $true)][string]$OutputZip +) + +$ErrorActionPreference = "Stop" + +$apiDir = Join-Path $ProjectRoot "services\api" +$stageRoot = Join-Path $env:TEMP ("abyssinfo-api-stage-" + [guid]::NewGuid().ToString("N")) +$stageApi = Join-Path $stageRoot "api" + +New-Item -ItemType Directory -Force -Path $stageApi | Out-Null + +$excludeDirs = @(".venv", "__pycache__", "staticfiles") +$excludeFiles = @("db.sqlite3") + +Get-ChildItem -LiteralPath $apiDir -Force | ForEach-Object { + if ($_.PSIsContainer) { + if ($excludeDirs -notcontains $_.Name) { + Copy-Item -LiteralPath $_.FullName -Destination $stageApi -Recurse -Force + } + } elseif ($excludeFiles -notcontains $_.Name) { + Copy-Item -LiteralPath $_.FullName -Destination $stageApi -Force + } +} + +if (Test-Path -LiteralPath $OutputZip) { + Remove-Item -LiteralPath $OutputZip -Force +} + +Compress-Archive -Path (Join-Path $stageApi "*") -DestinationPath $OutputZip -Force +Remove-Item -LiteralPath $stageRoot -Recurse -Force + +Write-Host "[AbyssInfo] Packaged API to $OutputZip" diff --git a/deploy/vendor/netmaker-assets/compose/docker-compose.yml b/deploy/vendor/netmaker-assets/compose/docker-compose.yml new file mode 100644 index 0000000..1c5cd60 --- /dev/null +++ b/deploy/vendor/netmaker-assets/compose/docker-compose.yml @@ -0,0 +1,76 @@ +services: + + netmaker: + container_name: netmaker + image: gravitl/netmaker:$SERVER_IMAGE_TAG + env_file: ./netmaker.env + restart: always + volumes: + - dnsconfig:/root/config/dnsconfig + - sqldata:/root/data + environment: + # config-dependant vars + - STUN_SERVERS=stun1.l.google.com:19302,stun2.l.google.com:19302,stun3.l.google.com:19302,stun4.l.google.com:19302 + # The domain/host IP indicating the mq broker address + - BROKER_ENDPOINT=wss://broker.${NM_DOMAIN} # For EMQX broker use `BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}/mqtt` + # For EMQX broker (uncomment the two lines below) + #- BROKER_TYPE=emqx + #- EMQX_REST_ENDPOINT=http://mq:18083 + # The base domain of netmaker + - SERVER_NAME=${NM_DOMAIN} + - SERVER_API_CONN_STRING=api.${NM_DOMAIN}:443 + # Address of the CoreDNS server. Defaults to SERVER_HOST + - COREDNS_ADDR=${SERVER_HOST} + # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks. + - SERVER_HTTP_HOST=api.${NM_DOMAIN} + + netmaker-ui: + container_name: netmaker-ui + image: gravitl/netmaker-ui:$UI_IMAGE_TAG + env_file: ./netmaker.env + environment: + # config-dependant vars + # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT + BACKEND_URL: "https://api.${NM_DOMAIN}" + depends_on: + - netmaker + links: + - "netmaker:api" + restart: always + + caddy: + image: caddy:2.8.4 + container_name: caddy + env_file: ./netmaker.env + restart: unless-stopped + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - caddy_data:/data + - caddy_conf:/config + ports: + - "80:80/tcp" + - "443:443/tcp" + - "50051:50051" + mq: + container_name: mq + image: eclipse-mosquitto:2.0.15-openssl + env_file: ./netmaker.env + depends_on: + - netmaker + restart: unless-stopped + command: [ "/mosquitto/config/wait.sh" ] + volumes: + - ./mosquitto.conf:/mosquitto/config/mosquitto.conf + - ./wait.sh:/mosquitto/config/wait.sh + - mosquitto_logs:/mosquitto/log + - mosquitto_data:/mosquitto/data +volumes: + caddy_data: { } # runtime data for caddy + caddy_conf: { } # configuration file for Caddy + sqldata: { } + dnsconfig: { } # storage for coredns + mosquitto_logs: { } # storage for mqtt logs + mosquitto_data: { } # storage for mqtt data + diff --git a/deploy/vendor/netmaker-assets/docker/Caddyfile b/deploy/vendor/netmaker-assets/docker/Caddyfile new file mode 100644 index 0000000..9f5b356 --- /dev/null +++ b/deploy/vendor/netmaker-assets/docker/Caddyfile @@ -0,0 +1,34 @@ +# Dashboard +https://dashboard.{$NM_DOMAIN} { + # Apply basic security headers + header { + # Enable cross origin access to *.{$NM_DOMAIN} + Access-Control-Allow-Origin *.{$NM_DOMAIN} + # Enable HTTP Strict Transport Security (HSTS) + Strict-Transport-Security "max-age=31536000;" + # Enable cross-site filter (XSS) and tell browser to block detected attacks + X-XSS-Protection "1; mode=block" + # Disallow the site to be rendered within a frame on a foreign domain (clickjacking protection) + X-Frame-Options "SAMEORIGIN" + # Prevent search engines from indexing + X-Robots-Tag "none" + # Remove the server name + -Server + } + + reverse_proxy http://netmaker-ui +} + +# API +https://api.{$NM_DOMAIN} { + reverse_proxy http://netmaker:8081 +} + +# MQ +broker.{$NM_DOMAIN} { + @ws { + header Connection *Upgrade* + header Upgrade websocket + } + reverse_proxy @ws mq:8883 # For EMQX websockets use `reverse_proxy @ws mq:8083` +} diff --git a/deploy/vendor/netmaker-assets/docker/mosquitto.conf b/deploy/vendor/netmaker-assets/docker/mosquitto.conf new file mode 100644 index 0000000..eac096c --- /dev/null +++ b/deploy/vendor/netmaker-assets/docker/mosquitto.conf @@ -0,0 +1,10 @@ +per_listener_settings false +listener 8883 +protocol websockets +allow_anonymous false + +listener 1883 +protocol websockets +allow_anonymous false + +password_file /mosquitto/password.txt diff --git a/deploy/vendor/netmaker-assets/docker/wait.sh b/deploy/vendor/netmaker-assets/docker/wait.sh new file mode 100644 index 0000000..bf98768 --- /dev/null +++ b/deploy/vendor/netmaker-assets/docker/wait.sh @@ -0,0 +1,18 @@ +#!/bin/ash + +encrypt_password() { + echo "${MQ_USERNAME}:${MQ_PASSWORD}" > /mosquitto/password.txt + mosquitto_passwd -U /mosquitto/password.txt +} + +main(){ + + encrypt_password + echo "Starting MQ..." + # Run the main container command. + /docker-entrypoint.sh + /usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf + +} + +main "${@}" diff --git a/deploy/vendor/netmaker-assets/scripts/netmaker.default.env b/deploy/vendor/netmaker-assets/scripts/netmaker.default.env new file mode 100644 index 0000000..71bfb58 --- /dev/null +++ b/deploy/vendor/netmaker-assets/scripts/netmaker.default.env @@ -0,0 +1,111 @@ +# Email used for SSL certificates +NM_EMAIL= +# The base domain of netmaker +NM_DOMAIN= +# Public IPv4 endpoint of machine +SERVER_HOST= +# Public IPv6 endpoint of machine +SERVER_HOST6= +# The admin master key for accessing the API. Change this in any production installation. +MASTER_KEY= +# The username to set for MQ access +MQ_USERNAME= +# The password to set for MQ access +MQ_PASSWORD= +INSTALL_TYPE= +NETMAKER_TENANT_ID= +LICENSE_KEY= +SERVER_IMAGE_TAG= +UI_IMAGE_TAG= +# used for HA - identifies this server vs other servers if unset uses host_name +HOST_NAME= +METRICS_EXPORTER=off +#metrics exporter secret +METRICS_SECRET= +#metrics exporter user +METRICS_USERNAME=netmaker +# Enables DNS Mode, meaning all nodes will set hosts file for private dns settings +DNS_MODE=on +# Enable auto update of netclient ? ENUM:- enabled,disabled | default=enabled +NETCLIENT_AUTO_UPDATE=enabled +# The HTTP API port for Netmaker. Used for API calls / communication from front end. +# If changed, need to change port of BACKEND_URL for netmaker-ui. +API_PORT=8081 +EXPORTER_API_PORT=8085 +# The "allowed origin" for API requests. Change to restrict where API requests can come from with comma-separated +# URLs. ex:- https://dashboard.netmaker.domain1.com,https://dashboard.netmaker.domain2.com +CORS_ALLOWED_ORIGIN=* +# Show keys permanently in UI (until deleted) as opposed to 1-time display. +DISPLAY_KEYS=on +# Database to use - sqlite, postgres +DATABASE=sqlite +# The address of the mq server. If running from docker compose it will be "mq". Otherwise, need to input address. +# If using "host networking", it will find and detect the IP of the mq container. +# For EMQX websockets use `SERVER_BROKER_ENDPOINT=ws://mq:8083/mqtt` +SERVER_BROKER_ENDPOINT=ws://mq:1883 +# Logging verbosity level - 1, 2, or 3 +VERBOSITY=1 +DEBUG_MODE=off +# Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). +REST_BACKEND=on +# If turned "on", Server will not set Host based on remote IP check. +# This is already overridden if SERVER_HOST is set. Turned "off" by default. +DISABLE_REMOTE_IP_CHECK=off +# Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry. +TELEMETRY=on +### +# +# OAuth section +# +### +# only mentioned domains will be allowded to signup using oauth, by default all domains are allowed +ALLOWED_EMAIL_DOMAINS=* +# "" +AUTH_PROVIDER= +# "" +CLIENT_ID= +# "" +CLIENT_SECRET= +# "https://dashboard." +FRONTEND_URL= +# "" +AZURE_TENANT= +# https://oidc.yourprovider.com - URL of oidc provider +OIDC_ISSUER= +# Duration of JWT token validity in seconds +JWT_VALIDITY_DURATION=43200 +# Allow a user to connect to multiple networks simultaneously +RAC_RESTRICT_TO_SINGLE_NETWORK=false +# if turned on data will be cached on to improve performance significantly (IMPORTANT: If HA set to `false` ) +CACHING_ENABLED=true +# if turned on netclient checks if peers are reachable over private/LAN address, and choose that as peer endpoint +ENDPOINT_DETECTION=true +# config for sending emails +# mail server host +SMTP_HOST=smtp.gmail.com +# mail server port +SMTP_PORT=587 +# sender email +EMAIL_SENDER_ADDR= +# sender smtp user, if unset sender email will be used +EMAIL_SENDER_USER= +# sender smtp password +EMAIL_SENDER_PASSWORD= +# default domain for internal DNS lookup +DEFAULT_DOMAIN=nm.internal +# managed dns setting, set to true to resolve dns entries on netmaker network +MANAGE_DNS=true +# set to true, old acl is supported, otherwise, old acl is disabled +OLD_ACL_SUPPORT=true +# if STUN is set to true, hole punch is called +STUN=true +# Metrics Collection Port +METRICS_PORT=51821 +# Metrics Collection interval in minutes +PUBLISH_METRIC_INTERVAL=15 +PROMETHEUS_HOST=http://prometheus:9090 #https://prometheus.${NM_DOMAIN} +NETMAKER_METRICS_TARGET=http://netmaker-exporter:8085 #https://netmaker-exporter.${NM_DOMAIN} +METRICS_SECRET= + + + diff --git a/deploy/vendor/nm-quick.sh b/deploy/vendor/nm-quick.sh new file mode 100644 index 0000000..48782af --- /dev/null +++ b/deploy/vendor/nm-quick.sh @@ -0,0 +1,1222 @@ +#!/bin/bash + +CONFIG_FILE=netmaker.env +# location of nm-quick.sh (usually `/root`) +SCRIPT_DIR=$(dirname "$(realpath "$0")") +# all netmaker assets (configs, compose files, etc.) go into netmaker subfolder +if [ "$(basename "$SCRIPT_DIR")" = "netmaker" ]; then + INSTALL_DIR="$SCRIPT_DIR" +else + INSTALL_DIR="$SCRIPT_DIR/netmaker" +fi +# Legacy flat install: compose lived in SCRIPT_DIR (e.g. /root) instead of SCRIPT_DIR/netmaker. +# Prefer the directory that actually contains docker-compose.yml so -m / upgrade paths match the running stack. +if [ ! -f "$INSTALL_DIR/docker-compose.yml" ] && [ -f "$SCRIPT_DIR/docker-compose.yml" ]; then + INSTALL_DIR="$SCRIPT_DIR" +fi +CONFIG_PATH="$INSTALL_DIR/$CONFIG_FILE" +NM_QUICK_VERSION="1.0.0" +#LATEST=$(curl -s https://api.github.com/repos/gravitl/netmaker/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d [:space:],\") +LATEST=v1.5.1 +BRANCH=master +if [ $(id -u) -ne 0 ]; then + echo "This script must be run as root" + exit 1 +fi + + + +# increase the timeouts +export DOCKER_CLIENT_TIMEOUT=120 +export COMPOSE_HTTP_TIMEOUT=120 +unset INSTALL_TYPE +unset BUILD_TAG +unset IMAGE_TAG +unset NETMAKER_BASE_DOMAIN +unset UPGRADE_FLAG +unset COLLECT_PRO_VARS +INSTALL_MONITORING="${INSTALL_MONITORING:-off}" +# usage - displays usage instructions +usage() { + echo "nm-quick.sh v$NM_QUICK_VERSION" + echo "usage: ./nm-quick.sh [-c]" + echo " -c if specified, will install netmaker community version" + echo " -p if specified, will install netmaker pro version" + echo " -m if specified, will install netmaker pro with monitoring stack (Prometheus, Grafana, Exporter); requires at least 2 GB RAM and 2 vCPUs" + echo " with an existing install, -m alone only adds monitoring; use -p -m for a full Pro+monitoring re-install" + echo " -u if specified, will upgrade netmaker to pro version" + echo " -d if specified, will downgrade netmaker to community version" + exit 1 +} + + + +# print_logo - prints the netmaker logo +print_logo() { + cat <<"EOF" +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + __ __ ______ ______ __ __ ______ __ __ ______ ______ +/\ "-.\ \ /\ ___\ /\__ _\ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \ +\ \ \-. \ \ \ __\ \/_/\ \/ \ \ \-./\ \ \ \ __ \ \ \ _"-. \ \ __\ \ \ __< + \ \_\\"\_\ \ \_____\ \ \_\ \ \_\ \ \_\ \ \_\ \_\ \ \_\ \_\ \ \_____\ \ \_\ \_\ + \/_/ \/_/ \/_____/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/ + + +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +EOF +} + +# set_buildinfo - sets the information based on script input for how the installation should be run +set_buildinfo() { + + + + BUILD_TAG=$LATEST + IMAGE_TAG=$(sed 's/\//-/g' <<<"$BUILD_TAG") + + if [ -z "$INSTALL_TYPE" ]; then + echo "-----------------------------------------------------" + echo "Would you like to install Netmaker Community Edition (CE), or Netmaker Enterprise Edition (pro)?" + echo "pro will require you to create an account at https://app.netmaker.io" + echo "-----------------------------------------------------" + select install_option in "Community Edition" "Enterprise Edition"; do + case $REPLY in + 1) + echo "installing Netmaker CE" + INSTALL_TYPE="ce" + break + ;; + 2) + echo "installing Netmaker pro" + INSTALL_TYPE="pro" + break + ;; + *) echo "invalid option $REPLY" ;; + esac + done + fi + echo "-----------Build Options-----------------------------" + echo " Pro or CE: $INSTALL_TYPE" + echo " Build Tag: $BUILD_TAG" + echo " Image Tag: $IMAGE_TAG" + echo " Installer: v$NM_QUICK_VERSION" + echo "-----------------------------------------------------" + +} + +# install_yq - install yq if not present +install_yq() { + if [ -f /etc/debian_version ]; then + if ! command -v yq &>/dev/null; then + wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.31.1/yq_linux_$(dpkg --print-architecture) + chmod +x /usr/bin/yq + fi + fi + set +e + if ! command -v yq &>/dev/null; then + set -e + wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.31.1/yq_linux_amd64 + chmod +x /usr/bin/yq + fi + set -e + if ! command -v yq &>/dev/null; then + echo "failed to install yq. Please install yq and try again." + echo "https://github.com/mikefarah/yq/#install" + exit 1 + fi +} + +# setup_netclient - adds netclient to docker-compose +setup_netclient() { + + set +e + if [ -x "$(command -v netclient)" ]; then + netclient uninstall + fi + set -e + + mkdir -p "$INSTALL_DIR" + wget -qO "$INSTALL_DIR/netclient" https://github.com/gravitl/netclient/releases/download/$LATEST/netclient-linux-$ARCH + chmod +x "$INSTALL_DIR/netclient" + "$INSTALL_DIR/netclient" install + echo "Register token: $TOKEN" + sleep 2 + netclient join -t $TOKEN + + echo "waiting for netclient to become available" + local found=false + local file=/etc/netclient/nodes.json + for ((a = 1; a <= 90; a++)); do + if [ -f "$file" ]; then + found=true + break + fi + sleep 3 + done + + if [ "$found" = false ]; then + echo "Error - $file state not matching" + exit 1 + fi +} + +# configure_netclient - configures server's netclient as a default host and an ingress gateway +configure_netclient() { + sleep 2 + # NODE_ID=$(sudo cat /etc/netclient/nodes.json | jq -r .netmaker.id) + # if [ "$NODE_ID" = "" ] || [ "$NODE_ID" = "null" ]; then + # echo "Error obtaining NODE_ID for the new network" + # exit 1 + # fi + # echo "register complete. New node ID: $NODE_ID" + HOST_ID=$(sudo cat /etc/netclient/netclient.json | jq -r .id) + if [ "$HOST_ID" = "" ] || [ "$HOST_ID" = "null" ]; then + echo "Error obtaining HOST_ID for the new network" + exit 1 + fi + echo "making host a default" + echo "Host ID: $HOST_ID" + # set as a default host + set +e + GET_RESPONSE=$(curl -s -w "\n%{http_code}" -X GET "https://api.${NETMAKER_BASE_DOMAIN}/api/hosts/${HOST_ID}" \ + -H "Authorization: Bearer ${MASTER_KEY}" \ + -H "Content-Type: application/json") + GET_HTTP_CODE=$(echo "$GET_RESPONSE" | tail -n1) + HOST_JSON=$(echo "$GET_RESPONSE" | head -n -1) + if [ "$GET_HTTP_CODE" != "200" ]; then + echo "Warning: failed to fetch host (HTTP $GET_HTTP_CODE), skipping set default" + else + UPDATED_HOST_JSON=$(echo "$HOST_JSON" | jq '.Response | .isdefault = true') + PUT_HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X PUT "https://api.${NETMAKER_BASE_DOMAIN}/api/hosts/${HOST_ID}" \ + -H "Authorization: Bearer ${MASTER_KEY}" \ + -H "Content-Type: application/json" \ + -d "$UPDATED_HOST_JSON") + if [ "$PUT_HTTP_CODE" != "200" ]; then + echo "Warning: failed to set host as default (HTTP $PUT_HTTP_CODE), skipping" + fi + fi + sleep 5 + # nmctl node create_remote_access_gateway netmaker $NODE_ID + # sleep 2 + # # set failover + # if [ "$INSTALL_TYPE" = "pro" ]; then + # #setup failOver + # curl --location --request POST "https://api.${NETMAKER_BASE_DOMAIN}/api/v1/node/${NODE_ID}/failover" --header "Authorization: Bearer ${MASTER_KEY}" + # fi + set -e +} + +# setup_nmctl - pulls nmctl and makes it executable +setup_nmctl() { + + local URL="https://github.com/gravitl/netmaker/releases/download/$LATEST/nmctl-linux-$ARCH" + echo "Downloading nmctl..." + wget -qO /usr/bin/nmctl "$URL" + + if [ ! -f /usr/bin/nmctl ]; then + echo "Error downloading nmctl from '$URL'" + exit 1 + fi + + chmod +x /usr/bin/nmctl + echo "using server api.$NETMAKER_BASE_DOMAIN" + nmctl context set default --endpoint="https://api.$NETMAKER_BASE_DOMAIN" --master_key="$MASTER_KEY" + nmctl context use default + RESP=$(nmctl network list) + if [[ $RESP == *"unauthorized"* ]]; then + echo "Unable to properly configure NMCTL, exiting..." + exit 1 + fi +} + +# wait_seconds - wait for the specified period of time +wait_seconds() { ( + for ((a = 1; a <= $1; a++)); do + echo ". . ." + sleep 1 + done +); } + +# confirm - get user input to confirm that they want to perform the next step +confirm() { ( + while true; do + read -p 'Does everything look right? [y/n]: ' yn + case $yn in + [Yy]*) + override="true" + break + ;; + [Nn]*) + echo "exiting..." + exit 1 + # TODO start from the beginning instead + ;; + *) echo "Please answer yes or no." ;; + esac + done +) } + + +save_config() { ( + echo "Saving the config to $CONFIG_PATH" + touch "$CONFIG_PATH" + if [ -n "$EMAIL" ]; then + save_config_item NM_EMAIL "$EMAIL" + fi + if [ -n "$NETMAKER_BASE_DOMAIN" ]; then + save_config_item NM_DOMAIN "$NETMAKER_BASE_DOMAIN" + save_config_item FRONTEND_URL "https://dashboard.$NETMAKER_BASE_DOMAIN" + fi + save_config_item UI_IMAGE_TAG "$IMAGE_TAG" + # version-specific entries + if [ "$INSTALL_TYPE" = "pro" ]; then + save_config_item NETMAKER_TENANT_ID "$NETMAKER_TENANT_ID" + save_config_item LICENSE_KEY "$LICENSE_KEY" + save_config_item METRICS_EXPORTER "$INSTALL_MONITORING" + save_config_item SERVER_IMAGE_TAG "$IMAGE_TAG-ee" + else + save_config_item METRICS_EXPORTER "off" + save_config_item SERVER_IMAGE_TAG "$IMAGE_TAG" + fi + # copy entries from the previous config + local toCopy=("SERVER_HOST" "SERVER_HOST6" "MASTER_KEY" "MQ_USERNAME" "MQ_PASSWORD" "LICENSE_KEY" "NETMAKER_TENANT_ID" + "INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT" "MANAGE_DNS" "DEFAULT_DOMAIN" + "CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "VERBOSITY" + "DEBUG_MODE" "REST_BACKEND" "DISABLE_REMOTE_IP_CHECK" "TELEMETRY" "ALLOWED_EMAIL_DOMAINS" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET" + "FRONTEND_URL" "AZURE_TENANT" "OIDC_ISSUER" "EXPORTER_API_PORT" "JWT_VALIDITY_DURATION" "RAC_RESTRICT_TO_SINGLE_NETWORK" "CACHING_ENABLED" "ENDPOINT_DETECTION" + "SMTP_HOST" "SMTP_PORT" "EMAIL_SENDER_ADDR" "EMAIL_SENDER_USER" "EMAIL_SENDER_PASSWORD" "METRICS_SECRET" "PROMETHEUS_HOST" "NETMAKER_METRICS_TARGET") + for name in "${toCopy[@]}"; do + save_config_item $name "${!name}" + done + # preserve debug entries + if test -n "$NM_SKIP_BUILD"; then + save_config_item NM_SKIP_BUILD "$NM_SKIP_BUILD" + fi + if test -n "$NM_SKIP_CLONE"; then + save_config_item NM_SKIP_CLONE "$NM_SKIP_CLONE" + fi + if test -n "$NM_SKIP_DEPS"; then + save_config_item NM_SKIP_DEPS "$NM_SKIP_DEPS" + fi +); } + +save_config_item() { ( + local NAME="$1" + local VALUE="$2" + #echo "$NAME=$VALUE" + if test -z "$VALUE"; then + # load the default for empty values (check install dir first, then legacy) + local defaults_file="$INSTALL_DIR/netmaker.default.env" + [ -f "$defaults_file" ] || defaults_file="$SCRIPT_DIR/netmaker.default.env" + if [ -f "$defaults_file" ]; then + VALUE=$(awk -F'=' "/^$NAME/ { print \$2}" "$defaults_file") + fi + # trim quotes for docker + VALUE=$(echo "$VALUE" | sed -E "s|^(['\"])(.*)\1$|\2|g") + #echo "Default for $NAME=$VALUE" + fi + # TODO single quote passwords + if grep -q "^$NAME=" "$CONFIG_PATH"; then + # TODO escape | in the value + sed -i "s|$NAME=.*|$NAME=$VALUE|" "$CONFIG_PATH" + else + echo "$NAME=$VALUE" >>"$CONFIG_PATH" + fi +); } + + + +# install_dependencies - install necessary packages to run netmaker +install_dependencies() { + + if test -n "$NM_SKIP_DEPS"; then + return + fi + + echo "checking dependencies..." + + OS=$(uname) + if [ -f /etc/debian_version ]; then + dependencies="git wireguard-tools dnsutils jq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin grep gawk" + update_cmd='apt update' + install_cmd='apt-get install -y' + elif [ -f /etc/alpine-release ]; then + dependencies="git wireguard jq docker.io docker-compose grep gawk" + update_cmd='apk update' + install_cmd='apk --update add' + elif [ -f /etc/centos-release ]; then + dependencies="wget git wireguard-tools jq bind-utils docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin grep gawk" + update_cmd='yum updateinfo' + install_cmd='yum install -y' + elif [ -f /etc/amazon-linux-release ]; then + dependencies="git wireguard-tools bind-utils jq docker grep gawk" + update_cmd='yum updateinfo' + install_cmd='yum install -y' + elif [ -f /etc/fedora-release ]; then + dependencies="wget git wireguard-tools bind-utils jq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin grep gawk" + update_cmd='dnf updateinfo' + install_cmd='dnf install -y' + elif [ -f /etc/redhat-release ]; then + dependencies="wget git wireguard-tools jq bind-utils docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin grep gawk" + update_cmd='yum updateinfo' + install_cmd='yum install -y' + elif [ -f /etc/arch-release ]; then + dependencies="git wireguard-tools dnsutils jq docker.io docker-compose grep gawk" + update_cmd='pacman -Sy' + install_cmd='pacman -S --noconfirm' + elif [ "${OS}" = "FreeBSD" ]; then + dependencies="git wireguard wget jq docker.io docker-compose grep gawk" + update_cmd='pkg update' + install_cmd='pkg install -y' + else + echo "-----------------------nm-quick.sh----------------------------------------------" + echo "OS supported and tested include:" + echo " Debian" + echo " Ubuntu" + echo " Fedora" + echo " Centos" + echo " Redhat" + echo " Amazon Linux" + echo " Rocky Linux" + echo " AlmaLinux" + + echo "Your OS system is not in the support list, please chanage to an OS in the list" + echo "--------------------------------------------------------------------------------" + exit 1 + fi + + if [ -z "${install_cmd}" ]; then + echo "OS unsupported for automatic dependency install" + # TODO shouldnt exit, check if deps available, if not + # ask the user to install manually and continue when ready + exit 1 + fi + # TODO add other supported architectures + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + ARCH=amd64 + elif [ "$ARCH" = "aarch64" ]; then + ARCH=arm64 + else + echo "Unsupported architechure" + # exit 1 + fi + + # setup docker repository + if [ "$(cat /etc/*-release |grep ubuntu |wc -l)" -gt 0 ]; then + apt update + apt install -y ca-certificates curl + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt update + elif [ "$(cat /etc/*-release |grep debian |wc -l)" -gt 0 ]; then + apt update + apt install -y ca-certificates curl + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt update + elif [ -f /etc/fedora-release ]; then + dnf -y install dnf-plugins-core + dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + elif [ -f /etc/centos-release ]; then + yum install -y yum-utils + yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + if [ "$(cat /etc/*-release |grep 'release 8' |wc -l)" -gt 0 ]; then + yum install -y elrepo-release epel-release + elif [ "$(cat /etc/*-release |grep 'release 7' |wc -l)" -gt 0 ]; then + yum install -y elrepo-release epel-release + yum install -y yum-plugin-elrepo + fi + elif [ -f /etc/redhat-release ]; then + yum install -y yum-utils + yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + if [ "$(cat /etc/*-release |grep 'release 8' |wc -l)" -gt 0 ]; then + yum install -y elrepo-release epel-release + fi + fi + + set -- $dependencies + + ${update_cmd} + + while [ -n "$1" ]; do + if [ "${OS}" = "FreeBSD" ]; then + is_installed=$(pkg check -d $1 | grep "Checking" | grep "done") + if [ "$is_installed" != "" ]; then + echo " " $1 is installed + else + echo " " $1 is not installed. Attempting install. + ${install_cmd} $1 + sleep 5 + is_installed=$(pkg check -d $1 | grep "Checking" | grep "done") + if [ "$is_installed" != "" ]; then + echo " " $1 is installed + elif [ -x "$(command -v $1)" ]; then + echo " " $1 is installed + else + echo " " FAILED TO INSTALL $1 + echo " " This may break functionality. + fi + fi + else + if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then + is_installed=$(opkg list-installed $1 | grep $1) + elif [ -f /etc/debian_version ]; then + is_installed=$(dpkg-query -W --showformat='${Status}\n' $1 | grep "install ok installed") + else + is_installed=$(yum list installed | grep $1) + fi + if [ "${is_installed}" != "" ]; then + echo " " $1 is installed + else + echo " " $1 is not installed. Attempting install. + ${install_cmd} $1 + sleep 5 + if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then + is_installed=$(opkg list-installed $1 | grep $1) + elif [ -f /etc/debian_version ]; then + is_installed=$(dpkg-query -W --showformat='${Status}\n' $1 | grep "install ok installed") + else + is_installed=$(yum list installed | grep $1) + fi + if [ "${is_installed}" != "" ]; then + echo " " $1 is installed + elif [ -x "$(command -v $1)" ]; then + echo " " $1 is installed + else + echo " " FAILED TO INSTALL $1 + echo " " This may break functionality. + fi + fi + fi + shift + done + + # Startup docker daemon for OS which does not start it automatically + if [ -f /etc/fedora-release ]; then + systemctl start docker + systemctl enable docker + elif [ -f /etc/amazon-linux-release ]; then + systemctl start docker + systemctl enable docker + usermod -a -G docker ec2-user + mkdir -p /usr/local/lib/docker/cli-plugins + curl -sL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) \ + -o /usr/local/lib/docker/cli-plugins/docker-compose + chown root:root /usr/local/lib/docker/cli-plugins/docker-compose + chmod +x /usr/local/lib/docker/cli-plugins/docker-compose + elif [ -f /etc/centos-release ]; then + systemctl start docker + systemctl enable docker + elif [ -f /etc/redhat-release ]; then + systemctl start docker + systemctl enable docker + fi + + echo "-----------------------------------------------------" + echo "dependency check complete" + echo "-----------------------------------------------------" +} +set -e + +# set_install_vars - sets the variables that will be used throughout installation +set_install_vars() { + + IP_ADDR=$(curl -s -4 --connect-timeout 5 --max-time 15 api64.ipify.org || echo "") + IP6_ADDR=$(curl -s -6 --connect-timeout 5 --max-time 15 api64.ipify.org || echo "") + NETMAKER_BASE_DOMAIN="${NETMAKER_BASE_DOMAIN:-$NM_DOMAIN}" + if [ "$NETMAKER_BASE_DOMAIN" = "" ]; then + NETMAKER_BASE_DOMAIN=nm.$(echo $IP_ADDR | tr . -).nip.io + fi + SERVER_HOST=$IP_ADDR + SERVER_HOST6=$IP6_ADDR + if [ "$IP_ADDR" = "" ]; then + SERVER_HOST=$IP6_ADDR + fi + if test -z "$MASTER_KEY"; then + MASTER_KEY=$( + tr -dc A-Za-z0-9 &1) + + if [[ "$i" == 8 ]]; then + echo " Caddy is having an issue setting up certificates, please investigate (docker logs caddy)" + echo " Exiting..." + exit 1 + elif [[ "$curlresponse" == *"failed to verify the legitimacy of the server"* ]]; then + echo " Certificates not yet configured, retrying..." + + elif [[ "$curlresponse" == *"left intact"* ]]; then + echo " Certificates ok" + break + else + secs=$(($i * 5 + 10)) + echo " Issue establishing connection...retrying in $secs seconds..." + fi + sleep $secs + done + +} + +# setup_mesh - sets up a default mesh network on the server +setup_mesh() { + + wait_seconds 5 + # networks=$(nmctl network list -o json) + # if [[ ${networks} != "null" ]]; then + # netmakerNet=$(nmctl network list -o json | jq -r '.[] | .netid' | grep -w "netmaker") + # fi + # # create netmaker network + # if [[ ${netmakerNet} = "" ]]; then + # echo "Creating netmaker network (100.64.0.0/16)" + # # TODO causes "Error Status: 400 Response: {"Code":400,"Message":"could not find any records"}" + # nmctl network create --name netmaker --ipv4_addr 100.64.0.0/16 + # fi + # create enrollment key for netmaker network + local netmakerTag=$(nmctl enrollment_key list | jq -r '.[] | .tags[0]' | grep -w "firstJoinKey") + if [[ ${netmakerTag} = "" ]]; then + nmctl enrollment_key create --tags firstJoinKey --unlimited + fi + echo "Obtaining enrollment key..." + # key exists already, fetch token + TOKEN=$(nmctl enrollment_key list | jq -r '.[] | select(.tags[0]=="firstJoinKey") | .token') + wait_seconds 3 +} + +# print_success - prints a success message upon completion +print_success() { + echo "-----------------------------------------------------------------" + echo "-----------------------------------------------------------------" + echo "Netmaker setup is now complete. You are ready to begin using Netmaker." + echo "Visit dashboard.$NETMAKER_BASE_DOMAIN to log in" + echo "" + echo "Installation files are located in: $INSTALL_DIR" + if [ "$INSTALL_TYPE" = "pro" ] && [ "$INSTALL_MONITORING" != "on" ]; then + echo "" + echo "To add the monitoring stack (Prometheus, Grafana, Exporter), re-run:" + echo " sudo ./nm-quick.sh -m" + echo "NOTE: The monitoring stack requires at least 2 GB of RAM and 2 vCPUs." + fi + echo "-----------------------------------------------------------------" + echo "-----------------------------------------------------------------" +} + +cleanup() { + # remove the existing netclient's instance from the existing network (skip when reusing saved config) + if [ "${REUSE_EXISTING_CONFIG:-0}" -eq 1 ]; then + echo "Keeping existing netclient registration (reusing saved configuration)." + else + if ! command -v netclient >/dev/null 2>&1; then + return + fi + if command -v nmctl >/dev/null 2>&1; then + local node_id=$(netclient list | jq '.[0].node_id' 2>/dev/null) + node_id="${node_id//\"/}" + if test -n "$node_id"; then + echo "De-registering the existing netclient..." + nmctl node delete netmaker $node_id >/dev/null 2>&1 + fi + fi + fi + + stop_services +} + +stop_services(){ + echo "Stopping all containers, this will take a while please wait..." + local containers=("mq" "netmaker-ui" "coredns" "turn" "caddy" "netmaker" "netmaker-exporter" "prometheus" "grafana") + for name in "${containers[@]}"; do + local running=$(docker ps | grep -w "$name") + local exists=$(docker ps -a | grep -w "$name") + if test -n "$running"; then + docker stop "$name" 1>/dev/null + fi + if test -n "$exists"; then + docker rm "$name" 1>/dev/null + fi + done +} + +upgrade() { + print_logo + unset IMAGE_TAG + unset BUILD_TAG + IMAGE_TAG=$UI_IMAGE_TAG + semver=$(chsv_check_version_ex "$UI_IMAGE_TAG") + if [[ ! "$semver" ]]; then + BUILD_TAG=$LATEST + else + BUILD_TAG=$UI_IMAGE_TAG + fi + echo "-----------------------------------------------------" + echo "Provide Details for pro installation:" + echo " 1. Log into https://app.netmaker.io" + echo " 2. follow instructions to get a license at: https://docs.netmaker.io/docs/server-installation/netmaker-professional-setup" + echo " 3. Retrieve License and Tenant ID" + echo "-----------------------------------------------------" + unset LICENSE_KEY + while [ -z "$LICENSE_KEY" ]; do + read -p "License Key: " LICENSE_KEY + done + unset NETMAKER_TENANT_ID + while [ -z ${NETMAKER_TENANT_ID} ]; do + read -p "Tenant ID: " NETMAKER_TENANT_ID + done + mkdir -p "$INSTALL_DIR" + CONFIG_PATH="$INSTALL_DIR/$CONFIG_FILE" + # migrate config from legacy location if needed + if [ ! -f "$CONFIG_PATH" ] && [ -f "$SCRIPT_DIR/$CONFIG_FILE" ]; then + cp "$SCRIPT_DIR/$CONFIG_FILE" "$CONFIG_PATH" + fi + save_config + # start docker and rebuild containers / networks + stop_services + install_netmaker +} + +downgrade () { + print_logo + unset IMAGE_TAG + unset BUILD_TAG + IMAGE_TAG=$UI_IMAGE_TAG + + semver=$(chsv_check_version_ex "$UI_IMAGE_TAG") + if [[ ! "$semver" ]]; then + BUILD_TAG=$LATEST + else + BUILD_TAG=$UI_IMAGE_TAG + fi + mkdir -p "$INSTALL_DIR" + CONFIG_PATH="$INSTALL_DIR/$CONFIG_FILE" + # migrate config from legacy location if needed + if [ ! -f "$CONFIG_PATH" ] && [ -f "$SCRIPT_DIR/$CONFIG_FILE" ]; then + cp "$SCRIPT_DIR/$CONFIG_FILE" "$CONFIG_PATH" + fi + save_config + if [ -a "$INSTALL_DIR"/docker-compose.override.yml ]; then + rm -f "$INSTALL_DIR"/docker-compose.override.yml + fi + # start docker and rebuild containers / networks + stop_services + install_netmaker +} + +add_monitoring() { + print_logo + echo "Adding monitoring stack (Prometheus, Grafana, Exporter)..." + echo "" + + INSTALL_MONITORING="on" + INSTALL_TYPE="pro" + + mkdir -p "$INSTALL_DIR" + CONFIG_PATH="$INSTALL_DIR/$CONFIG_FILE" + if [ ! -f "$CONFIG_PATH" ] && [ -f "$SCRIPT_DIR/$CONFIG_FILE" ]; then + cp "$SCRIPT_DIR/$CONFIG_FILE" "$CONFIG_PATH" + fi + + unset IMAGE_TAG + unset BUILD_TAG + IMAGE_TAG=$UI_IMAGE_TAG + semver=$(chsv_check_version_ex "$UI_IMAGE_TAG") + if [[ ! "$semver" ]]; then + BUILD_TAG=$LATEST + else + BUILD_TAG=$UI_IMAGE_TAG + fi + + local BASE_URL="https://raw.githubusercontent.com/gravitl/netmaker/$BRANCH" + + # re-download the full pro override (with monitoring services intact) + wget -qO "$INSTALL_DIR"/docker-compose.override.yml "$BASE_URL/compose/docker-compose.pro.yml" + + # download Caddyfile-pro (with monitoring reverse-proxy entries) + wget -qO "$INSTALL_DIR"/Caddyfile "$BASE_URL/docker/Caddyfile-pro" + + # download Grafana assets + mkdir -p "$INSTALL_DIR/grafana" + local GRAFANA_BASE="https://downloads.netmaker.io/assests/grafana" + wget -qO "$INSTALL_DIR/grafana/dashboard-config.yaml" "$GRAFANA_BASE/dashboard-config.yaml" + wget -qO "$INSTALL_DIR/grafana/dashboard.json" "$GRAFANA_BASE/dashboard.json" + wget -qO "$INSTALL_DIR/grafana/datasource.yaml" "$GRAFANA_BASE/datasource.yaml" + wget -qO "$INSTALL_DIR/grafana/grafana.ini" "$GRAFANA_BASE/grafana.ini" + + # download Prometheus config + mkdir -p "$INSTALL_DIR/prometheus" + wget -qO "$INSTALL_DIR/prometheus/prometheus.yml" "https://downloads.netmaker.io/assests/prometheus/prometheus.yml" + + # update METRICS_EXPORTER in config + save_config_item METRICS_EXPORTER "on" + + # restart services + stop_services + echo "Starting containers..." + cd "${INSTALL_DIR}" + docker compose up -d --force-recreate + cd - + + echo "" + echo "-----------------------------------------------------------------" + echo "Monitoring stack has been added successfully." + echo " Grafana: https://grafana.${NM_DOMAIN}" + echo " Exporter: https://netmaker-exporter.${NM_DOMAIN}" + echo "-----------------------------------------------------------------" +} + +function chsv_check_version() { + if [[ $1 =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then + echo "$1" + else + echo "" + fi +} + +function chsv_check_version_ex() { + if [[ $1 =~ ^v.+$ ]]; then + chsv_check_version "${1:1}" + else + chsv_check_version "${1}" + fi +} + + + +main (){ + + EXISTING_CONFIG_LOADED=0 + REUSE_EXISTING_CONFIG=0 + + # read the config (check netmaker folder first, then legacy script dir for upgrades) + if [ -f "$INSTALL_DIR/$CONFIG_FILE" ]; then + CONFIG_PATH="$INSTALL_DIR/$CONFIG_FILE" + echo "Using config: $CONFIG_PATH" + source "$CONFIG_PATH" + EXISTING_CONFIG_LOADED=1 + elif [ -f "$SCRIPT_DIR/$CONFIG_FILE" ]; then + CONFIG_PATH="$SCRIPT_DIR/$CONFIG_FILE" + echo "Using config: $CONFIG_PATH (legacy location)" + source "$CONFIG_PATH" + EXISTING_CONFIG_LOADED=1 + fi + + # Detect -p and -m together (any order, including -pm) so we can run full Pro+monitoring install + # instead of add_monitoring+exit when netmaker.env already exists. + OPTIND=1 + HAS_P=0 + HAS_M=0 + while getopts :cudpmv flag; do + case "${flag}" in + p) HAS_P=1 ;; + m) HAS_M=1 ;; + esac + done + OPTIND=1 + + if [ "$HAS_M" -eq 1 ]; then + echo "NOTE: The monitoring stack requires at least 2 GB of RAM and 2 vCPUs." + echo "" + fi + + INSTALL_TYPE="ce" + while getopts :cudpmv flag; do + case "${flag}" in + c) + INSTALL_TYPE="ce" + ;; + u) + echo "upgrading to pro version..." + INSTALL_TYPE="pro" + UPGRADE_FLAG="yes" + upgrade + exit 0 + ;; + d) + echo "downgrading to community version..." + INSTALL_TYPE="ce" + downgrade + exit 0 + ;; + p) + echo "installing pro version..." + INSTALL_TYPE="pro" + COLLECT_PRO_VARS="true" + ;; + m) + if [ -f "$INSTALL_DIR/$CONFIG_FILE" ] || [ -f "$SCRIPT_DIR/$CONFIG_FILE" ]; then + if [ "$HAS_P" -eq 1 ] && [ "$HAS_M" -eq 1 ]; then + echo "installing pro version with monitoring stack (full install)..." + INSTALL_TYPE="pro" + INSTALL_MONITORING="on" + COLLECT_PRO_VARS="true" + else + add_monitoring + exit 0 + fi + else + echo "installing pro version with monitoring stack..." + INSTALL_TYPE="pro" + INSTALL_MONITORING="on" + COLLECT_PRO_VARS="true" + fi + ;; + v) + usage + exit 0 + ;; + esac +done + + # 1. print netmaker logo + print_logo + + # 2. setup the build instructions + set_buildinfo + set +e + # 3. install necessary packages + install_dependencies + + # 4. install yq if necessary + install_yq + + set -e + + # 6. get user input for variables + if [ "$EXISTING_CONFIG_LOADED" -eq 1 ]; then + echo "-----------------------------------------------------" + echo "Existing installation config found at $CONFIG_PATH." + echo "Choose how to continue:" + select reuse_option in "Keep existing settings from the config file" "Reconfigure (enter domain, email, and license prompts again)"; do + case $REPLY in + 1) + REUSE_EXISTING_CONFIG=1 + break + ;; + 2) + REUSE_EXISTING_CONFIG=0 + break + ;; + *) echo "invalid option $REPLY" ;; + esac + done + echo "-----------------------------------------------------" + fi + + if [ "$REUSE_EXISTING_CONFIG" -eq 1 ]; then + set_install_vars_reuse + else + set_install_vars + fi + + set +e + cleanup + set -e + + # 7. get and set config files, startup docker-compose + install_netmaker + + set +e + + # 8. make sure Caddy certs are working + test_connection + + # 9. install the netmaker CLI + setup_nmctl + + # 10. create a default mesh network for netmaker + setup_mesh + + set -e + + # 11–12. netclient: skip reinstall/join when reusing an existing netmaker.env + if [ "$REUSE_EXISTING_CONFIG" -eq 1 ]; then + echo "Skipping netclient setup and host configuration (reusing saved configuration)." + else + setup_netclient + configure_netclient + fi + + # 13. print success message + print_success +} + +main "${@}" \ No newline at end of file diff --git a/desgin/home_vpn_mobile_1/code.html b/desgin/home_vpn_mobile_1/code.html new file mode 100644 index 0000000..1224337 --- /dev/null +++ b/desgin/home_vpn_mobile_1/code.html @@ -0,0 +1,240 @@ + + + + + +NetGuard Workspace - Connecting + + + + + + + + + + +
+
+
+
+Profile +
+

NetGuard Workspace

+
+ +
+
+
+ +
+ +
+ +
+ + +
+
+

Connecting...

+
+

Fetching VPN Token...

+

Joining netclient...

+
+
+
+ +
+ +
+
+
+USA Flag +
+
+

Selected Node

+

Silicon Valley, USA

+
+
+chevron_right +
+ +
+

Protocol

+
+ +

WireGuard

+
+
+ +
+

New IP

+
+
+ +
+
+arrow_downward +

0.0 Kb/s

+
+
+
+arrow_upward +

0.0 Kb/s

+
+
+
+timer +

00:00:00

+
+
+
+
+ + + \ No newline at end of file diff --git a/desgin/home_vpn_mobile_1/screen.png b/desgin/home_vpn_mobile_1/screen.png new file mode 100644 index 0000000..14abd95 Binary files /dev/null and b/desgin/home_vpn_mobile_1/screen.png differ diff --git a/desgin/home_vpn_mobile_2/code.html b/desgin/home_vpn_mobile_2/code.html new file mode 100644 index 0000000..7cf9dac --- /dev/null +++ b/desgin/home_vpn_mobile_2/code.html @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + +
+
+
+User +
+
+

NetGuard Workspace

+ +
+ +
+ +
+
+ + + Disconnected + +
+

Tap to secure your connection

+
+ +
+ + + +
+ +
+
+
+
+Germany +
+
+Frankfurt, Germany + +signal_cellular_alt + Optimal Latency (24ms) + +
+
+chevron_right +
+
+ +
+ +
+
+schedule +Duration +
+
00:00:00
+
+ +
+
+database +Data Usage +
+
0.00 MB
+
+
+ +
+info +
+Privacy Shield +

Your IP address is currently visible to websites and trackers.

+
+
+
+ + + +
+Map +
+ \ No newline at end of file diff --git a/desgin/home_vpn_mobile_2/screen.png b/desgin/home_vpn_mobile_2/screen.png new file mode 100644 index 0000000..7acbf04 Binary files /dev/null and b/desgin/home_vpn_mobile_2/screen.png differ diff --git a/desgin/home_vpn_mobile_3/code.html b/desgin/home_vpn_mobile_3/code.html new file mode 100644 index 0000000..c726ea9 --- /dev/null +++ b/desgin/home_vpn_mobile_3/code.html @@ -0,0 +1,242 @@ + + + + + +NetGuard Workspace - Connected + + + + + + + + + + +
+
+
+User Profile +
+

NetGuard Workspace

+
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+
+

VPN Connected

+
+

Secure tunnel established via WireGuard

+
+
+ +
+
+
+

Virtual IP Address

+

10.8.0.42

+
+
+vpn_lock +
+
+
+ +
+ +
+
+schedule +Uptime +
+

04:12:15

+
+ +
+
+speed +Transfer Speed +
+

1.2 MB/s

+
+
+ +
+
+

Recent Activity

+ +
+
+ +
+
+laptop_mac +
+
+

MacBook Pro 16"

+

Connected 5m ago • Office

+
+check_circle +
+ +
+
+smartphone +
+
+

iPhone 15 Pro

+

Connected 12m ago • Mobile

+
+check_circle +
+
+
+
+ + + \ No newline at end of file diff --git a/desgin/home_vpn_mobile_3/screen.png b/desgin/home_vpn_mobile_3/screen.png new file mode 100644 index 0000000..148d111 Binary files /dev/null and b/desgin/home_vpn_mobile_3/screen.png differ diff --git a/desgin/home_vpn_mobile_4/code.html b/desgin/home_vpn_mobile_4/code.html new file mode 100644 index 0000000..6886a4c --- /dev/null +++ b/desgin/home_vpn_mobile_4/code.html @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + +
+
+
+User profile picture +
+

NetGuard Workspace

+
+ +
+
+ +
+
+error +
+
+

Netclient not detected

+

Please install Netmaker netclient to continue. This is required to establish a secure connection.

+
+ + +
+
+
+ +
+
+link_off +
+close +
+
+
+

Disconnected

+

Connection unavailable

+
+ + +
+ +
+
+System Diagnostics +
+
+
+
+
+
+
+
+[14:22:01] +INFO +Initializing NetGuard Core... +
+
+[14:22:02] +INFO +Searching for netclient binary in /usr/local/bin +
+
+[14:22:02] +ERROR +netclient command not found +
+
+[14:22:03] +WARN +Kernel modules for WireGuard not loaded +
+
+[14:22:05] +Waiting for status check... _ +
+
+
+ +
+
+
+help +
+
Get Help
+
View troubleshooting
+
+
+
+upload_file +
+
Export Logs
+
For support ticket
+
+
+
+ + + +
+ \ No newline at end of file diff --git a/desgin/home_vpn_mobile_4/screen.png b/desgin/home_vpn_mobile_4/screen.png new file mode 100644 index 0000000..8e1a5e3 Binary files /dev/null and b/desgin/home_vpn_mobile_4/screen.png differ diff --git a/desgin/professional_vpn_system/DESIGN.md b/desgin/professional_vpn_system/DESIGN.md new file mode 100644 index 0000000..0cc3d0a --- /dev/null +++ b/desgin/professional_vpn_system/DESIGN.md @@ -0,0 +1,171 @@ +--- +name: Professional VPN System +colors: + surface: '#f8f9ff' + surface-dim: '#d7dae2' + surface-bright: '#f8f9ff' + surface-container-lowest: '#ffffff' + surface-container-low: '#f1f3fc' + surface-container: '#ebeef6' + surface-container-high: '#e5e8f0' + surface-container-highest: '#dfe2eb' + on-surface: '#181c22' + on-surface-variant: '#424655' + inverse-surface: '#2d3137' + inverse-on-surface: '#eef1f9' + outline: '#737687' + outline-variant: '#c3c6d8' + surface-tint: '#0053db' + primary: '#0050d6' + on-primary: '#ffffff' + primary-container: '#2a6af9' + on-primary-container: '#fefcff' + inverse-primary: '#b4c5ff' + secondary: '#006e16' + on-secondary: '#ffffff' + secondary-container: '#6bfd6a' + on-secondary-container: '#007317' + tertiary: '#9e3e00' + on-tertiary: '#ffffff' + tertiary-container: '#c64f00' + on-tertiary-container: '#fffbff' + error: '#ba1a1a' + on-error: '#ffffff' + error-container: '#ffdad6' + on-error-container: '#93000a' + primary-fixed: '#dbe1ff' + primary-fixed-dim: '#b4c5ff' + on-primary-fixed: '#00174b' + on-primary-fixed-variant: '#003ea8' + secondary-fixed: '#72ff70' + secondary-fixed-dim: '#4ee253' + on-secondary-fixed: '#002203' + on-secondary-fixed-variant: '#00530e' + tertiary-fixed: '#ffdbcc' + tertiary-fixed-dim: '#ffb695' + on-tertiary-fixed: '#351000' + on-tertiary-fixed-variant: '#7b2e00' + background: '#f8f9ff' + on-background: '#181c22' + surface-variant: '#dfe2eb' +typography: + display: + fontFamily: Inter + fontSize: 32px + fontWeight: '600' + lineHeight: 40px + letterSpacing: -0.02em + h1: + fontFamily: Inter + fontSize: 24px + fontWeight: '600' + lineHeight: 32px + h2: + fontFamily: Inter + fontSize: 20px + fontWeight: '600' + lineHeight: 28px + body-lg: + fontFamily: Inter + fontSize: 16px + fontWeight: '400' + lineHeight: 24px + body-md: + fontFamily: Inter + fontSize: 14px + fontWeight: '400' + lineHeight: 22px + label-md: + fontFamily: Inter + fontSize: 14px + fontWeight: '500' + lineHeight: 20px + label-sm: + fontFamily: Inter + fontSize: 12px + fontWeight: '500' + lineHeight: 18px + caption: + fontFamily: Inter + fontSize: 12px + fontWeight: '400' + lineHeight: 18px +rounded: + sm: 0.25rem + DEFAULT: 0.5rem + md: 0.75rem + lg: 1rem + xl: 1.5rem + full: 9999px +spacing: + xs: 4px + sm: 8px + md: 16px + lg: 24px + xl: 32px + xxl: 48px +--- + +## Brand & Style + +The brand personality of the design system is anchored in **Enterprise-grade Reliability** and **Transparent Utility**. It is designed to feel less like a "utility tool" and more like a high-performance "productivity workspace." The interface must evoke a sense of calm, security, and effortless control, moving away from the aggressive aesthetics of consumer VPNs toward a sophisticated, collaborative atmosphere. + +The design style is a blend of **Corporate Modern** and **Minimalism**. It prioritizes clarity through generous whitespace, high-contrast functional elements, and a structured information architecture. The emotional response should be one of "silent protection"—the software remains unobtrusive in the workflow while remaining instantly legible when interaction is required. + +## Colors + +The color system is built around "Feishu Blue" (#3370FF) to represent intelligence and stability. The palette utilizes a clean, high-brightness white base to maintain the "workspace" feel, supported by a sophisticated range of cool grays. + +- **Primary Blue:** Used for primary actions, active states, and branding. +- **Semantic Connectivity:** The system uses a strict traffic-light logic for connection status. The "Connected" state uses a vibrant green (#00B42A), while "Disconnected" uses a crisp red (#F53F3F). +- **Surface Grays:** The background uses a slightly off-white gray (#F5F6F7) to reduce eye strain, while cards and primary containers use pure white to pop from the background. +- **Text Contrast:** Text colors are tiered to ensure deep legibility, with the primary text using a near-black gray (#1F2329) rather than pure black. + +## Typography + +The typography system utilizes **Inter** for its exceptional legibility on digital screens and its neutral, systematic character. The hierarchy is designed to highlight connectivity status and server locations at a glance. + +- **Display & Headlines:** Used for connection status (e.g., "Connected") and primary headers. Tightened letter spacing is used for larger sizes to maintain a professional, compact feel. +- **Body Text:** Standardized at 14px for the majority of UI interactions to align with enterprise software standards. +- **Labels:** Medium weights (500) are used for interactive UI elements like button text and navigation items to distinguish them from static body content. +- **Data Mono (Optional):** While Inter is the primary font, numerical data like IP addresses or latency (ms) should prioritize clarity and alignment. + +## Layout & Spacing + +The layout follows a **Fixed-Fluid Hybrid** model typical of professional desktop clients. A fixed-width left sidebar handles navigation, while the main content area utilizes a fluid grid that expands to fill the window. + +- **The 8px Rhythm:** All margins, paddings, and component heights must be increments of 8px (or 4px for tight internal component spacing). +- **Whitespace:** Emphasize generous internal padding within cards (24px) to create the "Lark" workspace feel, ensuring the UI never feels cramped even when displaying complex technical data. +- **Alignment:** Content is generally left-aligned to mimic document reading patterns, with the exception of the "Connect" toggle which may be centered for focus. + +## Elevation & Depth + +This design system uses **Tonal Layering** supplemented by **Ambient Shadows** to establish hierarchy. + +- **Base Layer:** The application background is the lowest level (#F5F6F7), acting as the canvas. +- **Surface Layer:** Main content areas and sidebar segments use pure white or slightly darker grays to distinguish functional zones. +- **Shadows:** Use extremely soft, diffused shadows to lift cards from the background. Shadows should have a large blur (16px+) and very low opacity (4-8%), utilizing a slight blue tint (#1F2329 with 0.05 opacity) rather than pure black to maintain a clean aesthetic. +- **Interactions:** On hover, buttons and interactive cards should transition with a subtle elevation increase or a soft inner-glow to provide tactile feedback without visual clutter. + +## Shapes + +The shape language is defined by "Soft Geometry." Rounded corners are used consistently to make the enterprise tool feel approachable and modern. + +- **Standard Components:** Buttons, input fields, and server list items use an 8px radius. +- **Container Elements:** Main content cards and the central connection module use a 12px radius to anchor the visual experience. +- **Circular Elements:** Toggle switches and status indicators (dots) use full "pill" rounding. +- **Borders:** Use thin (1px) borders in soft grays (#DEE0E3) instead of heavy shadows to define boundaries, maintaining a flat, professional look. + +## Components + +Components in this design system follow a minimalist, high-functionality philosophy: + +- **Buttons:** + - *Primary:* Solid #3370FF with white text; 8px corners. + - *Secondary:* Ghost style with 1px border (#DEE0E3) and primary text. + - *Connectivity Toggle:* A large, distinct button or switch that changes color significantly (Green vs Red) based on state. +- **Input Fields:** Flat design with a subtle light gray background (#F5F6F7). On focus, the border transitions to Primary Blue with a soft 2px glow. +- **Lists (Server Selection):** Clean rows with 14px typography. Include a thin-stroke country flag or icon, name, and a signal strength indicator (3-4 vertical bars). +- **Chips/Badges:** Small, rounded-pill shapes used for protocol labels (e.g., "WireGuard", "OpenVPN") using low-saturation background tints of the primary blue. +- **Cards:** Used to group connection details (IP, Duration, Data Used). Cards should have a 12px radius and a very subtle shadow to differentiate them from the background. +- **Icons:** Use thin-stroke (1.5px) linear icons. Icons should be monochrome (Secondary Text color) unless they represent a specific active status. \ No newline at end of file diff --git a/docs/next-todos.md b/docs/next-todos.md new file mode 100644 index 0000000..0655dc8 --- /dev/null +++ b/docs/next-todos.md @@ -0,0 +1,68 @@ +# AbyssInfo VPN 下次待办 + +## 当前状态 + +- Netmaker CE 已部署在火山引擎服务器 `101.96.214.81`。 +- Django API 已部署并由 Caddy 反代: + - 健康检查:`https://vpn-api.nm.101-96-214-81.sslip.io/health/` + - 飞书 OAuth 回调:`https://vpn-api.nm.101-96-214-81.sslip.io/auth/feishu/callback` + - 飞书事件校验:`https://vpn-api.nm.101-96-214-81.sslip.io/auth/feishu/event-callback` +- Netmaker 网络已创建:`homevpn`,网段 `100.88.0.0/24`。 +- 飞书 App ID/Secret 已写入后端 `.env`,登录 URL 接口已验证。 +- Tauri 客户端已支持 Windows 托盘和 macOS 菜单栏常驻。 + +## 重要账号和地址 + +- Netmaker Dashboard:`https://dashboard.nm.101-96-214-81.nip.io` +- Netmaker API:`https://api.nm.101-96-214-81.nip.io` +- Netmaker Broker:`wss://broker.nm.101-96-214-81.nip.io` +- Django API:`https://vpn-api.nm.101-96-214-81.sslip.io` +- SSH:`ssh -i E:\ai\homeVpn\codex.pem root@101.96.214.81` + +## 下次优先处理 + +1. 安装 Windows netclient,并确认 `netclient status` 可执行。 +2. 用 AbyssInfo VPN 客户端完成飞书登录。 +3. 点击“一键连接 VPN”,验证后端能签发 Netmaker enrollment token,客户端能成功 `netclient join`。 +4. 收敛 Netmaker Dashboard 公网暴露风险: + - 推荐关闭公网 Dashboard,只通过 SSH 隧道访问。 + - 或至少给 Dashboard 加 Basic Auth / 安全组白名单。 +5. 梳理备案和正式域名方案: + - 正式生产域名建议备案后替换 `*.nip.io`。 + - 换域名后同步更新 Netmaker、Django `.env`、飞书回调地址和客户端构建配置。 + +## 常用命令 + +```powershell +# 检查服务器环境 +cmd /c deploy\00_check_server.bat + +# 检查 Netmaker +cmd /c deploy\03_check_netmaker.bat + +# 检查 Django API +cmd /c deploy\08_check_api.bat + +# 部署 Django API +cmd /c deploy\07_deploy_api.bat + +# 前端构建 +cd apps\desktop +npm run build + +# Rust 检查 +cd apps\desktop\src-tauri +cargo check + +# Tauri 打包 +cd apps\desktop +npm run tauri:build +``` + +## 当前客户端要求 + +- App 首屏必须是飞书登录界面。 +- 未登录时不展示 VPN 连接按钮,也不检测 netclient。 +- 登录成功后才进入 VPN 主界面。 +- VPN 主界面使用手机端单列布局。 +- App 图标使用蓝白 VPN 图标。 diff --git a/docs/project-structure.md b/docs/project-structure.md new file mode 100644 index 0000000..c8dc1bc --- /dev/null +++ b/docs/project-structure.md @@ -0,0 +1,45 @@ +# 项目业务目录层级 + +## 后端:Django + SQLite + +```text +services/api/ + manage.py + requirements.txt + .env.example + config/ Django 项目配置、路由、ASGI/WSGI + common/ 通用鉴权、响应、工具函数 + accounts/ 飞书登录、用户模型、JWT 签发 + services/ + feishu_oauth.py 飞书 OAuth 登录地址和回调辅助逻辑 + jwt_service.py JWT 签发与解析 + vpn/ VPN 设备、连接 token、审计日志 + services/ + device_service.py 设备绑定和连接 token 发放 + netmaker_client.py Netmaker API 客户端封装 +``` + +数据库使用 Django 内置 SQLite,配置位于 `services/api/config/settings.py`: + +```python +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", + } +} +``` + +## 前端:Tauri + Vue 选项式 + Vite + +```text +apps/desktop/ + src/ + api/ 后端接口封装 + services/ 客户端业务服务 + stores/ 本地状态读写 + views/ Vue 页面,使用 Options API + src-tauri/ + src/commands/ Rust 命令,调用 netclient + src/tray.rs Windows 托盘和 macOS 菜单栏常驻逻辑 +``` diff --git a/docs/resume-after-domain-icp.md b/docs/resume-after-domain-icp.md new file mode 100644 index 0000000..d35e760 --- /dev/null +++ b/docs/resume-after-domain-icp.md @@ -0,0 +1,222 @@ +# AbyssInfo VPN 域名备案后续接记录 + +记录时间:2026-04-28 + +当前开发先暂停,等待正式域名备案完成后继续。本文用于下次重新进入项目时快速恢复上下文。 + +## 当前状态 + +- 项目根目录:`E:\ai\homeVpn` +- 服务端:Django + SQLite +- 桌面端:Tauri + Vue Options API + Vite +- 云服务器公网 IP:`101.96.214.81` +- SSH 私钥路径:`E:\ai\homeVpn\codex.pem` +- 远端应用目录:`/opt/abyssinfo-home-vpn` +- 当前临时 API 域名:`https://vpn-api.nm.101-96-214-81.sslip.io` +- 当前 Netmaker 域名仍使用:`*.nm.101-96-214-81.nip.io` + +## 暂停原因 + +本机访问 `https://vpn-api.nm.101-96-214-81.sslip.io` 时 TLS 会被重置,导致 Tauri 端显示: + +```text +Failed to fetch +``` + +测试证据: + +```text +HTTP/1.1 302 OK +Server: Suzaku +Location: https://webblock.volcengine.com +``` + +判断原因: + +- 火山引擎大陆节点对公网 `80/443` 的 Web 域名访问存在备案/接入限制。 +- `sslip.io` / `nip.io` 这类临时解析域名不是正式备案域名,公网访问容易被拦截。 +- HTTP 会被重定向到 `webblock.volcengine.com`。 +- HTTPS 在 TLS 握手阶段被直接断开,所以客户端表现为 TLS reset / `Failed to fetch`。 +- 服务器内部访问 Django API 正常,不是 Django、Caddy、Tauri 代码本身的问题。 + +## 当前临时开发方案 + +为了绕过公网 Web 入口拦截,当前本地开发使用 SSH 隧道: + +```powershell +ssh -i E:\ai\homeVpn\codex.pem -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -N -L 18000:127.0.0.1:8000 root@101.96.214.81 +``` + +前端本地配置: + +```env +VITE_API_BASE_URL=http://127.0.0.1:18000 +VITE_VPN_NETWORK_NAME=homevpn +``` + +对应文件: + +```text +apps/desktop/.env.local +``` + +注意:这个测试方式依赖后台 `ssh.exe` 隧道进程,关闭后前端就无法访问远端 Django API。 + +## 已完成的重要改动 + +- Tauri App 名称已改为 `AbyssInfo VPN`。 +- 登录页要求先飞书登录,再进入 VPN 连接页面。 +- 前端改成移动端样式布局。 +- Windows / macOS 托盘常驻已加入。 +- 自定义标题栏已启用,禁用了系统标题栏。 +- 服务器已部署 Netmaker。 +- 服务器已部署 Django API。 +- 后端数据库使用 SQLite。 +- 后端飞书 token 链路已改为官方 v1 方式: + - 先通过 `app_id/app_secret` 获取 `app_access_token` + - 再用 OAuth `code` 换 `user_access_token` +- 已在服务器验证 `app_access_token` 获取成功。 +- 前端构建通过。 +- Django API 在服务器部署时 `manage.py check` 通过。 + +## 不能写入文档的敏感信息 + +以下内容不要写入 Markdown 或提交仓库: + +- 飞书 `appSecret` +- Netmaker 管理 token +- JWT secret +- Django secret key +- 任何 enrollment key / VPN 入网 token + +这些值目前在本地和服务器 `.env` 文件中维护。 + +## 备案完成后需要替换的配置 + +假设正式域名为: + +```text +api.example.com +dashboard.example.com +netmaker-api.example.com +broker.example.com +``` + +实际继续时按备案后的域名替换。 + +需要更新: + +1. `deploy/config.bat` + +```bat +set "API_DOMAIN=正式 API 域名" +set "API_LEGACY_DOMAIN=旧临时域名或留空后清理" +set "NETMAKER_BASE_DOMAIN=正式 Netmaker 基础域名" +``` + +2. 前端配置 + +```text +apps/desktop/.env +apps/desktop/.env.local +``` + +把临时隧道地址恢复为正式 HTTPS API: + +```env +VITE_API_BASE_URL=https://正式 API 域名 +``` + +3. 飞书开放平台 + +在飞书应用后台配置回调地址: + +```text +https://正式 API 域名/auth/feishu/callback +``` + +4. 服务器 Django `.env` + +部署脚本会根据 `deploy/config.bat` 自动生成: + +```env +FEISHU_REDIRECT_URI=https://正式 API 域名/auth/feishu/callback +DJANGO_ALLOWED_HOSTS=... +CORS_ALLOWED_ORIGINS=... +``` + +5. Caddy / Netmaker 域名 + +需要将 Netmaker 相关入口从 `nip.io` 迁到正式域名,包括: + +```text +dashboard +api +broker +vpn-api +``` + +## 备案完成后的建议执行顺序 + +1. 确认正式域名 DNS A 记录都指向 `101.96.214.81`。 +2. 确认火山引擎备案和接入状态已生效。 +3. 修改 `deploy/config.bat`。 +4. 修改 `apps/desktop/.env` 和 `.env.local`。 +5. 在飞书开放平台配置正式回调地址。 +6. 执行 Django API 部署: + +```powershell +cmd /c deploy\07_deploy_api.bat +``` + +7. 验证正式域名公网访问: + +```powershell +curl.exe -vk https://正式 API 域名/health/ +``` + +8. 重启 Tauri 开发客户端: + +```powershell +cd apps\desktop +npm run tauri:dev +``` + +9. 扫码登录测试: + +- App 启动后应显示飞书扫码二维码。 +- 扫码后飞书回调应进入 Django。 +- Django 将 `DesktopLoginSession` 状态从 `pending` 改为 `authenticated`。 +- 前端轮询成功后进入 VPN 连接页。 + +## 下次继续时优先检查 + +```powershell +Get-Content .\apps\desktop\.env.local +Get-Content .\deploy\config.bat +``` + +```powershell +ssh -i E:\ai\homeVpn\codex.pem root@101.96.214.81 "systemctl status abyssinfo-api --no-pager" +``` + +```powershell +ssh -i E:\ai\homeVpn\codex.pem root@101.96.214.81 "cd /opt/abyssinfo-home-vpn/api && tail -n 80 .env" +``` + +如继续排查扫码状态,可在服务器查询最近会话: + +```powershell +ssh -i E:\ai\homeVpn\codex.pem root@101.96.214.81 @' +cd /opt/abyssinfo-home-vpn/api +/opt/abyssinfo-home-vpn/.venv-api/bin/python manage.py shell <<'PY' +from accounts.models import DesktopLoginSession +for s in DesktopLoginSession.objects.order_by('-created_at')[:10]: + print(s.session_id, s.status, s.error, s.created_at.isoformat(), s.updated_at.isoformat()) +PY +'@ +``` + +## 当前结论 + +开发暂停点不是业务代码问题,而是临时域名在火山引擎大陆公网 `80/443` 上被拦截。备案正式域名完成后,优先恢复正式 HTTPS 域名访问,再继续扫码登录和 VPN 连接联调。 diff --git a/scripts/download-netclient-assets.bat b/scripts/download-netclient-assets.bat new file mode 100644 index 0000000..349ad81 --- /dev/null +++ b/scripts/download-netclient-assets.bat @@ -0,0 +1,2 @@ +@echo off +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0download-netclient-assets.ps1" diff --git a/scripts/download-netclient-assets.ps1 b/scripts/download-netclient-assets.ps1 new file mode 100644 index 0000000..cf2e5fb --- /dev/null +++ b/scripts/download-netclient-assets.ps1 @@ -0,0 +1,64 @@ +$ErrorActionPreference = "Stop" + +$ProjectRoot = Resolve-Path (Join-Path $PSScriptRoot "..") +$AssetRoot = Join-Path $ProjectRoot "apps\desktop\src-tauri\resources\netclient" +$Curl = Get-Command curl.exe -ErrorAction SilentlyContinue +if (-not $Curl) { + $Curl = Get-Command curl -ErrorAction Stop +} + +$Assets = @( + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/netclientbundle.exe" + Path = "windows\netclientbundle.exe" + }, + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/netclient-windows-amd64.exe" + Path = "windows\netclient-windows-amd64.exe" + }, + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/Netclient-M1.pkg" + Path = "macos\Netclient-M1.pkg" + }, + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/Netclient-Intel.pkg" + Path = "macos\Netclient-Intel.pkg" + }, + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/netclient-darwin-arm64" + Path = "macos\netclient-darwin-arm64" + }, + @{ + Url = "https://fileserver.netmaker.io/releases/download/latest/netclient-darwin-amd64" + Path = "macos\netclient-darwin-amd64" + } +) + +New-Item -ItemType Directory -Force -Path (Join-Path $AssetRoot "windows") | Out-Null +New-Item -ItemType Directory -Force -Path (Join-Path $AssetRoot "macos") | Out-Null + +foreach ($Asset in $Assets) { + $Target = Join-Path $AssetRoot $Asset.Path + $TargetDir = Split-Path -Parent $Target + New-Item -ItemType Directory -Force -Path $TargetDir | Out-Null + + Write-Host "Downloading $($Asset.Url)" + & $Curl.Source -L --fail --retry 3 --retry-delay 2 -o $Target $Asset.Url +} + +$MacBinaries = @( + (Join-Path $AssetRoot "macos\netclient-darwin-arm64"), + (Join-Path $AssetRoot "macos\netclient-darwin-amd64") +) + +foreach ($Binary in $MacBinaries) { + if (Test-Path $Binary) { + try { + chmod +x $Binary + } catch { + Write-Host "Skip chmod on $Binary" + } + } +} + +Write-Host "Netclient assets are ready in $AssetRoot" diff --git a/services/api/.env.example b/services/api/.env.example new file mode 100644 index 0000000..786a321 --- /dev/null +++ b/services/api/.env.example @@ -0,0 +1,21 @@ +DJANGO_SECRET_KEY=change-me +DJANGO_DEBUG=true +DJANGO_ALLOWED_HOSTS=127.0.0.1,localhost +CORS_ALLOWED_ORIGINS=http://localhost:5173,tauri://localhost + +FEISHU_APP_ID= +FEISHU_APP_SECRET= +FEISHU_REDIRECT_URI=http://127.0.0.1:8000/auth/feishu/callback +FEISHU_EVENT_VERIFICATION_TOKEN= +TAURI_DEEP_LINK_SCHEME=myvpn + +JWT_SECRET=change-me-too +JWT_EXPIRES_SECONDS=604800 +OAUTH_STATE_EXPIRES_SECONDS=300 +LOGIN_CODE_EXPIRES_SECONDS=120 + +NETMAKER_BASE_URL= +NETMAKER_API_TOKEN= +NETMAKER_NETWORK_ID= +NETMAKER_ENROLLMENT_TAGS=homevpn,desktop,vpn +NETMAKER_ENROLLMENT_TTL_SECONDS=600 diff --git a/services/api/accounts/__init__.py b/services/api/accounts/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/accounts/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/accounts/admin.py b/services/api/accounts/admin.py new file mode 100644 index 0000000..a6f4d5a --- /dev/null +++ b/services/api/accounts/admin.py @@ -0,0 +1,22 @@ +from django.contrib import admin + +from .models import LoginCode, OAuthState, User + + +@admin.register(User) +class UserAdmin(admin.ModelAdmin): + list_display = ("id", "name", "email", "feishu_open_id", "status", "created_at") + search_fields = ("name", "email", "feishu_open_id") + list_filter = ("status",) + + +@admin.register(OAuthState) +class OAuthStateAdmin(admin.ModelAdmin): + list_display = ("id", "state", "used_at", "expires_at", "created_at") + search_fields = ("state",) + + +@admin.register(LoginCode) +class LoginCodeAdmin(admin.ModelAdmin): + list_display = ("id", "user", "used_at", "expires_at", "created_at") + search_fields = ("code", "user__name", "user__email") diff --git a/services/api/accounts/apps.py b/services/api/accounts/apps.py new file mode 100644 index 0000000..e8819c7 --- /dev/null +++ b/services/api/accounts/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class AccountsConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "accounts" + diff --git a/services/api/accounts/migrations/0001_initial.py b/services/api/accounts/migrations/0001_initial.py new file mode 100644 index 0000000..de1139e --- /dev/null +++ b/services/api/accounts/migrations/0001_initial.py @@ -0,0 +1,59 @@ +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="User", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("feishu_open_id", models.CharField(max_length=128, unique=True)), + ("email", models.EmailField(blank=True, max_length=254)), + ("name", models.CharField(blank=True, max_length=128)), + ( + "status", + models.CharField( + choices=[("active", "Active"), ("disabled", "Disabled")], + default="active", + max_length=16, + ), + ), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("updated_at", models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name="OAuthState", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("state", models.CharField(max_length=128, unique=True)), + ("used_at", models.DateTimeField(blank=True, null=True)), + ("expires_at", models.DateTimeField()), + ("created_at", models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name="LoginCode", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("code", models.CharField(max_length=128, unique=True)), + ("used_at", models.DateTimeField(blank=True, null=True)), + ("expires_at", models.DateTimeField()), + ("created_at", models.DateTimeField(auto_now_add=True)), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="login_codes", + to="accounts.user", + ), + ), + ], + ), + ] + diff --git a/services/api/accounts/migrations/0002_desktoploginsession.py b/services/api/accounts/migrations/0002_desktoploginsession.py new file mode 100644 index 0000000..f49ca04 --- /dev/null +++ b/services/api/accounts/migrations/0002_desktoploginsession.py @@ -0,0 +1,29 @@ +# Generated by Django 5.2.13 on 2026-04-28 03:08 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='DesktopLoginSession', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('session_id', models.CharField(max_length=128, unique=True)), + ('state', models.CharField(max_length=128, unique=True)), + ('status', models.CharField(choices=[('pending', 'Pending'), ('authenticated', 'Authenticated'), ('failed', 'Failed'), ('expired', 'Expired')], default='pending', max_length=24)), + ('error', models.CharField(blank=True, max_length=255)), + ('expires_at', models.DateTimeField()), + ('authenticated_at', models.DateTimeField(blank=True, null=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='desktop_login_sessions', to='accounts.user')), + ], + ), + ] diff --git a/services/api/accounts/migrations/__init__.py b/services/api/accounts/migrations/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/accounts/migrations/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/accounts/models.py b/services/api/accounts/models.py new file mode 100644 index 0000000..59bc578 --- /dev/null +++ b/services/api/accounts/models.py @@ -0,0 +1,73 @@ +from django.db import models +from django.utils import timezone + + +class User(models.Model): + STATUS_ACTIVE = "active" + STATUS_DISABLED = "disabled" + + STATUS_CHOICES = ( + (STATUS_ACTIVE, "Active"), + (STATUS_DISABLED, "Disabled"), + ) + + feishu_open_id = models.CharField(max_length=128, unique=True) + email = models.EmailField(blank=True) + name = models.CharField(max_length=128, blank=True) + status = models.CharField(max_length=16, choices=STATUS_CHOICES, default=STATUS_ACTIVE) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self) -> str: + return self.name or self.email or self.feishu_open_id + + +class OAuthState(models.Model): + state = models.CharField(max_length=128, unique=True) + used_at = models.DateTimeField(null=True, blank=True) + expires_at = models.DateTimeField() + created_at = models.DateTimeField(auto_now_add=True) + + @property + def is_valid(self) -> bool: + return self.used_at is None and self.expires_at > timezone.now() + + +class LoginCode(models.Model): + code = models.CharField(max_length=128, unique=True) + user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="login_codes") + used_at = models.DateTimeField(null=True, blank=True) + expires_at = models.DateTimeField() + created_at = models.DateTimeField(auto_now_add=True) + + @property + def is_valid(self) -> bool: + return self.used_at is None and self.expires_at > timezone.now() + + +class DesktopLoginSession(models.Model): + STATUS_PENDING = "pending" + STATUS_AUTHENTICATED = "authenticated" + STATUS_FAILED = "failed" + STATUS_EXPIRED = "expired" + + STATUS_CHOICES = ( + (STATUS_PENDING, "Pending"), + (STATUS_AUTHENTICATED, "Authenticated"), + (STATUS_FAILED, "Failed"), + (STATUS_EXPIRED, "Expired"), + ) + + session_id = models.CharField(max_length=128, unique=True) + state = models.CharField(max_length=128, unique=True) + user = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL, related_name="desktop_login_sessions") + status = models.CharField(max_length=24, choices=STATUS_CHOICES, default=STATUS_PENDING) + error = models.CharField(max_length=255, blank=True) + expires_at = models.DateTimeField() + authenticated_at = models.DateTimeField(null=True, blank=True) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + @property + def is_expired(self) -> bool: + return self.expires_at <= timezone.now() diff --git a/services/api/accounts/services/__init__.py b/services/api/accounts/services/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/accounts/services/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/accounts/services/feishu_oauth.py b/services/api/accounts/services/feishu_oauth.py new file mode 100644 index 0000000..a04f4ef --- /dev/null +++ b/services/api/accounts/services/feishu_oauth.py @@ -0,0 +1,273 @@ +import secrets +from datetime import timedelta +from urllib.parse import parse_qs, urlencode, urljoin, urlparse + +import requests +from django.conf import settings +from django.db import transaction +from django.utils import timezone + +from accounts.models import DesktopLoginSession, LoginCode, OAuthState, User + +AUTHORIZE_URL = "https://open.feishu.cn/open-apis/authen/v1/index" +QR_AUTHORIZE_URL = "https://passport.feishu.cn/suite/passport/oauth/authorize" +TOKEN_URL = "https://open.feishu.cn/open-apis/authen/v2/oauth/token" +APP_ACCESS_TOKEN_URL = "https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal" +USER_ACCESS_TOKEN_URL = "https://open.feishu.cn/open-apis/authen/v1/access_token" +USER_INFO_URL = "https://open.feishu.cn/open-apis/authen/v1/user_info" + + +def build_login_url() -> dict: + state = secrets.token_urlsafe(24) + OAuthState.objects.create( + state=state, + expires_at=timezone.now() + timedelta(seconds=settings.OAUTH_STATE_EXPIRES_SECONDS), + ) + params = { + "app_id": settings.FEISHU_APP_ID, + "redirect_uri": settings.FEISHU_REDIRECT_URI, + "state": state, + } + return {"url": f"{AUTHORIZE_URL}?{urlencode(params)}", "state": state} + + +def build_qr_login_config() -> dict: + state = secrets.token_urlsafe(24) + OAuthState.objects.create( + state=state, + expires_at=timezone.now() + timedelta(seconds=settings.OAUTH_STATE_EXPIRES_SECONDS), + ) + params = { + "client_id": settings.FEISHU_APP_ID, + "redirect_uri": settings.FEISHU_REDIRECT_URI, + "response_type": "code", + "state": state, + } + return { + "goto": f"{QR_AUTHORIZE_URL}?{urlencode(params)}", + "state": state, + "expires_in": settings.OAUTH_STATE_EXPIRES_SECONDS, + } + + +def build_qr_goto(state: str) -> str: + params = { + "client_id": settings.FEISHU_APP_ID, + "redirect_uri": settings.FEISHU_REDIRECT_URI, + "response_type": "code", + "state": state, + } + return f"{QR_AUTHORIZE_URL}?{urlencode(params)}" + + +def exchange_tmp_code_for_oauth_code(tmp_code: str, state: str) -> str: + authorize_url = f"{build_qr_goto(state)}&tmp_code={tmp_code}" + session = requests.Session() + url = authorize_url + last_location = "" + + for _ in range(6): + response = session.get( + url, + allow_redirects=False, + headers={"User-Agent": "Mozilla/5.0 AbyssInfoVPN/0.1"}, + timeout=10, + ) + if response.status_code not in (301, 302, 303, 307, 308): + raise ValueError(f"feishu_tmp_code_error:{response.status_code}") + + location = response.headers.get("Location", "") + if not location: + raise ValueError("missing_feishu_redirect_location") + + last_location = urljoin(url, location) + parsed = urlparse(last_location) + query = parse_qs(parsed.query) + returned_state = (query.get("state") or [""])[0] + code = (query.get("code") or [""])[0] + error = (query.get("error") or query.get("error_description") or [""])[0] + + if returned_state and returned_state != state: + raise ValueError("invalid_feishu_redirect_state") + if code: + return code + if error: + raise ValueError(f"feishu_oauth_error:{error}") + + if last_location.startswith(settings.FEISHU_REDIRECT_URI): + break + url = last_location + + raise ValueError(f"missing_feishu_oauth_code:{last_location[:180]}") + + +def create_desktop_login_session() -> DesktopLoginSession: + state = secrets.token_urlsafe(24) + expires_at = timezone.now() + timedelta(seconds=settings.OAUTH_STATE_EXPIRES_SECONDS) + OAuthState.objects.create(state=state, expires_at=expires_at) + return DesktopLoginSession.objects.create( + session_id=secrets.token_urlsafe(32), + state=state, + expires_at=expires_at, + ) + + +def build_tauri_callback(login_code: str, state: str) -> str: + return f"{settings.TAURI_DEEP_LINK_SCHEME}://login-success?code={login_code}&state={state}" + + +def verify_state(state: str) -> None: + oauth_state = OAuthState.objects.filter(state=state).first() + if oauth_state is None or not oauth_state.is_valid: + raise ValueError("invalid_state") + oauth_state.used_at = timezone.now() + oauth_state.save(update_fields=["used_at"]) + + +def raise_feishu_error(response: requests.Response, fallback: str) -> None: + try: + body = response.json() + except ValueError: + body = {"raw": response.text[:300]} + message = body.get("msg") or body.get("error_description") or body.get("error") or str(body) + raise ValueError(f"{fallback}:{response.status_code}:{message}") + + +def fetch_app_access_token() -> str: + payload = { + "app_id": settings.FEISHU_APP_ID, + "app_secret": settings.FEISHU_APP_SECRET, + } + response = requests.post(APP_ACCESS_TOKEN_URL, json=payload, timeout=10) + if not response.ok: + raise_feishu_error(response, "feishu_app_token_http_error") + body = response.json() + if body.get("code") not in (0, None): + raise ValueError(body.get("msg") or "feishu_app_token_error") + app_access_token = body.get("app_access_token") or (body.get("data") or {}).get("app_access_token") + if not app_access_token: + raise ValueError("missing_feishu_app_access_token") + return app_access_token + + +def exchange_code_for_access_token(code: str) -> str: + app_access_token = fetch_app_access_token() + payload = { + "grant_type": "authorization_code", + "code": code, + } + response = requests.post( + USER_ACCESS_TOKEN_URL, + json=payload, + headers={"Authorization": f"Bearer {app_access_token}"}, + timeout=10, + ) + if not response.ok: + raise_feishu_error(response, "feishu_user_token_http_error") + body = response.json() + if body.get("code") not in (0, None): + raise ValueError(body.get("msg") or "feishu_user_token_error") + data = body.get("data") or body + access_token = data.get("access_token") or data.get("user_access_token") + if not access_token: + raise ValueError("missing_feishu_access_token") + return access_token + + +def fetch_user_info(access_token: str) -> dict: + response = requests.get( + USER_INFO_URL, + headers={"Authorization": f"Bearer {access_token}"}, + timeout=10, + ) + response.raise_for_status() + body = response.json() + if body.get("code") not in (0, None): + raise ValueError(body.get("msg") or "feishu_user_info_error") + return body.get("data") or body + + +def upsert_user_from_feishu(user_info: dict) -> User: + open_id = _first_text( + user_info.get("open_id"), + _nested_value(user_info, "user", "open_id"), + _nested_value(user_info, "user_id", "open_id"), + ) + if not open_id: + raise ValueError("missing_feishu_open_id") + user, _created = User.objects.update_or_create( + feishu_open_id=open_id, + defaults={ + "email": _extract_feishu_email(user_info), + "name": _extract_feishu_name(user_info), + }, + ) + return user + + +def _extract_feishu_name(user_info: dict) -> str: + return _first_text( + user_info.get("name"), + user_info.get("display_name"), + user_info.get("cn_name"), + user_info.get("nickname"), + _nested_value(user_info, "user", "name"), + _nested_value(user_info, "user", "display_name"), + _nested_value(user_info, "user", "cn_name"), + _nested_value(user_info, "user", "nickname"), + user_info.get("en_name"), + _nested_value(user_info, "user", "en_name"), + ) + + +def _extract_feishu_email(user_info: dict) -> str: + return _first_text(user_info.get("email"), _nested_value(user_info, "user", "email")) + + +def _nested_value(value: dict, *keys: str): + current = value + for key in keys: + if not isinstance(current, dict): + return None + current = current.get(key) + return current + + +def _first_text(*values) -> str: + for value in values: + text = _text_from_value(value) + if text: + return text + return "" + + +def _text_from_value(value) -> str: + if isinstance(value, str): + return value.strip() + if isinstance(value, dict): + for key in ("zh_cn", "zh-CN", "zh", "default", "name", "en_us", "en-US"): + text = _text_from_value(value.get(key)) + if text: + return text + return "" + + +def create_login_code(user: User) -> LoginCode: + return LoginCode.objects.create( + user=user, + code=secrets.token_urlsafe(32), + expires_at=timezone.now() + timedelta(seconds=settings.LOGIN_CODE_EXPIRES_SECONDS), + ) + + +@transaction.atomic +def handle_feishu_callback(code: str, state: str) -> LoginCode: + if not code: + raise ValueError("missing_code") + verify_state(state) + access_token = exchange_code_for_access_token(code) + user_info = fetch_user_info(access_token) + user = upsert_user_from_feishu(user_info) + if user.status != User.STATUS_ACTIVE: + raise PermissionError("user_disabled") + return create_login_code(user) diff --git a/services/api/accounts/services/jwt_service.py b/services/api/accounts/services/jwt_service.py new file mode 100644 index 0000000..881a215 --- /dev/null +++ b/services/api/accounts/services/jwt_service.py @@ -0,0 +1,19 @@ +from datetime import datetime, timedelta, timezone + +import jwt +from django.conf import settings + + +def issue_jwt(user_id: int) -> str: + now = datetime.now(timezone.utc) + payload = { + "sub": str(user_id), + "iat": int(now.timestamp()), + "exp": int((now + timedelta(seconds=settings.JWT_EXPIRES_SECONDS)).timestamp()), + } + return jwt.encode(payload, settings.JWT_SECRET, algorithm="HS256") + + +def decode_jwt(token: str) -> dict: + return jwt.decode(token, settings.JWT_SECRET, algorithms=["HS256"]) + diff --git a/services/api/accounts/tests.py b/services/api/accounts/tests.py new file mode 100644 index 0000000..b324190 --- /dev/null +++ b/services/api/accounts/tests.py @@ -0,0 +1,151 @@ +import json +from unittest.mock import patch + +from django.test import TestCase, override_settings + +from accounts.models import User +from accounts.services.feishu_oauth import upsert_user_from_feishu +from vpn.models import Device, VpnLog + + +class FeishuUserInfoTests(TestCase): + def test_upsert_user_prefers_chinese_display_name(self): + user = upsert_user_from_feishu( + { + "open_id": "ou_name", + "email": "chenhuan@example.com", + "name": {"zh_cn": "陈欢", "en_us": "Chen Huan"}, + "en_name": "Chen Huan", + } + ) + + self.assertEqual(user.name, "陈欢") + self.assertEqual(user.email, "chenhuan@example.com") + + def test_upsert_user_reads_nested_user_payload(self): + user = upsert_user_from_feishu( + { + "user": { + "open_id": "ou_nested", + "display_name": "陈欢", + "email": "chenhuan@example.com", + } + } + ) + + self.assertEqual(user.feishu_open_id, "ou_nested") + self.assertEqual(user.name, "陈欢") + + +@override_settings(FEISHU_EVENT_VERIFICATION_TOKEN="verify-token") +class FeishuEventCallbackTests(TestCase): + def setUp(self): + self.user = User.objects.create(feishu_open_id="ou_123", email="u@example.com", name="User") + self.device = Device.objects.create( + user=self.user, + device_name="pc-01", + device_fingerprint="fingerprint-01", + netmaker_node_id="host-01", + ) + + def test_url_verification_returns_challenge(self): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps({"token": "verify-token", "challenge": "challenge-value"}), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 200) + self.assertEqual(response.json()["challenge"], "challenge-value") + + @override_settings(FEISHU_EVENT_VERIFICATION_TOKEN="", DEBUG=False) + def test_url_verification_can_pass_before_token_is_configured(self): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps({"challenge": "challenge-value"}), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 200) + self.assertEqual(response.json()["challenge"], "challenge-value") + + @override_settings(FEISHU_EVENT_VERIFICATION_TOKEN="", DEBUG=False) + def test_real_events_require_token_in_production(self): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps( + { + "schema": "2.0", + "header": {"event_type": "contact.user.deleted_v3"}, + "event": {"object": {"open_id": "ou_123"}}, + } + ), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 403) + + @patch("vpn.services.offboarding.NetmakerClient") + def test_deleted_user_event_disables_user_and_revokes_vpn(self, client_cls): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps( + { + "schema": "2.0", + "header": { + "event_type": "contact.user.deleted_v3", + "event_id": "event-01", + "token": "verify-token", + }, + "event": {"object": {"open_id": "ou_123"}}, + } + ), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 200) + self.user.refresh_from_db() + self.device.refresh_from_db() + self.assertEqual(self.user.status, User.STATUS_DISABLED) + self.assertEqual(self.device.status, Device.STATUS_REVOKED) + client_cls.return_value.delete_node.assert_called_once_with("host-01") + self.assertTrue(VpnLog.objects.filter(user=self.user, action="user_disabled").exists()) + + @patch("vpn.services.offboarding.NetmakerClient") + def test_frozen_user_update_disables_user_and_revokes_vpn(self, client_cls): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps( + { + "schema": "2.0", + "header": { + "event_type": "contact.user.updated_v3", + "event_id": "event-02", + "token": "verify-token", + }, + "event": { + "object": { + "open_id": "ou_123", + "status": {"is_frozen": True}, + } + }, + } + ), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 200) + self.user.refresh_from_db() + self.device.refresh_from_db() + self.assertEqual(self.user.status, User.STATUS_DISABLED) + self.assertEqual(self.device.status, Device.STATUS_REVOKED) + client_cls.return_value.delete_node.assert_called_once_with("host-01") + + def test_invalid_event_token_is_rejected(self): + response = self.client.post( + "/auth/feishu/event-callback", + data=json.dumps({"token": "wrong", "challenge": "challenge-value"}), + content_type="application/json", + ) + + self.assertEqual(response.status_code, 403) diff --git a/services/api/accounts/tokens.py b/services/api/accounts/tokens.py new file mode 100644 index 0000000..d08cbaa --- /dev/null +++ b/services/api/accounts/tokens.py @@ -0,0 +1,3 @@ +from .services.jwt_service import decode_jwt, issue_jwt + +__all__ = ["decode_jwt", "issue_jwt"] diff --git a/services/api/accounts/urls.py b/services/api/accounts/urls.py new file mode 100644 index 0000000..6ee4737 --- /dev/null +++ b/services/api/accounts/urls.py @@ -0,0 +1,17 @@ +from django.urls import path + +from . import views + + +urlpatterns = [ + path("feishu/login-url", views.feishu_login_url), + path("feishu/qr-config", views.feishu_qr_config), + path("feishu/qr-page", views.feishu_qr_page), + path("feishu/callback", views.feishu_callback), + path("feishu/event-callback", views.feishu_event_callback), + path("desktop-session", views.desktop_session_create), + path("desktop-session/", views.desktop_session_status), + path("desktop-session//complete", views.desktop_session_complete), + path("desktop-session//qr-page", views.desktop_session_qr_page), + path("exchange", views.exchange), +] diff --git a/services/api/accounts/views.py b/services/api/accounts/views.py new file mode 100644 index 0000000..9be621c --- /dev/null +++ b/services/api/accounts/views.py @@ -0,0 +1,589 @@ +import json + +from django.conf import settings +from django.http import HttpRequest, JsonResponse, HttpResponse, HttpResponseBadRequest, HttpResponseRedirect +from django.utils import timezone +from django.views.decorators.clickjacking import xframe_options_exempt +from django.views.decorators.csrf import csrf_exempt +from django.views.decorators.http import require_GET, require_http_methods, require_POST + +from .models import DesktopLoginSession, LoginCode, User +from .services.feishu_oauth import ( + build_login_url, + build_qr_goto, + build_qr_login_config, + build_tauri_callback, + create_desktop_login_session, + exchange_tmp_code_for_oauth_code, + handle_feishu_callback, +) +from .services.jwt_service import issue_jwt +from vpn.services.offboarding import revoke_user_vpn_access + + +class TauriDeepLinkRedirect(HttpResponseRedirect): + allowed_schemes = HttpResponseRedirect.allowed_schemes + [settings.TAURI_DEEP_LINK_SCHEME] + + +@require_GET +def feishu_login_url(_request: HttpRequest) -> JsonResponse: + return JsonResponse(build_login_url()) + + +@require_GET +def feishu_qr_config(_request: HttpRequest) -> JsonResponse: + return JsonResponse(build_qr_login_config()) + + +@require_GET +def feishu_qr_page(_request: HttpRequest) -> HttpResponse: + config = build_qr_login_config() + html = f""" + + + + + AbyssInfo VPN 飞书扫码登录 + + + +
+

飞书扫码登录

+

请使用飞书 App 扫描二维码。授权完成后会自动回到 AbyssInfo VPN。

+
+

二维码 5 分钟内有效,过期请刷新页面。

+
+ + + +""" + return HttpResponse(html) + + +@csrf_exempt +@require_POST +def desktop_session_create(_request: HttpRequest) -> JsonResponse: + session = create_desktop_login_session() + return JsonResponse( + { + "session_id": session.session_id, + "goto": build_qr_goto(session.state), + "state": session.state, + "expires_in": settings.OAUTH_STATE_EXPIRES_SECONDS, + } + ) + + +@require_GET +def desktop_session_status(_request: HttpRequest, session_id: str) -> JsonResponse: + session = DesktopLoginSession.objects.select_related("user").filter(session_id=session_id).first() + if session is None: + return JsonResponse({"error": "session_not_found"}, status=404) + if session.is_expired and session.status == DesktopLoginSession.STATUS_PENDING: + session.status = DesktopLoginSession.STATUS_EXPIRED + session.error = "session_expired" + session.save(update_fields=["status", "error", "updated_at"]) + if session.status != DesktopLoginSession.STATUS_AUTHENTICATED: + return JsonResponse( + { + "status": session.status, + "error": session.error, + "expires_at": session.expires_at.isoformat(), + } + ) + if session.user is None or session.user.status != session.user.STATUS_ACTIVE: + return JsonResponse({"status": DesktopLoginSession.STATUS_FAILED, "error": "user_disabled"}, status=403) + return JsonResponse( + { + "status": session.status, + "token": issue_jwt(session.user.id), + "expires_in": settings.JWT_EXPIRES_SECONDS, + "user": { + "id": session.user.id, + "name": session.user.name, + "email": session.user.email, + }, + } + ) + + +@csrf_exempt +@require_POST +def desktop_session_complete(request: HttpRequest, session_id: str) -> JsonResponse: + session = DesktopLoginSession.objects.select_related("user").filter(session_id=session_id).first() + if session is None: + return JsonResponse({"error": "session_not_found"}, status=404) + if session.is_expired: + session.status = DesktopLoginSession.STATUS_EXPIRED + session.error = "session_expired" + session.save(update_fields=["status", "error", "updated_at"]) + return JsonResponse({"error": "session_expired"}, status=401) + try: + body = json.loads(request.body or b"{}") + except json.JSONDecodeError: + return JsonResponse({"error": "invalid_json"}, status=400) + tmp_code = body.get("tmp_code") or "" + code = body.get("code") or "" + if not code: + if not tmp_code: + return JsonResponse({"error": "missing_tmp_code"}, status=400) + try: + code = exchange_tmp_code_for_oauth_code(tmp_code, session.state) + except Exception as error: + session.status = DesktopLoginSession.STATUS_FAILED + session.error = str(error)[:255] + session.save(update_fields=["status", "error", "updated_at"]) + return JsonResponse({"error": str(error)}, status=400) + try: + login_code = handle_feishu_callback(code, session.state) + except PermissionError: + session.status = DesktopLoginSession.STATUS_FAILED + session.error = "user_disabled" + session.save(update_fields=["status", "error", "updated_at"]) + return JsonResponse({"error": "user_disabled"}, status=403) + except Exception as error: + session.status = DesktopLoginSession.STATUS_FAILED + session.error = str(error)[:255] + session.save(update_fields=["status", "error", "updated_at"]) + return JsonResponse({"error": str(error)}, status=400) + session.user = login_code.user + session.status = DesktopLoginSession.STATUS_AUTHENTICATED + session.error = "" + session.authenticated_at = timezone.now() + session.save(update_fields=["user", "status", "error", "authenticated_at", "updated_at"]) + return JsonResponse({"status": session.status}) + + +@xframe_options_exempt +@require_GET +def desktop_session_qr_page(request: HttpRequest, session_id: str) -> HttpResponse: + session = DesktopLoginSession.objects.filter(session_id=session_id).first() + if session is None: + return HttpResponseBadRequest("session_not_found") + if session.is_expired: + return HttpResponseBadRequest("session_expired") + embedded = request.GET.get("embedded") == "1" + body_class = "embedded" if embedded else "" + goto = build_qr_goto(session.state) + html = f""" + + + + + AbyssInfo VPN 飞书扫码登录 + + + +
+

飞书扫码登录

+

请使用飞书 App 扫描二维码。授权完成后可回到 AbyssInfo VPN。

+
+

二维码 5 分钟内有效,过期请回到客户端刷新。

+
+ + + +""" + return HttpResponse(html) + + +def desktop_session_success_page() -> HttpResponse: + return HttpResponse( + """ + + + + + AbyssInfo VPN 登录成功 + + + +
+

登录成功

+

可以回到 AbyssInfo VPN 客户端。

+
+ +""" + ) + + +@require_GET +def feishu_callback(request: HttpRequest) -> HttpResponseRedirect: + code = request.GET.get("code", "") + state = request.GET.get("state", "") + desktop_session = DesktopLoginSession.objects.filter(state=state).first() + try: + login_code = handle_feishu_callback(code, state) + except PermissionError: + if desktop_session: + desktop_session.status = DesktopLoginSession.STATUS_FAILED + desktop_session.error = "user_disabled" + desktop_session.save(update_fields=["status", "error", "updated_at"]) + return HttpResponseBadRequest("user_disabled") + except Exception as error: + if desktop_session: + desktop_session.status = DesktopLoginSession.STATUS_FAILED + desktop_session.error = str(error)[:255] + desktop_session.save(update_fields=["status", "error", "updated_at"]) + return HttpResponseBadRequest(str(error)) + if desktop_session: + desktop_session.user = login_code.user + desktop_session.status = DesktopLoginSession.STATUS_AUTHENTICATED + desktop_session.error = "" + desktop_session.authenticated_at = timezone.now() + desktop_session.save(update_fields=["user", "status", "error", "authenticated_at", "updated_at"]) + return desktop_session_success_page() + redirect_url = build_tauri_callback(login_code.code, state) + return TauriDeepLinkRedirect(redirect_url) + + +@csrf_exempt +@require_http_methods(["GET", "POST"]) +def feishu_event_callback(request: HttpRequest) -> JsonResponse: + if request.method == "GET": + return JsonResponse({"status": "ok"}) + + try: + body = json.loads(request.body or b"{}") + except json.JSONDecodeError: + return JsonResponse({"status": "ok"}) + + challenge = body.get("challenge") + if challenge: + if settings.FEISHU_EVENT_VERIFICATION_TOKEN and not _feishu_event_token_is_valid(body): + return JsonResponse({"error": "invalid_event_token"}, status=403) + return JsonResponse({"challenge": challenge}) + + if not _feishu_event_token_is_valid(body): + return JsonResponse({"error": "invalid_event_token"}, status=403) + + event_type = _extract_feishu_event_type(body) + if not _is_feishu_user_disabled_event(event_type, body): + return JsonResponse({"status": "ignored", "event_type": event_type}) + + open_id = _extract_feishu_open_id(body) + if not open_id: + return JsonResponse({"status": "ignored", "event_type": event_type, "reason": "missing_open_id"}) + + user = User.objects.filter(feishu_open_id=open_id).first() + if user is None: + return JsonResponse({"status": "ok", "event_type": event_type, "action": "user_not_found"}) + + summary = revoke_user_vpn_access( + user, + reason=event_type or "feishu_user_disabled", + source="feishu", + event=_build_feishu_event_audit_detail(body, event_type, open_id), + ) + return JsonResponse( + { + "status": "ok", + "event_type": event_type, + "action": "user_disabled", + "summary": summary, + } + ) + + +def _feishu_event_token_is_valid(body: dict) -> bool: + expected = settings.FEISHU_EVENT_VERIFICATION_TOKEN + if not expected: + return bool(settings.DEBUG) + header = body.get("header") if isinstance(body.get("header"), dict) else {} + token = body.get("token") or header.get("token") + return token == expected + + +def _extract_feishu_event_type(body: dict) -> str: + header = body.get("header") if isinstance(body.get("header"), dict) else {} + event = body.get("event") if isinstance(body.get("event"), dict) else {} + return ( + header.get("event_type") + or event.get("type") + or body.get("event_type") + or body.get("type") + or "" + ) + + +def _extract_feishu_open_id(body: dict) -> str: + event = body.get("event") if isinstance(body.get("event"), dict) else {} + candidates = [ + event.get("open_id"), + _nested_get(event, "user", "open_id"), + _nested_get(event, "user_id", "open_id"), + _nested_get(event, "object", "open_id"), + _nested_get(event, "object", "user_id", "open_id"), + _nested_get(event, "employee", "open_id"), + _nested_get(body, "open_id"), + event.get("union_id"), + ] + for value in candidates: + if isinstance(value, str) and value.strip(): + return value.strip() + return "" + + +def _nested_get(value: dict, *keys: str): + current = value + for key in keys: + if not isinstance(current, dict): + return None + current = current.get(key) + return current + + +def _is_feishu_user_disabled_event(event_type: str, body: dict) -> bool: + normalized = (event_type or "").lower() + if normalized in { + "contact.user.deleted_v3", + "contact.user.deleted", + "user.deleted", + "user_deleted", + }: + return True + if "user" in normalized and any(keyword in normalized for keyword in ("delete", "disabled", "disable", "frozen", "resigned")): + return True + + event = body.get("event") if isinstance(body.get("event"), dict) else {} + status_sources = [ + event, + event.get("user") if isinstance(event.get("user"), dict) else {}, + event.get("object") if isinstance(event.get("object"), dict) else {}, + event.get("employee") if isinstance(event.get("employee"), dict) else {}, + ] + return any(_status_source_is_disabled(source) for source in status_sources) + + +def _status_source_is_disabled(source: dict) -> bool: + if not isinstance(source, dict): + return False + + disabled_flags = { + "is_deleted", + "is_delete", + "is_disabled", + "is_frozen", + "is_resigned", + "is_inactive", + "deleted", + "disabled", + "frozen", + "resigned", + } + for key in disabled_flags: + if source.get(key) is True: + return True + + status = source.get("status") + if isinstance(status, str): + return status.lower() in {"deleted", "disabled", "disable", "frozen", "inactive", "resigned"} + if isinstance(status, dict): + for key in disabled_flags: + if status.get(key) is True: + return True + text_values = [value.lower() for value in status.values() if isinstance(value, str)] + return any(value in {"deleted", "disabled", "disable", "frozen", "inactive", "resigned"} for value in text_values) + return False + + +def _build_feishu_event_audit_detail(body: dict, event_type: str, open_id: str) -> dict: + header = body.get("header") if isinstance(body.get("header"), dict) else {} + return { + "event_type": event_type, + "event_id": header.get("event_id") or body.get("uuid") or "", + "open_id": open_id, + "create_time": header.get("create_time") or body.get("ts") or "", + } + + +@csrf_exempt +@require_POST +def exchange(request: HttpRequest) -> JsonResponse: + body = json.loads(request.body or b"{}") + code = body.get("code", "") + login_code = LoginCode.objects.select_related("user").filter(code=code).first() + if login_code is None or not login_code.is_valid: + return JsonResponse({"error": "invalid_login_code"}, status=401) + if login_code.user.status != login_code.user.STATUS_ACTIVE: + return JsonResponse({"error": "user_disabled"}, status=403) + login_code.used_at = timezone.now() + login_code.save(update_fields=["used_at"]) + return JsonResponse( + { + "token": issue_jwt(login_code.user.id), + "expires_in": settings.JWT_EXPIRES_SECONDS, + "user": { + "id": login_code.user.id, + "name": login_code.user.name, + "email": login_code.user.email, + }, + } + ) diff --git a/services/api/common/__init__.py b/services/api/common/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/common/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/common/auth.py b/services/api/common/auth.py new file mode 100644 index 0000000..e5ac142 --- /dev/null +++ b/services/api/common/auth.py @@ -0,0 +1,16 @@ +from django.http import HttpRequest + +from accounts.models import User +from accounts.services.jwt_service import decode_jwt + + +def get_current_user(request: HttpRequest) -> User | None: + auth = request.headers.get("Authorization", "") + if not auth.startswith("Bearer "): + return None + try: + payload = decode_jwt(auth.removeprefix("Bearer ").strip()) + return User.objects.get(id=payload["sub"], status=User.STATUS_ACTIVE) + except Exception: + return None + diff --git a/services/api/config/__init__.py b/services/api/config/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/config/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/config/asgi.py b/services/api/config/asgi.py new file mode 100644 index 0000000..7988de0 --- /dev/null +++ b/services/api/config/asgi.py @@ -0,0 +1,9 @@ +import os + +from django.core.asgi import get_asgi_application + + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +application = get_asgi_application() + diff --git a/services/api/config/settings.py b/services/api/config/settings.py new file mode 100644 index 0000000..6d9856c --- /dev/null +++ b/services/api/config/settings.py @@ -0,0 +1,109 @@ +import os +from pathlib import Path + +try: + from dotenv import load_dotenv +except ImportError: + load_dotenv = None + + +BASE_DIR = Path(__file__).resolve().parent.parent +if load_dotenv: + load_dotenv(BASE_DIR / ".env") + + +def env_bool(name: str, default: bool = False) -> bool: + value = os.getenv(name) + if value is None: + return default + return value.lower() in {"1", "true", "yes", "on"} + + +SECRET_KEY = os.getenv("DJANGO_SECRET_KEY", "dev-secret-key") +DEBUG = env_bool("DJANGO_DEBUG", True) +ALLOWED_HOSTS = [host.strip() for host in os.getenv("DJANGO_ALLOWED_HOSTS", "127.0.0.1,localhost").split(",")] + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "corsheaders", + "accounts", + "vpn", +] + +MIDDLEWARE = [ + "corsheaders.middleware.CorsMiddleware", + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "config.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + +WSGI_APPLICATION = "config.wsgi.application" + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", + } +} + +LANGUAGE_CODE = "zh-hans" +TIME_ZONE = "Asia/Shanghai" +USE_I18N = True +USE_TZ = True + +STATIC_URL = "static/" +STATIC_ROOT = BASE_DIR / "staticfiles" +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" + +CORS_ALLOWED_ORIGINS = [ + item.strip() + for item in os.getenv("CORS_ALLOWED_ORIGINS", "http://localhost:5173").split(",") + if item.strip() +] + +FEISHU_APP_ID = os.getenv("FEISHU_APP_ID", "") +FEISHU_APP_SECRET = os.getenv("FEISHU_APP_SECRET", "") +FEISHU_REDIRECT_URI = os.getenv("FEISHU_REDIRECT_URI", "") +FEISHU_EVENT_VERIFICATION_TOKEN = os.getenv("FEISHU_EVENT_VERIFICATION_TOKEN", "") +TAURI_DEEP_LINK_SCHEME = os.getenv("TAURI_DEEP_LINK_SCHEME", "myvpn") + +JWT_SECRET = os.getenv("JWT_SECRET", SECRET_KEY) +JWT_EXPIRES_SECONDS = int(os.getenv("JWT_EXPIRES_SECONDS", "600")) +OAUTH_STATE_EXPIRES_SECONDS = int(os.getenv("OAUTH_STATE_EXPIRES_SECONDS", "300")) +LOGIN_CODE_EXPIRES_SECONDS = int(os.getenv("LOGIN_CODE_EXPIRES_SECONDS", "120")) + +NETMAKER_BASE_URL = os.getenv("NETMAKER_BASE_URL", "") +NETMAKER_API_TOKEN = os.getenv("NETMAKER_API_TOKEN", "") +NETMAKER_NETWORK_ID = os.getenv("NETMAKER_NETWORK_ID", "") +NETMAKER_ENROLLMENT_TAGS = [ + item.strip() + for item in os.getenv("NETMAKER_ENROLLMENT_TAGS", "homevpn,desktop,vpn").split(",") + if item.strip() +] +NETMAKER_ENROLLMENT_TTL_SECONDS = int(os.getenv("NETMAKER_ENROLLMENT_TTL_SECONDS", "600")) diff --git a/services/api/config/urls.py b/services/api/config/urls.py new file mode 100644 index 0000000..07d441c --- /dev/null +++ b/services/api/config/urls.py @@ -0,0 +1,16 @@ +from django.contrib import admin +from django.urls import include, path +from django.http import JsonResponse + + +def health(_request): + return JsonResponse({"status": "ok"}) + + +urlpatterns = [ + path("admin/", admin.site.urls), + path("health/", health), + path("auth/", include("accounts.urls")), + path("vpn/", include("vpn.urls")), +] + diff --git a/services/api/config/wsgi.py b/services/api/config/wsgi.py new file mode 100644 index 0000000..b751488 --- /dev/null +++ b/services/api/config/wsgi.py @@ -0,0 +1,9 @@ +import os + +from django.core.wsgi import get_wsgi_application + + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + +application = get_wsgi_application() + diff --git a/services/api/manage.py b/services/api/manage.py new file mode 100644 index 0000000..05a51c9 --- /dev/null +++ b/services/api/manage.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +"""Django management utility.""" +import os +import sys + + +def main() -> None: + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() + diff --git a/services/api/requirements.txt b/services/api/requirements.txt new file mode 100644 index 0000000..3edbdf8 --- /dev/null +++ b/services/api/requirements.txt @@ -0,0 +1,7 @@ +Django>=5.2,<6.0 +djangorestframework>=3.16,<4.0 +django-cors-headers>=4.7,<5.0 +python-dotenv>=1.1,<2.0 +PyJWT>=2.10,<3.0 +requests>=2.32,<3.0 +gunicorn>=23.0,<24.0 diff --git a/services/api/vpn/__init__.py b/services/api/vpn/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/vpn/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/vpn/admin.py b/services/api/vpn/admin.py new file mode 100644 index 0000000..87248a4 --- /dev/null +++ b/services/api/vpn/admin.py @@ -0,0 +1,17 @@ +from django.contrib import admin + +from .models import Device, VpnLog + + +@admin.register(Device) +class DeviceAdmin(admin.ModelAdmin): + list_display = ("id", "user", "device_name", "status", "netmaker_node_id", "created_at") + search_fields = ("device_name", "device_fingerprint", "netmaker_node_id") + list_filter = ("status",) + + +@admin.register(VpnLog) +class VpnLogAdmin(admin.ModelAdmin): + list_display = ("id", "user", "device", "action", "created_at") + list_filter = ("action",) + diff --git a/services/api/vpn/apps.py b/services/api/vpn/apps.py new file mode 100644 index 0000000..ec6701d --- /dev/null +++ b/services/api/vpn/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class VpnConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "vpn" + diff --git a/services/api/vpn/migrations/0001_initial.py b/services/api/vpn/migrations/0001_initial.py new file mode 100644 index 0000000..8f3e415 --- /dev/null +++ b/services/api/vpn/migrations/0001_initial.py @@ -0,0 +1,53 @@ +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + initial = True + + dependencies = [ + ("accounts", "0001_initial"), + ] + + operations = [ + migrations.CreateModel( + name="Device", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("device_name", models.CharField(max_length=128)), + ("device_fingerprint", models.CharField(blank=True, max_length=256)), + ("netmaker_node_id", models.CharField(blank=True, max_length=128)), + ("status", models.CharField(default="active", max_length=16)), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("updated_at", models.DateTimeField(auto_now=True)), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="devices", + to="accounts.user", + ), + ), + ], + ), + migrations.CreateModel( + name="VpnLog", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("action", models.CharField(max_length=64)), + ("detail", models.JSONField(blank=True, default=dict)), + ("created_at", models.DateTimeField(auto_now_add=True)), + ( + "device", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="vpn.device", + ), + ), + ("user", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="accounts.user")), + ], + ), + ] + diff --git a/services/api/vpn/migrations/0002_device_unique_fingerprint.py b/services/api/vpn/migrations/0002_device_unique_fingerprint.py new file mode 100644 index 0000000..9329768 --- /dev/null +++ b/services/api/vpn/migrations/0002_device_unique_fingerprint.py @@ -0,0 +1,18 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("vpn", "0001_initial"), + ] + + operations = [ + migrations.AddConstraint( + model_name="device", + constraint=models.UniqueConstraint( + fields=("user", "device_fingerprint"), + name="unique_user_device_fingerprint", + ), + ), + ] + diff --git a/services/api/vpn/migrations/__init__.py b/services/api/vpn/migrations/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/vpn/migrations/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/vpn/models.py b/services/api/vpn/models.py new file mode 100644 index 0000000..f87784a --- /dev/null +++ b/services/api/vpn/models.py @@ -0,0 +1,35 @@ +from django.db import models + +from accounts.models import User + + +class Device(models.Model): + STATUS_ACTIVE = "active" + STATUS_REVOKED = "revoked" + + user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="devices") + device_name = models.CharField(max_length=128) + device_fingerprint = models.CharField(max_length=256, blank=True) + netmaker_node_id = models.CharField(max_length=128, blank=True) + status = models.CharField(max_length=16, default=STATUS_ACTIVE) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self) -> str: + return f"{self.user_id}:{self.device_name}" + + class Meta: + constraints = [ + models.UniqueConstraint( + fields=["user", "device_fingerprint"], + name="unique_user_device_fingerprint", + ) + ] + + +class VpnLog(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + device = models.ForeignKey(Device, on_delete=models.SET_NULL, null=True, blank=True) + action = models.CharField(max_length=64) + detail = models.JSONField(default=dict, blank=True) + created_at = models.DateTimeField(auto_now_add=True) diff --git a/services/api/vpn/netmaker.py b/services/api/vpn/netmaker.py new file mode 100644 index 0000000..7ab83e8 --- /dev/null +++ b/services/api/vpn/netmaker.py @@ -0,0 +1,5 @@ +from .services.netmaker_client import NetmakerClient + + +def create_one_time_join_token(device_name: str) -> str: + return NetmakerClient().create_one_time_join_token(device_name) diff --git a/services/api/vpn/services/__init__.py b/services/api/vpn/services/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/services/api/vpn/services/__init__.py @@ -0,0 +1 @@ + diff --git a/services/api/vpn/services/device_service.py b/services/api/vpn/services/device_service.py new file mode 100644 index 0000000..e16efdb --- /dev/null +++ b/services/api/vpn/services/device_service.py @@ -0,0 +1,19 @@ +from accounts.models import User + +from vpn.models import Device, VpnLog +from vpn.services.netmaker_client import NetmakerClient + + +def issue_connect_token(user: User, device_name: str, fingerprint: str) -> str: + device, _created = Device.objects.get_or_create( + user=user, + device_fingerprint=fingerprint, + defaults={"device_name": device_name}, + ) + if device.status == Device.STATUS_REVOKED: + raise PermissionError("device_revoked") + + token = NetmakerClient().create_one_time_join_token(device.device_name) + VpnLog.objects.create(user=user, device=device, action="connect_token_issued") + return token + diff --git a/services/api/vpn/services/netmaker_client.py b/services/api/vpn/services/netmaker_client.py new file mode 100644 index 0000000..064c634 --- /dev/null +++ b/services/api/vpn/services/netmaker_client.py @@ -0,0 +1,111 @@ +import re +from urllib.parse import quote, urljoin +from uuid import uuid4 + +import requests +from django.conf import settings + + +class NetmakerConfigError(RuntimeError): + pass + + +class NetmakerApiError(RuntimeError): + pass + + +class NetmakerClient: + def __init__(self) -> None: + self.base_url = settings.NETMAKER_BASE_URL.rstrip("/") + self.api_token = settings.NETMAKER_API_TOKEN + self.network_id = settings.NETMAKER_NETWORK_ID + + def create_one_time_join_token(self, device_name: str) -> str: + self._validate_config() + key_name = self._build_unique_key_name(device_name) + payload = { + "name": key_name, + "tags": [key_name[:32]], + # Netmaker v1.5 uses numeric key types: + # 1 = time-bound, 2 = uses-based, 3 = unlimited. + "type": 2, + "uses_remaining": 1, + "unlimited": False, + "expiration": 0, + "networks": [self.network_id], + "groups": settings.NETMAKER_ENROLLMENT_TAGS, + "auto_egress": False, + "auto_assign_gw": False, + } + response = requests.post( + self._api_url("/api/v1/enrollment-keys"), + json=payload, + headers={ + "Authorization": f"Bearer {self.api_token}", + "Content-Type": "application/json", + }, + timeout=10, + ) + if response.status_code >= 400: + raise NetmakerApiError(f"netmaker_error:{response.status_code}:{response.text}") + + body = response.json() + token = body.get("token") or body.get("data", {}).get("token") + if not token: + raise NetmakerApiError("netmaker_missing_token") + return token + + def delete_node(self, node_id: str) -> None: + self._validate_config() + normalized = (node_id or "").strip() + if not normalized: + return + + encoded_node_id = quote(normalized, safe="") + encoded_network_id = quote(self.network_id, safe="") + paths = [ + f"/api/v1/hosts/{encoded_node_id}", + f"/api/v1/nodes/{encoded_network_id}/{encoded_node_id}", + ] + last_error = "" + for index, path in enumerate(paths): + response = requests.delete( + self._api_url(path), + headers={"Authorization": f"Bearer {self.api_token}"}, + timeout=10, + ) + if response.status_code in (200, 202, 204): + return + if response.status_code == 404: + last_error = f"netmaker_error:{response.status_code}:{response.text}" + if index < len(paths) - 1: + continue + return + last_error = f"netmaker_error:{response.status_code}:{response.text}" + if response.status_code in (400, 405): + continue + raise NetmakerApiError(last_error) + + raise NetmakerApiError(last_error or "netmaker_delete_node_failed") + + def _build_unique_key_name(self, device_name: str) -> str: + normalized = re.sub(r"[^a-z0-9-]+", "-", device_name.lower()).strip("-") + if not normalized: + normalized = "device" + return f"homevpn-{normalized[:24]}-{uuid4().hex[:12]}" + + def _validate_config(self) -> None: + missing = [ + name + for name, value in { + "NETMAKER_BASE_URL": self.base_url, + "NETMAKER_API_TOKEN": self.api_token, + "NETMAKER_NETWORK_ID": self.network_id, + }.items() + if not value + ] + if missing: + raise NetmakerConfigError("missing_config:" + ",".join(missing)) + + def _api_url(self, path: str) -> str: + return urljoin(f"{self.base_url}/", path.lstrip("/")) diff --git a/services/api/vpn/services/offboarding.py b/services/api/vpn/services/offboarding.py new file mode 100644 index 0000000..c7ebff6 --- /dev/null +++ b/services/api/vpn/services/offboarding.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from typing import Any + +from accounts.models import User +from vpn.models import Device, VpnLog +from vpn.services.netmaker_client import NetmakerApiError, NetmakerClient, NetmakerConfigError + + +def revoke_user_vpn_access( + user: User, + *, + reason: str, + source: str = "system", + event: dict[str, Any] | None = None, +) -> dict[str, Any]: + disabled = False + if user.status != User.STATUS_DISABLED: + user.status = User.STATUS_DISABLED + user.save(update_fields=["status", "updated_at"]) + disabled = True + + client = NetmakerClient() + revoked_count = 0 + netmaker_errors: list[dict[str, str]] = [] + devices = list(Device.objects.filter(user=user)) + + for device in devices: + node_id = (device.netmaker_node_id or "").strip() + if node_id: + try: + client.delete_node(node_id) + except (NetmakerConfigError, NetmakerApiError) as error: + netmaker_errors.append({"device_id": str(device.id), "error": str(error)}) + + if device.status != Device.STATUS_REVOKED: + device.status = Device.STATUS_REVOKED + device.save(update_fields=["status", "updated_at"]) + revoked_count += 1 + + VpnLog.objects.create( + user=user, + device=device, + action="device_revoked", + detail={ + "reason": reason, + "source": source, + "netmaker_node_id": node_id, + }, + ) + + VpnLog.objects.create( + user=user, + action="user_disabled", + detail={ + "reason": reason, + "source": source, + "disabled": disabled, + "revoked_devices": revoked_count, + "netmaker_errors": netmaker_errors, + "event": event or {}, + }, + ) + return { + "disabled": disabled, + "revoked_devices": revoked_count, + "netmaker_errors": netmaker_errors, + } diff --git a/services/api/vpn/tests.py b/services/api/vpn/tests.py new file mode 100644 index 0000000..d45b3a8 --- /dev/null +++ b/services/api/vpn/tests.py @@ -0,0 +1,190 @@ +from unittest.mock import Mock, patch + +from django.test import TestCase, override_settings +from django.utils import timezone + +from accounts.models import User +from accounts.services.jwt_service import issue_jwt +from vpn.models import Device, VpnLog +from vpn.services.netmaker_client import NetmakerApiError, NetmakerClient, NetmakerConfigError + + +class NetmakerClientTests(TestCase): + @override_settings( + NETMAKER_BASE_URL="https://netmaker.example.com", + NETMAKER_API_TOKEN="secret", + NETMAKER_NETWORK_ID="office", + NETMAKER_ENROLLMENT_TAGS=["homevpn", "desktop", "vpn"], + NETMAKER_ENROLLMENT_TTL_SECONDS=600, + ) + @patch("vpn.services.netmaker_client.uuid4") + @patch("vpn.services.netmaker_client.requests.post") + def test_create_one_time_join_token(self, post, uuid4): + uuid4.return_value.hex = "abcdef1234567890" + response = Mock() + response.status_code = 200 + response.json.return_value = {"token": "join-token"} + post.return_value = response + + token = NetmakerClient().create_one_time_join_token("pc-01") + + self.assertEqual(token, "join-token") + url = post.call_args.args[0] + payload = post.call_args.kwargs["json"] + headers = post.call_args.kwargs["headers"] + self.assertEqual(url, "https://netmaker.example.com/api/v1/enrollment-keys") + self.assertEqual(payload["name"], "homevpn-pc-01-abcdef123456") + self.assertEqual(payload["tags"], ["homevpn-pc-01-abcdef123456"[:32]]) + self.assertEqual(payload["uses_remaining"], 1) + self.assertEqual(payload["networks"], ["office"]) + self.assertEqual(headers["Authorization"], "Bearer secret") + + @override_settings( + NETMAKER_BASE_URL="https://netmaker.example.com", + NETMAKER_API_TOKEN="secret", + NETMAKER_NETWORK_ID="office", + NETMAKER_ENROLLMENT_TAGS=["homevpn", "desktop", "vpn"], + NETMAKER_ENROLLMENT_TTL_SECONDS=600, + ) + @patch("vpn.services.netmaker_client.uuid4") + @patch("vpn.services.netmaker_client.requests.post") + def test_create_one_time_join_token_uses_unique_key_name(self, post, uuid4): + first = Mock() + first.hex = "111111111111aaaaaaaa" + second = Mock() + second.hex = "222222222222bbbbbbbb" + uuid4.side_effect = [first, second] + response = Mock() + response.status_code = 200 + response.json.return_value = {"token": "join-token"} + post.return_value = response + + NetmakerClient().create_one_time_join_token("pc-01") + NetmakerClient().create_one_time_join_token("pc-01") + + first_payload = post.call_args_list[0].kwargs["json"] + second_payload = post.call_args_list[1].kwargs["json"] + self.assertNotEqual(first_payload["name"], second_payload["name"]) + + @override_settings(NETMAKER_BASE_URL="", NETMAKER_API_TOKEN="", NETMAKER_NETWORK_ID="") + def test_missing_config_raises(self): + with self.assertRaises(NetmakerConfigError): + NetmakerClient().create_one_time_join_token("pc-01") + + @override_settings( + NETMAKER_BASE_URL="https://netmaker.example.com", + NETMAKER_API_TOKEN="secret", + NETMAKER_NETWORK_ID="office", + NETMAKER_ENROLLMENT_TAGS=["homevpn", "desktop", "vpn"], + NETMAKER_ENROLLMENT_TTL_SECONDS=600, + ) + @patch("vpn.services.netmaker_client.requests.post") + def test_api_error_raises(self, post): + response = Mock() + response.status_code = 500 + response.text = "server error" + post.return_value = response + + with self.assertRaises(NetmakerApiError): + NetmakerClient().create_one_time_join_token("pc-01") + + @override_settings( + NETMAKER_BASE_URL="https://netmaker.example.com", + NETMAKER_API_TOKEN="secret", + NETMAKER_NETWORK_ID="office", + ) + @patch("vpn.services.netmaker_client.requests.delete") + def test_delete_node_uses_host_endpoint(self, delete): + response = Mock() + response.status_code = 204 + response.text = "" + delete.return_value = response + + NetmakerClient().delete_node("host-01") + + self.assertEqual(delete.call_args.args[0], "https://netmaker.example.com/api/v1/hosts/host-01") + self.assertEqual(delete.call_args.kwargs["headers"]["Authorization"], "Bearer secret") + + @override_settings( + NETMAKER_BASE_URL="https://netmaker.example.com", + NETMAKER_API_TOKEN="secret", + NETMAKER_NETWORK_ID="office", + ) + @patch("vpn.services.netmaker_client.requests.delete") + def test_delete_node_falls_back_to_network_node_endpoint(self, delete): + first = Mock() + first.status_code = 405 + first.text = "method not allowed" + second = Mock() + second.status_code = 204 + second.text = "" + delete.side_effect = [first, second] + + NetmakerClient().delete_node("node-01") + + urls = [call.args[0] for call in delete.call_args_list] + self.assertEqual(urls[0], "https://netmaker.example.com/api/v1/hosts/node-01") + self.assertEqual(urls[1], "https://netmaker.example.com/api/v1/nodes/office/node-01") + + +@override_settings(JWT_SECRET="test-secret-key-with-at-least-32-bytes") +class VpnApiTests(TestCase): + def setUp(self): + self.user = User.objects.create(feishu_open_id="open-id", email="u@example.com", name="User") + self.jwt = issue_jwt(self.user.id) + self.device = Device.objects.create( + user=self.user, + device_name="pc-01", + device_fingerprint="fingerprint-01", + ) + + def test_status_returns_devices_and_logs(self): + VpnLog.objects.create(user=self.user, device=self.device, action="connect_token_issued") + + response = self.client.get("/vpn/status", HTTP_AUTHORIZATION=f"Bearer {self.jwt}") + + self.assertEqual(response.status_code, 200) + data = response.json() + self.assertEqual(data["user"]["name"], "User") + self.assertEqual(data["user"]["email"], "u@example.com") + self.assertEqual(len(data["devices"]), 1) + self.assertEqual(data["devices"][0]["device_name"], "pc-01") + self.assertEqual(len(data["logs"]), 1) + + def test_register_node_stores_netmaker_identifier(self): + response = self.client.post( + "/vpn/register-node", + data='{"device_name": "pc-01", "device_fingerprint": "fingerprint-01", "netmaker_node_id": "host-01"}', + content_type="application/json", + HTTP_AUTHORIZATION=f"Bearer {self.jwt}", + ) + + self.assertEqual(response.status_code, 200) + self.device.refresh_from_db() + self.assertEqual(self.device.netmaker_node_id, "host-01") + self.assertTrue(VpnLog.objects.filter(user=self.user, action="netmaker_node_registered").exists()) + + def test_revoke_device_marks_device_revoked(self): + response = self.client.post( + "/vpn/revoke-device", + data='{"device_id": %d}' % self.device.id, + content_type="application/json", + HTTP_AUTHORIZATION=f"Bearer {self.jwt}", + ) + + self.assertEqual(response.status_code, 200) + self.device.refresh_from_db() + self.assertEqual(self.device.status, Device.STATUS_REVOKED) + self.assertTrue(VpnLog.objects.filter(user=self.user, action="device_revoked").exists()) + + def test_disconnect_log_records_action(self): + response = self.client.post( + "/vpn/disconnect-log", + data='{"device_fingerprint": "fingerprint-01"}', + content_type="application/json", + HTTP_AUTHORIZATION=f"Bearer {self.jwt}", + ) + + self.assertEqual(response.status_code, 200) + log = VpnLog.objects.get(user=self.user, action="disconnect") + self.assertEqual(log.device_id, self.device.id) diff --git a/services/api/vpn/urls.py b/services/api/vpn/urls.py new file mode 100644 index 0000000..782c8d2 --- /dev/null +++ b/services/api/vpn/urls.py @@ -0,0 +1,12 @@ +from django.urls import path + +from . import views + + +urlpatterns = [ + path("connect-token", views.connect_token), + path("disconnect-log", views.disconnect_log), + path("register-node", views.register_node), + path("status", views.status), + path("revoke-device", views.revoke_device), +] diff --git a/services/api/vpn/views.py b/services/api/vpn/views.py new file mode 100644 index 0000000..6a87d3d --- /dev/null +++ b/services/api/vpn/views.py @@ -0,0 +1,142 @@ +import json + +from django.http import HttpRequest, JsonResponse +from django.views.decorators.csrf import csrf_exempt +from django.views.decorators.http import require_GET, require_POST + +from common.auth import get_current_user +from .models import Device, VpnLog +from .services.device_service import issue_connect_token +from .services.netmaker_client import NetmakerApiError, NetmakerClient, NetmakerConfigError + + +@csrf_exempt +@require_POST +def connect_token(request: HttpRequest) -> JsonResponse: + user = get_current_user(request) + if user is None: + return JsonResponse({"error": "unauthorized"}, status=401) + + body = json.loads(request.body or b"{}") + device_name = body.get("device_name") or "unknown-device" + fingerprint = body.get("device_fingerprint") or "" + try: + token = issue_connect_token(user, device_name, fingerprint) + except PermissionError as error: + return JsonResponse({"error": str(error)}, status=403) + except NetmakerConfigError as error: + return JsonResponse({"error": str(error)}, status=503) + except NetmakerApiError as error: + return JsonResponse({"error": str(error)}, status=502) + return JsonResponse({"token": token}) + + +@require_GET +def status(request: HttpRequest) -> JsonResponse: + user = get_current_user(request) + if user is None: + return JsonResponse({"error": "unauthorized"}, status=401) + devices = list(user.devices.values("id", "device_name", "status", "netmaker_node_id", "updated_at")) + logs = list( + VpnLog.objects.filter(user=user) + .select_related("device") + .order_by("-created_at") + .values("id", "device_id", "action", "detail", "created_at")[:20] + ) + return JsonResponse( + { + "user": { + "id": user.id, + "name": user.name, + "email": user.email, + }, + "devices": devices, + "logs": logs, + } + ) + + +@csrf_exempt +@require_POST +def register_node(request: HttpRequest) -> JsonResponse: + user = get_current_user(request) + if user is None: + return JsonResponse({"error": "unauthorized"}, status=401) + + body = json.loads(request.body or b"{}") + fingerprint = body.get("device_fingerprint") or "" + node_id = body.get("netmaker_node_id") or body.get("host_id") or body.get("node_id") or "" + device_name = body.get("device_name") or "unknown-device" + if not fingerprint: + return JsonResponse({"error": "missing_device_fingerprint"}, status=400) + if not node_id: + return JsonResponse({"error": "missing_netmaker_node_id"}, status=400) + + device, _created = Device.objects.get_or_create( + user=user, + device_fingerprint=fingerprint, + defaults={"device_name": device_name}, + ) + if device.status == Device.STATUS_REVOKED: + return JsonResponse({"error": "device_revoked"}, status=403) + + changed_fields = [] + if device.device_name != device_name: + device.device_name = device_name + changed_fields.append("device_name") + if device.netmaker_node_id != node_id: + device.netmaker_node_id = node_id + changed_fields.append("netmaker_node_id") + if changed_fields: + changed_fields.append("updated_at") + device.save(update_fields=changed_fields) + VpnLog.objects.create( + user=user, + device=device, + action="netmaker_node_registered", + detail={"netmaker_node_id": node_id}, + ) + + return JsonResponse({"status": "ok", "device_id": device.id}) + + +@csrf_exempt +@require_POST +def disconnect_log(request: HttpRequest) -> JsonResponse: + user = get_current_user(request) + if user is None: + return JsonResponse({"error": "unauthorized"}, status=401) + body = json.loads(request.body or b"{}") + fingerprint = body.get("device_fingerprint") or "" + device = Device.objects.filter(user=user, device_fingerprint=fingerprint).first() + VpnLog.objects.create(user=user, device=device, action="disconnect", detail={"device_fingerprint": fingerprint}) + return JsonResponse({"status": "ok"}) + + +@csrf_exempt +@require_POST +def revoke_device(request: HttpRequest) -> JsonResponse: + user = get_current_user(request) + if user is None: + return JsonResponse({"error": "unauthorized"}, status=401) + body = json.loads(request.body or b"{}") + device = Device.objects.filter(user=user, id=body.get("device_id")).first() + if device is None: + return JsonResponse({"error": "device_not_found"}, status=404) + + netmaker_error = "" + if device.netmaker_node_id: + try: + NetmakerClient().delete_node(device.netmaker_node_id) + except (NetmakerConfigError, NetmakerApiError) as error: + netmaker_error = str(error) + + device.status = Device.STATUS_REVOKED + device.save(update_fields=["status", "updated_at"]) + VpnLog.objects.create( + user=user, + device=device, + action="device_revoked", + detail={"device_id": device.id, "netmaker_error": netmaker_error}, + ) + return JsonResponse({"status": "ok", "netmaker_error": netmaker_error})