mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-28 05:30:29 +08:00
Compare commits
No commits in common. "bcf104e0850fbe188724b7178193772569934766" and "d8d79f7b7df2127beee95fe8ef5557aff157b067" have entirely different histories.
bcf104e085
...
d8d79f7b7d
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@ -13,10 +13,10 @@ permissions: write-all
|
||||
|
||||
jobs:
|
||||
cleanup-dev-release:
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Delete Dev Release Assets
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
# Get release ID for dev tag
|
||||
@ -41,12 +41,9 @@ jobs:
|
||||
else
|
||||
echo "No existing dev release found"
|
||||
fi
|
||||
- name: Skip for Tag Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: echo "Skipping cleanup for tag release"
|
||||
windows:
|
||||
needs: [cleanup-dev-release]
|
||||
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
|
||||
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -99,6 +96,7 @@ jobs:
|
||||
dist/*.sha256
|
||||
dist/*setup.exe
|
||||
dist/*portable.7z
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish Dev Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
@ -116,7 +114,7 @@ jobs:
|
||||
|
||||
windows7:
|
||||
needs: [cleanup-dev-release]
|
||||
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
|
||||
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -170,6 +168,7 @@ jobs:
|
||||
dist/*.sha256
|
||||
dist/*setup.exe
|
||||
dist/*portable.7z
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish Dev Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
@ -187,7 +186,7 @@ jobs:
|
||||
|
||||
linux:
|
||||
needs: [cleanup-dev-release]
|
||||
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
|
||||
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -234,6 +233,7 @@ jobs:
|
||||
dist/*.sha256
|
||||
dist/*.deb
|
||||
dist/*.rpm
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish Dev Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
@ -251,7 +251,7 @@ jobs:
|
||||
|
||||
macos:
|
||||
needs: [cleanup-dev-release]
|
||||
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
|
||||
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -321,6 +321,7 @@ jobs:
|
||||
files: |
|
||||
dist/*.sha256
|
||||
dist/*.pkg
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish Dev Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
@ -337,7 +338,7 @@ jobs:
|
||||
|
||||
macos10:
|
||||
needs: [cleanup-dev-release]
|
||||
if: always() && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
|
||||
if: (startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && always())
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -409,6 +410,7 @@ jobs:
|
||||
files: |
|
||||
dist/*.sha256
|
||||
dist/*.pkg
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish Dev Release
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
@ -425,7 +427,7 @@ jobs:
|
||||
|
||||
updater:
|
||||
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
|
||||
needs: [windows, windows7, linux, macos, macos10]
|
||||
needs: [windows, macos, windows7, macos10]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@ -4,12 +4,10 @@
|
||||
- 如果当前没有以管理员模式运行,TUN 开关保持关闭
|
||||
- 区分 app 日志与 core 日志输出为不同文件
|
||||
- 完善内核权限鉴别,上一个内核以管理员模式启动的时候,弹出提示
|
||||
- 修改 MacOS 默认虚拟网卡名称为 utun1500,可自定义
|
||||
|
||||
### 修复 (Fix)
|
||||
- 修复某些系统下的悬浮窗开启崩溃的问题(开启兼容模式=关闭硬件加速)
|
||||
- 开机自启在非管理员模式下报错的问题
|
||||
- 解决某些 macos 系统下无法开启虚拟网卡的问题(tun device名称冲突)
|
||||
|
||||
## 1.8.3
|
||||
**本次更新移除了 Windows 下启动必须管理员模式的机制,改为只在启用虚拟网卡模式的时候,申请 UAC 权限重启软件,安全性更好,更灵活,给无法使用管理员模式运行软件的企业用户提供了更大的便利**
|
||||
|
||||
@ -24,7 +24,5 @@ changelog += '\n#### Linux:\n\n'
|
||||
changelog += `- DEB:[64位](${downloadUrl}/mihomo-party-linux-${version}-amd64.deb) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-arm64.deb)\n\n`
|
||||
changelog += `- RPM:[64位](${downloadUrl}/mihomo-party-linux-${version}-x86_64.rpm) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-aarch64.rpm)`
|
||||
|
||||
changelog += '\n\n### 机场推荐:\n- 高性能海外机场,稳定首选:[https://狗狗加速.com](https://party.dginv.click/#/register?code=ARdo0mXx)'
|
||||
|
||||
writeFileSync('latest.yml', yaml.stringify(latest))
|
||||
writeFileSync('changelog.md', changelog)
|
||||
|
||||
@ -487,9 +487,23 @@ export async function checkHighPrivilegeCore(): Promise<boolean> {
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin' || process.platform === 'linux') {
|
||||
await managerLogger.info('Non-Windows platform, skipping high privilege core check')
|
||||
const { stat, existsSync } = await import('fs')
|
||||
const { promisify } = await import('util')
|
||||
const statAsync = promisify(stat)
|
||||
|
||||
if (!existsSync(corePath)) {
|
||||
await managerLogger.info('Core file does not exist')
|
||||
return false
|
||||
}
|
||||
|
||||
const stats = await statAsync(corePath)
|
||||
const hasSetuid = (stats.mode & 0o4000) !== 0
|
||||
const isOwnedByRoot = stats.uid === 0
|
||||
|
||||
await managerLogger.info(`Core file stats - setuid: ${hasSetuid}, owned by root: ${isOwnedByRoot}, mode: ${stats.mode.toString(8)}`)
|
||||
|
||||
return hasSetuid && isOwnedByRoot
|
||||
}
|
||||
} catch (error) {
|
||||
await managerLogger.error('Failed to check high privilege core', error)
|
||||
return false
|
||||
|
||||
@ -113,15 +113,13 @@ if (process.platform === 'win32' && !exePath().startsWith('C')) {
|
||||
app.commandLine.appendSwitch('in-process-gpu')
|
||||
}
|
||||
|
||||
// 运行内核检测
|
||||
// 内核检测
|
||||
async function checkHighPrivilegeCoreEarly(): Promise<void> {
|
||||
if (process.platform !== 'win32') {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await initBasic()
|
||||
|
||||
// 应用管理员权限运行,跳过检测
|
||||
if (process.platform === 'win32') {
|
||||
const { checkAdminPrivileges } = await import('./core/manager')
|
||||
const isCurrentAppAdmin = await checkAdminPrivileges()
|
||||
|
||||
@ -129,6 +127,12 @@ async function checkHighPrivilegeCoreEarly(): Promise<void> {
|
||||
console.log('Current app is running as administrator, skipping privilege check')
|
||||
return
|
||||
}
|
||||
} else if (process.platform === 'darwin' || process.platform === 'linux') {
|
||||
if (process.getuid && process.getuid() === 0) {
|
||||
console.log('Current app is running as root, skipping privilege check')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const hasHighPrivilegeCore = await checkHighPrivilegeCore()
|
||||
if (hasHighPrivilegeCore) {
|
||||
@ -151,7 +155,7 @@ async function checkHighPrivilegeCoreEarly(): Promise<void> {
|
||||
|
||||
if (choice === 0) {
|
||||
try {
|
||||
// Windows 平台重启应用获取管理员权限
|
||||
// 非TUN重启
|
||||
await restartAsAdmin(false)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
|
||||
@ -67,7 +67,7 @@ export const defaultControledMihomoConfig: Partial<IMihomoConfig> = {
|
||||
'skip-auth-prefixes': ['127.0.0.1/32'],
|
||||
tun: {
|
||||
enable: false,
|
||||
device: process.platform === 'darwin' ? 'utun1500' : 'Mihomo',
|
||||
device: 'Mihomo',
|
||||
stack: 'mixed',
|
||||
'auto-route': true,
|
||||
'auto-redirect': false,
|
||||
|
||||
@ -18,7 +18,7 @@ const Tun: React.FC = () => {
|
||||
const { tun } = controledMihomoConfig || {}
|
||||
const [loading, setLoading] = useState(false)
|
||||
const {
|
||||
device = platform === 'darwin' ? 'utun1500' : 'Mihomo',
|
||||
device = 'Mihomo',
|
||||
stack = 'mixed',
|
||||
'auto-route': autoRoute = true,
|
||||
'auto-redirect': autoRedirect = false,
|
||||
@ -165,17 +165,18 @@ const Tun: React.FC = () => {
|
||||
<Tab key="system" title="System" />
|
||||
</Tabs>
|
||||
</SettingItem>
|
||||
{platform !== 'darwin' && (
|
||||
<SettingItem title={t('tun.device.title')} divider>
|
||||
<Input
|
||||
size="sm"
|
||||
className="w-[100px]"
|
||||
value={values.device}
|
||||
placeholder={platform === 'darwin' ? 'utun1500' : 'Mihomo'}
|
||||
onValueChange={(v) => {
|
||||
setValues({ ...values, device: v })
|
||||
}}
|
||||
/>
|
||||
</SettingItem>
|
||||
)}
|
||||
|
||||
<SettingItem title={t('tun.strictRoute')} divider>
|
||||
<Switch
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user