diff --git a/.github/update.log b/.github/update.log index c6c27a7fcd..2e85a9d22f 100644 --- a/.github/update.log +++ b/.github/update.log @@ -691,3 +691,4 @@ Update On Sat Jun 29 20:29:36 CEST 2024 Update On Sun Jun 30 20:30:33 CEST 2024 Update On Mon Jul 1 20:30:34 CEST 2024 Update On Tue Jul 2 20:34:08 CEST 2024 +Update On Wed Jul 3 20:29:03 CEST 2024 diff --git a/clash-nyanpasu/backend/Cargo.lock b/clash-nyanpasu/backend/Cargo.lock index 975296c5bb..a98c7ec087 100644 --- a/clash-nyanpasu/backend/Cargo.lock +++ b/clash-nyanpasu/backend/Cargo.lock @@ -891,7 +891,7 @@ dependencies = [ "nanoid", "num_cpus", "once_cell", - "open 5.1.4", + "open 5.2.0", "parking_lot", "percent-encoding", "port_scanner", @@ -2606,7 +2606,7 @@ dependencies = [ "httpdate", "itoa 1.0.11", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -3153,7 +3153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -3823,9 +3823,9 @@ dependencies = [ [[package]] name = "open" -version = "5.1.4" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ca541f22b1c46d4bb9801014f234758ab4297e7870b904b6a8415b980a7388" +checksum = "9d2c909a3fce3bd80efef4cd1c6c056bd9376a8fe06fcfdbebaf32cb485a7e37" dependencies = [ "is-wsl", "libc", @@ -5810,9 +5810,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "1.6.8" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77567d2b3b74de4588d544147142d02297f3eaa171a25a065252141d8597a516" +checksum = "336bc661a3f3250853fa83c6e5245449ed1c26dce5dcb28bdee7efedf6278806" dependencies = [ "anyhow", "base64 0.21.7", @@ -5875,9 +5875,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab30cba12974d0f9b09794f61e72cad6da2142d3ceb81e519321bab86ce53312" +checksum = "b0c6ec7a5c3296330c7818478948b422967ce4649094696c985f61d50076d29c" dependencies = [ "anyhow", "cargo_toml", @@ -5894,9 +5894,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.4.3" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a1d90db526a8cdfd54444ad3f34d8d4d58fa5c536463915942393743bd06f8" +checksum = "c1aed706708ff1200ec12de9cfbf2582b5d8ec05f6a7293911091effbd22036b" dependencies = [ "base64 0.21.7", "brotli", @@ -5920,9 +5920,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a582d75414250122e4a597b9dd7d3c910a2c77906648fc2ac9353845ff0feec" +checksum = "b88f831d2973ae4f81a706a0004e67dac87f2e4439973bbe98efbd73825d8ede" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -5948,9 +5948,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7ffddf36d450791018e63a3ddf54979b9581d9644c584a5fb5611e6b5f20b4" +checksum = "3068ed62b63dedc705558f4248c7ecbd5561f0f8050949859ea0db2326f26012" dependencies = [ "gtk", "http", @@ -5969,9 +5969,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1989b3b4d611f5428b3414a4abae6fa6df30c7eb8ed33250ca90a5f7e5bb3655" +checksum = "d4c3db170233096aa30330feadcd895bf9317be97e624458560a20e814db7955" dependencies = [ "arboard", "cocoa 0.24.1", @@ -5990,9 +5990,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450b17a7102e5d46d4bdabae0d1590fd27953e704e691fc081f06c06d2253b35" +checksum = "2826db448309d382dac14d520f0c0a40839b87b57b977e59cf5f296b3ace6a93" dependencies = [ "brotli", "ctor", diff --git a/clash-nyanpasu/frontend/interface/package.json b/clash-nyanpasu/frontend/interface/package.json index d51ee50a39..d22caa50d8 100644 --- a/clash-nyanpasu/frontend/interface/package.json +++ b/clash-nyanpasu/frontend/interface/package.json @@ -4,7 +4,7 @@ "main": "index.ts", "module": "index.ts", "dependencies": { - "@tauri-apps/api": "1.5.6", + "@tauri-apps/api": "1.6.0", "ahooks": "3.8.0", "ofetch": "1.3.4", "react": "18.3.1", diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index c8364e1960..c8f8b15750 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -22,7 +22,7 @@ "@mui/x-data-grid": "7.8.0", "@nyanpasu/interface": "workspace:^", "@nyanpasu/ui": "workspace:^", - "@tauri-apps/api": "1.5.6", + "@tauri-apps/api": "1.6.0", "ahooks": "3.8.0", "allotment": "1.20.2", "axios": "1.7.2", @@ -37,7 +37,7 @@ "react-error-boundary": "4.0.13", "react-fast-marquee": "1.6.5", "react-hook-form": "7.52.1", - "react-hook-form-mui": "7.0.0", + "react-hook-form-mui": "7.0.1", "react-i18next": "14.1.2", "react-markdown": "9.0.1", "react-router-dom": "6.24.0", @@ -58,11 +58,11 @@ "@vitejs/plugin-react": "4.3.1", "@vitejs/plugin-react-swc": "3.7.0", "clsx": "2.1.1", - "react-resizable-panels": "2.0.19", + "react-resizable-panels": "2.0.20", "sass": "1.77.6", - "shiki": "1.10.0", + "shiki": "1.10.1", "tailwindcss-textshadow": "2.1.3", - "vite": "5.3.2", + "vite": "5.3.3", "vite-plugin-monaco-editor": "1.1.3", "vite-plugin-sass-dts": "1.3.22", "vite-plugin-svgr": "4.2.0", diff --git a/clash-nyanpasu/frontend/ui/package.json b/clash-nyanpasu/frontend/ui/package.json index 456e0a2892..8a6c5f0a1a 100644 --- a/clash-nyanpasu/frontend/ui/package.json +++ b/clash-nyanpasu/frontend/ui/package.json @@ -8,7 +8,7 @@ "@mui/icons-material": "5.15.21", "@mui/lab": "5.0.0-alpha.170", "@mui/material": "5.15.21", - "@tauri-apps/api": "1.5.6", + "@tauri-apps/api": "1.6.0", "@types/d3": "7.4.3", "@types/react": "18.3.3", "ahooks": "3.8.0", diff --git a/clash-nyanpasu/package.json b/clash-nyanpasu/package.json index c4b7821014..6499c38647 100644 --- a/clash-nyanpasu/package.json +++ b/clash-nyanpasu/package.json @@ -71,7 +71,7 @@ "devDependencies": { "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", - "@tauri-apps/cli": "1.5.14", + "@tauri-apps/cli": "1.6.0", "@types/fs-extra": "11.0.4", "@types/lodash-es": "4.17.12", "@types/node": "20.14.9", @@ -106,7 +106,7 @@ "stylelint-order": "6.0.4", "stylelint-scss": "6.3.2", "tailwindcss": "3.4.4", - "tsx": "4.16.0", + "tsx": "4.16.2", "typescript": "5.5.3" }, "packageManager": "pnpm@9.4.0", diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index 95425123eb..2289c4937d 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -29,8 +29,8 @@ importers: specifier: 19.2.2 version: 19.2.2 '@tauri-apps/cli': - specifier: 1.5.14 - version: 1.5.14 + specifier: 1.6.0 + version: 1.6.0 '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -134,8 +134,8 @@ importers: specifier: 3.4.4 version: 3.4.4 tsx: - specifier: 4.16.0 - version: 4.16.0 + specifier: 4.16.2 + version: 4.16.2 typescript: specifier: 5.5.3 version: 5.5.3 @@ -143,8 +143,8 @@ importers: frontend/interface: dependencies: '@tauri-apps/api': - specifier: 1.5.6 - version: 1.5.6 + specifier: 1.6.0 + version: 1.6.0 ahooks: specifier: 3.8.0 version: 3.8.0(react@19.0.0-rc-fb9a90fa48-20240614) @@ -178,7 +178,7 @@ importers: version: 11.11.5(@emotion/react@11.11.4(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1) '@generouted/react-router': specifier: 1.19.5 - version: 1.19.5(react-router-dom@6.24.0(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 1.19.5(react-router-dom@6.24.0(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) '@juggle/resize-observer': specifier: 3.4.0 version: 3.4.0 @@ -204,8 +204,8 @@ importers: specifier: workspace:^ version: link:../ui '@tauri-apps/api': - specifier: 1.5.6 - version: 1.5.6 + specifier: 1.6.0 + version: 1.6.0 ahooks: specifier: 3.8.0 version: 3.8.0(react@19.0.0-rc-fb9a90fa48-20240614) @@ -249,8 +249,8 @@ importers: specifier: 7.52.1 version: 7.52.1(react@19.0.0-rc-fb9a90fa48-20240614) react-hook-form-mui: - specifier: 7.0.0 - version: 7.0.0(hnsbxdphojlfk7ty6r3hqlevge) + specifier: 7.0.1 + version: 7.0.1(hnsbxdphojlfk7ty6r3hqlevge) react-i18next: specifier: 14.1.2 version: 14.1.2(i18next@23.11.5)(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614) @@ -299,40 +299,40 @@ importers: version: 7.15.0(eslint@8.57.0)(typescript@5.5.3) '@vitejs/plugin-react': specifier: 4.3.1 - version: 4.3.1(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 4.3.1(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) '@vitejs/plugin-react-swc': specifier: 3.7.0 - version: 3.7.0(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 3.7.0(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) clsx: specifier: 2.1.1 version: 2.1.1 react-resizable-panels: - specifier: 2.0.19 - version: 2.0.19(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614) + specifier: 2.0.20 + version: 2.0.20(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614) sass: specifier: 1.77.6 version: 1.77.6 shiki: - specifier: 1.10.0 - version: 1.10.0 + specifier: 1.10.1 + version: 1.10.1 tailwindcss-textshadow: specifier: 2.1.3 version: 2.1.3 vite: - specifier: 5.3.2 - version: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + specifier: 5.3.3 + version: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) vite-plugin-monaco-editor: specifier: npm:vite-plugin-monaco-editor-new@1.1.3 version: vite-plugin-monaco-editor-new@1.1.3(monaco-editor@0.50.0) vite-plugin-sass-dts: specifier: 1.3.22 - version: 1.3.22(postcss@8.4.39)(prettier@3.3.2)(sass@1.77.6)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 1.3.22(postcss@8.4.39)(prettier@3.3.2)(sass@1.77.6)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) vite-plugin-svgr: specifier: 4.2.0 - version: 4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) vite-tsconfig-paths: specifier: 4.3.2 - version: 4.3.2(typescript@5.5.3)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + version: 4.3.2(typescript@5.5.3)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) frontend/ui: dependencies: @@ -349,8 +349,8 @@ importers: specifier: 5.15.21 version: 5.15.21(@emotion/react@11.11.4(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1) '@tauri-apps/api': - specifier: 1.5.6 - version: 1.5.6 + specifier: 1.6.0 + version: 1.6.0 '@types/d3': specifier: 7.4.3 version: 7.4.3 @@ -751,12 +751,6 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.21.4': - resolution: {integrity: sha512-Zrm+B33R4LWPLjDEVnEqt2+SLTATlru1q/xYKVn8oVTbiRBGmK2VIMoIYGJDGyftnGaC788IuzGFAlb7IQ0Y8A==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -769,12 +763,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.21.4': - resolution: {integrity: sha512-fYFnz+ObClJ3dNiITySBUx+oNalYUT18/AryMxfovLkYWbutXsct3Wz2ZWAcGGppp+RVVX5FiXeLYGi97umisA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm64@0.21.5': resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} engines: {node: '>=12'} @@ -787,12 +775,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.21.4': - resolution: {integrity: sha512-E7H/yTd8kGQfY4z9t3nRPk/hrhaCajfA3YSQSBrst8B+3uTcgsi8N+ZWYCaeIDsiVs6m65JPCaQN/DxBRclF3A==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - '@esbuild/android-arm@0.21.5': resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} engines: {node: '>=12'} @@ -805,12 +787,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.21.4': - resolution: {integrity: sha512-mDqmlge3hFbEPbCWxp4fM6hqq7aZfLEHZAKGP9viq9wMUBVQx202aDIfc3l+d2cKhUJM741VrCXEzRFhPDKH3Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - '@esbuild/android-x64@0.21.5': resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} engines: {node: '>=12'} @@ -823,12 +799,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.21.4': - resolution: {integrity: sha512-72eaIrDZDSiWqpmCzVaBD58c8ea8cw/U0fq/PPOTqE3c53D0xVMRt2ooIABZ6/wj99Y+h4ksT/+I+srCDLU9TA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-arm64@0.21.5': resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} engines: {node: '>=12'} @@ -841,12 +811,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.21.4': - resolution: {integrity: sha512-uBsuwRMehGmw1JC7Vecu/upOjTsMhgahmDkWhGLWxIgUn2x/Y4tIwUZngsmVb6XyPSTXJYS4YiASKPcm9Zitag==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - '@esbuild/darwin-x64@0.21.5': resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} engines: {node: '>=12'} @@ -859,12 +823,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.21.4': - resolution: {integrity: sha512-8JfuSC6YMSAEIZIWNL3GtdUT5NhUA/CMUCpZdDRolUXNAXEE/Vbpe6qlGLpfThtY5NwXq8Hi4nJy4YfPh+TwAg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-arm64@0.21.5': resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} engines: {node: '>=12'} @@ -877,12 +835,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.4': - resolution: {integrity: sha512-8d9y9eQhxv4ef7JmXny7591P/PYsDFc4+STaxC1GBv0tMyCdyWfXu2jBuqRsyhY8uL2HU8uPyscgE2KxCY9imQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} engines: {node: '>=12'} @@ -895,12 +847,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.21.4': - resolution: {integrity: sha512-/GLD2orjNU50v9PcxNpYZi+y8dJ7e7/LhQukN3S4jNDXCKkyyiyAz9zDw3siZ7Eh1tRcnCHAo/WcqKMzmi4eMQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm64@0.21.5': resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} engines: {node: '>=12'} @@ -913,12 +859,6 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.21.4': - resolution: {integrity: sha512-2rqFFefpYmpMs+FWjkzSgXg5vViocqpq5a1PSRgT0AvSgxoXmGF17qfGAzKedg6wAwyM7UltrKVo9kxaJLMF/g==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - '@esbuild/linux-arm@0.21.5': resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} @@ -931,12 +871,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.21.4': - resolution: {integrity: sha512-pNftBl7m/tFG3t2m/tSjuYeWIffzwAZT9m08+9DPLizxVOsUl8DdFzn9HvJrTQwe3wvJnwTdl92AonY36w/25g==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - '@esbuild/linux-ia32@0.21.5': resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} engines: {node: '>=12'} @@ -949,12 +883,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.21.4': - resolution: {integrity: sha512-cSD2gzCK5LuVX+hszzXQzlWya6c7hilO71L9h4KHwqI4qeqZ57bAtkgcC2YioXjsbfAv4lPn3qe3b00Zt+jIfQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-loong64@0.21.5': resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} engines: {node: '>=12'} @@ -967,12 +895,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.21.4': - resolution: {integrity: sha512-qtzAd3BJh7UdbiXCrg6npWLYU0YpufsV9XlufKhMhYMJGJCdfX/G6+PNd0+v877X1JG5VmjBLUiFB0o8EUSicA==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-mips64el@0.21.5': resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} engines: {node: '>=12'} @@ -985,12 +907,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.21.4': - resolution: {integrity: sha512-yB8AYzOTaL0D5+2a4xEy7OVvbcypvDR05MsB/VVPVA7nL4hc5w5Dyd/ddnayStDgJE59fAgNEOdLhBxjfx5+dg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-ppc64@0.21.5': resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} engines: {node: '>=12'} @@ -1003,12 +919,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.21.4': - resolution: {integrity: sha512-Y5AgOuVzPjQdgU59ramLoqSSiXddu7F3F+LI5hYy/d1UHN7K5oLzYBDZe23QmQJ9PIVUXwOdKJ/jZahPdxzm9w==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-riscv64@0.21.5': resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} engines: {node: '>=12'} @@ -1021,12 +931,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.21.4': - resolution: {integrity: sha512-Iqc/l/FFwtt8FoTK9riYv9zQNms7B8u+vAI/rxKuN10HgQIXaPzKZc479lZ0x6+vKVQbu55GdpYpeNWzjOhgbA==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-s390x@0.21.5': resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} engines: {node: '>=12'} @@ -1039,12 +943,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.21.4': - resolution: {integrity: sha512-Td9jv782UMAFsuLZINfUpoF5mZIbAj+jv1YVtE58rFtfvoKRiKSkRGQfHTgKamLVT/fO7203bHa3wU122V/Bdg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - '@esbuild/linux-x64@0.21.5': resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} engines: {node: '>=12'} @@ -1057,12 +955,6 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.21.4': - resolution: {integrity: sha512-Awn38oSXxsPMQxaV0Ipb7W/gxZtk5Tx3+W+rAPdZkyEhQ6968r9NvtkjhnhbEgWXYbgV+JEONJ6PcdBS+nlcpA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - '@esbuild/netbsd-x64@0.21.5': resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} engines: {node: '>=12'} @@ -1075,12 +967,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.4': - resolution: {integrity: sha512-IsUmQeCY0aU374R82fxIPu6vkOybWIMc3hVGZ3ChRwL9hA1TwY+tS0lgFWV5+F1+1ssuvvXt3HFqe8roCip8Hg==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} engines: {node: '>=12'} @@ -1093,12 +979,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.21.4': - resolution: {integrity: sha512-hsKhgZ4teLUaDA6FG/QIu2q0rI6I36tZVfM4DBZv3BG0mkMIdEnMbhc4xwLvLJSS22uWmaVkFkqWgIS0gPIm+A==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - '@esbuild/sunos-x64@0.21.5': resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} engines: {node: '>=12'} @@ -1111,12 +991,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.21.4': - resolution: {integrity: sha512-UUfMgMoXPoA/bvGUNfUBFLCh0gt9dxZYIx9W4rfJr7+hKe5jxxHmfOK8YSH4qsHLLN4Ck8JZ+v7Q5fIm1huErg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-arm64@0.21.5': resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} engines: {node: '>=12'} @@ -1129,12 +1003,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.21.4': - resolution: {integrity: sha512-yIxbspZb5kGCAHWm8dexALQ9en1IYDfErzjSEq1KzXFniHv019VT3mNtTK7t8qdy4TwT6QYHI9sEZabONHg+aw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-ia32@0.21.5': resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} engines: {node: '>=12'} @@ -1147,12 +1015,6 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.21.4': - resolution: {integrity: sha512-sywLRD3UK/qRJt0oBwdpYLBibk7KiRfbswmWRDabuncQYSlf8aLEEUor/oP6KRz8KEG+HoiVLBhPRD5JWjS8Sg==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - '@esbuild/win32-x64@0.21.5': resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} engines: {node: '>=12'} @@ -1673,8 +1535,8 @@ packages: cpu: [x64] os: [win32] - '@shikijs/core@1.10.0': - resolution: {integrity: sha512-BZcr6FCmPfP6TXaekvujZcnkFmJHZ/Yglu97r/9VjzVndQA56/F4WjUKtJRQUnK59Wi7p/UTAOekMfCJv7jnYg==} + '@shikijs/core@1.10.1': + resolution: {integrity: sha512-qdiJS5a/QGCff7VUFIqd0hDdWly9rDp8lhVmXVrS11aazX8LOTRLHAXkkEeONNsS43EcCd7gax9LLoOz4vlFQA==} '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} @@ -1833,72 +1695,72 @@ packages: '@taplo/lib@0.4.0-alpha.2': resolution: {integrity: sha512-DV/Re3DPVY+BhBtLZ3dmP4mP6YMLSsgq9qGLXwOV38lvNF/fBlgvQswzlXmzCEefL/3q2eMoefZpOI/+GLuCNA==} - '@tauri-apps/api@1.5.6': - resolution: {integrity: sha512-LH5ToovAHnDVe5Qa9f/+jW28I6DeMhos8bNDtBOmmnaDpPmJmYLyHdeDblAWWWYc7KKRDg9/66vMuKyq0WIeFA==} + '@tauri-apps/api@1.6.0': + resolution: {integrity: sha512-rqI++FWClU5I2UBp4HXFvl+sBWkdigBkxnpJDQUWttNyG7IZP4FwQGhTNL5EOw0vI8i6eSAJ5frLqO7n7jbJdg==} engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} - '@tauri-apps/cli-darwin-arm64@1.5.14': - resolution: {integrity: sha512-lxoSOp3KKSqzHJa7iT32dukPGMlfsTuja1xXSgwR8o/fqzpYJY7FY/3ZxesP8HR66FcK+vtqa//HNqeOQ0mHkA==} + '@tauri-apps/cli-darwin-arm64@1.6.0': + resolution: {integrity: sha512-SNRwUD9nqGxY47mbY1CGTt/jqyQOU7Ps7Mx/mpgahL0FVUDiCEY/5L9QfEPPhEgccgcelEVn7i6aQHIkHyUtCA==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@tauri-apps/cli-darwin-x64@1.5.14': - resolution: {integrity: sha512-EXSwN1n5spfG8FoXuyc90ACtmDJXzaZ1gxyENaq9xEpQoo7j/Q1vb6qXxmr6azKr8zmqY4h08ZFbv3exh93xJg==} + '@tauri-apps/cli-darwin-x64@1.6.0': + resolution: {integrity: sha512-g2/uDR/eeH2arvuawA4WwaEOqv/7jDO/ZLNI3JlBjP5Pk8GGb3Kdy0ro1xQzF94mtk2mOnOXa4dMgAet4sUJ1A==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@tauri-apps/cli-linux-arm-gnueabihf@1.5.14': - resolution: {integrity: sha512-Yb8BH/KYR7Tl+de40sZPfrqbhcU3Jlu+UPIrnXt05sjn48xqIps74Xjz8zzVp0TuHxUp8FmIGtCVhQgsbrsvvg==} + '@tauri-apps/cli-linux-arm-gnueabihf@1.6.0': + resolution: {integrity: sha512-EVwf4oRkQyG8BpSrk0gqO7oA0sDM2MdNDtJpMfleYFEgCxLIOGZKNqaOW3M7U+0Y4qikmG3TtRK+ngc8Ymtrjg==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@tauri-apps/cli-linux-arm64-gnu@1.5.14': - resolution: {integrity: sha512-QrKHP4gRaHiup478rPBZ+BmNd88yze9jMmheoNy9mN1K/aECRmTHO+tWhsxv5moFHZzRhO0QDWxxvTtiaPXaGg==} + '@tauri-apps/cli-linux-arm64-gnu@1.6.0': + resolution: {integrity: sha512-YdpY17cAySrhK9dX4BUVEmhAxE2o+6skIEFg8iN/xrDwRxhaNPI9I80YXPatUTX54Kx55T5++25VJG9+3iw83A==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tauri-apps/cli-linux-arm64-musl@1.5.14': - resolution: {integrity: sha512-Hb1C1VMxmUcyGjW/K/INKF87zzzgLEVRmWZZnQd7M1P4uue4xPyIwUELSdX12Z2jREPgmLW4AXPD0m6wsNu7iw==} + '@tauri-apps/cli-linux-arm64-musl@1.6.0': + resolution: {integrity: sha512-4U628tuf2U8pMr4tIBJhEkrFwt+46dwhXrDlpdyWSZtnop5RJAVKHODm0KbWns4xGKfTW1F3r6sSv+2ZxLcISA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@tauri-apps/cli-linux-x64-gnu@1.5.14': - resolution: {integrity: sha512-kD9v/UwPDuhIgq2TJj/s2/7rqk+vmExVV6xHPKI8vVbIvlNAOZqmx3fpxjej1241vhJ/piGd/m6q6YMWGsL0oQ==} + '@tauri-apps/cli-linux-x64-gnu@1.6.0': + resolution: {integrity: sha512-AKRzp76fVUaJyXj5KRJT9bJyhwZyUnRQU0RqIRqOtZCT5yr6qGP8rjtQ7YhCIzWrseBlOllc3Qvbgw3Yl0VQcA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tauri-apps/cli-linux-x64-musl@1.5.14': - resolution: {integrity: sha512-204Drgg9Zx0+THKndqASz4+iPCwqA3gQVF9C0CDIArNXrjPyJjVvW8VP5CHiZYaTNWxlz/ltyxluM6UFWbXNFw==} + '@tauri-apps/cli-linux-x64-musl@1.6.0': + resolution: {integrity: sha512-0edIdq6aMBTaRMIXddHfyAFL361JqulLLd2Wi2aoOie7DkQ2MYh6gv3hA7NB9gqFwNIGE+xtJ4BkXIP2tSGPlg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@tauri-apps/cli-win32-arm64-msvc@1.5.14': - resolution: {integrity: sha512-sqPSni2MnWNCm+8YZnLdWCclxfSHaYqKuPFSz8q7Tn1G1m/cA9gyPoC1G0esHftY7bu/ZM5lB4kM3I4U0KlLiA==} + '@tauri-apps/cli-win32-arm64-msvc@1.6.0': + resolution: {integrity: sha512-QwWpWk4ubcwJ1rljsRAmINgB2AwkyzZhpYbalA+MmzyYMREcdXWGkyixWbRZgqc6fEWEBmq5UG73qz5eBJiIKg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@tauri-apps/cli-win32-ia32-msvc@1.5.14': - resolution: {integrity: sha512-8xN8W0zTs8oFsQmvYLxHFeqhzVI7oTaPK1xQMc5gbpFP45jN41c21aCXfjnvzT+h90EfCHUF9EWj2HTEJSb7Iw==} + '@tauri-apps/cli-win32-ia32-msvc@1.6.0': + resolution: {integrity: sha512-Vtw0yxO9+aEFuhuxQ57ALG43tjECopRimRuKGbtZYDCriB/ty5TrT3QWMdy0dxBkpDTu3Rqsz30sbDzw6tlP3Q==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] - '@tauri-apps/cli-win32-x64-msvc@1.5.14': - resolution: {integrity: sha512-U0slee5tNM2PYECBpPHavLSwkT3szGMZ+qhcikQQbDan84bQdLn/kHWjyXOgLJs4KSve4+KxcrN+AVqj0VyHnw==} + '@tauri-apps/cli-win32-x64-msvc@1.6.0': + resolution: {integrity: sha512-h54FHOvGi7+LIfRchzgZYSCHB1HDlP599vWXQQJ/XnwJY+6Rwr2E5bOe/EhqoG8rbGkfK0xX3KPAvXPbUlmggg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] - '@tauri-apps/cli@1.5.14': - resolution: {integrity: sha512-JOSMKymlg116UdEXSj69eg5p1OtZnQkUE0qIGbtNDO1sk3X/KgBN6+oHBW0BzPStp/W0AjBgrMWCqjHPwEpOug==} + '@tauri-apps/cli@1.6.0': + resolution: {integrity: sha512-DBBpBl6GhTzm8ImMbKkfaZ4fDTykWrC7Q5OXP4XqD91recmDEn2LExuvuiiS3HYe7uP8Eb5B9NPHhqJb+Zo7qQ==} engines: {node: '>= 10'} hasBin: true @@ -3084,11 +2946,6 @@ packages: engines: {node: '>=12'} hasBin: true - esbuild@0.21.4: - resolution: {integrity: sha512-sFMcNNrj+Q0ZDolrp5pDhH0nRPN9hLIM3fRPwgbLYJeSHHgnXSnbV3xYgSVuOeLWH9c73VwmEverVzupIv5xuA==} - engines: {node: '>=12'} - hasBin: true - esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -4878,8 +4735,8 @@ packages: react: npm:react@rc react-dom: npm:react-dom@rc - react-hook-form-mui@7.0.0: - resolution: {integrity: sha512-P/0Vd2p1Sjom1+um2hS58L5xMsiNObg3aenmRqsND8IG+dTQhLRevGl0U6UOpWr9UZ5X51wgDwPOzxKbylIcog==} + react-hook-form-mui@7.0.1: + resolution: {integrity: sha512-ik4upg0pc3K9VTJcKSxmGXfwwPVoDLA+mPtD+csF47h1tYx4rrrRBpJ/27fvmzBPhUZS3pFAo7rs1LgMQ94Ukw==} engines: {node: '>=14'} peerDependencies: '@mui/icons-material': '>= 5.x <6' @@ -4928,8 +4785,8 @@ packages: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} - react-resizable-panels@2.0.19: - resolution: {integrity: sha512-v3E41kfKSuCPIvJVb4nL4mIZjjKIn/gh6YqZF/gDfQDolv/8XnhJBek4EiV2gOr3hhc5A3kOGOayk3DhanpaQw==} + react-resizable-panels@2.0.20: + resolution: {integrity: sha512-aMbK3VF8U+VBICG+rwhE0Rr/eFZaRzmNq3akBRL1TrayIpLXz7Rbok0//kYeWj6SQRsjcQ3f4eRplJicM+oL6w==} peerDependencies: react: npm:react@rc react-dom: npm:react-dom@rc @@ -5161,8 +5018,8 @@ packages: shell-quote@1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} - shiki@1.10.0: - resolution: {integrity: sha512-YD2sXQ+TMD/F9BimV9Jn0wj35pqOvywvOG/3PB6hGHyGKlM7TJ9tyJ02jOb2kF8F0HfJwKNYrh3sW7jEcuRlXA==} + shiki@1.10.1: + resolution: {integrity: sha512-uafV7WCgN4YYrccH6yxpnps6k38sSTlFRrwc4jycWmhWxJIm9dPrk+XkY1hZ2t0I7jmacMNb15Lf2fspa/Y3lg==} side-channel@1.0.6: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} @@ -5503,8 +5360,8 @@ packages: tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - tsx@4.16.0: - resolution: {integrity: sha512-MPgN+CuY+4iKxGoJNPv+1pyo5YWZAQ5XfsyobUG+zoKG7IkvCPLZDEyoIb8yLS2FcWci1nlxAqmvPlFWD5AFiQ==} + tsx@4.16.2: + resolution: {integrity: sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==} engines: {node: '>=18.0.0'} hasBin: true @@ -5713,8 +5570,8 @@ packages: vite: optional: true - vite@5.3.2: - resolution: {integrity: sha512-6lA7OBHBlXUxiJxbO5aAY2fsHHzDr1q7DvXYnyZycRs2Dz+dXBWuhpWHvmljTRTpQC2uvGmUFFkSHF2vGo90MA==} + vite@5.3.3: + resolution: {integrity: sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -6299,207 +6156,138 @@ snapshots: '@esbuild/aix-ppc64@0.19.12': optional: true - '@esbuild/aix-ppc64@0.21.4': - optional: true - '@esbuild/aix-ppc64@0.21.5': optional: true '@esbuild/android-arm64@0.19.12': optional: true - '@esbuild/android-arm64@0.21.4': - optional: true - '@esbuild/android-arm64@0.21.5': optional: true '@esbuild/android-arm@0.19.12': optional: true - '@esbuild/android-arm@0.21.4': - optional: true - '@esbuild/android-arm@0.21.5': optional: true '@esbuild/android-x64@0.19.12': optional: true - '@esbuild/android-x64@0.21.4': - optional: true - '@esbuild/android-x64@0.21.5': optional: true '@esbuild/darwin-arm64@0.19.12': optional: true - '@esbuild/darwin-arm64@0.21.4': - optional: true - '@esbuild/darwin-arm64@0.21.5': optional: true '@esbuild/darwin-x64@0.19.12': optional: true - '@esbuild/darwin-x64@0.21.4': - optional: true - '@esbuild/darwin-x64@0.21.5': optional: true '@esbuild/freebsd-arm64@0.19.12': optional: true - '@esbuild/freebsd-arm64@0.21.4': - optional: true - '@esbuild/freebsd-arm64@0.21.5': optional: true '@esbuild/freebsd-x64@0.19.12': optional: true - '@esbuild/freebsd-x64@0.21.4': - optional: true - '@esbuild/freebsd-x64@0.21.5': optional: true '@esbuild/linux-arm64@0.19.12': optional: true - '@esbuild/linux-arm64@0.21.4': - optional: true - '@esbuild/linux-arm64@0.21.5': optional: true '@esbuild/linux-arm@0.19.12': optional: true - '@esbuild/linux-arm@0.21.4': - optional: true - '@esbuild/linux-arm@0.21.5': optional: true '@esbuild/linux-ia32@0.19.12': optional: true - '@esbuild/linux-ia32@0.21.4': - optional: true - '@esbuild/linux-ia32@0.21.5': optional: true '@esbuild/linux-loong64@0.19.12': optional: true - '@esbuild/linux-loong64@0.21.4': - optional: true - '@esbuild/linux-loong64@0.21.5': optional: true '@esbuild/linux-mips64el@0.19.12': optional: true - '@esbuild/linux-mips64el@0.21.4': - optional: true - '@esbuild/linux-mips64el@0.21.5': optional: true '@esbuild/linux-ppc64@0.19.12': optional: true - '@esbuild/linux-ppc64@0.21.4': - optional: true - '@esbuild/linux-ppc64@0.21.5': optional: true '@esbuild/linux-riscv64@0.19.12': optional: true - '@esbuild/linux-riscv64@0.21.4': - optional: true - '@esbuild/linux-riscv64@0.21.5': optional: true '@esbuild/linux-s390x@0.19.12': optional: true - '@esbuild/linux-s390x@0.21.4': - optional: true - '@esbuild/linux-s390x@0.21.5': optional: true '@esbuild/linux-x64@0.19.12': optional: true - '@esbuild/linux-x64@0.21.4': - optional: true - '@esbuild/linux-x64@0.21.5': optional: true '@esbuild/netbsd-x64@0.19.12': optional: true - '@esbuild/netbsd-x64@0.21.4': - optional: true - '@esbuild/netbsd-x64@0.21.5': optional: true '@esbuild/openbsd-x64@0.19.12': optional: true - '@esbuild/openbsd-x64@0.21.4': - optional: true - '@esbuild/openbsd-x64@0.21.5': optional: true '@esbuild/sunos-x64@0.19.12': optional: true - '@esbuild/sunos-x64@0.21.4': - optional: true - '@esbuild/sunos-x64@0.21.5': optional: true '@esbuild/win32-arm64@0.19.12': optional: true - '@esbuild/win32-arm64@0.21.4': - optional: true - '@esbuild/win32-arm64@0.21.5': optional: true '@esbuild/win32-ia32@0.19.12': optional: true - '@esbuild/win32-ia32@0.21.4': - optional: true - '@esbuild/win32-ia32@0.21.5': optional: true '@esbuild/win32-x64@0.19.12': optional: true - '@esbuild/win32-x64@0.21.4': - optional: true - '@esbuild/win32-x64@0.21.5': optional: true @@ -6550,13 +6338,13 @@ snapshots: postcss: 7.0.32 purgecss: 2.3.0 - '@generouted/react-router@1.19.5(react-router-dom@6.24.0(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': + '@generouted/react-router@1.19.5(react-router-dom@6.24.0(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': dependencies: fast-glob: 3.3.2 - generouted: 1.19.5(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) + generouted: 1.19.5(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)) react: 19.0.0-rc-fb9a90fa48-20240614 react-router-dom: 6.24.0(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614) - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) '@humanwhocodes/config-array@0.11.14': dependencies: @@ -7039,7 +6827,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.17.2': optional: true - '@shikijs/core@1.10.0': {} + '@shikijs/core@1.10.1': {} '@sindresorhus/is@4.6.0': {} @@ -7175,50 +6963,50 @@ snapshots: dependencies: '@taplo/core': 0.1.1 - '@tauri-apps/api@1.5.6': {} + '@tauri-apps/api@1.6.0': {} - '@tauri-apps/cli-darwin-arm64@1.5.14': + '@tauri-apps/cli-darwin-arm64@1.6.0': optional: true - '@tauri-apps/cli-darwin-x64@1.5.14': + '@tauri-apps/cli-darwin-x64@1.6.0': optional: true - '@tauri-apps/cli-linux-arm-gnueabihf@1.5.14': + '@tauri-apps/cli-linux-arm-gnueabihf@1.6.0': optional: true - '@tauri-apps/cli-linux-arm64-gnu@1.5.14': + '@tauri-apps/cli-linux-arm64-gnu@1.6.0': optional: true - '@tauri-apps/cli-linux-arm64-musl@1.5.14': + '@tauri-apps/cli-linux-arm64-musl@1.6.0': optional: true - '@tauri-apps/cli-linux-x64-gnu@1.5.14': + '@tauri-apps/cli-linux-x64-gnu@1.6.0': optional: true - '@tauri-apps/cli-linux-x64-musl@1.5.14': + '@tauri-apps/cli-linux-x64-musl@1.6.0': optional: true - '@tauri-apps/cli-win32-arm64-msvc@1.5.14': + '@tauri-apps/cli-win32-arm64-msvc@1.6.0': optional: true - '@tauri-apps/cli-win32-ia32-msvc@1.5.14': + '@tauri-apps/cli-win32-ia32-msvc@1.6.0': optional: true - '@tauri-apps/cli-win32-x64-msvc@1.5.14': + '@tauri-apps/cli-win32-x64-msvc@1.6.0': optional: true - '@tauri-apps/cli@1.5.14': + '@tauri-apps/cli@1.6.0': optionalDependencies: - '@tauri-apps/cli-darwin-arm64': 1.5.14 - '@tauri-apps/cli-darwin-x64': 1.5.14 - '@tauri-apps/cli-linux-arm-gnueabihf': 1.5.14 - '@tauri-apps/cli-linux-arm64-gnu': 1.5.14 - '@tauri-apps/cli-linux-arm64-musl': 1.5.14 - '@tauri-apps/cli-linux-x64-gnu': 1.5.14 - '@tauri-apps/cli-linux-x64-musl': 1.5.14 - '@tauri-apps/cli-win32-arm64-msvc': 1.5.14 - '@tauri-apps/cli-win32-ia32-msvc': 1.5.14 - '@tauri-apps/cli-win32-x64-msvc': 1.5.14 + '@tauri-apps/cli-darwin-arm64': 1.6.0 + '@tauri-apps/cli-darwin-x64': 1.6.0 + '@tauri-apps/cli-linux-arm-gnueabihf': 1.6.0 + '@tauri-apps/cli-linux-arm64-gnu': 1.6.0 + '@tauri-apps/cli-linux-arm64-musl': 1.6.0 + '@tauri-apps/cli-linux-x64-gnu': 1.6.0 + '@tauri-apps/cli-linux-x64-musl': 1.6.0 + '@tauri-apps/cli-win32-arm64-msvc': 1.6.0 + '@tauri-apps/cli-win32-ia32-msvc': 1.6.0 + '@tauri-apps/cli-win32-x64-msvc': 1.6.0 '@types/adm-zip@0.5.5': dependencies: @@ -7546,21 +7334,21 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-react-swc@3.7.0(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': + '@vitejs/plugin-react-swc@3.7.0(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': dependencies: '@swc/core': 1.6.1 - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react@4.3.1(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': + '@vitejs/plugin-react@4.3.1(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0))': dependencies: '@babel/core': 7.24.5 '@babel/plugin-transform-react-jsx-self': 7.24.5(@babel/core@7.24.5) '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.5) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) transitivePeerDependencies: - supports-color @@ -8618,32 +8406,6 @@ snapshots: '@esbuild/win32-ia32': 0.19.12 '@esbuild/win32-x64': 0.19.12 - esbuild@0.21.4: - optionalDependencies: - '@esbuild/aix-ppc64': 0.21.4 - '@esbuild/android-arm': 0.21.4 - '@esbuild/android-arm64': 0.21.4 - '@esbuild/android-x64': 0.21.4 - '@esbuild/darwin-arm64': 0.21.4 - '@esbuild/darwin-x64': 0.21.4 - '@esbuild/freebsd-arm64': 0.21.4 - '@esbuild/freebsd-x64': 0.21.4 - '@esbuild/linux-arm': 0.21.4 - '@esbuild/linux-arm64': 0.21.4 - '@esbuild/linux-ia32': 0.21.4 - '@esbuild/linux-loong64': 0.21.4 - '@esbuild/linux-mips64el': 0.21.4 - '@esbuild/linux-ppc64': 0.21.4 - '@esbuild/linux-riscv64': 0.21.4 - '@esbuild/linux-s390x': 0.21.4 - '@esbuild/linux-x64': 0.21.4 - '@esbuild/netbsd-x64': 0.21.4 - '@esbuild/openbsd-x64': 0.21.4 - '@esbuild/sunos-x64': 0.21.4 - '@esbuild/win32-arm64': 0.21.4 - '@esbuild/win32-ia32': 0.21.4 - '@esbuild/win32-x64': 0.21.4 - esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -9067,9 +8829,9 @@ snapshots: functions-have-names@1.2.3: {} - generouted@1.19.5(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): + generouted@1.19.5(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): dependencies: - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) gensync@1.0.0-beta.2: {} @@ -10606,7 +10368,7 @@ snapshots: react: 19.0.0-rc-fb9a90fa48-20240614 react-dom: 19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614) - react-hook-form-mui@7.0.0(hnsbxdphojlfk7ty6r3hqlevge): + react-hook-form-mui@7.0.1(hnsbxdphojlfk7ty6r3hqlevge): dependencies: '@mui/material': 5.15.21(@emotion/react@11.11.4(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1))(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react@19.0.0-rc.1) react: 19.0.0-rc-fb9a90fa48-20240614 @@ -10650,7 +10412,7 @@ snapshots: react-refresh@0.14.2: {} - react-resizable-panels@2.0.19(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614): + react-resizable-panels@2.0.20(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614): dependencies: react: 19.0.0-rc-fb9a90fa48-20240614 react-dom: 19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614) @@ -10912,9 +10674,9 @@ snapshots: shell-quote@1.8.1: {} - shiki@1.10.0: + shiki@1.10.1: dependencies: - '@shikijs/core': 1.10.0 + '@shikijs/core': 1.10.1 side-channel@1.0.6: dependencies: @@ -11359,7 +11121,7 @@ snapshots: tslib@2.6.2: {} - tsx@4.16.0: + tsx@4.16.2: dependencies: esbuild: 0.21.5 get-tsconfig: 4.7.5 @@ -11583,40 +11345,40 @@ snapshots: esbuild: 0.19.12 monaco-editor: 0.50.0 - vite-plugin-sass-dts@1.3.22(postcss@8.4.39)(prettier@3.3.2)(sass@1.77.6)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): + vite-plugin-sass-dts@1.3.22(postcss@8.4.39)(prettier@3.3.2)(sass@1.77.6)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): dependencies: postcss: 8.4.39 postcss-js: 4.0.1(postcss@8.4.39) prettier: 3.3.2 sass: 1.77.6 - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) - vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): + vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.5.3)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.17.2) '@svgr/core': 8.1.0(typescript@5.5.3) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.5.3)) - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) transitivePeerDependencies: - rollup - supports-color - typescript - vite-tsconfig-paths@4.3.2(typescript@5.5.3)(vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): + vite-tsconfig-paths@4.3.2(typescript@5.5.3)(vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0)): dependencies: debug: 4.3.4 globrex: 0.1.2 tsconfck: 3.0.3(typescript@5.5.3) optionalDependencies: - vite: 5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) + vite: 5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0) transitivePeerDependencies: - supports-color - typescript - vite@5.3.2(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0): + vite@5.3.3(@types/node@20.14.9)(less@4.2.0)(sass@1.77.6)(stylus@0.62.0): dependencies: - esbuild: 0.21.4 - postcss: 8.4.38 + esbuild: 0.21.5 + postcss: 8.4.39 rollup: 4.17.2 optionalDependencies: '@types/node': 20.14.9 diff --git a/clash-verge-rev/UPDATELOG.md b/clash-verge-rev/UPDATELOG.md index 8f818f661c..6794960775 100644 --- a/clash-verge-rev/UPDATELOG.md +++ b/clash-verge-rev/UPDATELOG.md @@ -1,3 +1,83 @@ +## v1.7.2 + +### Break Changes + +- 更新后请务必重新导入所有订阅,包括 Remote 和 Local +- 此版本重构了 Merge/Script,更新前请先备份好自定义 Merge 和 Script(更新并不会删除配置文件,但是旧版 Merge 和 Script 在更新后无法从前端访问,备份以防万一) +- Merge 改名为 `扩展配置`,分为 `全局扩展配置` 和 `订阅扩展配置`,全局扩展配置对所有订阅生效,订阅扩展配置只对关联的订阅生效 +- Script 改名为 `扩展脚本`,同样分为 `全局扩展脚本` 和 `订阅扩展脚本` +- 订阅扩展配置在订阅右键菜单里进入 +- 执行优先级为: 全局扩展配置 -> 全局扩展脚本 -> 订阅扩展配置 ->订阅扩展脚本 +- 扩展配置删除了 `prepend/append` 能力,请使用 右键订阅 -> `编辑规则`/`编辑节点`/`编辑代理组` 来代替 +- MacOS 用户更新后请重新安装服务模式 + +### Features + +- 升级内核到 1.18.6 +- 移除内核授权,改为服务模式实现 +- 自动填充本地订阅名称 +- 添加重大更新处理逻辑 +- 订阅单独指定扩展配置/脚本(需要重新导入订阅) +- 添加可视化规则编辑器(需要重新导入订阅) +- 编辑器新增工具栏按钮(格式化、最大化/最小化) +- WEBUI 使用最新版 metacubex,并解决无法自动登陆问问题 +- 禁用部分 Webview2 快捷键 +- 热键配置新增连接符 + 号 +- 新增部分悬浮提示按钮,用于解释说明 +- 当日志等级为`Debug`时(更改需重启软件生效),支持点击内存主动内存回收(绿色文字) +- 设置页面右上角新增 TG 频道链接 +- 各种细节优化和界面性能优化 + +### Bugs Fixes + +- 修复代理绕过格式检查 +- 通过进程名称关闭进程 +- 退出软件时恢复 DNS 设置 +- 修复创建本地订阅时更新间隔无法保存 +- 连接页面列宽无法调整 + +--- + +## v1.7.1 + +### Break Changes + +- 更新后请务必重新导入所有订阅,包括 Remote 和 Local +- 此版本重构了 Merge/Script,更新前请先备份好自定义 Merge 和 Script(更新并不会删除配置文件,但是旧版 Merge 和 Script 在更新后无法从前端访问,备份以防万一) +- Merge 改名为 `扩展配置`,分为 `全局扩展配置` 和 `订阅扩展配置`,全局扩展配置对所有订阅生效,订阅扩展配置只对关联的订阅生效 +- Script 改名为 `扩展脚本`,同样分为 `全局扩展脚本` 和 `订阅扩展脚本` +- 订阅扩展配置在订阅右键菜单里进入 +- 执行优先级为: 全局扩展配置 -> 全局扩展脚本 -> 订阅扩展配置 ->订阅扩展脚本 +- 扩展配置删除了 `prepend/append` 能力,请使用 右键订阅 -> `编辑规则`/`编辑节点`/`编辑代理组` 来代替 +- MacOS 用户更新后请重新安装服务模式 + +### Features + +- 升级内核到 1.18.6 +- 移除内核授权,改为服务模式实现 +- 自动填充本地订阅名称 +- 添加重大更新处理逻辑 +- 订阅单独指定扩展配置/脚本(需要重新导入订阅) +- 添加可视化规则编辑器(需要重新导入订阅) +- 编辑器新增工具栏按钮(格式化、最大化/最小化) +- WEBUI 使用最新版 metacubex,并解决无法自动登陆问问题 +- 禁用部分 Webview2 快捷键 +- 热键配置新增连接符 + 号 +- 新增部分悬浮提示按钮,用于解释说明 +- 当日志等级为`Debug`时(更改需重启软件生效),支持点击内存主动内存回收(绿色文字) +- 设置页面右上角新增 TG 频道链接 +- 各种细节优化和界面性能优化 + +### Bugs Fixes + +- 修复代理绕过格式检查 +- 通过进程名称关闭进程 +- 退出软件时恢复 DNS 设置 +- 修复创建本地订阅时更新间隔无法保存 +- 连接页面列宽无法调整 + +--- + ## v1.7.0 ### Break Changes diff --git a/clash-verge-rev/package.json b/clash-verge-rev/package.json index 042bf26bba..f6465c3621 100644 --- a/clash-verge-rev/package.json +++ b/clash-verge-rev/package.json @@ -1,6 +1,6 @@ { "name": "clash-verge", - "version": "1.7.0", + "version": "1.7.2", "license": "GPL-3.0-only", "scripts": { "dev": "tauri dev", diff --git a/clash-verge-rev/src-tauri/Cargo.lock b/clash-verge-rev/src-tauri/Cargo.lock index ef122ce7ff..c11de2b0f5 100644 --- a/clash-verge-rev/src-tauri/Cargo.lock +++ b/clash-verge-rev/src-tauri/Cargo.lock @@ -784,7 +784,7 @@ dependencies = [ [[package]] name = "clash-verge" -version = "1.7.0" +version = "1.7.2" dependencies = [ "anyhow", "auto-launch", diff --git a/clash-verge-rev/src-tauri/Cargo.toml b/clash-verge-rev/src-tauri/Cargo.toml index 677df46b84..0171e52cef 100644 --- a/clash-verge-rev/src-tauri/Cargo.toml +++ b/clash-verge-rev/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clash-verge" -version = "1.7.0" +version = "1.7.2" description = "clash verge" authors = ["zzzgydi", "wonfen", "MystiPanda"] license = "GPL-3.0-only" diff --git a/clash-verge-rev/src-tauri/src/config/prfitem.rs b/clash-verge-rev/src-tauri/src/config/prfitem.rs index 49c6455e52..c796e99f04 100644 --- a/clash-verge-rev/src-tauri/src/config/prfitem.rs +++ b/clash-verge-rev/src-tauri/src/config/prfitem.rs @@ -247,33 +247,6 @@ impl PrfItem { let mut groups = opt_ref.and_then(|o| o.groups.clone()); let mut builder = reqwest::ClientBuilder::new().use_rustls_tls().no_proxy(); - if merge.is_none() { - let merge_item = PrfItem::from_merge(None)?; - Config::profiles().data().append_item(merge_item.clone())?; - merge = merge_item.uid; - } - if script.is_none() { - let script_item = PrfItem::from_script(None)?; - Config::profiles().data().append_item(script_item.clone())?; - script = script_item.uid; - } - if rules.is_none() { - let rules_item = PrfItem::from_rules()?; - Config::profiles().data().append_item(rules_item.clone())?; - rules = rules_item.uid; - } - if proxies.is_none() { - let proxies_item = PrfItem::from_proxies()?; - Config::profiles() - .data() - .append_item(proxies_item.clone())?; - proxies = proxies_item.uid; - } - if groups.is_none() { - let groups_item = PrfItem::from_groups()?; - Config::profiles().data().append_item(groups_item.clone())?; - groups = groups_item.uid; - } // 使用软件自己的代理 if self_proxy { let port = Config::verge() @@ -400,6 +373,34 @@ impl PrfItem { bail!("profile does not contain `proxies` or `proxy-providers`"); } + if merge.is_none() { + let merge_item = PrfItem::from_merge(None)?; + Config::profiles().data().append_item(merge_item.clone())?; + merge = merge_item.uid; + } + if script.is_none() { + let script_item = PrfItem::from_script(None)?; + Config::profiles().data().append_item(script_item.clone())?; + script = script_item.uid; + } + if rules.is_none() { + let rules_item = PrfItem::from_rules()?; + Config::profiles().data().append_item(rules_item.clone())?; + rules = rules_item.uid; + } + if proxies.is_none() { + let proxies_item = PrfItem::from_proxies()?; + Config::profiles() + .data() + .append_item(proxies_item.clone())?; + proxies = proxies_item.uid; + } + if groups.is_none() { + let groups_item = PrfItem::from_groups()?; + Config::profiles().data().append_item(groups_item.clone())?; + groups = groups_item.uid; + } + Ok(PrfItem { uid: Some(uid), itype: Some("remote".into()), diff --git a/clash-verge-rev/src-tauri/src/config/profiles.rs b/clash-verge-rev/src-tauri/src/config/profiles.rs index 08ef1f9eb9..260eba76f2 100644 --- a/clash-verge-rev/src-tauri/src/config/profiles.rs +++ b/clash-verge-rev/src-tauri/src/config/profiles.rs @@ -1,4 +1,4 @@ -use super::prfitem::PrfItem; +use super::{prfitem::PrfItem, PrfOption}; use crate::utils::{dirs, help}; use anyhow::{bail, Context, Result}; use serde::{Deserialize, Serialize}; @@ -205,6 +205,7 @@ impl IProfiles { each.extra = item.extra; each.updated = item.updated; each.home = item.home; + each.option = PrfOption::merge(each.option.clone(), item.option); // save the file data // move the field value after save if let Some(file_data) = item.file_data.take() { diff --git a/clash-verge-rev/src-tauri/src/enhance/seq.rs b/clash-verge-rev/src-tauri/src/enhance/seq.rs index c442eea42f..1aa1785c73 100644 --- a/clash-verge-rev/src-tauri/src/enhance/seq.rs +++ b/clash-verge-rev/src-tauri/src/enhance/seq.rs @@ -8,15 +8,15 @@ pub struct SeqMap { } pub fn use_seq(seq_map: SeqMap, config: Mapping, name: &str) -> Mapping { - let prepend = seq_map.prepend; + let mut prepend = seq_map.prepend; let append = seq_map.append; let delete = seq_map.delete; let origin_seq = config.get(&name).map_or(Sequence::default(), |val| { - val.as_sequence().unwrap().clone() + val.as_sequence().unwrap_or(&Sequence::default()).clone() }); let mut seq = origin_seq.clone(); - + prepend.reverse(); for item in prepend { seq.insert(0, item); } diff --git a/clash-verge-rev/src-tauri/tauri.conf.json b/clash-verge-rev/src-tauri/tauri.conf.json index 7d294ea9f0..c33c989c34 100644 --- a/clash-verge-rev/src-tauri/tauri.conf.json +++ b/clash-verge-rev/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "../node_modules/@tauri-apps/cli/schema.json", "package": { "productName": "Clash Verge", - "version": "1.7.0" + "version": "1.7.2" }, "build": { "distDir": "../dist", diff --git a/clash-verge-rev/src/components/profile/editor-viewer.tsx b/clash-verge-rev/src/components/profile/editor-viewer.tsx index 33e73c5059..0ec82eb5f8 100644 --- a/clash-verge-rev/src/components/profile/editor-viewer.tsx +++ b/clash-verge-rev/src/components/profile/editor-viewer.tsx @@ -162,7 +162,7 @@ export const EditorViewer = (props: Props) => { {title} - + { const from = parseUrl(itemData.url); const description = itemData.desc; const expire = parseExpire(extra?.expire); - const progress = Math.round(((download + upload) * 100) / (total + 0.1)); + const progress = Math.round(((download + upload) * 100) / (total + 0.01) + 1); const loading = loadingCache[itemData.uid] ?? false; @@ -211,27 +211,27 @@ export const ProfileItem = (props: Props) => { { label: "Edit Rules", handler: onEditRules, - disabled: option?.rules === null, + disabled: !option?.rules, + }, + { + label: "Edit Proxies", + handler: onEditProxies, + disabled: !option?.proxies, + }, + { + label: "Edit Groups", + handler: onEditGroups, + disabled: !option?.groups, }, - // { - // label: "Edit Proxies", - // handler: onEditProxies, - // disabled: option?.proxies === null, - // }, - // { - // label: "Edit Groups", - // handler: onEditGroups, - // disabled: option?.groups === null, - // }, { label: "Extend Config", handler: onEditMerge, - disabled: option?.merge === null, + disabled: !option?.merge, }, { label: "Extend Script", handler: onEditScript, - disabled: option?.script === null, + disabled: !option?.script, }, { label: "Open File", handler: onOpenFile, disabled: false }, { label: "Update", handler: () => onUpdate(0), disabled: false }, @@ -252,27 +252,27 @@ export const ProfileItem = (props: Props) => { { label: "Edit Rules", handler: onEditRules, - disabled: option?.rules === null, + disabled: !option?.rules, + }, + { + label: "Edit Proxies", + handler: onEditProxies, + disabled: !option?.proxies, + }, + { + label: "Edit Groups", + handler: onEditGroups, + disabled: !option?.groups, }, - // { - // label: "Edit Proxies", - // handler: onEditProxies, - // disabled: option?.proxies === null, - // }, - // { - // label: "Edit Groups", - // handler: onEditGroups, - // disabled: option?.groups === null, - // }, { label: "Extend Config", handler: onEditMerge, - disabled: option?.merge === null, + disabled: !option?.merge, }, { label: "Extend Script", handler: onEditScript, - disabled: option?.script === null, + disabled: !option?.script, }, { label: "Open File", handler: onOpenFile, disabled: false }, { @@ -429,7 +429,7 @@ export const ProfileItem = (props: Props) => { 0 ? 1 : 0 }} + style={{ opacity: total > 0 ? 1 : 0 }} /> @@ -483,6 +483,8 @@ export const ProfileItem = (props: Props) => { onClose={() => setFileOpen(false)} /> { /> { - await saveProfileFile(option?.proxies ?? "", curr ?? ""); + await saveProfileFile(option?.groups ?? "", curr ?? ""); onSave && onSave(prev, curr); }} onClose={() => setGroupsOpen(false)} diff --git a/clash-verge-rev/src/components/profile/rule-item.tsx b/clash-verge-rev/src/components/profile/rule-item.tsx index 7093a3e8fb..07a2fa2ab9 100644 --- a/clash-verge-rev/src/components/profile/rule-item.tsx +++ b/clash-verge-rev/src/components/profile/rule-item.tsx @@ -18,9 +18,17 @@ interface Props { export const RuleItem = (props: Props) => { let { type, ruleRaw, onDelete } = props; + const sortable = type === "prepend" || type === "append"; const rule = ruleRaw.replace(",no-resolve", "").split(","); - const { attributes, listeners, setNodeRef, transform, transition } = - useSortable({ id: ruleRaw }); + const { attributes, listeners, setNodeRef, transform, transition } = sortable + ? useSortable({ id: ruleRaw }) + : { + attributes: {}, + listeners: {}, + setNodeRef: null, + transform: null, + transition: null, + }; return ( ({ diff --git a/clash-verge-rev/src/components/profile/rules-editor-viewer.tsx b/clash-verge-rev/src/components/profile/rules-editor-viewer.tsx index 6cf0f23316..e0832ae72c 100644 --- a/clash-verge-rev/src/components/profile/rules-editor-viewer.tsx +++ b/clash-verge-rev/src/components/profile/rules-editor-viewer.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useEffect, useState } from "react"; +import { ReactNode, useEffect, useMemo, useState } from "react"; import { useLockFn } from "ahooks"; import yaml from "js-yaml"; import { useTranslation } from "react-i18next"; @@ -36,8 +36,12 @@ import getSystem from "@/utils/get-system"; import { RuleItem } from "@/components/profile/rule-item"; import { BaseSearchBox } from "../base/base-search-box"; import { Virtuoso } from "react-virtuoso"; +import MonacoEditor from "react-monaco-editor"; +import { useThemeMode } from "@/services/states"; interface Props { + groupsUid: string; + mergeUid: string; profileUid: string; title?: string | ReactNode; property: string; @@ -228,10 +232,22 @@ const rules: { const builtinProxyPolicies = ["DIRECT", "REJECT", "REJECT-DROP", "PASS"]; export const RulesEditorViewer = (props: Props) => { - const { title, profileUid, property, open, onClose, onSave } = props; + const { + title, + groupsUid, + mergeUid, + profileUid, + property, + open, + onClose, + onSave, + } = props; const { t } = useTranslation(); + const themeMode = useThemeMode(); const [prevData, setPrevData] = useState(""); + const [currData, setCurrData] = useState(""); + const [visible, setVisible] = useState(true); const [match, setMatch] = useState(() => (_: string) => true); const [ruleType, setRuleType] = useState<(typeof rules)[number]>(rules[0]); @@ -247,6 +263,11 @@ export const RulesEditorViewer = (props: Props) => { const [appendSeq, setAppendSeq] = useState([]); const [deleteSeq, setDeleteSeq] = useState([]); + const filteredRuleList = useMemo( + () => ruleList.filter((rule) => match(rule)), + [ruleList, match] + ); + const sensors = useSensors( useSensor(PointerSensor), useSensor(KeyboardSensor, { @@ -281,36 +302,78 @@ export const RulesEditorViewer = (props: Props) => { }; const fetchContent = async () => { let data = await readProfileFile(property); - let obj = yaml.load(data) as { prepend: []; append: []; delete: [] }; + let obj = yaml.load(data) as { prepend: []; append: []; delete: [] } | null; + + setPrependSeq(obj?.prepend || []); + setAppendSeq(obj?.append || []); + setDeleteSeq(obj?.delete || []); - setPrependSeq(obj.prepend || []); - setAppendSeq(obj.append || []); - setDeleteSeq(obj.delete || []); setPrevData(data); + setCurrData(data); }; + useEffect(() => { + if (currData === "") return; + if (visible !== true) return; + + let obj = yaml.load(currData) as { + prepend: []; + append: []; + delete: []; + } | null; + setPrependSeq(obj?.prepend || []); + setAppendSeq(obj?.append || []); + setDeleteSeq(obj?.delete || []); + }, [visible]); + + useEffect(() => { + if (prependSeq && appendSeq && deleteSeq) + setCurrData( + yaml.dump({ prepend: prependSeq, append: appendSeq, delete: deleteSeq }) + ); + }, [prependSeq, appendSeq, deleteSeq]); + const fetchProfile = async () => { let data = await readProfileFile(profileUid); - let groupsObj = yaml.load(data) as { "proxy-groups": [] }; - let rulesObj = yaml.load(data) as { rules: [] }; - let ruleSetObj = yaml.load(data) as { "rule-providers": [] }; - let subRuleObj = yaml.load(data) as { "sub-rules": [] }; + let groupsData = await readProfileFile(groupsUid); + let mergeData = await readProfileFile(mergeUid); + let globalMergeData = await readProfileFile("Merge"); + + let rulesObj = yaml.load(data) as { rules: [] } | null; + + let originGroupsObj = yaml.load(data) as { "proxy-groups": [] } | null; + let originGroups = originGroupsObj?.["proxy-groups"] || []; + let moreGroupsObj = yaml.load(groupsData) as { "proxy-groups": [] } | null; + let moreGroups = moreGroupsObj?.["proxy-groups"] || []; + let groups = originGroups.concat(moreGroups); + + let originRuleSetObj = yaml.load(data) as { "rule-providers": {} } | null; + let originRuleSet = originRuleSetObj?.["rule-providers"] || {}; + let moreRuleSetObj = yaml.load(mergeData) as { + "rule-providers": {}; + } | null; + let moreRuleSet = moreRuleSetObj?.["rule-providers"] || {}; + let globalRuleSetObj = yaml.load(globalMergeData) as { + "rule-providers": {}; + } | null; + let globalRuleSet = globalRuleSetObj?.["rule-providers"] || {}; + let ruleSet = Object.assign({}, originRuleSet, moreRuleSet, globalRuleSet); + + let originSubRuleObj = yaml.load(data) as { "sub-rules": {} } | null; + let originSubRule = originSubRuleObj?.["sub-rules"] || {}; + let moreSubRuleObj = yaml.load(mergeData) as { "sub-rules": {} } | null; + let moreSubRule = moreSubRuleObj?.["sub-rules"] || {}; + let globalSubRuleObj = yaml.load(globalMergeData) as { + "sub-rules": {}; + } | null; + let globalSubRule = globalSubRuleObj?.["sub-rules"] || {}; + let subRule = Object.assign({}, originSubRule, moreSubRule, globalSubRule); setProxyPolicyList( - builtinProxyPolicies.concat( - groupsObj["proxy-groups"] - ? groupsObj["proxy-groups"].map((item: any) => item.name) - : [] - ) - ); - setRuleList(rulesObj.rules || []); - setRuleSetList( - ruleSetObj["rule-providers"] - ? Object.keys(ruleSetObj["rule-providers"]) - : [] - ); - setSubRuleList( - subRuleObj["sub-rules"] ? Object.keys(subRuleObj["sub-rules"]) : [] + builtinProxyPolicies.concat(groups.map((group: any) => group.name)) ); + setRuleSetList(Object.keys(ruleSet)); + setSubRuleList(Object.keys(subRule)); + setRuleList(rulesObj?.rules || []); }; useEffect(() => { @@ -326,18 +389,14 @@ export const RulesEditorViewer = (props: Props) => { throw new Error(t("Invalid Rule")); } - return `${ruleType.name}${ - ruleContent ? "," + ruleContent : "" - },${proxyPolicy}${ruleType.noResolve && noResolve ? ",no-resolve" : ""}`; + const condition = ruleType.required ?? true ? ruleContent : ""; + return `${ruleType.name}${condition ? "," + condition : ""},${proxyPolicy}${ + ruleType.noResolve && noResolve ? ",no-resolve" : "" + }`; }; const handleSave = useLockFn(async () => { try { - let currData = yaml.dump({ - prepend: prependSeq, - append: appendSeq, - delete: deleteSeq, - }); await saveProfileFile(property, currData); onSave?.(prevData, currData); onClose(); @@ -348,229 +407,292 @@ export const RulesEditorViewer = (props: Props) => { return ( - {title ?? t("Edit Rules")} + + { + + {t("Edit Rules")} + + + + + } + - - - - - } - options={rules} - value={ruleType} - getOptionLabel={(option) => option.name} - renderOption={(props, option) => ( -
  • - {option.name} -
  • - )} - onChange={(_, value) => value && setRuleType(value)} - /> -
    - - - - {ruleType.name === "RULE-SET" && ( - } - options={ruleSetList} - value={ruleContent} - onChange={(_, value) => value && setRuleContent(value)} - /> - )} - {ruleType.name === "SUB-RULE" && ( - } - options={subRuleList} - value={ruleContent} - onChange={(_, value) => value && setRuleContent(value)} - /> - )} - {ruleType.name !== "RULE-SET" && ruleType.name !== "SUB-RULE" && ( - setRuleContent(e.target.value)} - /> - )} - - - - } - options={proxyPolicyList} - value={proxyPolicy} - renderOption={(props, option) => ( -
  • - {option} -
  • - )} - onChange={(_, value) => value && setProxyPolicy(value)} - /> -
    - {ruleType.noResolve && ( - - - setNoResolve(!noResolve)} - /> - - )} - - - - - - -
    + + + } + options={rules} + value={ruleType} + getOptionLabel={(option) => option.name} + renderOption={(props, option) => ( +
  • + {option.name} +
  • + )} + onChange={(_, value) => value && setRuleType(value)} + /> +
    + + - - setMatch(() => match)} - /> - 0 ? 1 : 0) + - (appendSeq.length > 0 ? 1 : 0) - } - increaseViewportBy={256} - itemContent={(index) => { - let shift = prependSeq.length > 0 ? 1 : 0; - if (prependSeq.length > 0 && index === 0) { - return ( - - { - return x; - })} - > - {prependSeq.map((item, index) => { - return ( - { - setPrependSeq( - prependSeq.filter((v) => v !== item) - ); - }} - /> - ); - })} - - - ); - } else if (index < ruleList.length + shift) { - let newIndex = index - shift; - return ( - { - if (deleteSeq.includes(ruleList[newIndex])) { - setDeleteSeq( - deleteSeq.filter((v) => v !== ruleList[newIndex]) - ); - } else { - setDeleteSeq((prev) => [...prev, ruleList[newIndex]]); - } - }} + {ruleType.name === "RULE-SET" && ( + } + options={ruleSetList} + value={ruleContent} + onChange={(_, value) => value && setRuleContent(value)} /> - ); - } else { - return ( - - { - return x; - })} - > - {appendSeq.map((item, index) => { - return ( - { - setAppendSeq(appendSeq.filter((v) => v !== item)); - }} - /> - ); - })} - - - ); - } + )} + {ruleType.name === "SUB-RULE" && ( + } + options={subRuleList} + value={ruleContent} + onChange={(_, value) => value && setRuleContent(value)} + /> + )} + {ruleType.name !== "RULE-SET" && + ruleType.name !== "SUB-RULE" && ( + setRuleContent(e.target.value)} + /> + )} + + + + } + options={proxyPolicyList} + value={proxyPolicy} + renderOption={(props, option) => ( +
  • + {option} +
  • + )} + onChange={(_, value) => value && setProxyPolicy(value)} + /> +
    + {ruleType.noResolve && ( + + + setNoResolve(!noResolve)} + /> + + )} + + + + + + + + + + setMatch(() => match)} + /> + 0 ? 1 : 0) + + (appendSeq.length > 0 ? 1 : 0) + } + increaseViewportBy={256} + itemContent={(index) => { + let shift = prependSeq.length > 0 ? 1 : 0; + if (prependSeq.length > 0 && index === 0) { + return ( + + { + return x; + })} + > + {prependSeq.map((item, index) => { + return ( + { + setPrependSeq( + prependSeq.filter((v) => v !== item) + ); + }} + /> + ); + })} + + + ); + } else if (index < filteredRuleList.length + shift) { + let newIndex = index - shift; + return ( + { + if (deleteSeq.includes(filteredRuleList[newIndex])) { + setDeleteSeq( + deleteSeq.filter( + (v) => v !== filteredRuleList[newIndex] + ) + ); + } else { + setDeleteSeq((prev) => [ + ...prev, + filteredRuleList[newIndex], + ]); + } + }} + /> + ); + } else { + return ( + + { + return x; + })} + > + {appendSeq.map((item, index) => { + return ( + { + setAppendSeq( + appendSeq.filter((v) => v !== item) + ); + }} + /> + ); + })} + + + ); + } + }} + /> + + + ) : ( + = 1500, // 超过一定宽度显示minimap滚动条 + }, + mouseWheelZoom: true, // 按住Ctrl滚轮调节缩放比例 + quickSuggestions: { + strings: true, // 字符串类型的建议 + comments: true, // 注释类型的建议 + other: true, // 其他类型的建议 + }, + padding: { + top: 33, // 顶部padding防止遮挡snippets + }, + fontFamily: `Fira Code, JetBrains Mono, Roboto Mono, "Source Code Pro", Consolas, Menlo, Monaco, monospace, "Courier New", "Apple Color Emoji"${ + getSystem() === "windows" ? ", twemoji mozilla" : "" + }`, + fontLigatures: true, // 连字符 + smoothScrolling: true, // 平滑滚动 }} + onChange={(value) => setCurrData(value)} /> - + )}
    diff --git a/clash-verge-rev/src/locales/en.json b/clash-verge-rev/src/locales/en.json index 4d706fe913..19aa913681 100644 --- a/clash-verge-rev/src/locales/en.json +++ b/clash-verge-rev/src/locales/en.json @@ -64,6 +64,8 @@ "Delete Rule": "Delete Rule", "Rule Condition Required": "Rule Condition Required", "Invalid Rule": "Invalid Rule", + "Advanced": "Advanced", + "Visible": "Visible", "DOMAIN": "Matches the full domain name", "DOMAIN-SUFFIX": "Matches the domain suffix", "DOMAIN-KEYWORD": "Matches the domain keyword", diff --git a/clash-verge-rev/src/locales/zh.json b/clash-verge-rev/src/locales/zh.json index a2d65b4259..138a9e6700 100644 --- a/clash-verge-rev/src/locales/zh.json +++ b/clash-verge-rev/src/locales/zh.json @@ -64,6 +64,8 @@ "Delete Rule": "删除规则", "Rule Condition Required": "规则条件缺失", "Invalid Rule": "无效规则", + "Advanced": "高级", + "Visible": "可视化", "DOMAIN": "匹配完整域名", "DOMAIN-SUFFIX": "匹配域名后缀", "DOMAIN-KEYWORD": "匹配域名关键字", diff --git a/echo/examples/speed_limit.json b/echo/examples/speed_limit.json new file mode 100644 index 0000000000..7dd587d54d --- /dev/null +++ b/echo/examples/speed_limit.json @@ -0,0 +1,14 @@ +{ + "relay_configs": [ + { + "listen": "127.0.0.1:1234", + "listen_type": "raw", + "transport_type": "raw", + "label": "iperf3", + "tcp_remotes": [ + "0.0.0.0:5201" + ], + "max_read_rate_kbps": 10000 + } + ] +} \ No newline at end of file diff --git a/echo/go.mod b/echo/go.mod index 3f54ade814..2eb651406f 100644 --- a/echo/go.mod +++ b/echo/go.mod @@ -65,6 +65,7 @@ require ( github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect github.com/josharian/native v1.1.0 // indirect github.com/jsimonetti/rtnetlink v1.4.2 // indirect + github.com/juju/ratelimit v1.0.2 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/labstack/gommon v0.4.2 // indirect diff --git a/echo/go.sum b/echo/go.sum index 01a4863ed2..179110cdbf 100644 --- a/echo/go.sum +++ b/echo/go.sum @@ -140,6 +140,8 @@ github.com/jsimonetti/rtnetlink v1.4.2 h1:Df9w9TZ3npHTyDn0Ev9e1uzmN2odmXd0QX+J5G github.com/jsimonetti/rtnetlink v1.4.2/go.mod h1:92s6LJdE+1iOrw+F2/RO7LYI2Qd8pPpFNNUYW06gcoM= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/juju/ratelimit v1.0.2 h1:sRxmtRiajbvrcLQT7S+JbqU0ntsb9W2yhSdNN8tWfaI= +github.com/juju/ratelimit v1.0.2/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= diff --git a/echo/internal/conn/limit_reader.go b/echo/internal/conn/limit_reader.go new file mode 100644 index 0000000000..e8456b82ab --- /dev/null +++ b/echo/internal/conn/limit_reader.go @@ -0,0 +1,29 @@ +package conn + +import ( + "io" + "net" + + "github.com/juju/ratelimit" +) + +type RateLimitedConn struct { + net.Conn + bucket *ratelimit.Bucket + reader io.Reader +} + +func NewRateLimitedConn(conn net.Conn, kbps int64) *RateLimitedConn { + bps := float64(kbps) * 1000 // Convert kbps to bps (1 kbps = 1000 bps) + rateBytesPerSec := bps / 8 // 1KB = 1024B, 1B = 8b + bucket := ratelimit.NewBucketWithRate(rateBytesPerSec, int64(rateBytesPerSec)) + return &RateLimitedConn{ + Conn: conn, + bucket: bucket, + reader: ratelimit.Reader(conn, bucket), + } +} + +func (r *RateLimitedConn) Read(p []byte) (int, error) { + return r.reader.Read(p) +} diff --git a/echo/internal/relay/conf/cfg.go b/echo/internal/relay/conf/cfg.go index c1633452ea..20a1c319d4 100644 --- a/echo/internal/relay/conf/cfg.go +++ b/echo/internal/relay/conf/cfg.go @@ -33,6 +33,7 @@ type Config struct { MaxConnection int `json:"max_connection,omitempty"` BlockedProtocols []string `json:"blocked_protocols,omitempty"` + MaxReadRateKbps int64 `json:"max_read_rate_kbps,omitempty"` WSConfig *WSConfig `json:"ws_config,omitempty"` } diff --git a/echo/internal/transporter/base.go b/echo/internal/transporter/base.go index 8bbbe7bae8..8f0be4c5bc 100644 --- a/echo/internal/transporter/base.go +++ b/echo/internal/transporter/base.go @@ -92,6 +92,12 @@ func (b *baseTransporter) RelayTCPConn(c net.Conn, handshakeF TCPHandShakeF) err if err != nil { return err } + defer rc.Close() + + // rate limit + if b.cfg.MaxReadRateKbps > 0 { + c = conn.NewRateLimitedConn(c, b.cfg.MaxReadRateKbps) + } b.l.Infof("RelayTCPConn from %s to %s", c.LocalAddr(), remote.Address) relayConn := conn.NewRelayConn( @@ -103,5 +109,6 @@ func (b *baseTransporter) RelayTCPConn(c net.Conn, handshakeF TCPHandShakeF) err func (b *baseTransporter) HealthCheck(ctx context.Context) (int64, error) { remote := b.GetRemote().Clone() - return remote.HandShakeDuration.Milliseconds(), b.relayer.HealthCheck(ctx, remote) + err := b.relayer.HealthCheck(ctx, remote) + return int64(remote.HandShakeDuration.Milliseconds()), err } diff --git a/echo/pkg/bytes/utils.go b/echo/pkg/bytes/utils.go index a713c6064e..e0e5c01b44 100644 --- a/echo/pkg/bytes/utils.go +++ b/echo/pkg/bytes/utils.go @@ -14,3 +14,13 @@ func PrettyByteSize(bf float64) string { } return fmt.Sprintf(" %.1fYiB ", bf) } + +func PrettyBitRate(bps float64) string { + for _, unit := range []string{"bps", "Kbps", "Mbps", "Gbps", "Tbps", "Pbps", "Ebps", "Zbps"} { + if math.Abs(bps) < 1000.0 { + return fmt.Sprintf(" %3.1f %s ", bps, unit) + } + bps /= 1000.0 + } + return fmt.Sprintf(" %.1f Ybps ", bps) +} diff --git a/hysteria/app/go.mod b/hysteria/app/go.mod index dfbea428ec..b4bd8dded6 100644 --- a/hysteria/app/go.mod +++ b/hysteria/app/go.mod @@ -28,7 +28,7 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 // indirect + github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e // indirect github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect github.com/cloudflare/circl v1.3.9 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/hysteria/app/go.sum b/hysteria/app/go.sum index e1b80a594d..86841ce6e6 100644 --- a/hysteria/app/go.sum +++ b/hysteria/app/go.sum @@ -42,8 +42,8 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f h1:uVh0qpEslrWjgzx9vOcyCqsOY3c9kofDZ1n+qaw35ZY= github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f/go.mod h1:xkkq9D4ygcldQQhKS/w9CadiCKwCngU7K9E3DaKahpM= -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 h1:UTrvVPt+GfeOeli9/3gvpCDz2Jd5UEn3YotfP0u/pok= -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023/go.mod h1:UkcG7+34BM+bbH2RFVKtHQp3mR7h8yJHx4z95lZ7sx4= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e h1:KBs8aBfKl5AKPKGpfn3bl0joDJXDq5fnH+AjFODiU+A= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad h1:QzQ2sKpc9o42HNRR8ukM5uMC/RzR2HgZd/Nvaqol2C0= github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad/go.mod h1:S5IydyLSN/QAfvY+r2GoomPJ6hidtXWm/Ad18sJVssk= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= diff --git a/hysteria/core/go.mod b/hysteria/core/go.mod index f35cc548a7..708b1dc52a 100644 --- a/hysteria/core/go.mod +++ b/hysteria/core/go.mod @@ -3,7 +3,7 @@ module github.com/apernet/hysteria/core/v2 go 1.21 require ( - github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 + github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.2.1 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 diff --git a/hysteria/core/go.sum b/hysteria/core/go.sum index 1a133cbe60..b4920932d8 100644 --- a/hysteria/core/go.sum +++ b/hysteria/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 h1:UTrvVPt+GfeOeli9/3gvpCDz2Jd5UEn3YotfP0u/pok= -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023/go.mod h1:UkcG7+34BM+bbH2RFVKtHQp3mR7h8yJHx4z95lZ7sx4= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e h1:KBs8aBfKl5AKPKGpfn3bl0joDJXDq5fnH+AjFODiU+A= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/hysteria/extras/go.mod b/hysteria/extras/go.mod index 2d9fae7ec5..f1f2bdcdd2 100644 --- a/hysteria/extras/go.mod +++ b/hysteria/extras/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000 - github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 + github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 github.com/hashicorp/golang-lru/v2 v2.0.5 github.com/miekg/dns v1.1.59 diff --git a/hysteria/extras/go.sum b/hysteria/extras/go.sum index 74dceb5690..5517d6dc07 100644 --- a/hysteria/extras/go.sum +++ b/hysteria/extras/go.sum @@ -1,7 +1,7 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023 h1:UTrvVPt+GfeOeli9/3gvpCDz2Jd5UEn3YotfP0u/pok= -github.com/apernet/quic-go v0.44.1-0.20240520215222-bb2e53664023/go.mod h1:UkcG7+34BM+bbH2RFVKtHQp3mR7h8yJHx4z95lZ7sx4= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e h1:KBs8aBfKl5AKPKGpfn3bl0joDJXDq5fnH+AjFODiU+A= +github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e/go.mod h1:MjGWpXA31DZZWESdX3/PjIpSWIT1fOm8FNCqyXXFZFU= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 h1:4NNbNM2Iq/k57qEu7WfL67UrbPq1uFWxW4qODCohi+0= github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6/go.mod h1:J29hk+f9lJrblVIfiJOtTFk+OblBawmib4uz/VdKzlg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= diff --git a/hysteria/go.work.sum b/hysteria/go.work.sum index f0551e7035..a870be4f57 100644 --- a/hysteria/go.work.sum +++ b/hysteria/go.work.sum @@ -37,6 +37,7 @@ github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8 github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625 h1:ckJgFhFWywOx+YLEMIJsTb+NV6NexWICk5+AMSuz3ss= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI= @@ -44,6 +45,7 @@ github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7 github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= @@ -170,10 +172,14 @@ github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTm github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -256,6 +262,7 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE= golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= @@ -294,6 +301,7 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= @@ -314,6 +322,7 @@ golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -324,6 +333,7 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -347,6 +357,7 @@ google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= diff --git a/lede/include/kernel-6.1 b/lede/include/kernel-6.1 index 93a76f81fe..e8acd5ca1f 100644 --- a/lede/include/kernel-6.1 +++ b/lede/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .95 -LINUX_KERNEL_HASH-6.1.95 = 2960f0aa1d75665f39114ad3c272a999c54796e553a2355d0379f5188d14dfbd +LINUX_VERSION-6.1 = .96 +LINUX_KERNEL_HASH-6.1.96 = 3e77c9069de5e7ab02ff9c2dcfe77dab193613fc1de21071901b4153374862a9 diff --git a/lede/include/kernel-6.6 b/lede/include/kernel-6.6 index 1d73f76874..bb8c01bfbf 100644 --- a/lede/include/kernel-6.6 +++ b/lede/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .35 -LINUX_KERNEL_HASH-6.6.35 = fce3ee728712ed063aa8c14a8756c8ff8c7a46ba3827f61d2b04a73c7cf5dd9e +LINUX_VERSION-6.6 = .36 +LINUX_KERNEL_HASH-6.6.36 = b9676828b737e8fb8eaa5198303d35d35e8df019550be153c8a42c99afe0cdd5 diff --git a/lede/package/kernel/mac80211/patches/subsys/900-add-eth-ieee80211_bss_conf.patch b/lede/package/kernel/mac80211/patches/subsys/900-add-eth-ieee80211_bss_conf.patch new file mode 100644 index 0000000000..55e2e1b73c --- /dev/null +++ b/lede/package/kernel/mac80211/patches/subsys/900-add-eth-ieee80211_bss_conf.patch @@ -0,0 +1,55 @@ +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -673,6 +673,12 @@ + * @he_full_ul_mumimo: does this BSS support the reception (AP) or transmission + * (non-AP STA) of an HE TB PPDU on an RU that spans the entire PPDU + * bandwidth ++ * @eht_su_beamformer: in AP-mode, does this BSS enable operation as an EHT SU ++ * beamformer ++ * @eht_su_beamformee: in AP-mode, does this BSS enable operation as an EHT SU ++ * beamformee ++ * @eht_mu_beamformer: in AP-mode, does this BSS enable operation as an EHT MU ++ * beamformer + */ + struct ieee80211_bss_conf { + const u8 *bssid; +@@ -758,6 +764,9 @@ + bool he_su_beamformee; + bool he_mu_beamformer; + bool he_full_ul_mumimo; ++ bool eht_su_beamformer; ++ bool eht_su_beamformee; ++ bool eht_mu_beamformer; + }; + + /** +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1307,6 +1307,27 @@ + IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO; + } + ++ if (params->eht_cap) { ++ if (!link_conf->he_support) ++ return -EOPNOTSUPP; ++ link_conf->eht_support = true; ++ link_conf->eht_su_beamformer = ++ params->eht_cap->fixed.phy_cap_info[0] & ++ IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER; ++ link_conf->eht_su_beamformee = ++ params->eht_cap->fixed.phy_cap_info[0] & ++ IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE; ++ link_conf->eht_mu_beamformer = ++ params->eht_cap->fixed.phy_cap_info[7] & ++ (IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ | ++ IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ | ++ IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ); ++ } else { ++ link_conf->eht_su_beamformer = false; ++ link_conf->eht_su_beamformee = false; ++ link_conf->eht_mu_beamformer = false; ++ } ++ + if (sdata->vif.type == NL80211_IFTYPE_AP && + params->mbssid_config.tx_wdev) { + err = ieee80211_set_ap_mbssid_options(sdata, diff --git a/lede/package/kernel/mt76/Makefile b/lede/package/kernel/mt76/Makefile index 6b5041d3c5..1268710349 100644 --- a/lede/package/kernel/mt76/Makefile +++ b/lede/package/kernel/mt76/Makefile @@ -14,14 +14,11 @@ PKG_SOURCE_DATE:=2022-12-22 PKG_SOURCE_VERSION:=5b509e80384ab019ac11aa90c81ec0dbb5b0d7f2 PKG_MIRROR_HASH:=6fc25df4d28becd010ff4971b23731c08b53e69381a9e4c868091899712f78a9 PATCH_DIR:=./patches-5.4 -else ifdef CONFIG_LINUX_6_1 -PKG_SOURCE_DATE:=2024-02-03 -PKG_SOURCE_VERSION:=9827df56b241601f29bf496b62545713c67afb61 -PKG_MIRROR_HASH:=d758db4228eed55c93fff8f87ec92d482b8507a68698b28dcf273e12b02ddf5f -else ifdef CONFIG_LINUX_6_6 -PKG_SOURCE_DATE:=2024-02-03 -PKG_SOURCE_VERSION:=9827df56b241601f29bf496b62545713c67afb61 -PKG_MIRROR_HASH:=d758db4228eed55c93fff8f87ec92d482b8507a68698b28dcf273e12b02ddf5f +else ifndef ($(filter on,$(CONFIG_LINUX_6_1) $(CONFIG_LINUX_6_6)),) +PKG_SOURCE_DATE:=2024-04-19 +PKG_SOURCE_VERSION:=1d0bd57e58899d9c526c7c25cbaa04dc4a0559bf +PKG_MIRROR_HASH:=09e2256ca6efcc8375f96722f0aabe539b83e35fc93d4fec44b71a0efe3f7914 +PATCH_DIR:=./patches-6.x else PKG_SOURCE_DATE:=2023-08-14 PKG_SOURCE_VERSION:=b14c2351ddb8601c322576d84029e463d456caef @@ -331,6 +328,44 @@ define KernelPackage/mt7921e AUTOLOAD:=$(call AutoProbe,mt7921e) endef +define KernelPackage/mt7996e + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996E wireless driver + DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY + FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko + AUTOLOAD:=$(call AutoProbe,mt7996e) +endef + +define KernelPackage/mt7996-firmware + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996 firmware + DEPENDS+=+kmod-mt7996e +endef + +define KernelPackage/mt7925-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925 wireless driver common code + HIDDEN:=1 + DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925-common.ko +endef + +define KernelPackage/mt7925u + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925U wireless driver + DEPENDS+=+kmod-mt792x-usb +kmod-mt7925-common + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925u.ko + AUTOLOAD:=$(call AutoProbe,mt7921u) +endef + +define KernelPackage/mt7925e + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925e wireless driver + DEPENDS+=@PCI_SUPPORT +kmod-mt7925-common + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925e.ko + AUTOLOAD:=$(call AutoProbe,mt7921e) +endef + define Package/mt76-test SECTION:=devel CATEGORY:=Development @@ -439,6 +474,18 @@ endif ifdef CONFIG_PACKAGE_kmod-mt7921e PKG_MAKE_FLAGS += CONFIG_MT7921E=m endif +ifdef CONFIG_PACKAGE_kmod-mt7996e + PKG_MAKE_FLAGS += CONFIG_MT7996E=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925-common + PKG_MAKE_FLAGS += CONFIG_MT7925_COMMON=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925u + PKG_MAKE_FLAGS += CONFIG_MT7925U=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925e + PKG_MAKE_FLAGS += CONFIG_MT7925E=m +endif define Build/Compile +$(KERNEL_MAKE) $(PKG_JOBS) \ @@ -582,11 +629,27 @@ define KernelPackage/mt7922-firmware/install $(1)/lib/firmware/mediatek endef +define KernelPackage/mt7996-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 + cp \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_dsp.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \ + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \ + $(1)/lib/firmware/mediatek/mt7996 +endef + define Package/mt76-test/install mkdir -p $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin endef +define Build/InstallDev + mkdir -p $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/firmware/mt7981_eeprom_mt7976_dbdc.bin $(STAGING_DIR_IMAGE)/ +endef + $(eval $(call KernelPackage,mt76-core)) $(eval $(call KernelPackage,mt76-usb)) $(eval $(call KernelPackage,mt76x02-usb)) @@ -619,8 +682,13 @@ $(eval $(call KernelPackage,mt7922-firmware)) $(eval $(call KernelPackage,mt792x-common)) $(eval $(call KernelPackage,mt792x-usb)) $(eval $(call KernelPackage,mt7921-common)) +$(eval $(call KernelPackage,mt7925-common)) $(eval $(call KernelPackage,mt7921u)) $(eval $(call KernelPackage,mt7921s)) $(eval $(call KernelPackage,mt7921e)) +$(eval $(call KernelPackage,mt7925u)) +$(eval $(call KernelPackage,mt7925e)) +$(eval $(call KernelPackage,mt7996e)) +$(eval $(call KernelPackage,mt7996-firmware)) $(eval $(call KernelPackage,mt76)) $(eval $(call BuildPackage,mt76-test)) diff --git a/lede/package/kernel/mt76/patches-6.x/001-allow-vht-on-2g.patch b/lede/package/kernel/mt76/patches-6.x/001-allow-vht-on-2g.patch new file mode 100644 index 0000000000..aaa8dd5fab --- /dev/null +++ b/lede/package/kernel/mt76/patches-6.x/001-allow-vht-on-2g.patch @@ -0,0 +1,59 @@ +From ed0b9c38becdbf9379787ca0b4db557f03a31dd7 Mon Sep 17 00:00:00 2001 +From: DENG Qingfang +Date: Mon, 23 Nov 2020 10:46:37 +0800 +Subject: [PATCH] mt76: allow VHT rate on 2.4GHz + +Allow chips that support 11ac to use 256QAM on 2.4GHz + +Signed-off-by: DENG Qingfang +--- + mac80211.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/mac80211.c b/mac80211.c +index 766681a4..06aa4228 100644 +--- a/mac80211.c ++++ b/mac80211.c +@@ -282,7 +282,7 @@ static void mt76_init_stream_cap(struct mt76_phy *phy, + void mt76_set_stream_caps(struct mt76_phy *phy, bool vht) + { + if (phy->cap.has_2ghz) +- mt76_init_stream_cap(phy, &phy->sband_2g.sband, false); ++ mt76_init_stream_cap(phy, &phy->sband_2g.sband, vht); + if (phy->cap.has_5ghz) + mt76_init_stream_cap(phy, &phy->sband_5g.sband, vht); + if (phy->cap.has_6ghz) +@@ -349,13 +349,13 @@ mt76_init_sband(struct mt76_phy *phy, struct mt76_sband *msband, + + static int + mt76_init_sband_2g(struct mt76_phy *phy, struct ieee80211_rate *rates, +- int n_rates) ++ int n_rates, bool vht) + { + phy->hw->wiphy->bands[NL80211_BAND_2GHZ] = &phy->sband_2g.sband; + + return mt76_init_sband(phy, &phy->sband_2g, mt76_channels_2ghz, + ARRAY_SIZE(mt76_channels_2ghz), rates, +- n_rates, true, false); ++ n_rates, true, vht); + } + + static int +@@ -508,7 +508,7 @@ int mt76_register_phy(struct mt76_phy *phy, bool vht, + return ret; + + if (phy->cap.has_2ghz) { +- ret = mt76_init_sband_2g(phy, rates, n_rates); ++ ret = mt76_init_sband_2g(phy, rates, n_rates, vht); + if (ret) + return ret; + } +@@ -691,7 +691,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, + return ret; + + if (phy->cap.has_2ghz) { +- ret = mt76_init_sband_2g(phy, rates, n_rates); ++ ret = mt76_init_sband_2g(phy, rates, n_rates, vht); + if (ret) + return ret; + } diff --git a/lede/package/utils/f2fs-tools/Makefile b/lede/package/utils/f2fs-tools/Makefile index d5dc1a6d78..d11e89d8e3 100644 --- a/lede/package/utils/f2fs-tools/Makefile +++ b/lede/package/utils/f2fs-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools PKG_VERSION:=1.16.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ @@ -137,6 +137,7 @@ define Package/f2fsck/install $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/f2fslabel endef Package/f2fsck-selinux/install = $(Package/f2fsck/install) diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch index c50177898a..6ca3493e4c 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch @@ -266,7 +266,7 @@ Signed-off-by: Phil Elwell static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, -@@ -3042,6 +3049,8 @@ static int mmc_blk_probe(struct mmc_card +@@ -3052,6 +3059,8 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md; int ret = 0; @@ -275,7 +275,7 @@ Signed-off-by: Phil Elwell /* * Check that the card supports the command class(es) we need. -@@ -3049,7 +3058,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -3059,7 +3068,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -293,7 +293,7 @@ Signed-off-by: Phil Elwell card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -3064,6 +3082,17 @@ static int mmc_blk_probe(struct mmc_card +@@ -3074,6 +3092,17 @@ static int mmc_blk_probe(struct mmc_card goto out_free; } diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 168bba5c48..20e1cf4f8d 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1372,6 +1375,9 @@ +@@ -1373,6 +1376,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch index 032708a9a9..4860bae933 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch @@ -343,7 +343,7 @@ Signed-off-by: Naushir Patuck +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19288,6 +19288,14 @@ T: git git://linuxtv.org/media_tree.git +@@ -19290,6 +19290,14 @@ T: git git://linuxtv.org/media_tree.git F: Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml F: drivers/media/i2c/imx412.c diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch index c90ba4a189..662c057e9a 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch @@ -177,7 +177,7 @@ Signed-off-by: Phil Elwell +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19296,6 +19296,14 @@ T: git git://linuxtv.org/media_tree.git +@@ -19298,6 +19298,14 @@ T: git git://linuxtv.org/media_tree.git F: Documentation/devicetree/bindings/media/i2c/imx477.yaml F: drivers/media/i2c/imx477.c diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0197-Documentation-devicetree-Add-documentation-for-imx37.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0197-Documentation-devicetree-Add-documentation-for-imx37.patch index f48b7ef170..e1115b80bb 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0197-Documentation-devicetree-Add-documentation-for-imx37.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0197-Documentation-devicetree-Add-documentation-for-imx37.patch @@ -132,7 +132,7 @@ Signed-off-by: David Plowman +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19293,6 +19293,7 @@ M: Raspberry Pi Kernel Maintenance return; val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3); -@@ -905,7 +906,7 @@ static struct phy_driver broadcom_driver +@@ -906,7 +907,7 @@ static struct phy_driver broadcom_driver .link_change_notify = bcm54xx_link_change_notify, }, { .phy_id = PHY_ID_BCM54210E, @@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell .name = "Broadcom BCM54210E", /* PHY_GBIT_FEATURES */ .get_sset_count = bcm_phy_get_sset_count, -@@ -919,6 +920,13 @@ static struct phy_driver broadcom_driver +@@ -920,6 +921,13 @@ static struct phy_driver broadcom_driver .suspend = bcm54xx_suspend, .resume = bcm54xx_resume, }, { @@ -49,7 +49,7 @@ Signed-off-by: Jonathan Bell .phy_id = PHY_ID_BCM5461, .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM5461", -@@ -1155,7 +1163,8 @@ module_phy_driver(broadcom_drivers); +@@ -1158,7 +1166,8 @@ module_phy_driver(broadcom_drivers); static struct mdio_device_id __maybe_unused broadcom_tbl[] = { { PHY_ID_BCM5411, 0xfffffff0 }, { PHY_ID_BCM5421, 0xfffffff0 }, diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0427-Populate-phy-driver-block-for-BCM54213PE.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0427-Populate-phy-driver-block-for-BCM54213PE.patch index 18e654071c..cdfc996abf 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0427-Populate-phy-driver-block-for-BCM54213PE.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0427-Populate-phy-driver-block-for-BCM54213PE.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonathan Lemon --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c -@@ -932,8 +932,14 @@ static struct phy_driver broadcom_driver +@@ -933,8 +933,14 @@ static struct phy_driver broadcom_driver .phy_id_mask = 0xffffffff, .name = "Broadcom BCM54213PE", /* PHY_GBIT_FEATURES */ diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0528-dtbindings-media-i2c-Add-IMX708-CMOS-sensor-binding.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0528-dtbindings-media-i2c-Add-IMX708-CMOS-sensor-binding.patch index b475106747..efee9ebcd7 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0528-dtbindings-media-i2c-Add-IMX708-CMOS-sensor-binding.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0528-dtbindings-media-i2c-Add-IMX708-CMOS-sensor-binding.patch @@ -138,7 +138,7 @@ Signed-off-by: Dave Stevenson +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19337,6 +19337,14 @@ T: git git://linuxtv.org/media_tree.git +@@ -19339,6 +19339,14 @@ T: git git://linuxtv.org/media_tree.git F: Documentation/devicetree/bindings/media/i2c/imx519.yaml F: drivers/media/i2c/imx519.c diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0593-dt-bindings-media-i2c-Add-IMX296-CMOS-sensor-binding.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0593-dt-bindings-media-i2c-Add-IMX296-CMOS-sensor-binding.patch index 25aba4738d..003e0d4ccb 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0593-dt-bindings-media-i2c-Add-IMX296-CMOS-sensor-binding.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0593-dt-bindings-media-i2c-Add-IMX296-CMOS-sensor-binding.patch @@ -128,7 +128,7 @@ Signed-off-by: Sakari Ailus +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19279,6 +19279,14 @@ T: git git://linuxtv.org/media_tree.git +@@ -19281,6 +19281,14 @@ T: git git://linuxtv.org/media_tree.git F: Documentation/devicetree/bindings/media/i2c/imx290.txt F: drivers/media/i2c/imx290.c diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch index accb5fd51d..853b2c757a 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch @@ -23,7 +23,7 @@ Signed-off-by: Sakari Ailus --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19286,6 +19286,7 @@ L: linux-media@vger.kernel.org +@@ -19288,6 +19288,7 @@ L: linux-media@vger.kernel.org S: Maintained T: git git://linuxtv.org/media_tree.git F: Documentation/devicetree/bindings/media/i2c/sony,imx296.yaml diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0649-media-dt-bindings-Convert-imx290.txt-to-YAML.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0649-media-dt-bindings-Convert-imx290.txt-to-YAML.patch index cb0674887d..b2417364c6 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0649-media-dt-bindings-Convert-imx290.txt-to-YAML.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0649-media-dt-bindings-Convert-imx290.txt-to-YAML.patch @@ -219,7 +219,7 @@ Signed-off-by: Sakari Ailus +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19276,7 +19276,7 @@ M: Manivannan Sadhasivam +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -19351,7 +19351,7 @@ M: Raspberry Pi Kernel Maintenance static void macb_init_buffers(struct macb *bp) { struct macb_queue *queue; -@@ -915,6 +931,7 @@ static int macb_mii_init(struct macb *bp +@@ -914,6 +930,7 @@ static int macb_mii_init(struct macb *bp bp->mii_bus->name = "MACB_mii_bus"; bp->mii_bus->read = &macb_mdio_read; bp->mii_bus->write = &macb_mdio_write; @@ -199,7 +199,7 @@ Signed-off-by: Jonathan Bell snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", bp->pdev->name, bp->pdev->id); bp->mii_bus->priv = bp; -@@ -1584,6 +1601,11 @@ static int macb_rx(struct macb_queue *qu +@@ -1583,6 +1600,11 @@ static int macb_rx(struct macb_queue *qu macb_init_rx_ring(queue); queue_writel(queue, RBQP, queue->rx_ring_dma); @@ -211,7 +211,7 @@ Signed-off-by: Jonathan Bell macb_writel(bp, NCR, ctrl | MACB_BIT(RE)); -@@ -1884,8 +1906,9 @@ static irqreturn_t macb_interrupt(int ir +@@ -1883,8 +1905,9 @@ static irqreturn_t macb_interrupt(int ir queue_writel(queue, ISR, MACB_BIT(TCOMP) | MACB_BIT(TXUBR)); @@ -222,7 +222,7 @@ Signed-off-by: Jonathan Bell wmb(); // ensure softirq can see update } -@@ -2332,6 +2355,11 @@ static netdev_tx_t macb_start_xmit(struc +@@ -2331,6 +2354,11 @@ static netdev_tx_t macb_start_xmit(struc skb_tx_timestamp(skb); spin_lock_irq(&bp->lock); @@ -234,7 +234,7 @@ Signed-off-by: Jonathan Bell macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); spin_unlock_irq(&bp->lock); -@@ -2699,6 +2727,37 @@ static void macb_configure_dma(struct ma +@@ -2698,6 +2726,37 @@ static void macb_configure_dma(struct ma } } @@ -272,7 +272,7 @@ Signed-off-by: Jonathan Bell static void macb_init_hw(struct macb *bp) { u32 config; -@@ -2727,6 +2786,11 @@ static void macb_init_hw(struct macb *bp +@@ -2726,6 +2785,11 @@ static void macb_init_hw(struct macb *bp if (bp->caps & MACB_CAPS_JUMBO) bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK; @@ -284,7 +284,7 @@ Signed-off-by: Jonathan Bell macb_configure_dma(bp); } -@@ -3072,6 +3136,52 @@ static void gem_get_ethtool_strings(stru +@@ -3071,6 +3135,52 @@ static void gem_get_ethtool_strings(stru } } @@ -337,7 +337,7 @@ Signed-off-by: Jonathan Bell static struct net_device_stats *macb_get_stats(struct net_device *dev) { struct macb *bp = netdev_priv(dev); -@@ -3664,6 +3774,8 @@ static const struct ethtool_ops macb_eth +@@ -3663,6 +3773,8 @@ static const struct ethtool_ops macb_eth }; static const struct ethtool_ops gem_ethtool_ops = { @@ -346,7 +346,7 @@ Signed-off-by: Jonathan Bell .get_regs_len = macb_get_regs_len, .get_regs = macb_get_regs, .get_wol = macb_get_wol, -@@ -3673,6 +3785,8 @@ static const struct ethtool_ops gem_etht +@@ -3672,6 +3784,8 @@ static const struct ethtool_ops gem_etht .get_ethtool_stats = gem_get_ethtool_stats, .get_strings = gem_get_ethtool_strings, .get_sset_count = gem_get_sset_count, @@ -355,7 +355,7 @@ Signed-off-by: Jonathan Bell .get_link_ksettings = macb_get_link_ksettings, .set_link_ksettings = macb_set_link_ksettings, .get_ringparam = macb_get_ringparam, -@@ -4940,6 +5054,10 @@ static int macb_probe(struct platform_de +@@ -4939,6 +5053,10 @@ static int macb_probe(struct platform_de bp->usrio = macb_config->usrio; @@ -366,7 +366,7 @@ Signed-off-by: Jonathan Bell spin_lock_init(&bp->lock); /* setup capabilities */ -@@ -4995,6 +5113,21 @@ static int macb_probe(struct platform_de +@@ -4994,6 +5112,21 @@ static int macb_probe(struct platform_de else bp->phy_interface = interface; @@ -388,7 +388,7 @@ Signed-off-by: Jonathan Bell /* IP specific init */ err = init(pdev); if (err) -@@ -5071,6 +5204,19 @@ static int macb_remove(struct platform_d +@@ -5070,6 +5203,19 @@ static int macb_remove(struct platform_d return 0; } @@ -408,7 +408,7 @@ Signed-off-by: Jonathan Bell static int __maybe_unused macb_suspend(struct device *dev) { struct net_device *netdev = dev_get_drvdata(dev); -@@ -5285,6 +5431,7 @@ static const struct dev_pm_ops macb_pm_o +@@ -5284,6 +5430,7 @@ static const struct dev_pm_ops macb_pm_o static struct platform_driver macb_driver = { .probe = macb_probe, .remove = macb_remove, diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0882-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0882-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch index fff6cfdeb4..02565c0571 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0882-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0882-dmaengine-dw-axi-dmac-Fixes-for-RP1.patch @@ -102,16 +102,7 @@ Signed-off-by: Phil Elwell for (i = 0; i < chip->dw->hdata->nr_channels; i++) { axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL); axi_chan_disable(&chip->dw->chan[i]); -@@ -276,7 +299,7 @@ static struct axi_dma_lli *axi_desc_get( - static void axi_desc_put(struct axi_dma_desc *desc) - { - struct axi_dma_chan *chan = desc->chan; -- int count = atomic_read(&chan->descs_allocated); -+ u32 count = desc->hw_desc_count; - struct axi_dma_hw_desc *hw_desc; - int descs_put; - -@@ -298,6 +321,48 @@ static void vchan_desc_put(struct virt_d +@@ -299,6 +322,48 @@ static void vchan_desc_put(struct virt_d axi_desc_put(vd_to_axi_desc(vdesc)); } @@ -160,7 +151,7 @@ Signed-off-by: Phil Elwell static enum dma_status dma_chan_tx_status(struct dma_chan *dchan, dma_cookie_t cookie, struct dma_tx_state *txstate) -@@ -307,10 +372,7 @@ dma_chan_tx_status(struct dma_chan *dcha +@@ -308,10 +373,7 @@ dma_chan_tx_status(struct dma_chan *dcha enum dma_status status; u32 completed_length; unsigned long flags; @@ -171,7 +162,7 @@ Signed-off-by: Phil Elwell status = dma_cookie_status(dchan, cookie, txstate); if (status == DMA_COMPLETE || !txstate) -@@ -319,16 +381,31 @@ dma_chan_tx_status(struct dma_chan *dcha +@@ -320,16 +382,31 @@ dma_chan_tx_status(struct dma_chan *dcha spin_lock_irqsave(&chan->vc.lock, flags); vdesc = vchan_find_desc(&chan->vc, cookie); @@ -210,7 +201,7 @@ Signed-off-by: Phil Elwell return status; } -@@ -516,7 +593,7 @@ static void dw_axi_dma_set_hw_channel(st +@@ -517,7 +594,7 @@ static void dw_axi_dma_set_hw_channel(st unsigned long reg_value, val; if (!chip->apb_regs) { @@ -219,7 +210,7 @@ Signed-off-by: Phil Elwell return; } -@@ -620,18 +697,25 @@ static int dw_axi_dma_set_hw_desc(struct +@@ -621,18 +698,25 @@ static int dw_axi_dma_set_hw_desc(struct switch (chan->direction) { case DMA_MEM_TO_DEV: reg_width = __ffs(chan->config.dst_addr_width); @@ -247,7 +238,7 @@ Signed-off-by: Phil Elwell DWAXIDMAC_CH_CTL_L_INC << CH_CTL_L_DST_INC_POS | DWAXIDMAC_CH_CTL_L_NOINC << CH_CTL_L_SRC_INC_POS; block_ts = len >> reg_width; -@@ -667,9 +751,6 @@ static int dw_axi_dma_set_hw_desc(struct +@@ -668,9 +752,6 @@ static int dw_axi_dma_set_hw_desc(struct } hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1); @@ -257,7 +248,7 @@ Signed-off-by: Phil Elwell hw_desc->lli->ctl_lo = cpu_to_le32(ctllo); set_desc_src_master(hw_desc); -@@ -764,6 +845,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c +@@ -765,6 +846,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c src_addr += segment_len; } @@ -266,7 +257,7 @@ Signed-off-by: Phil Elwell llp = desc->hw_desc[0].llp; /* Managed transfer list */ -@@ -843,6 +926,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma +@@ -844,6 +927,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma } while (len >= segment_len); } @@ -275,7 +266,7 @@ Signed-off-by: Phil Elwell /* Set end-of-link to the last link descriptor of list */ set_desc_last(&desc->hw_desc[num_sgs - 1]); -@@ -950,6 +1035,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan +@@ -951,6 +1036,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan num++; } @@ -284,7 +275,7 @@ Signed-off-by: Phil Elwell /* Set end-of-link to the last link descriptor of list */ set_desc_last(&desc->hw_desc[num - 1]); /* Managed transfer list */ -@@ -998,7 +1085,7 @@ static void axi_chan_dump_lli(struct axi +@@ -999,7 +1086,7 @@ static void axi_chan_dump_lli(struct axi static void axi_chan_list_dump_lli(struct axi_dma_chan *chan, struct axi_dma_desc *desc_head) { @@ -293,7 +284,7 @@ Signed-off-by: Phil Elwell int i; for (i = 0; i < count; i++) -@@ -1041,11 +1128,11 @@ out: +@@ -1042,11 +1129,11 @@ out: static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan) { @@ -306,7 +297,7 @@ Signed-off-by: Phil Elwell u64 llp; int i; -@@ -1067,6 +1154,7 @@ static void axi_chan_block_xfer_complete +@@ -1068,6 +1155,7 @@ static void axi_chan_block_xfer_complete if (chan->cyclic) { desc = vd_to_axi_desc(vd); if (desc) { @@ -314,7 +305,7 @@ Signed-off-by: Phil Elwell llp = lo_hi_readq(chan->chan_regs + CH_LLP); for (i = 0; i < count; i++) { hw_desc = &desc->hw_desc[i]; -@@ -1310,6 +1398,8 @@ static int parse_device_properties(struc +@@ -1308,6 +1396,8 @@ static int parse_device_properties(struc chip->dw->hdata->nr_channels = tmp; if (tmp <= DMA_REG_MAP_CH_REF) chip->dw->hdata->reg_map_8_channels = true; @@ -323,7 +314,7 @@ Signed-off-by: Phil Elwell ret = device_property_read_u32(dev, "snps,dma-masters", &tmp); if (ret) -@@ -1319,6 +1409,10 @@ static int parse_device_properties(struc +@@ -1317,6 +1407,10 @@ static int parse_device_properties(struc chip->dw->hdata->nr_masters = tmp; diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-1194-media-dt-bindings-i2c-Add-Rohm-BU64754-bindings.patch b/lede/target/linux/bcm27xx/patches-6.1/950-1194-media-dt-bindings-i2c-Add-Rohm-BU64754-bindings.patch index 14698638ab..c11fbe2ec6 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-1194-media-dt-bindings-i2c-Add-Rohm-BU64754-bindings.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-1194-media-dt-bindings-i2c-Add-Rohm-BU64754-bindings.patch @@ -67,7 +67,7 @@ Signed-off-by: Jacopo Mondi +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -17902,6 +17902,13 @@ S: Maintained +@@ -17904,6 +17904,13 @@ S: Maintained F: Documentation/devicetree/bindings/iio/light/bh1750.yaml F: drivers/iio/light/bh1750.c diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-1195-media-i2c-Add-driver-for-OmniVision-OV64A40.patch b/lede/target/linux/bcm27xx/patches-6.1/950-1195-media-i2c-Add-driver-for-OmniVision-OV64A40.patch index 81e7a70203..01940e18e3 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-1195-media-i2c-Add-driver-for-OmniVision-OV64A40.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-1195-media-i2c-Add-driver-for-OmniVision-OV64A40.patch @@ -16,7 +16,7 @@ Signed-off-by: Jacopo Mondi --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -15328,6 +15328,14 @@ S: Maintained +@@ -15330,6 +15330,14 @@ S: Maintained T: git git://linuxtv.org/media_tree.git F: drivers/media/i2c/ov5695.c diff --git a/lede/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch b/lede/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch index 2724efa15e..d285da60c7 100644 --- a/lede/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch +++ b/lede/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch @@ -55,7 +55,7 @@ Signed-off-by: David Bauer /* SGMII */ #define VSPEC1_SGMII_CTRL 0x08 #define VSPEC1_SGMII_CTRL_ANEN BIT(12) /* Aneg enable */ -@@ -241,6 +248,35 @@ out: +@@ -258,6 +265,35 @@ out: return ret; } @@ -90,16 +90,4 @@ Signed-off-by: David Bauer + static int gpy_config_init(struct phy_device *phydev) { - int ret; -@@ -252,7 +288,10 @@ static int gpy_config_init(struct phy_de - - /* Clear all pending interrupts */ - ret = phy_read(phydev, PHY_ISTAT); -- return ret < 0 ? ret : 0; -+ if (ret < 0) -+ return ret; -+ -+ return gpy_led_write(phydev); - } - - static bool gpy_has_broken_mdint(struct phy_device *phydev) + /* Nothing to configure. Configuration Requirement Placeholder */ diff --git a/lede/target/linux/generic/hack-6.1/902-debloat_proc.patch b/lede/target/linux/generic/hack-6.1/902-debloat_proc.patch index 06b3a04f7a..ee3caa9f47 100644 --- a/lede/target/linux/generic/hack-6.1/902-debloat_proc.patch +++ b/lede/target/linux/generic/hack-6.1/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4115,6 +4115,8 @@ static __net_initdata struct pernet_oper +@@ -4118,6 +4118,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index bc089c8515..093820d31b 100644 --- a/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -92,7 +92,7 @@ struct net_bridge_port *p; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3618,9 +3618,17 @@ static int xmit_one(struct sk_buff *skb, +@@ -3603,9 +3603,17 @@ static int xmit_one(struct sk_buff *skb, { unsigned int len; int rc; @@ -111,7 +111,7 @@ #ifdef CONFIG_ETHERNET_PACKET_MANGLE if (dev->eth_mangle_tx && !(skb = dev->eth_mangle_tx(dev, skb))) -@@ -5281,6 +5289,11 @@ void netdev_rx_handler_unregister(struct +@@ -5266,6 +5274,11 @@ void netdev_rx_handler_unregister(struct } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -123,7 +123,7 @@ /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -5329,6 +5342,10 @@ static int __netif_receive_skb_core(stru +@@ -5314,6 +5327,10 @@ static int __netif_receive_skb_core(stru int ret = NET_RX_DROP; __be16 type; @@ -134,7 +134,7 @@ net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb); trace_netif_receive_skb(skb); -@@ -5366,6 +5383,15 @@ another_round: +@@ -5351,6 +5368,15 @@ another_round: goto out; } diff --git a/lede/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch b/lede/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch index 51a03be2ad..13f5e9af88 100644 --- a/lede/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch +++ b/lede/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch @@ -55,7 +55,7 @@ Signed-off-by: David Bauer #define PHY_PMA_MGBT_POLARITY 0x82 #define PHY_MDI_MDI_X_MASK GENMASK(1, 0) #define PHY_MDI_MDI_X_NORMAL 0x3 -@@ -260,6 +267,35 @@ out: +@@ -270,6 +277,35 @@ out: return ret; } @@ -90,16 +90,4 @@ Signed-off-by: David Bauer + static int gpy_config_init(struct phy_device *phydev) { - int ret; -@@ -271,7 +307,10 @@ static int gpy_config_init(struct phy_de - - /* Clear all pending interrupts */ - ret = phy_read(phydev, PHY_ISTAT); -- return ret < 0 ? ret : 0; -+ if (ret < 0) -+ return ret; -+ -+ return gpy_led_write(phydev); - } - - static int gpy_probe(struct phy_device *phydev) + /* Nothing to configure. Configuration Requirement Placeholder */ diff --git a/lede/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch b/lede/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch index a4d84f8b7d..7733b45520 100644 --- a/lede/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch +++ b/lede/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), -@@ -2586,7 +2589,8 @@ static void sfp_sm_main(struct sfp *sfp, +@@ -2589,7 +2592,8 @@ static void sfp_sm_main(struct sfp *sfp, * or t_start_up, so assume there is a fault. */ sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, @@ -46,7 +46,7 @@ Signed-off-by: Daniel Golle } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { init_done: /* Create mdiobus and start trying for PHY */ -@@ -2840,10 +2844,12 @@ static void sfp_check_state(struct sfp * +@@ -2843,10 +2847,12 @@ static void sfp_check_state(struct sfp * mutex_lock(&sfp->st_mutex); state = sfp_get_state(sfp); changed = state ^ sfp->state; diff --git a/lede/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch b/lede/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch index 9375a721b5..a011cf8ffa 100644 --- a/lede/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch +++ b/lede/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch @@ -133,7 +133,7 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP # host support --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c -@@ -1287,6 +1287,14 @@ static int __init ssb_modinit(void) +@@ -1289,6 +1289,14 @@ static int __init ssb_modinit(void) { int err; diff --git a/lede/target/linux/generic/hack-6.6/902-debloat_proc.patch b/lede/target/linux/generic/hack-6.6/902-debloat_proc.patch index 3b037a732c..26832476c3 100644 --- a/lede/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/lede/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4145,6 +4145,8 @@ static __net_initdata struct pernet_oper +@@ -4148,6 +4148,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index 2a4022f4b0..308de8a0c4 100644 --- a/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -92,7 +92,7 @@ struct net_bridge_port *p; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3567,9 +3567,17 @@ static int xmit_one(struct sk_buff *skb, +@@ -3593,9 +3593,17 @@ static int xmit_one(struct sk_buff *skb, { unsigned int len; int rc; @@ -111,7 +111,7 @@ #ifdef CONFIG_ETHERNET_PACKET_MANGLE if (dev->eth_mangle_tx && !(skb = dev->eth_mangle_tx(dev, skb))) -@@ -5308,6 +5316,11 @@ void netdev_rx_handler_unregister(struct +@@ -5355,6 +5363,11 @@ void netdev_rx_handler_unregister(struct } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -123,7 +123,7 @@ /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -5356,6 +5369,10 @@ static int __netif_receive_skb_core(stru +@@ -5403,6 +5416,10 @@ static int __netif_receive_skb_core(stru int ret = NET_RX_DROP; __be16 type; @@ -134,7 +134,7 @@ net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb); trace_netif_receive_skb(skb); -@@ -5393,6 +5410,15 @@ another_round: +@@ -5440,6 +5457,15 @@ another_round: goto out; } diff --git a/lede/target/linux/generic/pending-6.1/630-packet_socket_type.patch b/lede/target/linux/generic/pending-6.1/630-packet_socket_type.patch index 9c8be72745..359d002b0e 100644 --- a/lede/target/linux/generic/pending-6.1/630-packet_socket_type.patch +++ b/lede/target/linux/generic/pending-6.1/630-packet_socket_type.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -4012,6 +4015,16 @@ packet_setsockopt(struct socket *sock, i +@@ -4014,6 +4017,16 @@ packet_setsockopt(struct socket *sock, i WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4068,6 +4081,13 @@ static int packet_getsockopt(struct sock +@@ -4070,6 +4083,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/lede/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/lede/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 7ffb6dd1d1..43d49f07d1 100644 --- a/lede/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/lede/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1042,6 +1056,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1077,6 +1092,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4545,6 +4564,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4547,6 +4566,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5038,7 +5068,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5040,7 +5070,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6285,6 +6316,8 @@ static int ip6_route_dev_notify(struct n +@@ -6287,6 +6318,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6296,6 +6329,7 @@ static int ip6_route_dev_notify(struct n +@@ -6298,6 +6331,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6487,6 +6521,8 @@ static int __net_init ip6_route_net_init +@@ -6489,6 +6523,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6497,11 +6533,21 @@ static int __net_init ip6_route_net_init +@@ -6499,11 +6535,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6528,6 +6574,8 @@ out: +@@ -6530,6 +6576,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6547,6 +6595,7 @@ static void __net_exit ip6_route_net_exi +@@ -6549,6 +6597,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6630,6 +6679,9 @@ void __init ip6_route_init_special_entri +@@ -6632,6 +6681,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/lede/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch b/lede/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch index f6c3783219..52e97e46ef 100644 --- a/lede/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch +++ b/lede/target/linux/generic/pending-6.6/600-netfilter_conntrack_flush.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau #include #ifdef CONFIG_SYSCTL #include -@@ -461,6 +462,58 @@ static int ct_cpu_seq_show(struct seq_fi +@@ -458,6 +459,58 @@ static int ct_cpu_seq_show(struct seq_fi return 0; } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static const struct seq_operations ct_cpu_seq_ops = { .start = ct_cpu_seq_start, .next = ct_cpu_seq_next, -@@ -474,8 +527,9 @@ static int nf_conntrack_standalone_init_ +@@ -471,8 +524,9 @@ static int nf_conntrack_standalone_init_ kuid_t root_uid; kgid_t root_gid; diff --git a/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch b/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch index da74ac68bf..1426e634a5 100644 --- a/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch +++ b/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch @@ -46,7 +46,7 @@ Signed-off-by: Christian 'Ansuel' Marangi --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c -@@ -633,6 +633,7 @@ enum nf_ct_sysctl_index { +@@ -630,6 +630,7 @@ enum nf_ct_sysctl_index { #endif NF_SYSCTL_CT_PROTO_TCP_LOOSE, NF_SYSCTL_CT_PROTO_TCP_LIBERAL, @@ -54,7 +54,7 @@ Signed-off-by: Christian 'Ansuel' Marangi NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST, NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS, NF_SYSCTL_CT_PROTO_TIMEOUT_UDP, -@@ -840,6 +841,14 @@ static struct ctl_table nf_ct_sysctl_tab +@@ -834,6 +835,14 @@ static struct ctl_table nf_ct_sysctl_tab .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, @@ -69,7 +69,7 @@ Signed-off-by: Christian 'Ansuel' Marangi [NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST] = { .procname = "nf_conntrack_tcp_ignore_invalid_rst", .maxlen = sizeof(u8), -@@ -1050,6 +1059,7 @@ static void nf_conntrack_standalone_init +@@ -1035,6 +1044,7 @@ static void nf_conntrack_standalone_init XASSIGN(LOOSE, &tn->tcp_loose); XASSIGN(LIBERAL, &tn->tcp_be_liberal); diff --git a/lede/target/linux/generic/pending-6.6/630-packet_socket_type.patch b/lede/target/linux/generic/pending-6.6/630-packet_socket_type.patch index 10a312776f..fd00e1e052 100644 --- a/lede/target/linux/generic/pending-6.6/630-packet_socket_type.patch +++ b/lede/target/linux/generic/pending-6.6/630-packet_socket_type.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -4034,6 +4037,16 @@ packet_setsockopt(struct socket *sock, i +@@ -4036,6 +4039,16 @@ packet_setsockopt(struct socket *sock, i packet_sock_flag_set(po, PACKET_SOCK_QDISC_BYPASS, val); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4093,6 +4106,13 @@ static int packet_getsockopt(struct sock +@@ -4095,6 +4108,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR_SZ: val = READ_ONCE(po->vnet_hdr_sz); break; diff --git a/lede/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/lede/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 77a16bad9a..cc92e20f63 100644 --- a/lede/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/lede/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__rcuref = RCUREF_INIT(1), -@@ -1038,6 +1052,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1073,6 +1088,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4544,6 +4563,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4546,6 +4565,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5035,7 +5065,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5037,7 +5067,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6282,6 +6313,8 @@ static int ip6_route_dev_notify(struct n +@@ -6284,6 +6315,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6293,6 +6326,7 @@ static int ip6_route_dev_notify(struct n +@@ -6295,6 +6328,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6493,6 +6527,8 @@ static int __net_init ip6_route_net_init +@@ -6495,6 +6529,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6503,11 +6539,21 @@ static int __net_init ip6_route_net_init +@@ -6505,11 +6541,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6534,6 +6580,8 @@ out: +@@ -6536,6 +6582,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6553,6 +6601,7 @@ static void __net_exit ip6_route_net_exi +@@ -6555,6 +6603,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6636,6 +6685,9 @@ void __init ip6_route_init_special_entri +@@ -6638,6 +6687,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/lede/target/linux/mediatek/dts/mt7986a-hf-m7986r1.dtsi b/lede/target/linux/mediatek/dts/mt7986a-hf-m7986r1.dtsi index 81011c59a7..4914f1faaa 100644 --- a/lede/target/linux/mediatek/dts/mt7986a-hf-m7986r1.dtsi +++ b/lede/target/linux/mediatek/dts/mt7986a-hf-m7986r1.dtsi @@ -24,11 +24,10 @@ reg = <0 0x40000000 0 0x40000000>; }; - gpio-keys { + keys { compatible = "gpio-keys"; - // seems to conflict with pcie_clk, needs investigate - button-reset { + reset { label = "reset"; linux,code = ; gpios = <&pio 9 GPIO_ACTIVE_LOW>; @@ -167,11 +166,6 @@ mediatek,pull-down-adv = <1>; output-low; }; - - mux { - function = "pcie"; - groups = "pcie_clk", "pcie_wake", "pcie_pereset"; - }; }; usb_pins: usb-pins { @@ -323,7 +317,6 @@ hs400-ds-delay = <0x14014>; max-frequency = <200000000>; mmc-hs200-1_8v; - mmc-hs400-1_8v; no-sd; no-sdio; non-removable; diff --git a/lede/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/lede/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 8082fa3620..3afebeaf52 100644 --- a/lede/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/lede/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -35,7 +35,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan ;; hf,m7986r1*) - ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" lan1 + ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "lan1 usb0" ;; glinet,gl-mt2500|\ glinet,gl-mt3000) diff --git a/lede/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/lede/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 37cba01940..ebbb273277 100755 --- a/lede/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/lede/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_do_upgrade() { cmcc,rax3000m-emmc|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ + hf,m7986r1-emmc|\ jdcloud,re-cs-05) CI_KERNPART="kernel" CI_ROOTPART="rootfs" @@ -97,6 +98,7 @@ platform_copy_config() { cmcc,rax3000m-emmc|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ + hf,m7986r1-emmc|\ jdcloud,re-cs-05) emmc_copy_config ;; diff --git a/lede/target/linux/mediatek/image/filogic.mk b/lede/target/linux/mediatek/image/filogic.mk index c1ac001c20..62532d3ded 100644 --- a/lede/target/linux/mediatek/image/filogic.mk +++ b/lede/target/linux/mediatek/image/filogic.mk @@ -503,7 +503,7 @@ define Device/hf_m7986r1-nand PAGESIZE := 2048 IMAGE_SIZE := 116736k KERNEL_IN_UBI := 1 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7921e kmod-usb-serial-option kmod-usb-net-rndis + DEVICE_PACKAGES := kmod-usb3 kmod-mt7921e kmod-usb-serial-option kmod-usb-net-rndis mmc-utils SUPPORTED_DEVICES += HF-M7986R1 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef diff --git a/lede/target/linux/mediatek/patches-6.1/041-block-fit-partition-parser.patch b/lede/target/linux/mediatek/patches-6.1/041-block-fit-partition-parser.patch index 49fc7e638c..3cef80d836 100644 --- a/lede/target/linux/mediatek/patches-6.1/041-block-fit-partition-parser.patch +++ b/lede/target/linux/mediatek/patches-6.1/041-block-fit-partition-parser.patch @@ -19,7 +19,7 @@ Subject: [PATCH] kernel: add block fit partition parser --- a/block/blk.h +++ b/block/blk.h -@@ -424,6 +424,8 @@ void blk_free_ext_minor(unsigned int min +@@ -415,6 +415,8 @@ void blk_free_ext_minor(unsigned int min #define ADDPART_FLAG_NONE 0 #define ADDPART_FLAG_RAID 1 #define ADDPART_FLAG_WHOLEDISK 2 @@ -82,7 +82,7 @@ Subject: [PATCH] kernel: add block fit partition parser #include "check.h" -@@ -48,6 +51,9 @@ static int (*const check_part[])(struct +@@ -48,6 +51,9 @@ static int (*check_part[])(struct parsed #ifdef CONFIG_EFI_PARTITION efi_partition, /* this must come before msdos */ #endif @@ -92,7 +92,7 @@ Subject: [PATCH] kernel: add block fit partition parser #ifdef CONFIG_SGI_PARTITION sgi_partition, #endif -@@ -430,6 +436,11 @@ static struct block_device *add_partitio +@@ -439,6 +445,11 @@ static struct block_device *add_partitio goto out_del; } @@ -104,7 +104,7 @@ Subject: [PATCH] kernel: add block fit partition parser /* everything is up and running, commence */ err = xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL); if (err) -@@ -622,6 +633,11 @@ static bool blk_add_partition(struct gen +@@ -631,6 +642,11 @@ static bool blk_add_partition(struct gen (state->parts[p].flags & ADDPART_FLAG_RAID)) md_autodetect_dev(part->bd_dev); @@ -193,7 +193,7 @@ Subject: [PATCH] kernel: add block fit partition parser set_capacity(gd, ((u64)new->size * tr->blksize) >> 9); --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c -@@ -410,7 +410,9 @@ int ubiblock_create(struct ubi_volume_in +@@ -432,7 +432,9 @@ int ubiblock_create(struct ubi_volume_in ret = -ENODEV; goto out_cleanup_disk; } diff --git a/lede/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch b/lede/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch index 1f747d1f4f..ac8a55e187 100644 --- a/lede/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch +++ b/lede/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch @@ -26,7 +26,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -2900,6 +2900,18 @@ static const struct flash_info *spi_nor_ +@@ -2922,6 +2922,18 @@ static const struct flash_info *spi_nor_ return NULL; } @@ -45,7 +45,7 @@ Signed-off-by: SkyLake.Huang static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, const char *name) { -@@ -3003,6 +3015,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3025,6 +3037,9 @@ int spi_nor_scan(struct spi_nor *nor, co if (!nor->bouncebuf) return -ENOMEM; diff --git a/lede/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch b/lede/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch index e37705f388..487990ab77 100644 --- a/lede/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch +++ b/lede/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -389,6 +389,12 @@ config ROCKCHIP_PHY +@@ -384,6 +384,12 @@ config ROCKCHIP_PHY help Currently supports the integrated Ethernet PHY. @@ -15,7 +15,7 @@ help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -98,6 +98,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o +@@ -95,6 +95,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o obj-$(CONFIG_REALTEK_PHY) += realtek.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o diff --git a/lede/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch b/lede/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch index 8d1b89d69c..4022b2a842 100644 --- a/lede/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch +++ b/lede/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch @@ -24,9 +24,9 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12943,6 +12943,15 @@ S: Maintained - F: drivers/net/pcs/pcs-mtk-lynxi.c +@@ -12945,6 +12945,15 @@ F: drivers/net/pcs/pcs-mtk-usxgmii.c F: include/linux/pcs/pcs-mtk-lynxi.h + F: include/linux/pcs/pcs-mtk-usxgmii.h +MEDIATEK ETHERNET PHY DRIVERS +M: Daniel Golle @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -84,6 +84,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o +@@ -80,6 +80,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o diff --git a/lede/target/linux/mediatek/patches-6.1/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch b/lede/target/linux/mediatek/patches-6.1/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch index d745727371..ecc77bd92a 100644 --- a/lede/target/linux/mediatek/patches-6.1/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch +++ b/lede/target/linux/mediatek/patches-6.1/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c -@@ -367,8 +367,11 @@ static bool gpy_2500basex_chk(struct phy +@@ -377,8 +377,11 @@ static bool gpy_2500basex_chk(struct phy phydev->speed = SPEED_2500; phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -28,7 +28,7 @@ Signed-off-by: Daniel Golle return true; } -@@ -392,6 +395,14 @@ static int gpy_config_aneg(struct phy_de +@@ -402,6 +405,14 @@ static int gpy_config_aneg(struct phy_de u32 adv; int ret; @@ -43,7 +43,7 @@ Signed-off-by: Daniel Golle if (phydev->autoneg == AUTONEG_DISABLE) { /* Configure half duplex with genphy_setup_forced, * because genphy_c45_pma_setup_forced does not support. -@@ -482,6 +493,8 @@ static void gpy_update_interface(struct +@@ -492,6 +503,8 @@ static void gpy_update_interface(struct switch (phydev->speed) { case SPEED_2500: phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, VSPEC1_SGMII_CTRL_ANEN, 0); if (ret < 0) -@@ -493,7 +506,7 @@ static void gpy_update_interface(struct +@@ -503,7 +516,7 @@ static void gpy_update_interface(struct case SPEED_100: case SPEED_10: phydev->interface = PHY_INTERFACE_MODE_SGMII; diff --git a/lede/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch b/lede/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch index 125bd9b0b3..b4c07a4b1f 100644 --- a/lede/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch +++ b/lede/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch @@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -83,6 +83,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell +@@ -79,6 +79,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o diff --git a/lede/target/linux/mediatek/patches-6.1/940-net-ethernet-mtk_wed-rename-mtk_wed_get_memory_regio.patch b/lede/target/linux/mediatek/patches-6.1/940-net-ethernet-mtk_wed-rename-mtk_wed_get_memory_regio.patch index 465f0eaf27..30be53518a 100644 --- a/lede/target/linux/mediatek/patches-6.1/940-net-ethernet-mtk_wed-rename-mtk_wed_get_memory_regio.patch +++ b/lede/target/linux/mediatek/patches-6.1/940-net-ethernet-mtk_wed-rename-mtk_wed_get_memory_regio.patch @@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi { struct reserved_mem *rmem; struct device_node *np; -@@ -325,7 +325,7 @@ mtk_wed_mcu_load_firmware(struct mtk_wed +@@ -321,7 +321,7 @@ mtk_wed_mcu_load_firmware(struct mtk_wed if (index < 0) continue; diff --git a/lede/target/linux/mediatek/patches-6.1/944-net-ethernet-mtk_wed-move-dlm-a-dedicated-dts-node.patch b/lede/target/linux/mediatek/patches-6.1/944-net-ethernet-mtk_wed-move-dlm-a-dedicated-dts-node.patch index 209580d64a..c92fcd43ce 100644 --- a/lede/target/linux/mediatek/patches-6.1/944-net-ethernet-mtk_wed-move-dlm-a-dedicated-dts-node.patch +++ b/lede/target/linux/mediatek/patches-6.1/944-net-ethernet-mtk_wed-move-dlm-a-dedicated-dts-node.patch @@ -22,7 +22,7 @@ Signed-off-by: Lorenzo Bianconi --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c -@@ -814,6 +814,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device +@@ -1320,6 +1320,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device struct device_node *np; int index; @@ -47,7 +47,7 @@ Signed-off-by: Lorenzo Bianconi index = of_property_match_string(dev->hw->node, "memory-region-names", "wo-dlm"); if (index < 0) -@@ -830,6 +848,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device +@@ -1336,6 +1354,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device return -ENODEV; dev->rro.miod_phys = rmem->base; diff --git a/lede/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch b/lede/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch index 80179cc7dc..99d0a0dbc2 100644 --- a/lede/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch +++ b/lede/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c -@@ -386,8 +386,11 @@ static bool gpy_2500basex_chk(struct phy +@@ -385,8 +385,11 @@ static bool gpy_2500basex_chk(struct phy phydev->speed = SPEED_2500; phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -28,7 +28,7 @@ Signed-off-by: Daniel Golle return true; } -@@ -438,6 +441,14 @@ static int gpy_config_aneg(struct phy_de +@@ -437,6 +440,14 @@ static int gpy_config_aneg(struct phy_de u32 adv; int ret; @@ -43,7 +43,7 @@ Signed-off-by: Daniel Golle if (phydev->autoneg == AUTONEG_DISABLE) { /* Configure half duplex with genphy_setup_forced, * because genphy_c45_pma_setup_forced does not support. -@@ -560,6 +571,8 @@ static int gpy_update_interface(struct p +@@ -559,6 +570,8 @@ static int gpy_update_interface(struct p switch (phydev->speed) { case SPEED_2500: phydev->interface = PHY_INTERFACE_MODE_2500BASEX; @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, VSPEC1_SGMII_CTRL_ANEN, 0); if (ret < 0) { -@@ -573,7 +586,7 @@ static int gpy_update_interface(struct p +@@ -572,7 +585,7 @@ static int gpy_update_interface(struct p case SPEED_100: case SPEED_10: phydev->interface = PHY_INTERFACE_MODE_SGMII; diff --git a/lede/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch b/lede/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch index 29393a6891..76fe8326d6 100644 --- a/lede/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch +++ b/lede/target/linux/mediatek/patches-6.6/830-v6.7-39-thermal-lvts-Convert-to-platform-remove-callback-ret.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafael J. Wysocki --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1243,7 +1243,7 @@ static int lvts_probe(struct platform_de +@@ -1247,7 +1247,7 @@ static int lvts_probe(struct platform_de return 0; } @@ -38,7 +38,7 @@ Signed-off-by: Rafael J. Wysocki { struct lvts_domain *lvts_td; int i; -@@ -1254,8 +1254,6 @@ static int lvts_remove(struct platform_d +@@ -1258,8 +1258,6 @@ static int lvts_remove(struct platform_d lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); lvts_debugfs_exit(lvts_td); @@ -47,7 +47,7 @@ Signed-off-by: Rafael J. Wysocki } static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { -@@ -1356,7 +1354,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); +@@ -1360,7 +1358,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); static struct platform_driver lvts_driver = { .probe = lvts_probe, diff --git a/lede/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch b/lede/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch index 5871c87549..0b965c9521 100644 --- a/lede/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch +++ b/lede/target/linux/mediatek/patches-6.6/830-v6.7-40-thermal-drivers-mediatek-lvts_thermal-Make-coeff-con.patch @@ -135,8 +135,8 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de { u32 gt; -@@ -703,7 +712,7 @@ static int lvts_golden_temp_init(struct - if (gt && gt < LVTS_GOLDEN_TEMP_MAX) +@@ -707,7 +716,7 @@ static int lvts_golden_temp_init(struct + if (gt < LVTS_GOLDEN_TEMP_MAX) golden_temp = gt; - coeff_b = golden_temp * 500 + LVTS_COEFF_B; @@ -144,7 +144,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de return 0; } -@@ -726,7 +735,7 @@ static int lvts_ctrl_init(struct device +@@ -730,7 +739,7 @@ static int lvts_ctrl_init(struct device * The golden temp information is contained in the first chunk * of efuse data. */ @@ -153,7 +153,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de if (ret) return ret; -@@ -737,6 +746,7 @@ static int lvts_ctrl_init(struct device +@@ -741,6 +750,7 @@ static int lvts_ctrl_init(struct device for (i = 0; i < lvts_data->num_lvts_ctrl; i++) { lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset; @@ -161,7 +161,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_sensor_init(dev, &lvts_ctrl[i], &lvts_data->lvts_ctrl[i]); -@@ -760,7 +770,8 @@ static int lvts_ctrl_init(struct device +@@ -764,7 +774,8 @@ static int lvts_ctrl_init(struct device * after initializing the calibration. */ lvts_ctrl[i].hw_tshut_raw_temp = @@ -171,7 +171,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de lvts_ctrl[i].low_thresh = INT_MIN; lvts_ctrl[i].high_thresh = INT_MIN; -@@ -1225,6 +1236,8 @@ static int lvts_probe(struct platform_de +@@ -1229,6 +1240,8 @@ static int lvts_probe(struct platform_de if (irq < 0) return irq; @@ -180,7 +180,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de ret = lvts_domain_init(dev, lvts_td, lvts_data); if (ret) return dev_err_probe(dev, ret, "Failed to initialize the lvts domain\n"); -@@ -1338,11 +1351,15 @@ static const struct lvts_ctrl_data mt819 +@@ -1342,11 +1355,15 @@ static const struct lvts_ctrl_data mt819 static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), diff --git a/lede/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch b/lede/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch index b758720d24..65d90899f8 100644 --- a/lede/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch +++ b/lede/target/linux/mediatek/patches-6.6/830-v6.7-42-thermal-drivers-mediatek-lvts_thermal-Add-mt7988-sup.patch @@ -33,7 +33,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1269,6 +1272,33 @@ static void lvts_remove(struct platform_ +@@ -1273,6 +1276,33 @@ static void lvts_remove(struct platform_ lvts_debugfs_exit(lvts_td); } @@ -67,7 +67,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1348,6 +1378,13 @@ static const struct lvts_ctrl_data mt819 +@@ -1352,6 +1382,13 @@ static const struct lvts_ctrl_data mt819 } }; @@ -81,7 +81,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1363,6 +1400,7 @@ static const struct lvts_data mt8195_lvt +@@ -1367,6 +1404,7 @@ static const struct lvts_data mt8195_lvt }; static const struct of_device_id lvts_of_match[] = { diff --git a/lede/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch b/lede/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch index 0893db74a5..98946fc814 100644 --- a/lede/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch +++ b/lede/target/linux/mediatek/patches-6.6/830-v6.7-45-thermal-drivers-mediatek-lvts_thermal-Add-suspend-an.patch @@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c -@@ -1299,6 +1299,38 @@ static const struct lvts_ctrl_data mt798 +@@ -1303,6 +1303,38 @@ static const struct lvts_ctrl_data mt798 } }; @@ -63,7 +63,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1407,12 +1439,17 @@ static const struct of_device_id lvts_of +@@ -1411,12 +1443,17 @@ static const struct of_device_id lvts_of }; MODULE_DEVICE_TABLE(of, lvts_of_match); diff --git a/lede/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch b/lede/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch index 1fe7e255b7..d478856359 100644 --- a/lede/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch +++ b/lede/target/linux/mediatek/patches-6.6/830-v6.7-47-thermal-drivers-mediatek-lvts_thermal-Add-mt8192-sup.patch @@ -34,7 +34,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com #define LVTS_HW_SHUTDOWN_MT8195 105000 #define LVTS_MINIMUM_THRESHOLD 20000 -@@ -1331,6 +1332,88 @@ static int lvts_resume(struct device *de +@@ -1335,6 +1336,88 @@ static int lvts_resume(struct device *de return 0; } @@ -123,7 +123,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { { .cal_offset = { 0x04, 0x07 }, -@@ -1417,6 +1500,16 @@ static const struct lvts_data mt7988_lvt +@@ -1421,6 +1504,16 @@ static const struct lvts_data mt7988_lvt .temp_offset = LVTS_COEFF_B_MT7988, }; @@ -140,7 +140,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com static const struct lvts_data mt8195_lvts_mcu_data = { .lvts_ctrl = mt8195_lvts_mcu_data_ctrl, .num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), -@@ -1433,6 +1526,8 @@ static const struct lvts_data mt8195_lvt +@@ -1437,6 +1530,8 @@ static const struct lvts_data mt8195_lvt static const struct of_device_id lvts_of_match[] = { { .compatible = "mediatek,mt7988-lvts-ap", .data = &mt7988_lvts_ap_data }, diff --git a/lede/target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch b/lede/target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch index dd57eae360..5a4b1bbc99 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch @@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20220818220628.339366-9-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -675,6 +675,14 @@ +@@ -677,6 +677,14 @@ #mbox-cells = <1>; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch b/lede/target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch index bad75e4597..f5abd27965 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20220818220245.338396-5-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -274,6 +274,16 @@ +@@ -276,6 +276,16 @@ status = "disabled"; }; @@ -37,7 +37,7 @@ Link: https://lore.kernel.org/r/20220818220245.338396-5-robimarko@gmail.com cryptobam: dma-controller@704000 { compatible = "qcom,bam-v1.7.0"; reg = <0x00704000 0x20000>; -@@ -874,4 +884,90 @@ +@@ -876,4 +886,90 @@ , ; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch b/lede/target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch index e229851649..96b49e60bf 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch @@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20220818220849.339732-4-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -680,6 +680,8 @@ +@@ -682,6 +682,8 @@ apcs_glb: mailbox@b111000 { compatible = "qcom,ipq8074-apcs-apps-global"; reg = <0x0b111000 0x1000>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch b/lede/target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch index 1f99de002b..0f3fdfe4d4 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-3-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -361,9 +361,11 @@ +@@ -363,9 +363,11 @@ gcc: gcc@1800000 { compatible = "qcom,gcc-ipq8074"; reg = <0x01800000 0x80000>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch b/lede/target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch index 1ce1140682..c9fef2cab4 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch @@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20221108142357.67202-2-krzysztof.kozlowski@linar --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -318,35 +318,35 @@ +@@ -320,35 +320,35 @@ interrupt-controller; #interrupt-cells = <0x2>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch b/lede/target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch index 8719bf74c4..2578aa9343 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch @@ -14,7 +14,7 @@ Signed-off-by: Robert Marko --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -766,6 +766,7 @@ +@@ -768,6 +768,7 @@ linux,pci-domain = <1>; bus-range = <0x00 0xff>; num-lanes = <1>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0022-v6.4-arm64-dts-qcom-ipq8074-add-compatible-fallback-to.patch b/lede/target/linux/qualcommax/patches-6.1/0022-v6.4-arm64-dts-qcom-ipq8074-add-compatible-fallback-to.patch index 934ddea075..f85be793cd 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0022-v6.4-arm64-dts-qcom-ipq8074-add-compatible-fallback-to.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0022-v6.4-arm64-dts-qcom-ipq8074-add-compatible-fallback-to.patch @@ -14,7 +14,7 @@ Link: https://lore.kernel.org/r/20230322174148.810938-4-krzysztof.kozlowski@lina --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -680,7 +680,8 @@ +@@ -682,7 +682,8 @@ }; apcs_glb: mailbox@b111000 { diff --git a/lede/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch b/lede/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch index e2b4d73e37..737bb06752 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch @@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -897,6 +897,14 @@ +@@ -899,6 +899,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 4>; @@ -32,7 +32,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; nss0-thermal { -@@ -904,6 +912,14 @@ +@@ -906,6 +914,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 5>; @@ -47,7 +47,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; nss1-thermal { -@@ -911,6 +927,14 @@ +@@ -913,6 +929,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 6>; @@ -62,7 +62,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; wcss-phya0-thermal { -@@ -918,6 +942,14 @@ +@@ -920,6 +944,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 7>; @@ -77,7 +77,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; wcss-phya1-thermal { -@@ -925,6 +957,14 @@ +@@ -927,6 +959,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 8>; @@ -92,7 +92,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; cpu0_thermal: cpu0-thermal { -@@ -932,6 +972,14 @@ +@@ -934,6 +974,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 9>; @@ -107,7 +107,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; cpu1_thermal: cpu1-thermal { -@@ -939,6 +987,14 @@ +@@ -941,6 +989,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 10>; @@ -122,7 +122,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; cpu2_thermal: cpu2-thermal { -@@ -946,6 +1002,14 @@ +@@ -948,6 +1004,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 11>; @@ -137,7 +137,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; cpu3_thermal: cpu3-thermal { -@@ -953,6 +1017,14 @@ +@@ -955,6 +1019,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 12>; @@ -152,7 +152,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; cluster_thermal: cluster-thermal { -@@ -960,6 +1032,14 @@ +@@ -962,6 +1034,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 13>; @@ -167,7 +167,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; wcss-phyb0-thermal { -@@ -967,6 +1047,14 @@ +@@ -969,6 +1049,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 14>; @@ -182,7 +182,7 @@ Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com }; wcss-phyb1-thermal { -@@ -974,6 +1062,14 @@ +@@ -976,6 +1064,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 15>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch b/lede/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch index c2d7b67935..fb7011de95 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch @@ -19,7 +19,7 @@ Reviewed-by: Konrad Dybcio --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -683,8 +683,8 @@ +@@ -685,8 +685,8 @@ compatible = "qcom,ipq8074-apcs-apps-global", "qcom,ipq6018-apcs-apps-global"; reg = <0x0b111000 0x1000>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0040-v6.5-arm64-dts-qcom-enable-the-download-mode-support.patch b/lede/target/linux/qualcommax/patches-6.1/0040-v6.5-arm64-dts-qcom-enable-the-download-mode-support.patch index f9687994e4..6dd185f6e0 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0040-v6.5-arm64-dts-qcom-enable-the-download-mode-support.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0040-v6.5-arm64-dts-qcom-enable-the-download-mode-support.patch @@ -35,7 +35,7 @@ Link: https://lore.kernel.org/r/20230526110653.27777-3-quic_viswanat@quicinc.com }; }; -@@ -384,6 +385,11 @@ +@@ -386,6 +387,11 @@ #hwlock-cells = <1>; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0045-v6.5-arm64-dts-qcom-ipq8074-drop-incorrect-SPI-bus.patch b/lede/target/linux/qualcommax/patches-6.1/0045-v6.5-arm64-dts-qcom-ipq8074-drop-incorrect-SPI-bus.patch index 45861e192a..52ba16cc9f 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0045-v6.5-arm64-dts-qcom-ipq8074-drop-incorrect-SPI-bus.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0045-v6.5-arm64-dts-qcom-ipq8074-drop-incorrect-SPI-bus.patch @@ -19,7 +19,7 @@ Link: https://lore.kernel.org/r/20230416123730.300863-2-krzysztof.kozlowski@lina --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -485,7 +485,6 @@ +@@ -487,7 +487,6 @@ #size-cells = <0>; reg = <0x078b5000 0x600>; interrupts = ; diff --git a/lede/target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch b/lede/target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch index bb3bd13eb0..fd97663513 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch @@ -17,7 +17,7 @@ Signed-off-by: Robert Marko --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -397,8 +397,8 @@ +@@ -399,8 +399,8 @@ gcc: gcc@1800000 { compatible = "qcom,gcc-ipq8074"; reg = <0x01800000 0x80000>; diff --git a/lede/target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch b/lede/target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch index b0730dfa0b..d5de800d12 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch @@ -12,7 +12,7 @@ Signed-off-by: Robert Marko --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -704,7 +704,7 @@ +@@ -706,7 +706,7 @@ reg = <0x0b000000 0x1000>, <0x0b002000 0x1000>; ranges = <0 0xb00a000 0xffd>; @@ -21,7 +21,7 @@ Signed-off-by: Robert Marko compatible = "arm,gic-v2m-frame"; msi-controller; reg = <0x0 0xffd>; -@@ -817,8 +817,7 @@ +@@ -819,8 +819,7 @@ ranges = <0x81000000 0x0 0x00000000 0x10200000 0x0 0x10000>, /* I/O */ <0x82000000 0x0 0x10220000 0x10220000 0x0 0xfde0000>; /* MEM */ @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; interrupt-map = <0 0 0 1 &intc 0 142 -@@ -879,8 +878,7 @@ +@@ -881,8 +880,7 @@ ranges = <0x81000000 0x0 0x00000000 0x20200000 0x0 0x10000>, /* I/O */ <0x82000000 0x0 0x20220000 0x20220000 0x0 0xfde0000>; /* MEM */ diff --git a/lede/target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch b/lede/target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch index ffbd126c2c..4969c4c074 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch @@ -49,7 +49,7 @@ Signed-off-by: Robert Marko soc: soc { #address-cells = <0x1>; #size-cells = <0x1>; -@@ -415,6 +441,11 @@ +@@ -417,6 +443,11 @@ reg = <0x01937000 0x21000>; }; @@ -61,7 +61,7 @@ Signed-off-by: Robert Marko spmi_bus: spmi@200f000 { compatible = "qcom,spmi-pmic-arb"; reg = <0x0200f000 0x001000>, -@@ -919,6 +950,56 @@ +@@ -921,6 +952,56 @@ "axi_s_sticky"; status = "disabled"; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch b/lede/target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch index f9a32f93c4..5e4a24504e 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -1000,6 +1000,117 @@ +@@ -1002,6 +1002,117 @@ }; }; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch b/lede/target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch index ff5f86c199..8ec4660123 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch @@ -12,7 +12,7 @@ Signed-off-by: Robert Marko --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -341,6 +341,113 @@ +@@ -343,6 +343,113 @@ status = "disabled"; }; diff --git a/lede/target/linux/qualcommax/patches-6.1/0600-1-qca-nss-ecm-support-CORE.patch b/lede/target/linux/qualcommax/patches-6.1/0600-1-qca-nss-ecm-support-CORE.patch index b2b3575b74..7c9278324c 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0600-1-qca-nss-ecm-support-CORE.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0600-1-qca-nss-ecm-support-CORE.patch @@ -86,7 +86,7 @@ __be16 vlan_proto, u16 vlan_id) --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2831,6 +2831,10 @@ enum netdev_cmd { +@@ -2853,6 +2853,10 @@ enum netdev_cmd { NETDEV_OFFLOAD_XSTATS_DISABLE, NETDEV_OFFLOAD_XSTATS_REPORT_USED, NETDEV_OFFLOAD_XSTATS_REPORT_DELTA, @@ -652,7 +652,7 @@ const struct in6_addr *daddr) --- a/net/ipv6/route.c +++ b/net/ipv6/route.c -@@ -3856,6 +3856,9 @@ out_free: +@@ -3858,6 +3858,9 @@ out_free: return ERR_PTR(err); } @@ -662,7 +662,7 @@ int ip6_route_add(struct fib6_config *cfg, gfp_t gfp_flags, struct netlink_ext_ack *extack) { -@@ -3867,6 +3870,10 @@ int ip6_route_add(struct fib6_config *cf +@@ -3869,6 +3872,10 @@ int ip6_route_add(struct fib6_config *cf return PTR_ERR(rt); err = __ip6_ins_rt(rt, &cfg->fc_nlinfo, extack); @@ -673,7 +673,7 @@ fib6_info_release(rt); return err; -@@ -3888,6 +3895,9 @@ static int __ip6_del_rt(struct fib6_info +@@ -3890,6 +3897,9 @@ static int __ip6_del_rt(struct fib6_info err = fib6_del(rt, info); spin_unlock_bh(&table->tb6_lock); @@ -683,7 +683,7 @@ out: fib6_info_release(rt); return err; -@@ -6337,6 +6347,20 @@ static int ip6_route_dev_notify(struct n +@@ -6339,6 +6349,20 @@ static int ip6_route_dev_notify(struct n return NOTIFY_OK; } @@ -706,7 +706,7 @@ */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -1654,6 +1654,7 @@ const char *netdev_cmd_to_name(enum netd +@@ -1639,6 +1639,7 @@ const char *netdev_cmd_to_name(enum netd N(SVLAN_FILTER_PUSH_INFO) N(SVLAN_FILTER_DROP_INFO) N(PRE_CHANGEADDR) N(OFFLOAD_XSTATS_ENABLE) N(OFFLOAD_XSTATS_DISABLE) N(OFFLOAD_XSTATS_REPORT_USED) N(OFFLOAD_XSTATS_REPORT_DELTA) diff --git a/lede/target/linux/qualcommax/patches-6.1/0600-2-qca-nss-ecm-support-PPPOE-offload.patch b/lede/target/linux/qualcommax/patches-6.1/0600-2-qca-nss-ecm-support-PPPOE-offload.patch index 505b71382b..9fa644fdd7 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0600-2-qca-nss-ecm-support-PPPOE-offload.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0600-2-qca-nss-ecm-support-PPPOE-offload.patch @@ -466,7 +466,7 @@ #endif /* !(__LINUX_IF_PPPOX_H) */ --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1710,6 +1710,24 @@ enum netdev_priv_flags { +@@ -1733,6 +1733,24 @@ enum netdev_priv_flags { IFF_NO_IP_ALIGN = BIT_ULL(33), }; @@ -491,7 +491,7 @@ #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN #define IFF_EBRIDGE IFF_EBRIDGE #define IFF_BONDING IFF_BONDING -@@ -2053,6 +2071,7 @@ struct net_device { +@@ -2075,6 +2093,7 @@ struct net_device { /* Read-mostly cache-line for fast-path access */ unsigned int flags; unsigned long long priv_flags; diff --git a/lede/target/linux/qualcommax/patches-6.1/0600-7-qca-nss-ecm-add-missing-net-defines.patch b/lede/target/linux/qualcommax/patches-6.1/0600-7-qca-nss-ecm-add-missing-net-defines.patch index 2c63b46c3f..15970e2a37 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0600-7-qca-nss-ecm-add-missing-net-defines.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0600-7-qca-nss-ecm-add-missing-net-defines.patch @@ -1,6 +1,6 @@ --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1725,7 +1725,9 @@ enum netdev_priv_flags_ext { +@@ -1748,7 +1748,9 @@ enum netdev_priv_flags_ext { IFF_EXT_PPP_PPTP = 1<<3, IFF_EXT_GRE_V4_TAP = 1<<4, IFF_EXT_GRE_V6_TAP = 1<<5, diff --git a/lede/target/linux/qualcommax/patches-6.1/0603-1-qca-nss-clients-add-qdisc-support.patch b/lede/target/linux/qualcommax/patches-6.1/0603-1-qca-nss-clients-add-qdisc-support.patch index 4d74750f2b..cab46c6130 100644 --- a/lede/target/linux/qualcommax/patches-6.1/0603-1-qca-nss-clients-add-qdisc-support.patch +++ b/lede/target/linux/qualcommax/patches-6.1/0603-1-qca-nss-clients-add-qdisc-support.patch @@ -55,7 +55,7 @@ dev->needs_free_netdev = true; --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -4590,6 +4590,15 @@ void dev_uc_flush(struct net_device *dev +@@ -4612,6 +4612,15 @@ void dev_uc_flush(struct net_device *dev void dev_uc_init(struct net_device *dev); /** @@ -71,7 +71,7 @@ * __dev_uc_sync - Synchonize device's unicast list * @dev: device to sync * @sync: function to call if address should be added -@@ -5135,6 +5144,11 @@ static inline bool netif_is_failover_sla +@@ -5157,6 +5166,11 @@ static inline bool netif_is_failover_sla return dev->priv_flags & IFF_FAILOVER_SLAVE; } @@ -344,7 +344,7 @@ struct Qdisc *qdisc_lookup_rcu(struct net_device *dev, u32 handle) { -@@ -2386,4 +2387,26 @@ static int __init pktsched_init(void) +@@ -2387,4 +2388,26 @@ static int __init pktsched_init(void) return 0; } @@ -373,7 +373,7 @@ subsys_initcall(pktsched_init); --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -1069,6 +1069,7 @@ static void __qdisc_destroy(struct Qdisc +@@ -1073,6 +1073,7 @@ static void __qdisc_destroy(struct Qdisc call_rcu(&qdisc->rcu, qdisc_free_cb); } @@ -391,7 +391,7 @@ u32 limit; const struct Qdisc_ops *ops; struct qdisc_size_table __rcu *stab; -@@ -719,6 +720,40 @@ static inline bool skb_skip_tc_classify( +@@ -720,6 +721,40 @@ static inline bool skb_skip_tc_classify( return false; } @@ -432,7 +432,7 @@ /* Reset all TX qdiscs greater than index of a device. */ static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) { -@@ -1305,4 +1340,9 @@ static inline void qdisc_synchronize(con +@@ -1306,4 +1341,9 @@ static inline void qdisc_synchronize(con msleep(1); } diff --git a/lede/target/linux/rockchip/patches-6.1/102-net-phy-realtek-RTL8211-add-LED-configuration-from-OF.patch b/lede/target/linux/rockchip/patches-6.1/102-net-phy-realtek-RTL8211-add-LED-configuration-from-OF.patch index b9d368b6c4..dfd63600b5 100644 --- a/lede/target/linux/rockchip/patches-6.1/102-net-phy-realtek-RTL8211-add-LED-configuration-from-OF.patch +++ b/lede/target/linux/rockchip/patches-6.1/102-net-phy-realtek-RTL8211-add-LED-configuration-from-OF.patch @@ -18,7 +18,7 @@ Subject: [PATCH] net: phy: realtek: add LED configuration from OF for 8211f #define RTL8211F_PHYCR1 0x18 #define RTL8211F_PHYCR2 0x19 #define RTL8211F_INSR 0x1d -@@ -349,6 +351,7 @@ static int rtl8211f_config_init(struct p +@@ -350,6 +352,7 @@ static int rtl8211f_config_init(struct p struct rtl821x_priv *priv = phydev->priv; struct device *dev = &phydev->mdio.dev; u16 val_txdly, val_rxdly; @@ -26,7 +26,7 @@ Subject: [PATCH] net: phy: realtek: add LED configuration from OF for 8211f int ret; ret = phy_modify_paged_changed(phydev, 0xa43, RTL8211F_PHYCR1, -@@ -415,6 +418,15 @@ static int rtl8211f_config_init(struct p +@@ -416,6 +419,15 @@ static int rtl8211f_config_init(struct p val_rxdly ? "enabled" : "disabled"); } diff --git a/lede/target/linux/rockchip/patches-6.1/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch b/lede/target/linux/rockchip/patches-6.1/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch index 2a8748f543..b79b26d483 100644 --- a/lede/target/linux/rockchip/patches-6.1/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch +++ b/lede/target/linux/rockchip/patches-6.1/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -7074,6 +7074,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -7099,6 +7099,7 @@ int stmmac_dvr_probe(struct device *devi { struct net_device *ndev = NULL; struct stmmac_priv *priv; @@ -8,7 +8,7 @@ u32 rxq; int i, ret = 0; -@@ -7082,6 +7083,9 @@ int stmmac_dvr_probe(struct device *devi +@@ -7107,6 +7108,9 @@ int stmmac_dvr_probe(struct device *devi if (!ndev) return -ENOMEM; diff --git a/lede/target/linux/rockchip/patches-6.6/101-net-realtek-r8169-add-LED-configuration-from-OF.patch b/lede/target/linux/rockchip/patches-6.6/101-net-realtek-r8169-add-LED-configuration-from-OF.patch index a8be5cf6d3..27ec06f50f 100644 --- a/lede/target/linux/rockchip/patches-6.6/101-net-realtek-r8169-add-LED-configuration-from-OF.patch +++ b/lede/target/linux/rockchip/patches-6.6/101-net-realtek-r8169-add-LED-configuration-from-OF.patch @@ -17,7 +17,7 @@ Subject: [PATCH] r8169: add LED configuration from OF #include #include #include -@@ -174,6 +175,7 @@ enum rtl_registers { +@@ -177,6 +178,7 @@ enum rtl_registers { MAR0 = 8, /* Multicast filter. */ CounterAddrLow = 0x10, CounterAddrHigh = 0x14, @@ -25,7 +25,7 @@ Subject: [PATCH] r8169: add LED configuration from OF TxDescStartAddrLow = 0x20, TxDescStartAddrHigh = 0x24, TxHDescStartAddrLow = 0x28, -@@ -5233,6 +5235,22 @@ static bool rtl_aspm_is_safe(struct rtl8 +@@ -5407,6 +5409,22 @@ static bool rtl_aspm_is_safe(struct rtl8 return false; } @@ -48,7 +48,7 @@ Subject: [PATCH] r8169: add LED configuration from OF static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { struct rtl8169_private *tp; -@@ -5404,6 +5422,7 @@ static int rtl_init_one(struct pci_dev * +@@ -5579,6 +5597,7 @@ static int rtl_init_one(struct pci_dev * if (!tp->counters) return -ENOMEM; diff --git a/lede/target/linux/sunxi/patches-6.1/101-sunxi-add-get_soc_chipid-and-sunxi_get_serial.patch b/lede/target/linux/sunxi/patches-6.1/101-sunxi-add-get_soc_chipid-and-sunxi_get_serial.patch index a3abf98e23..dcba61ba97 100644 --- a/lede/target/linux/sunxi/patches-6.1/101-sunxi-add-get_soc_chipid-and-sunxi_get_serial.patch +++ b/lede/target/linux/sunxi/patches-6.1/101-sunxi-add-get_soc_chipid-and-sunxi_get_serial.patch @@ -35,7 +35,7 @@ Subject: [PATCH] nvmem: sunxi_sid: add sunxi_get_soc_chipid, sunxi_get_serial static int sunxi_sid_read(void *context, unsigned int offset, void *val, size_t bytes) { -@@ -180,6 +199,15 @@ static int sunxi_sid_probe(struct platfo +@@ -179,6 +198,15 @@ static int sunxi_sid_probe(struct platfo platform_set_drvdata(pdev, nvmem); diff --git a/mieru/.github/workflows/integration.yaml b/mieru/.github/workflows/integration.yaml index 51800210d9..6d05f919a7 100644 --- a/mieru/.github/workflows/integration.yaml +++ b/mieru/.github/workflows/integration.yaml @@ -1,5 +1,5 @@ name: 'integration test' -on: [workflow_dispatch] +on: [push, pull_request, workflow_dispatch] jobs: run-test: runs-on: ubuntu-latest diff --git a/nekoray/CMakeLists.txt b/nekoray/CMakeLists.txt index d8673d4a19..1a2dba22f3 100644 --- a/nekoray/CMakeLists.txt +++ b/nekoray/CMakeLists.txt @@ -150,7 +150,6 @@ set(PROJECT_SOURCES db/ConfigBuilder.cpp fmt/AbstractBean.cpp - fmt/Bean2CoreObj_ray.cpp fmt/Bean2CoreObj_box.cpp fmt/Bean2External.cpp fmt/Bean2Link.cpp diff --git a/nekoray/db/ConfigBuilder.cpp b/nekoray/db/ConfigBuilder.cpp index aeba840657..c28d91a507 100644 --- a/nekoray/db/ConfigBuilder.cpp +++ b/nekoray/db/ConfigBuilder.cpp @@ -64,11 +64,7 @@ namespace NekoGui { if (customBean != nullptr && customBean->core == "internal-full") { result->coreConfig = QString2QJsonObject(customBean->config_simple); } else { - if (IS_NEKO_BOX) { - BuildConfigSingBox(status); - } else { - BuildConfigV2Ray(status); - } + BuildConfigSingBox(status); } // apply custom config @@ -157,254 +153,6 @@ namespace NekoGui { status->ipListDirect += line; \ } - // V2Ray - - void BuildConfigV2Ray(const std::shared_ptr &status) { - // Log - auto logObj = QJsonObject{{"loglevel", dataStore->log_level}}; - status->result->coreConfig.insert("log", logObj); - - // Inbounds - QJsonObject sniffing{ - {"destOverride", QJsonArray{"http", "tls", "quic"}}, - {"enabled", true}, - {"metadataOnly", false}, - {"routeOnly", dataStore->routing->sniffing_mode == SniffingMode::FOR_ROUTING}, - }; - - // socks-in - if (IsValidPort(dataStore->inbound_socks_port) && !status->forTest) { - QJsonObject inboundObj; - inboundObj["tag"] = "socks-in"; - inboundObj["protocol"] = "socks"; - inboundObj["listen"] = dataStore->inbound_address; - inboundObj["port"] = dataStore->inbound_socks_port; - QJsonObject socksSettings = {{"udp", true}}; - if (dataStore->routing->sniffing_mode != SniffingMode::DISABLE) { - inboundObj["sniffing"] = sniffing; - } - if (dataStore->inbound_auth->NeedAuth()) { - socksSettings["auth"] = "password"; - socksSettings["accounts"] = QJsonArray{ - QJsonObject{ - {"user", dataStore->inbound_auth->username}, - {"pass", dataStore->inbound_auth->password}, - }, - }; - } - inboundObj["settings"] = socksSettings; - status->inbounds += inboundObj; - } - // http-in - if (IsValidPort(dataStore->inbound_http_port) && !status->forTest) { - QJsonObject inboundObj; - inboundObj["tag"] = "http-in"; - inboundObj["protocol"] = "http"; - inboundObj["listen"] = dataStore->inbound_address; - inboundObj["port"] = dataStore->inbound_http_port; - if (dataStore->routing->sniffing_mode != SniffingMode::DISABLE) { - inboundObj["sniffing"] = sniffing; - } - if (dataStore->inbound_auth->NeedAuth()) { - inboundObj["settings"] = QJsonObject{ - {"accounts", QJsonArray{ - QJsonObject{ - {"user", dataStore->inbound_auth->username}, - {"pass", dataStore->inbound_auth->password}, - }, - }}, - }; - } - status->inbounds += inboundObj; - } - - // Outbounds - auto tagProxy = BuildChain(0, status); - if (!status->result->error.isEmpty()) return; - - // direct & bypass & block - status->outbounds += QJsonObject{ - {"protocol", "freedom"}, - {"domainStrategy", dataStore->core_ray_freedom_domainStrategy}, - {"tag", "direct"}, - }; - status->outbounds += QJsonObject{ - {"protocol", "freedom"}, - {"domainStrategy", dataStore->core_ray_freedom_domainStrategy}, - {"tag", "bypass"}, - }; - status->outbounds += QJsonObject{ - {"protocol", "blackhole"}, - {"tag", "block"}, - }; - - // DNS out - if (!status->forTest) { - QJsonObject dnsOut; - dnsOut["protocol"] = "dns"; - dnsOut["tag"] = "dns-out"; - QJsonObject dnsOut_settings; - dnsOut_settings["network"] = "tcp"; - dnsOut_settings["port"] = 53; - dnsOut_settings["address"] = "8.8.8.8"; - dnsOut_settings["userLevel"] = 1; - dnsOut["settings"] = dnsOut_settings; - dnsOut["proxySettings"] = QJsonObject{{"tag", tagProxy}, - {"transportLayer", true}}; - - status->outbounds += dnsOut; - status->routingRules += QJsonObject{ - {"type", "field"}, - {"port", "53"}, - {"inboundTag", QJsonArray{"socks-in", "http-in"}}, - {"outboundTag", "dns-out"}, - }; - } - - // custom inbound - if (!status->forTest) QJSONARRAY_ADD(status->inbounds, QString2QJsonObject(dataStore->custom_inbound)["inbounds"].toArray()) - - status->result->coreConfig.insert("inbounds", status->inbounds); - status->result->coreConfig.insert("outbounds", status->outbounds); - - // user rule - if (!status->forTest) { - DOMAIN_USER_RULE - IP_USER_RULE - } - - // final add DNS - QJsonObject dns; - QJsonArray dnsServers; - - // Remote or FakeDNS - QJsonObject dnsServerRemote; - dnsServerRemote["address"] = dataStore->routing->remote_dns; - dnsServerRemote["domains"] = QList2QJsonArray(status->domainListDNSRemote); - dnsServerRemote["queryStrategy"] = dataStore->routing->remote_dns_strategy; - if (!status->forTest) dnsServers += dnsServerRemote; - - // Direct - auto directDnsAddress = dataStore->routing->direct_dns; - if (directDnsAddress.contains("://")) { - auto directDnsIp = SubStrBefore(SubStrAfter(directDnsAddress, "://"), "/"); - if (IsIpAddress(directDnsIp)) { - status->routingRules.push_front(QJsonObject{ - {"type", "field"}, - {"ip", QJsonArray{directDnsIp}}, - {"outboundTag", "direct"}, - }); - } else { - status->routingRules.push_front(QJsonObject{ - {"type", "field"}, - {"domain", QJsonArray{directDnsIp}}, - {"outboundTag", "direct"}, - }); - } - } else if (directDnsAddress != "localhost") { - status->routingRules.push_front(QJsonObject{ - {"type", "field"}, - {"ip", QJsonArray{directDnsAddress}}, - {"outboundTag", "direct"}, - }); - } - QJsonObject directObj{ - {"address", directDnsAddress.replace("https://", "https+local://")}, - {"queryStrategy", dataStore->routing->direct_dns_strategy}, - {"domains", QList2QJsonArray(status->domainListDNSDirect)}, - }; - if (dataStore->routing->dns_final_out == "bypass") { - dnsServers.prepend(directObj); - } else { - dnsServers.append(directObj); - } - - dns["disableFallback"] = true; - dns["servers"] = dnsServers; - dns["tag"] = "dns"; - - if (dataStore->routing->use_dns_object) { - dns = QString2QJsonObject(dataStore->routing->dns_object); - } - status->result->coreConfig.insert("dns", dns); - - // Routing - QJsonObject routing; - routing["domainStrategy"] = dataStore->routing->domain_strategy; - if (status->forTest) routing["domainStrategy"] = "AsIs"; - - // final add user rule (block) - QJsonObject routingRule_tmp; - routingRule_tmp["type"] = "field"; - routingRule_tmp["outboundTag"] = "block"; - if (!status->ipListBlock.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["ip"] = QList2QJsonArray(status->ipListBlock); - status->routingRules += tmp; - } - if (!status->domainListBlock.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["domain"] = QList2QJsonArray(status->domainListBlock); - status->routingRules += tmp; - } - - // final add user rule (proxy) - routingRule_tmp["outboundTag"] = "proxy"; - if (!status->ipListRemote.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["ip"] = QList2QJsonArray(status->ipListRemote); - status->routingRules += tmp; - } - if (!status->domainListRemote.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["domain"] = QList2QJsonArray(status->domainListRemote); - status->routingRules += tmp; - } - - // final add user rule (bypass) - routingRule_tmp["outboundTag"] = "bypass"; - if (!status->ipListDirect.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["ip"] = QList2QJsonArray(status->ipListDirect); - status->routingRules += tmp; - } - if (!status->domainListDirect.isEmpty()) { - auto tmp = routingRule_tmp; - tmp["domain"] = QList2QJsonArray(status->domainListDirect); - status->routingRules += tmp; - } - - // def_outbound - if (!status->forTest) status->routingRules += QJsonObject{ - {"type", "field"}, - {"port", "0-65535"}, - {"outboundTag", dataStore->routing->def_outbound}, - }; - - // final add routing rule - auto routingRules = QString2QJsonObject(dataStore->routing->custom)["rules"].toArray(); - if (status->forTest) routingRules = {}; - if (!status->forTest) QJSONARRAY_ADD(routingRules, QString2QJsonObject(dataStore->custom_route_global)["rules"].toArray()) - QJSONARRAY_ADD(routingRules, status->routingRules) - routing["rules"] = routingRules; - status->result->coreConfig.insert("routing", routing); - - // Policy & stats - QJsonObject policy; - QJsonObject levels; - QJsonObject level1; - level1["connIdle"] = 30; - levels["1"] = level1; - policy["levels"] = levels; - - QJsonObject policySystem; - policySystem["statsOutboundDownlink"] = true; - policySystem["statsOutboundUplink"] = true; - policy["system"] = policySystem; - status->result->coreConfig.insert("policy", policy); - status->result->coreConfig.insert("stats", QJsonObject()); - } - QString BuildChainInternal(int chainId, const QList> &ents, const std::shared_ptr &status) { QString chainTag = "c-" + Int2String(chainId); @@ -454,29 +202,14 @@ namespace NekoGui { // chain rules: past if (pastExternalStat == 0) { auto replaced = status->outbounds.last().toObject(); - if (IS_NEKO_BOX) { - replaced["detour"] = tagOut; - } else { - replaced["proxySettings"] = QJsonObject{ - {"tag", tagOut}, - {"transportLayer", true}, - }; - } + replaced["detour"] = tagOut; status->outbounds.removeLast(); status->outbounds += replaced; } else { - if (IS_NEKO_BOX) { - status->routingRules += QJsonObject{ - {"inbound", QJsonArray{pastTag + "-mapping"}}, - {"outbound", tagOut}, - }; - } else { - status->routingRules += QJsonObject{ - {"type", "field"}, - {"inboundTag", QJsonArray{pastTag + "-mapping"}}, - {"outboundTag", tagOut}, - }; - } + status->routingRules += QJsonObject{ + {"inbound", QJsonArray{pastTag + "-mapping"}}, + {"outbound", tagOut}, + }; } } else { // index == 0 means last profile in chain / not chain @@ -515,43 +248,20 @@ namespace NekoGui { if (thisExternalStat == 2) dataStore->need_keep_vpn_off = true; if (thisExternalStat == 1) { // mapping - if (IS_NEKO_BOX) { - status->inbounds += QJsonObject{ - {"type", "direct"}, - {"tag", tagOut + "-mapping"}, - {"listen", "127.0.0.1"}, - {"listen_port", ext_mapping_port}, - {"override_address", ent->bean->serverAddress}, - {"override_port", ent->bean->serverPort}, - }; - } else { - status->inbounds += QJsonObject{ - {"protocol", "dokodemo-door"}, - {"tag", tagOut + "-mapping"}, - {"listen", "127.0.0.1"}, - {"port", ext_mapping_port}, - {"settings", QJsonObject{ - // to - {"address", ent->bean->serverAddress}, - {"port", ent->bean->serverPort}, - {"network", "tcp,udp"}, - }}, - }; - } + status->inbounds += QJsonObject{ + {"type", "direct"}, + {"tag", tagOut + "-mapping"}, + {"listen", "127.0.0.1"}, + {"listen_port", ext_mapping_port}, + {"override_address", ent->bean->serverAddress}, + {"override_port", ent->bean->serverPort}, + }; // no chain rule and not outbound, so need to set to direct if (isFirstProfile) { - if (IS_NEKO_BOX) { - status->routingRules += QJsonObject{ - {"inbound", QJsonArray{tagOut + "-mapping"}}, - {"outbound", "direct"}, - }; - } else { - status->routingRules += QJsonObject{ - {"type", "field"}, - {"inboundTag", QJsonArray{tagOut + "-mapping"}}, - {"outboundTag", "direct"}, - }; - } + status->routingRules += QJsonObject{ + {"inbound", QJsonArray{tagOut + "-mapping"}}, + {"outbound", "direct"}, + }; } } @@ -574,23 +284,11 @@ namespace NekoGui { status->result->extRs.emplace_back(std::make_shared(extR)); // SOCKS OUTBOUND - if (IS_NEKO_BOX) { - outbound["type"] = "socks"; - outbound["server"] = "127.0.0.1"; - outbound["server_port"] = ext_socks_port; - } else { - outbound["protocol"] = "socks"; - QJsonObject settings; - QJsonArray servers; - QJsonObject server; - server["address"] = "127.0.0.1"; - server["port"] = ext_socks_port; - servers.push_back(server); - settings["servers"] = servers; - outbound["settings"] = settings; - } + outbound["type"] = "socks"; + outbound["server"] = "127.0.0.1"; + outbound["server_port"] = ext_socks_port; } else { - const auto coreR = IS_NEKO_BOX ? ent->bean->BuildCoreObjSingBox() : ent->bean->BuildCoreObjV2Ray(); + const auto coreR = ent->bean->BuildCoreObjSingBox(); if (coreR.outbound.isEmpty()) { status->result->error = "unsupported outbound"; return {}; @@ -613,14 +311,8 @@ namespace NekoGui { needMux &= dataStore->mux_concurrency > 0; if (stream != nullptr) { - if (IS_NEKO_BOX) { - if (stream->network == "grpc" || stream->network == "quic" || (stream->network == "http" && stream->security == "tls")) { - needMux = false; - } - } else { - if (stream->network == "grpc" || stream->network == "quic") { - needMux = false; - } + if (stream->network == "grpc" || stream->network == "quic" || (stream->network == "http" && stream->security == "tls")) { + needMux = false; } if (stream->multiplex_status == 0) { if (!dataStore->mux_default_on) needMux = false; @@ -635,32 +327,18 @@ namespace NekoGui { } // common - if (IS_NEKO_BOX) { - // apply domain_strategy - outbound["domain_strategy"] = dataStore->routing->outbound_domain_strategy; - // apply mux - if (!muxApplied && needMux) { - auto muxObj = QJsonObject{ - {"enabled", true}, - {"protocol", dataStore->mux_protocol}, - {"padding", dataStore->mux_padding}, - {"max_streams", dataStore->mux_concurrency}, - }; - outbound["multiplex"] = muxObj; - muxApplied = true; - } - } else { - // apply domain_strategy - if (!status->forTest) outbound["domainStrategy"] = dataStore->routing->outbound_domain_strategy; - // apply mux - if (!muxApplied && needMux) { - auto muxObj = QJsonObject{ - {"enabled", true}, - {"concurrency", dataStore->mux_concurrency}, - }; - outbound["mux"] = muxObj; - muxApplied = true; - } + // apply domain_strategy + outbound["domain_strategy"] = dataStore->routing->outbound_domain_strategy; + // apply mux + if (!muxApplied && needMux) { + auto muxObj = QJsonObject{ + {"enabled", true}, + {"protocol", dataStore->mux_protocol}, + {"padding", dataStore->mux_padding}, + {"max_streams", dataStore->mux_concurrency}, + }; + outbound["multiplex"] = muxObj; + muxApplied = true; } // apply custom outbound settings @@ -720,7 +398,7 @@ namespace NekoGui { } // tun-in - if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { + if (dataStore->vpn_internal_tun && dataStore->spmode_vpn && !status->forTest) { QJsonObject inboundObj; inboundObj["tag"] = "tun-in"; inboundObj["type"] = "tun"; @@ -869,7 +547,7 @@ namespace NekoGui { }; // Fakedns - if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { + if (dataStore->fake_dns && dataStore->vpn_internal_tun && dataStore->spmode_vpn && !status->forTest) { dnsServers += QJsonObject{ {"tag", "dns-fake"}, {"address", "fakeip"}, @@ -911,7 +589,7 @@ namespace NekoGui { } // fakedns rule - if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { + if (dataStore->fake_dns && dataStore->vpn_internal_tun && dataStore->spmode_vpn && !status->forTest) { dnsRules += QJsonObject{ {"inbound", "tun-in"}, {"server", "dns-fake"}, @@ -969,7 +647,7 @@ namespace NekoGui { }; // tun user rule - if (IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { + if (dataStore->vpn_internal_tun && dataStore->spmode_vpn && !status->forTest) { auto match_out = dataStore->vpn_rule_white ? "proxy" : "bypass"; QString process_name_rule = dataStore->vpn_rule_process.trimmed(); @@ -1099,7 +777,7 @@ namespace NekoGui { return QFileInfo(file).absoluteFilePath(); } - QString WriteVPNLinuxScript(const QString &protectPath, const QString &configPath) { + QString WriteVPNLinuxScript(const QString &configPath) { #ifdef Q_OS_WIN return {}; #endif @@ -1108,9 +786,7 @@ namespace NekoGui { if (QFile::exists("vpn/vpn-run-root.sh")) scriptFn = "vpn/vpn-run-root.sh"; auto script = ReadFileText(scriptFn) .replace("./nekobox_core", QApplication::applicationDirPath() + "/nekobox_core") - .replace("$PROTECT_LISTEN_PATH", protectPath) - .replace("$CONFIG_PATH", configPath) - .replace("$TABLE_FWMARK", "514"); + .replace("$CONFIG_PATH", configPath); // write script QFile file2; file2.setFileName(QFileInfo(scriptFn).fileName()); diff --git a/nekoray/db/ConfigBuilder.hpp b/nekoray/db/ConfigBuilder.hpp index 661c881c2d..3c150c76f7 100644 --- a/nekoray/db/ConfigBuilder.hpp +++ b/nekoray/db/ConfigBuilder.hpp @@ -46,8 +46,6 @@ namespace NekoGui { std::shared_ptr BuildConfig(const std::shared_ptr &ent, bool forTest, bool forExport); - void BuildConfigV2Ray(const std::shared_ptr &status); - void BuildConfigSingBox(const std::shared_ptr &status); QString BuildChain(int chainId, const std::shared_ptr &status); @@ -57,5 +55,5 @@ namespace NekoGui { QString WriteVPNSingBoxConfig(); - QString WriteVPNLinuxScript(const QString &protectPath, const QString &configPath); + QString WriteVPNLinuxScript(const QString &configPath); } // namespace NekoGui diff --git a/nekoray/fmt/AbstractBean.hpp b/nekoray/fmt/AbstractBean.hpp index 56782fbf0f..0a5c098311 100644 --- a/nekoray/fmt/AbstractBean.hpp +++ b/nekoray/fmt/AbstractBean.hpp @@ -59,8 +59,6 @@ namespace NekoGui_fmt { virtual int NeedExternal(bool isFirstProfile) { return 0; }; - virtual CoreObjOutboundBuildResult BuildCoreObjV2Ray() { return {}; }; - virtual CoreObjOutboundBuildResult BuildCoreObjSingBox() { return {}; }; virtual ExternalBuildResult BuildExternal(int mapping_port, int socks_port, int external_stat) { return {}; }; diff --git a/nekoray/fmt/Bean2CoreObj_ray.cpp b/nekoray/fmt/Bean2CoreObj_ray.cpp deleted file mode 100644 index bb1ccf3bd3..0000000000 --- a/nekoray/fmt/Bean2CoreObj_ray.cpp +++ /dev/null @@ -1,211 +0,0 @@ -#include "db/ProxyEntity.hpp" -#include "fmt/includes.h" - -#define MAKE_SETTINGS_STREAM_SETTINGS \ - outbound["settings"] = settings; \ - auto streamSettings = stream->BuildStreamSettingsV2Ray(); \ - outbound["streamSettings"] = streamSettings; - -namespace NekoGui_fmt { - QJsonObject V2rayStreamSettings::BuildStreamSettingsV2Ray() { - QJsonObject streamSettings{{"network", network}}; - - if (network == "ws") { - QJsonObject ws; - if (!host.isEmpty()) ws["headers"] = QJsonObject{{"Host", host}}; - // ws path & ed - if (!path.isEmpty()) ws["path"] = path; - streamSettings["wsSettings"] = ws; - } else if (network == "http") { - QJsonObject http; - if (!path.isEmpty()) http["path"] = path; - if (!host.isEmpty()) http["host"] = QList2QJsonArray(host.split(",")); - streamSettings["httpSettings"] = http; - } else if (network == "grpc") { - QJsonObject grpc; - if (!path.isEmpty()) grpc["serviceName"] = path; - streamSettings["grpcSettings"] = grpc; - } else if (network == "quic") { - QJsonObject quic; - if (!header_type.isEmpty()) quic["header"] = QJsonObject{{"type", header_type}}; - if (!path.isEmpty()) quic["key"] = path; - if (!host.isEmpty()) quic["security"] = host; - streamSettings["quicSettings"] = quic; - } else if (network == "tcp" && !header_type.isEmpty()) { - QJsonObject header{{"type", header_type}}; - if (header_type == "http") { - header["request"] = QJsonObject{ - {"path", QList2QJsonArray(path.split(","))}, - {"headers", QJsonObject{{"Host", QList2QJsonArray(host.split(","))}}}, - }; - } - streamSettings["tcpSettings"] = QJsonObject{{"header", header}}; - } - - if (security == "tls") { - QJsonObject tls; - if (!utlsFingerprint.isEmpty()) tls["fingerprint"] = utlsFingerprint; - if (!sni.trimmed().isEmpty()) tls["serverName"] = sni; - if (reality_pbk.trimmed().isEmpty()) { - if (allow_insecure || NekoGui::dataStore->skip_cert) tls["allowInsecure"] = true; - if (!alpn.trimmed().isEmpty()) tls["alpn"] = QList2QJsonArray(alpn.split(",")); - if (!certificate.trimmed().isEmpty()) { - tls["disableSystemRoot"] = true; - tls["certificates"] = QJsonArray{ - QJsonObject{ - {"usage", "verify"}, - {"certificate", QList2QJsonArray(SplitLines(certificate.trimmed()))}, - }, - }; - } - streamSettings["tlsSettings"] = tls; - streamSettings["security"] = "tls"; - } else { - tls["publicKey"] = reality_pbk; - tls["shortId"] = reality_sid; - tls["spiderX"] = reality_spx; - if (utlsFingerprint.isEmpty()) tls["fingerprint"] = "chrome"; - streamSettings["realitySettings"] = tls; - streamSettings["security"] = "reality"; - } - } - - return streamSettings; - } - - CoreObjOutboundBuildResult SocksHttpBean::BuildCoreObjV2Ray() { - CoreObjOutboundBuildResult result; - - QJsonObject outbound; - outbound["protocol"] = socks_http_type == type_HTTP ? "http" : "socks"; - - QJsonObject settings; - QJsonArray servers; - QJsonObject server; - - server["address"] = serverAddress; - server["port"] = serverPort; - - QJsonArray users; - QJsonObject user; - user["user"] = username; - user["pass"] = password; - users.push_back(user); - if (!username.isEmpty() && !password.isEmpty()) server["users"] = users; - - servers.push_back(server); - settings["servers"] = servers; - - MAKE_SETTINGS_STREAM_SETTINGS - - result.outbound = outbound; - return result; - } - - CoreObjOutboundBuildResult ShadowSocksBean::BuildCoreObjV2Ray() { - CoreObjOutboundBuildResult result; - - QJsonObject outbound{{"protocol", "shadowsocks"}}; - - QJsonObject settings; - QJsonArray servers; - QJsonObject server; - - server["address"] = serverAddress; - server["port"] = serverPort; - server["method"] = method; - server["password"] = password; - - if (uot != 0) { - server["uot"] = true; - server["UoTVersion"] = uot; - } else { - server["uot"] = false; - } - - servers.push_back(server); - settings["servers"] = servers; - - if (!plugin.trimmed().isEmpty()) { - settings["plugin"] = SubStrBefore(plugin, ";"); - settings["pluginOpts"] = SubStrAfter(plugin, ";"); - } - - MAKE_SETTINGS_STREAM_SETTINGS - - result.outbound = outbound; - return result; - } - - CoreObjOutboundBuildResult VMessBean::BuildCoreObjV2Ray() { - CoreObjOutboundBuildResult result; - QJsonObject outbound{{"protocol", "vmess"}}; - - QJsonObject settings{ - {"vnext", QJsonArray{ - QJsonObject{ - {"address", serverAddress}, - {"port", serverPort}, - {"users", QJsonArray{ - QJsonObject{ - {"id", uuid.trimmed()}, - {"alterId", aid}, - {"security", security}, - }}}, - }}}}; - - MAKE_SETTINGS_STREAM_SETTINGS - - result.outbound = outbound; - return result; - } - - CoreObjOutboundBuildResult TrojanVLESSBean::BuildCoreObjV2Ray() { - CoreObjOutboundBuildResult result; - QJsonObject outbound{ - {"protocol", proxy_type == proxy_VLESS ? "vless" : "trojan"}, - }; - - QJsonObject settings; - if (proxy_type == proxy_VLESS) { - if (flow == "none") { - flow = ""; - } - settings = QJsonObject{ - {"vnext", QJsonArray{ - QJsonObject{ - {"address", serverAddress}, - {"port", serverPort}, - {"users", QJsonArray{ - QJsonObject{ - {"id", password.trimmed()}, - {"encryption", "none"}, - {"flow", flow}, - }}}, - }}}}; - } else { - settings = QJsonObject{ - {"servers", QJsonArray{ - QJsonObject{ - {"address", serverAddress}, - {"port", serverPort}, - {"password", password}, - }}}}; - } - - MAKE_SETTINGS_STREAM_SETTINGS - - result.outbound = outbound; - return result; - } - - CoreObjOutboundBuildResult CustomBean::BuildCoreObjV2Ray() { - CoreObjOutboundBuildResult result; - - if (core == "internal") { - result.outbound = QString2QJsonObject(config_simple); - } - - return result; - } -} // namespace NekoGui_fmt \ No newline at end of file diff --git a/nekoray/fmt/Bean2External.cpp b/nekoray/fmt/Bean2External.cpp index 893fa44400..50de4efb57 100644 --- a/nekoray/fmt/Bean2External.cpp +++ b/nekoray/fmt/Bean2External.cpp @@ -70,19 +70,11 @@ namespace NekoGui_fmt { return 1; }; - if (IS_NEKO_BOX) { - if (!forceExternal && (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp)) { - // sing-box support - return 0; - } else { - // hysteria core support - return hysteriaCore(); - } - } else if (proxy_type == proxy_TUIC) { - return tuicCore(); - } else if (proxy_type == proxy_Hysteria2) { - return hysteria2Core(); + if (!forceExternal && (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp)) { + // sing-box support + return 0; } else { + // hysteria core support return hysteriaCore(); } } diff --git a/nekoray/fmt/CustomBean.hpp b/nekoray/fmt/CustomBean.hpp index 16efd99262..926e50d66b 100644 --- a/nekoray/fmt/CustomBean.hpp +++ b/nekoray/fmt/CustomBean.hpp @@ -24,7 +24,7 @@ namespace NekoGui_fmt { QString DisplayType() override { if (core == "internal") { auto obj = QString2QJsonObject(config_simple); - return obj[IS_NEKO_BOX ? "type" : "protocol"].toString(); + return obj["type"].toString(); } else if (core == "internal-full") { return software_core_name + " config"; } @@ -36,11 +36,7 @@ namespace NekoGui_fmt { QString DisplayAddress() override { if (core == "internal") { auto obj = QString2QJsonObject(config_simple); - if (IS_NEKO_BOX) { - return ::DisplayAddress(obj["server"].toString(), obj["server_port"].toInt()); - } else { - return {}; - } + return ::DisplayAddress(obj["server"].toString(), obj["server_port"].toInt()); } else if (core == "internal-full") { return {}; } @@ -52,7 +48,5 @@ namespace NekoGui_fmt { ExternalBuildResult BuildExternal(int mapping_port, int socks_port, int external_stat) override; CoreObjOutboundBuildResult BuildCoreObjSingBox() override; - - CoreObjOutboundBuildResult BuildCoreObjV2Ray() override; }; } // namespace NekoGui_fmt \ No newline at end of file diff --git a/nekoray/fmt/Preset.hpp b/nekoray/fmt/Preset.hpp index ff02682387..050a32e311 100644 --- a/nekoray/fmt/Preset.hpp +++ b/nekoray/fmt/Preset.hpp @@ -1,15 +1,6 @@ #pragma once namespace Preset { - namespace Xray { - inline QStringList UtlsFingerPrint = {"", "chrome", "firefox", "edge", "safari", "360", "qq", "ios", "android", "random", "randomized"}; - inline QStringList ShadowsocksMethods = {"aes-128-gcm", "aes-256-gcm", "aes-192-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", - "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", - "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", - "rc4", "rc4-md5", "bf-cfb", "chacha20", "chacha20-ietf", "xchacha20", "none"}; - inline QStringList Flows = {"xtls-rprx-vision", "xtls-rprx-vision-udp443"}; - } // namespace Xray - namespace SingBox { inline QStringList VpnImplementation = {"gvisor", "system", "mixed"}; inline QStringList DomainStrategy = {"", "ipv4_only", "ipv6_only", "prefer_ipv4", "prefer_ipv6"}; diff --git a/nekoray/fmt/ShadowSocksBean.hpp b/nekoray/fmt/ShadowSocksBean.hpp index 3bf58d91ba..becb68429e 100644 --- a/nekoray/fmt/ShadowSocksBean.hpp +++ b/nekoray/fmt/ShadowSocksBean.hpp @@ -23,8 +23,6 @@ namespace NekoGui_fmt { QString DisplayType() override { return "Shadowsocks"; }; - CoreObjOutboundBuildResult BuildCoreObjV2Ray() override; - CoreObjOutboundBuildResult BuildCoreObjSingBox() override; bool TryParseLink(const QString &link); diff --git a/nekoray/fmt/SocksHttpBean.hpp b/nekoray/fmt/SocksHttpBean.hpp index ef183266d3..930a5f8103 100644 --- a/nekoray/fmt/SocksHttpBean.hpp +++ b/nekoray/fmt/SocksHttpBean.hpp @@ -26,8 +26,6 @@ namespace NekoGui_fmt { QString DisplayType() override { return socks_http_type == type_HTTP ? "HTTP" : "Socks"; }; - CoreObjOutboundBuildResult BuildCoreObjV2Ray() override; - CoreObjOutboundBuildResult BuildCoreObjSingBox() override; bool TryParseLink(const QString &link); diff --git a/nekoray/fmt/TrojanVLESSBean.hpp b/nekoray/fmt/TrojanVLESSBean.hpp index e47f41d354..77070a609c 100644 --- a/nekoray/fmt/TrojanVLESSBean.hpp +++ b/nekoray/fmt/TrojanVLESSBean.hpp @@ -24,8 +24,6 @@ namespace NekoGui_fmt { QString DisplayType() override { return proxy_type == proxy_VLESS ? "VLESS" : "Trojan"; }; - CoreObjOutboundBuildResult BuildCoreObjV2Ray() override; - CoreObjOutboundBuildResult BuildCoreObjSingBox() override; bool TryParseLink(const QString &link); diff --git a/nekoray/fmt/V2RayStreamSettings.hpp b/nekoray/fmt/V2RayStreamSettings.hpp index 1b5c71cf44..9a6de9f8e6 100644 --- a/nekoray/fmt/V2RayStreamSettings.hpp +++ b/nekoray/fmt/V2RayStreamSettings.hpp @@ -49,8 +49,6 @@ namespace NekoGui_fmt { _add(new configItem("mux_s", &multiplex_status, itemType::integer)); } - QJsonObject BuildStreamSettingsV2Ray(); - void BuildStreamSettingsSingBox(QJsonObject *outbound); }; diff --git a/nekoray/fmt/VMessBean.hpp b/nekoray/fmt/VMessBean.hpp index 9bbd59061f..2bd81a480f 100644 --- a/nekoray/fmt/VMessBean.hpp +++ b/nekoray/fmt/VMessBean.hpp @@ -21,8 +21,6 @@ namespace NekoGui_fmt { QString DisplayType() override { return "VMess"; }; - CoreObjOutboundBuildResult BuildCoreObjV2Ray() override; - CoreObjOutboundBuildResult BuildCoreObjSingBox() override; bool TryParseLink(const QString &link); diff --git a/nekoray/main/HTTPRequestHelper.cpp b/nekoray/main/HTTPRequestHelper.cpp index 08a1a42a76..20e9d7812d 100644 --- a/nekoray/main/HTTPRequestHelper.cpp +++ b/nekoray/main/HTTPRequestHelper.cpp @@ -18,7 +18,7 @@ namespace NekoGui_network { if (NekoGui::dataStore->sub_use_proxy) { QNetworkProxy p; // Note: sing-box mixed socks5 protocol error - p.setType(IS_NEKO_BOX ? QNetworkProxy::HttpProxy : QNetworkProxy::Socks5Proxy); + p.setType(QNetworkProxy::HttpProxy); p.setHostName("127.0.0.1"); p.setPort(NekoGui::dataStore->inbound_socks_port); if (NekoGui::dataStore->inbound_auth->NeedAuth()) { diff --git a/nekoray/main/NekoGui.cpp b/nekoray/main/NekoGui.cpp index e45434f890..67b5a52140 100644 --- a/nekoray/main/NekoGui.cpp +++ b/nekoray/main/NekoGui.cpp @@ -237,7 +237,6 @@ namespace NekoGui { _add(new configItem("current_group", ¤t_group, itemType::integer)); _add(new configItem("inbound_address", &inbound_address, itemType::string)); _add(new configItem("inbound_socks_port", &inbound_socks_port, itemType::integer)); - _add(new configItem("inbound_http_port", &inbound_http_port, itemType::integer)); _add(new configItem("log_level", &log_level, itemType::string)); _add(new configItem("mux_protocol", &mux_protocol, itemType::string)); _add(new configItem("mux_concurrency", &mux_concurrency, itemType::integer)); @@ -284,12 +283,7 @@ namespace NekoGui { _add(new configItem("core_box_clash_api", &core_box_clash_api, itemType::integer)); _add(new configItem("core_box_clash_api_secret", &core_box_clash_api_secret, itemType::string)); _add(new configItem("core_box_underlying_dns", &core_box_underlying_dns, itemType::string)); - _add(new configItem("core_ray_direct_dns", &core_ray_direct_dns, itemType::boolean)); - _add(new configItem("core_ray_freedom_domainStrategy", &core_ray_freedom_domainStrategy, itemType::string)); _add(new configItem("vpn_internal_tun", &vpn_internal_tun, itemType::boolean)); -#ifdef Q_OS_WIN - _add(new configItem("core_ray_windows_disable_auto_interface", &core_ray_windows_disable_auto_interface, itemType::boolean)); -#endif } void DataStore::UpdateStartedId(int id) { @@ -310,11 +304,7 @@ namespace NekoGui { if (isDefault) { QString version = SubStrBefore(NKR_VERSION, "-"); if (!version.contains(".")) version = "2.0"; - if (IS_NEKO_BOX) { - return "NekoBox/PC/" + version + " (Prefer ClashMeta Format)"; - } else { - return "NekoRay/PC/" + version + " (Prefer ClashMeta Format)"; - } + return "NekoBox/PC/" + version + " (Prefer ClashMeta Format)"; } return user_agent; } @@ -335,10 +325,8 @@ namespace NekoGui { "domain:firebase.io\n" "domain:crashlytics.com\n"; } - if (IS_NEKO_BOX) { - if (!Preset::SingBox::DomainStrategy.contains(domain_strategy)) domain_strategy = ""; - if (!Preset::SingBox::DomainStrategy.contains(outbound_domain_strategy)) outbound_domain_strategy = ""; - } + if (!Preset::SingBox::DomainStrategy.contains(domain_strategy)) domain_strategy = ""; + if (!Preset::SingBox::DomainStrategy.contains(outbound_domain_strategy)) outbound_domain_strategy = ""; _add(new configItem("direct_ip", &this->direct_ip, itemType::string)); _add(new configItem("direct_domain", &this->direct_domain, itemType::string)); _add(new configItem("proxy_ip", &this->proxy_ip, itemType::string)); diff --git a/nekoray/main/NekoGui.hpp b/nekoray/main/NekoGui.hpp index c894636d1d..fa65cbf6be 100644 --- a/nekoray/main/NekoGui.hpp +++ b/nekoray/main/NekoGui.hpp @@ -17,7 +17,5 @@ namespace NekoGui { bool IsAdmin(); } // namespace NekoGui -#define IS_NEKO_BOX (NekoGui::coreType == NekoGui::CoreType::SING_BOX) -#define IS_NEKO_BOX_INTERNAL_TUN (IS_NEKO_BOX && NekoGui::dataStore->vpn_internal_tun) -#define ROUTES_PREFIX_NAME QString(IS_NEKO_BOX ? "routes_box" : "routes") +#define ROUTES_PREFIX_NAME QString("routes_box") #define ROUTES_PREFIX QString(ROUTES_PREFIX_NAME + "/") diff --git a/nekoray/main/NekoGui_DataStore.hpp b/nekoray/main/NekoGui_DataStore.hpp index 21ceffc5f2..66f0af528b 100644 --- a/nekoray/main/NekoGui_DataStore.hpp +++ b/nekoray/main/NekoGui_DataStore.hpp @@ -93,7 +93,7 @@ namespace NekoGui { // Saved // Misc - QString log_level = "warning"; + QString log_level = "info"; QString test_latency_url = "http://cp.cloudflare.com/"; QString test_download_url = "http://cachefly.cachefly.net/10mb.test"; int test_download_timeout = 30; @@ -102,7 +102,7 @@ namespace NekoGui { int traffic_loop_interval = 1000; bool connection_statistics = false; int current_group = 0; // group id - QString mux_protocol = ""; + QString mux_protocol = "h2mux"; bool mux_padding = false; int mux_concurrency = 8; bool mux_default_on = false; @@ -136,7 +136,6 @@ namespace NekoGui { // Socks & HTTP Inbound QString inbound_address = "127.0.0.1"; int inbound_socks_port = 2080; // or Mixed - int inbound_http_port = 2081; InboundAuthorization *inbound_auth = new InboundAuthorization; QString custom_inbound = "{\"inbounds\": []}"; @@ -166,9 +165,6 @@ namespace NekoGui { int core_box_clash_api = -9090; QString core_box_clash_api_secret = ""; QString core_box_underlying_dns = ""; - bool core_ray_direct_dns = false; - bool core_ray_windows_disable_auto_interface = false; - QString core_ray_freedom_domainStrategy = ""; // Other Core ExtraCore *extraCore = new ExtraCore; diff --git a/nekoray/main/NekoGui_Utils.hpp b/nekoray/main/NekoGui_Utils.hpp index 034dc1fc83..5c21d34133 100644 --- a/nekoray/main/NekoGui_Utils.hpp +++ b/nekoray/main/NekoGui_Utils.hpp @@ -8,8 +8,8 @@ // -inline QString software_name = "NekoRay"; -inline QString software_core_name = "Xray"; +inline QString software_name = "NekoBox"; +inline QString software_core_name = "sing-box"; // Main Functions diff --git a/nekoray/res/vpn/vpn-run-root.sh b/nekoray/res/vpn/vpn-run-root.sh index 7608f6fd55..d0c79ed98b 100755 --- a/nekoray/res/vpn/vpn-run-root.sh +++ b/nekoray/res/vpn/vpn-run-root.sh @@ -6,40 +6,25 @@ if [ "$EUID" -ne 0 ]; then echo "[Warning] Tun script not running as root" fi -if [ "$(uname)" == "Darwin" ]; then - IS_MACOS=1 -fi - -[ -z $TABLE_FWMARK ] && echo "Please set env TABLE_FWMARK" && exit command -v pkill >/dev/null 2>&1 || echo "[Warning] pkill not found" BASEDIR=$(dirname "$0") cd $BASEDIR pre_start_linux() { - # set bypass: fwmark - ip rule add pref 8999 fwmark $TABLE_FWMARK table main || return - ip -6 rule add pref 8999 fwmark $TABLE_FWMARK table main || return - # for Tun2Socket iptables -I INPUT -s 172.19.0.2 -d 172.19.0.1 -p tcp -j ACCEPT ip6tables -I INPUT -s fdfe:dcba:9876::2 -d fdfe:dcba:9876::1 -p tcp -j ACCEPT } start() { - [ -z $IS_MACOS ] && pre_start_linux - "./nekobox_core" run -c "$CONFIG_PATH" --protect-listen-path "$PROTECT_LISTEN_PATH" --protect-fwmark $TABLE_FWMARK + pre_start_linux + "./nekobox_core" run -c "$CONFIG_PATH" } stop() { - [ -z $IS_MACOS ] || return - for local in $BYPASS_IPS; do - ip rule del to $local table main - done iptables -D INPUT -s 172.19.0.2 -d 172.19.0.1 -p tcp -j ACCEPT ip6tables -D INPUT -s fdfe:dcba:9876::2 -d fdfe:dcba:9876::1 -p tcp -j ACCEPT - ip rule del fwmark $TABLE_FWMARK - ip -6 rule del fwmark $TABLE_FWMARK } if [ "$1" != "stop" ]; then diff --git a/nekoray/sys/ExternalProcess.cpp b/nekoray/sys/ExternalProcess.cpp index 2b00f35adf..bb0f1481e7 100644 --- a/nekoray/sys/ExternalProcess.cpp +++ b/nekoray/sys/ExternalProcess.cpp @@ -147,8 +147,6 @@ namespace NekoGui_sys { v2ray_asset_dir = QFileInfo(v2ray_asset_dir).absolutePath(); env << "XRAY_LOCATION_ASSET=" + v2ray_asset_dir; } - if (NekoGui::dataStore->core_ray_direct_dns) env << "NKR_CORE_RAY_DIRECT_DNS=1"; - if (NekoGui::dataStore->core_ray_windows_disable_auto_interface) env << "NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE=1"; // ExternalProcess::Start(); write((NekoGui::dataStore->core_token + "\n").toUtf8()); diff --git a/nekoray/translations/fa_IR.ts b/nekoray/translations/fa_IR.ts index bc37bff6a8..d757f54b73 100644 --- a/nekoray/translations/fa_IR.ts +++ b/nekoray/translations/fa_IR.ts @@ -11,18 +11,10 @@ Enable فعال کردن - - HTTP Listen Port - پورت HTTP درحال شنود - Listen Address آدرس درحال شنود - - Socks Listen Port - پورت ساکس درحال شنود - concurrency همزمانی @@ -197,16 +189,6 @@ Override underlying DNS لغو دی ان اس زیربنایی - - It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option. -For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode. -For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test. - پیشنهاد میشود که این گزینه را انتخاب نشده باقی بگذارید ، اما گاهی اوقات کار نمیکند در این مواقع شما میتوانید این گزینه را انتخاب کنید ، برای Nekoray این گزینه دی ان اس زیربنایی را در حالت تونل بازنویسی میکند ، و برای NekoBox این گزینه دی ان اس زیربنایی را هم در حالت تونل و هم در حالت معمولی و تست آدرس بازنویسی میکند - - - If you Tun Mode is not working, try to change this option. - اگر حالت تونل برای شما کار نمیکند ، این گزینه را تغییر دهید - Default On به صورت پیشفرض فعال @@ -243,6 +225,10 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod Old Share Link Format + + Mixed (SOCKS+HTTP) Listen Port + + DialogEditGroup @@ -1368,14 +1354,6 @@ This needs to be run NekoBox with administrator privileges. Imported %1 profile(s) - - Http inbound is not enabled, can't set system proxy. - - - - Settings - تنظیمات - Current server is incompatible with Tun. Please stop the server first, enable Tun Mode, and then restart. @@ -1384,11 +1362,6 @@ This needs to be run NekoBox with administrator privileges. Not Running در حال اجرا نیست - - None - هیچ یک - هیچ یک - Select انتخاب diff --git a/nekoray/translations/ru_RU.ts b/nekoray/translations/ru_RU.ts index 83eea8370e..395e18e865 100644 --- a/nekoray/translations/ru_RU.ts +++ b/nekoray/translations/ru_RU.ts @@ -23,14 +23,6 @@ Edit Изменить - - Socks Listen Port - Адрес входящих SOCKS - - - HTTP Listen Port - Адрес входящих HTTP - Enable Вкл @@ -211,18 +203,6 @@ Override underlying DNS Переопределить нижестоящий DNS - - It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option. -For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode. -For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test. - Рекомендуется оставить параметр пустым, но иногда это не срабатывает как надо, и в таком случае можно использовать эту опцию. -Для NekoRay это переопределяет нижестоящий (localhost) DNS в Tun режиме. -Для NekoBox это переопределяет нижестоящий (localhost) DNS в Tun режиме, нормальном режиме, а также при URL тесте. - - - If you Tun Mode is not working, try to change this option. - Если TUN-режим не работает, попробуйте изменить эту опцию. - Timeout (s) Таймаут (с) @@ -243,6 +223,10 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod Old Share Link Format Поделиться ссылкой в старом формате + + Mixed (SOCKS+HTTP) Listen Port + + DialogEditGroup @@ -1394,14 +1378,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun Imported %1 profile(s) Импортирован(ы) %1 профиль(ей) - - Http inbound is not enabled, can't set system proxy. - HTTP inbound не включен в настройках, невозможно установить системный прокси. - - - Settings - Настройки - Please run NekoBox as admin Пожалуйста, запустите NekoBox с правами администратора @@ -1414,10 +1390,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun Not Running Не запущен - - None - Нет - Select Выбор diff --git a/nekoray/translations/zh_CN.ts b/nekoray/translations/zh_CN.ts index c0a4ccabcb..c55d4cd8b7 100644 --- a/nekoray/translations/zh_CN.ts +++ b/nekoray/translations/zh_CN.ts @@ -11,18 +11,10 @@ Enable 启用 - - HTTP Listen Port - HTTP 监听端口 - Listen Address 监听地址 - - Socks Listen Port - Socks 监听端口 - concurrency 并发 @@ -203,18 +195,6 @@ Override underlying DNS 覆盖底层 DNS - - It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option. -For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode. -For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test. - 建议留空,但有时会出现问题,这时可以设置这个选项。 -对于 NekoRay 来说,在 Tun 模式下会重写 underlying(localhost) DNS。 -对于 NekoBox 来说,在 Tun 模式、正常模式和 URL 测试中会重写 underlying(localhost) DNS。 - - - If you Tun Mode is not working, try to change this option. - 如果您的 Tun 模式有问题,请尝试更改此选项。 - Default On 默认开启 @@ -243,6 +223,10 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod Interval (minute, invalid if less than 30) 时间间隔(分钟,少于 30 分钟无效) + + Mixed (SOCKS+HTTP) Listen Port + Mixed (SOCKS+HTTP) 监听端口 + DialogEditGroup @@ -1210,10 +1194,6 @@ This needs to be run NekoBox with administrator privileges. Imported %1 profile(s) 导入了 %1 个配置 - - None - - Unavailable 不可用 diff --git a/nekoray/ui/dialog_basic_settings.cpp b/nekoray/ui/dialog_basic_settings.cpp index 794da06abd..853fdda672 100644 --- a/nekoray/ui/dialog_basic_settings.cpp +++ b/nekoray/ui/dialog_basic_settings.cpp @@ -59,16 +59,8 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent) // Common - if (IS_NEKO_BOX) { - ui->groupBox_http->hide(); - ui->inbound_socks_port_l->setText(ui->inbound_socks_port_l->text().replace("Socks", "Mixed (SOCKS+HTTP)")); - ui->log_level->addItems(QString("trace debug info warn error fatal panic").split(" ")); - ui->mux_protocol->addItems({"h2mux", "smux", "yamux"}); - } else { - ui->log_level->addItems({"debug", "info", "warning", "none"}); - ui->mux_protocol->hide(); - ui->mux_padding->hide(); - } + ui->log_level->addItems(QString("trace debug info warn error fatal panic").split(" ")); + ui->mux_protocol->addItems({"h2mux", "smux", "yamux"}); refresh_auth(); @@ -76,7 +68,6 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent) D_LOAD_COMBO_STRING(log_level) CACHE.custom_inbound = NekoGui::dataStore->custom_inbound; D_LOAD_INT(inbound_socks_port) - D_LOAD_INT_ENABLE(inbound_http_port, http_enable) D_LOAD_INT(test_concurrent) D_LOAD_INT(test_download_timeout) D_LOAD_STRING(test_latency_url) @@ -102,9 +93,7 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent) #endif // Style - if (IS_NEKO_BOX) { - ui->connection_statistics_box->setDisabled(true); - } + ui->connection_statistics_box->setDisabled(true); // D_LOAD_BOOL(check_include_pre) D_LOAD_BOOL(connection_statistics) @@ -225,7 +214,7 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent) // Security - ui->utlsFingerprint->addItems(IS_NEKO_BOX ? Preset::SingBox::UtlsFingerPrint : Preset::Xray::UtlsFingerPrint); + ui->utlsFingerprint->addItems(Preset::SingBox::UtlsFingerPrint); D_LOAD_BOOL(skip_cert) ui->utlsFingerprint->setCurrentText(NekoGui::dataStore->utlsFingerprint); @@ -242,7 +231,6 @@ void DialogBasicSettings::accept() { D_SAVE_COMBO_STRING(log_level) NekoGui::dataStore->custom_inbound = CACHE.custom_inbound; D_SAVE_INT(inbound_socks_port) - D_SAVE_INT_ENABLE(inbound_http_port, http_enable) D_SAVE_INT(test_concurrent) D_SAVE_INT(test_download_timeout) D_SAVE_STRING(test_latency_url) @@ -395,80 +383,39 @@ void DialogBasicSettings::on_core_settings_clicked() { MyLineEdit *core_box_clash_api; MyLineEdit *core_box_clash_api_secret; MyLineEdit *core_box_underlying_dns; - QCheckBox *core_ray_direct_dns; - QCheckBox *core_ray_windows_disable_auto_interface; - QComboBox *core_ray_freedom_domainStrategy; // auto core_box_underlying_dns_l = new QLabel(tr("Override underlying DNS")); - core_box_underlying_dns_l->setToolTip(tr( - "It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option.\n" - "For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode.\n" - "For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test.")); core_box_underlying_dns = new MyLineEdit; core_box_underlying_dns->setText(NekoGui::dataStore->core_box_underlying_dns); core_box_underlying_dns->setMinimumWidth(300); layout->addWidget(core_box_underlying_dns_l, ++line, 0); layout->addWidget(core_box_underlying_dns, line, 1); // - if (IS_NEKO_BOX) { - auto core_box_enable_clash_api_l = new QLabel("Enable Clash API"); - core_box_enable_clash_api = new QCheckBox; - core_box_enable_clash_api->setChecked(NekoGui::dataStore->core_box_clash_api > 0); - layout->addWidget(core_box_enable_clash_api_l, ++line, 0); - layout->addWidget(core_box_enable_clash_api, line, 1); - // - auto core_box_clash_api_l = new QLabel("Clash API Listen Port"); - core_box_clash_api = new MyLineEdit; - core_box_clash_api->setText(Int2String(std::abs(NekoGui::dataStore->core_box_clash_api))); - layout->addWidget(core_box_clash_api_l, ++line, 0); - layout->addWidget(core_box_clash_api, line, 1); - // - auto core_box_clash_api_secret_l = new QLabel("Clash API Secret"); - core_box_clash_api_secret = new MyLineEdit; - core_box_clash_api_secret->setText(NekoGui::dataStore->core_box_clash_api_secret); - layout->addWidget(core_box_clash_api_secret_l, ++line, 0); - layout->addWidget(core_box_clash_api_secret, line, 1); - } else { - auto core_ray_direct_dns_l = new QLabel("NKR_CORE_RAY_DIRECT_DNS"); - core_ray_direct_dns_l->setToolTip(tr("If you Tun Mode is not working, try to change this option.")); - core_ray_direct_dns = new QCheckBox; - core_ray_direct_dns->setChecked(NekoGui::dataStore->core_ray_direct_dns); - connect(core_ray_direct_dns, &QCheckBox::clicked, this, [&] { CACHE.needRestart = true; }); - layout->addWidget(core_ray_direct_dns_l, ++line, 0); - layout->addWidget(core_ray_direct_dns, line, 1); - // - auto core_ray_freedom_domainStrategy_l = new QLabel("Freedom Strategy"); - core_ray_freedom_domainStrategy = new QComboBox; - core_ray_freedom_domainStrategy->addItems({"", "AsIs", "UseIP", "UseIPv4", "UseIPv6"}); - core_ray_freedom_domainStrategy->setCurrentText(NekoGui::dataStore->core_ray_freedom_domainStrategy); - layout->addWidget(core_ray_freedom_domainStrategy_l, ++line, 0); - layout->addWidget(core_ray_freedom_domainStrategy, line, 1); -#ifdef Q_OS_WIN - auto core_ray_windows_disable_auto_interface_l = new QLabel("NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE"); - core_ray_windows_disable_auto_interface_l->setToolTip(tr("If you Tun Mode is not working, try to change this option.")); - core_ray_windows_disable_auto_interface = new QCheckBox; - core_ray_windows_disable_auto_interface->setChecked(NekoGui::dataStore->core_ray_windows_disable_auto_interface); - connect(core_ray_windows_disable_auto_interface, &QCheckBox::clicked, this, [&] { CACHE.needRestart = true; }); - layout->addWidget(core_ray_windows_disable_auto_interface_l, ++line, 0); - layout->addWidget(core_ray_windows_disable_auto_interface, line, 1); -#endif - } + auto core_box_enable_clash_api_l = new QLabel("Enable Clash API"); + core_box_enable_clash_api = new QCheckBox; + core_box_enable_clash_api->setChecked(NekoGui::dataStore->core_box_clash_api > 0); + layout->addWidget(core_box_enable_clash_api_l, ++line, 0); + layout->addWidget(core_box_enable_clash_api, line, 1); + // + auto core_box_clash_api_l = new QLabel("Clash API Listen Port"); + core_box_clash_api = new MyLineEdit; + core_box_clash_api->setText(Int2String(std::abs(NekoGui::dataStore->core_box_clash_api))); + layout->addWidget(core_box_clash_api_l, ++line, 0); + layout->addWidget(core_box_clash_api, line, 1); + // + auto core_box_clash_api_secret_l = new QLabel("Clash API Secret"); + core_box_clash_api_secret = new MyLineEdit; + core_box_clash_api_secret->setText(NekoGui::dataStore->core_box_clash_api_secret); + layout->addWidget(core_box_clash_api_secret_l, ++line, 0); + layout->addWidget(core_box_clash_api_secret, line, 1); // auto box = new QDialogButtonBox; box->setOrientation(Qt::Horizontal); box->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); connect(box, &QDialogButtonBox::accepted, w, [=] { NekoGui::dataStore->core_box_underlying_dns = core_box_underlying_dns->text(); - if (IS_NEKO_BOX) { - NekoGui::dataStore->core_box_clash_api = core_box_clash_api->text().toInt() * (core_box_enable_clash_api->isChecked() ? 1 : -1); - NekoGui::dataStore->core_box_clash_api_secret = core_box_clash_api_secret->text(); - } else { - NekoGui::dataStore->core_ray_direct_dns = core_ray_direct_dns->isChecked(); - NekoGui::dataStore->core_ray_freedom_domainStrategy = core_ray_freedom_domainStrategy->currentText(); -#ifdef Q_OS_WIN - NekoGui::dataStore->core_ray_windows_disable_auto_interface = core_ray_windows_disable_auto_interface->isChecked(); -#endif - } + NekoGui::dataStore->core_box_clash_api = core_box_clash_api->text().toInt() * (core_box_enable_clash_api->isChecked() ? 1 : -1); + NekoGui::dataStore->core_box_clash_api_secret = core_box_clash_api_secret->text(); MW_dialog_message(Dialog_DialogBasicSettings, "UpdateDataStore"); w->accept(); }); diff --git a/nekoray/ui/dialog_basic_settings.ui b/nekoray/ui/dialog_basic_settings.ui index d9f8339e6e..a4e1291a1d 100644 --- a/nekoray/ui/dialog_basic_settings.ui +++ b/nekoray/ui/dialog_basic_settings.ui @@ -95,7 +95,7 @@ - Socks Listen Port + Mixed (SOCKS+HTTP) Listen Port @@ -112,36 +112,6 @@ - - - - - - - HTTP Listen Port - - - - - - - - 0 - 0 - - - - - - - - Enable - - - - - - @@ -709,8 +679,8 @@ 0 0 - 198 - 58 + 632 + 299 diff --git a/nekoray/ui/dialog_manage_routes.cpp b/nekoray/ui/dialog_manage_routes.cpp index f35cc2e376..637687bd83 100644 --- a/nekoray/ui/dialog_manage_routes.cpp +++ b/nekoray/ui/dialog_manage_routes.cpp @@ -22,19 +22,13 @@ DialogManageRoutes::DialogManageRoutes(QWidget *parent) : QDialog(parent), ui(ne QStringList qsValue = {""}; QString dnsHelpDocumentUrl; - if (IS_NEKO_BOX) { - ui->outbound_domain_strategy->addItems(Preset::SingBox::DomainStrategy); - ui->domainStrategyCombo->addItems(Preset::SingBox::DomainStrategy); - qsValue += QString("prefer_ipv4 prefer_ipv6 ipv4_only ipv6_only").split(" "); - ui->dns_object->setPlaceholderText(DecodeB64IfValid("ewogICJzZXJ2ZXJzIjogW10sCiAgInJ1bGVzIjogW10sCiAgImZpbmFsIjogIiIsCiAgInN0cmF0ZWd5IjogIiIsCiAgImRpc2FibGVfY2FjaGUiOiBmYWxzZSwKICAiZGlzYWJsZV9leHBpcmUiOiBmYWxzZSwKICAiaW5kZXBlbmRlbnRfY2FjaGUiOiBmYWxzZSwKICAicmV2ZXJzZV9tYXBwaW5nIjogZmFsc2UsCiAgImZha2VpcCI6IHt9Cn0=")); - dnsHelpDocumentUrl = "https://sing-box.sagernet.org/configuration/dns/"; - } else { - ui->outbound_domain_strategy->addItems({"AsIs", "UseIPv4", "UseIPv6", "PreferIPv4", "PreferIPv6"}); - ui->domainStrategyCombo->addItems({"AsIs", "IPIfNonMatch", "IPOnDemand"}); - qsValue += QString("use_ip use_ip4 use_ip6").split(" "); - ui->dns_object->setPlaceholderText(DecodeB64IfValid("ewogICJzZXJ2ZXJzIjogW10KfQ==")); - dnsHelpDocumentUrl = "https://www.v2fly.org/config/dns.html"; - } + // + ui->outbound_domain_strategy->addItems(Preset::SingBox::DomainStrategy); + ui->domainStrategyCombo->addItems(Preset::SingBox::DomainStrategy); + qsValue += QString("prefer_ipv4 prefer_ipv6 ipv4_only ipv6_only").split(" "); + ui->dns_object->setPlaceholderText(DecodeB64IfValid("ewogICJzZXJ2ZXJzIjogW10sCiAgInJ1bGVzIjogW10sCiAgImZpbmFsIjogIiIsCiAgInN0cmF0ZWd5IjogIiIsCiAgImRpc2FibGVfY2FjaGUiOiBmYWxzZSwKICAiZGlzYWJsZV9leHBpcmUiOiBmYWxzZSwKICAiaW5kZXBlbmRlbnRfY2FjaGUiOiBmYWxzZSwKICAicmV2ZXJzZV9tYXBwaW5nIjogZmFsc2UsCiAgImZha2VpcCI6IHt9Cn0=")); + dnsHelpDocumentUrl = "https://sing-box.sagernet.org/configuration/dns/"; + // ui->direct_dns_strategy->addItems(qsValue); ui->remote_dns_strategy->addItems(qsValue); // diff --git a/nekoray/ui/dialog_vpn_settings.cpp b/nekoray/ui/dialog_vpn_settings.cpp index 6576fb47da..12096ee528 100644 --- a/nekoray/ui/dialog_vpn_settings.cpp +++ b/nekoray/ui/dialog_vpn_settings.cpp @@ -20,7 +20,6 @@ DialogVPNSettings::DialogVPNSettings(QWidget *parent) : QDialog(parent), ui(new ui->hide_console->setVisible(false); #endif ui->strict_route->setChecked(NekoGui::dataStore->vpn_strict_route); - ui->single_core->setVisible(IS_NEKO_BOX); ui->single_core->setChecked(NekoGui::dataStore->vpn_internal_tun); // D_LOAD_STRING_PLAIN(vpn_rule_cidr) diff --git a/nekoray/ui/edit/dialog_edit_profile.cpp b/nekoray/ui/edit/dialog_edit_profile.cpp index 1e9efb8ade..bcdb481497 100644 --- a/nekoray/ui/edit/dialog_edit_profile.cpp +++ b/nekoray/ui/edit/dialog_edit_profile.cpp @@ -62,7 +62,7 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, ui->host_l->setVisible(false); } // 传输设置 ED - if (txt == "ws" && IS_NEKO_BOX) { + if (txt == "ws") { ui->ws_early_data_length->setVisible(true); ui->ws_early_data_length_l->setVisible(true); ui->ws_early_data_name->setVisible(true); @@ -74,11 +74,7 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, ui->ws_early_data_name_l->setVisible(false); } // 传输设置 for NekoBox - if (IS_NEKO_BOX) { - if (!ui->utlsFingerprint->count()) ui->utlsFingerprint->addItems(Preset::SingBox::UtlsFingerPrint); - } else { - if (!ui->utlsFingerprint->count()) ui->utlsFingerprint->addItems(Preset::Xray::UtlsFingerPrint); - } + if (!ui->utlsFingerprint->count()) ui->utlsFingerprint->addItems(Preset::SingBox::UtlsFingerPrint); // 传输设置 是否可见 int networkBoxVisible = 0; for (auto label: ui->network_box->findChildren()) { @@ -89,19 +85,13 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, }); ui->network->removeItem(0); -// if (IS_NEKO_BOX) { -// ui->network->addItem("httpupgrade"); -// } - // security changed connect(ui->security, &QComboBox::currentTextChanged, this, [=](const QString &txt) { if (txt == "tls") { ui->security_box->setVisible(true); ui->tls_camouflage_box->setVisible(true); - if (IS_NEKO_BOX) { - ui->reality_spx->hide(); - ui->reality_spx_l->hide(); - } + ui->reality_spx->hide(); + ui->reality_spx_l->hide(); } else { ui->security_box->setVisible(false); ui->tls_camouflage_box->setVisible(false); @@ -286,47 +276,43 @@ void DialogEditProfile::typeSelected(const QString &newType) { ADD_ASTERISK(this) // 设置 for NekoBox - if (IS_NEKO_BOX) { - if (type == "vmess" || type == "vless") { - ui->packet_encoding->setVisible(true); - ui->packet_encoding_l->setVisible(true); - } else { - ui->packet_encoding->setVisible(false); - ui->packet_encoding_l->setVisible(false); - } - if (type == "vmess" || type == "vless" || type == "trojan") { - ui->network_l->setVisible(true); - ui->network->setVisible(true); - ui->network_box->setVisible(true); - } else { - ui->network_l->setVisible(false); - ui->network->setVisible(false); - ui->network_box->setVisible(false); - } - if (type == "vmess" || type == "vless" || type == "trojan" || type == "http") { - ui->security->setVisible(true); - ui->security_l->setVisible(true); - } else { - ui->security->setVisible(false); - ui->security_l->setVisible(false); - } - if (type == "vmess" || type == "vless" || type == "trojan" || type == "shadowsocks") { - ui->multiplex->setVisible(true); - ui->multiplex_l->setVisible(true); - } else { - ui->multiplex->setVisible(false); - ui->multiplex_l->setVisible(false); - } - // 设置 是否可见 - int streamBoxVisible = 0; - for (auto label: ui->stream_box->findChildren()) { - if (!label->isHidden()) streamBoxVisible++; - } - ui->stream_box->setVisible(streamBoxVisible); + if (type == "vmess" || type == "vless") { + ui->packet_encoding->setVisible(true); + ui->packet_encoding_l->setVisible(true); } else { ui->packet_encoding->setVisible(false); ui->packet_encoding_l->setVisible(false); } + if (type == "vmess" || type == "vless" || type == "trojan") { + ui->network_l->setVisible(true); + ui->network->setVisible(true); + ui->network_box->setVisible(true); + } else { + ui->network_l->setVisible(false); + ui->network->setVisible(false); + ui->network_box->setVisible(false); + } + if (type == "vmess" || type == "vless" || type == "trojan" || type == "http") { + ui->security->setVisible(true); + ui->security_l->setVisible(true); + } else { + ui->security->setVisible(false); + ui->security_l->setVisible(false); + } + if (type == "vmess" || type == "vless" || type == "trojan" || type == "shadowsocks") { + ui->multiplex->setVisible(true); + ui->multiplex_l->setVisible(true); + } else { + ui->multiplex->setVisible(false); + ui->multiplex_l->setVisible(false); + } + + // 设置 是否可见 + int streamBoxVisible = 0; + for (auto label: ui->stream_box->findChildren()) { + if (!label->isHidden()) streamBoxVisible++; + } + ui->stream_box->setVisible(streamBoxVisible); // 载入 type 之后,有些类型没有右边的设置 auto rightNoBox = (ui->stream_box->isHidden() && ui->network_box->isHidden() && ui->security_box->isHidden()); diff --git a/nekoray/ui/edit/dialog_edit_profile.ui b/nekoray/ui/edit/dialog_edit_profile.ui index d4e1005fef..a39379a413 100644 --- a/nekoray/ui/edit/dialog_edit_profile.ui +++ b/nekoray/ui/edit/dialog_edit_profile.ui @@ -245,6 +245,11 @@ ws + + + httpupgrade + + http diff --git a/nekoray/ui/edit/edit_quic.cpp b/nekoray/ui/edit/edit_quic.cpp index 505546bf90..1c7c7902ba 100644 --- a/nekoray/ui/edit/edit_quic.cpp +++ b/nekoray/ui/edit/edit_quic.cpp @@ -60,7 +60,6 @@ void EditQUIC::onStart(std::shared_ptr _ent) { ui->heartbeat->hide(); ui->heartbeat_l->hide(); ui->uos->hide(); - if (!IS_NEKO_BOX) ui->forceExternal->hide(); if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria) { // hy1 ui->password->hide(); @@ -77,13 +76,11 @@ void EditQUIC::onStart(std::shared_ptr _ent) { ui->alpn->hide(); ui->alpn_l->hide(); ui->TLS->removeItem(ui->alpn_sp); - if (IS_NEKO_BOX) { - ui->disableMtuDiscovery->hide(); - ui->connectionReceiveWindow->hide(); - ui->connectionReceiveWindow_l->hide(); - ui->streamReceiveWindow->hide(); - ui->streamReceiveWindow_l->hide(); - } + ui->disableMtuDiscovery->hide(); + ui->connectionReceiveWindow->hide(); + ui->connectionReceiveWindow_l->hide(); + ui->streamReceiveWindow->hide(); + ui->streamReceiveWindow_l->hide(); } } else if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_TUIC) { ui->hopPort->hide(); @@ -107,9 +104,7 @@ void EditQUIC::onStart(std::shared_ptr _ent) { ui->streamReceiveWindow_l->hide(); ui->connectionReceiveWindow->hide(); ui->connectionReceiveWindow_l->hide(); - if (!IS_NEKO_BOX) { - ui->uos->hide(); - } + ui->uos->hide(); } } diff --git a/nekoray/ui/edit/edit_shadowsocks.cpp b/nekoray/ui/edit/edit_shadowsocks.cpp index 5c58846df4..e016e34e5a 100644 --- a/nekoray/ui/edit/edit_shadowsocks.cpp +++ b/nekoray/ui/edit/edit_shadowsocks.cpp @@ -7,7 +7,7 @@ EditShadowSocks::EditShadowSocks(QWidget *parent) : QWidget(parent), ui(new Ui::EditShadowSocks) { ui->setupUi(this); - ui->method->addItems(IS_NEKO_BOX ? Preset::SingBox::ShadowsocksMethods : Preset::Xray::ShadowsocksMethods); + ui->method->addItems(Preset::SingBox::ShadowsocksMethods); } EditShadowSocks::~EditShadowSocks() { diff --git a/nekoray/ui/edit/edit_trojan_vless.cpp b/nekoray/ui/edit/edit_trojan_vless.cpp index db71c846b1..4d298835e1 100644 --- a/nekoray/ui/edit/edit_trojan_vless.cpp +++ b/nekoray/ui/edit/edit_trojan_vless.cpp @@ -23,7 +23,7 @@ void EditTrojanVLESS::onStart(std::shared_ptr _ent) { ui->flow_l->hide(); } ui->password->setText(bean->password); - ui->flow->addItems(IS_NEKO_BOX ? Preset::SingBox::Flows : Preset::Xray::Flows); + ui->flow->addItems(Preset::SingBox::Flows); ui->flow->setCurrentText(bean->flow); } diff --git a/nekoray/ui/mainwindow.cpp b/nekoray/ui/mainwindow.cpp index 6ede9e36e9..785aa80ca7 100644 --- a/nekoray/ui/mainwindow.cpp +++ b/nekoray/ui/mainwindow.cpp @@ -91,18 +91,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi } } - // software_name - if (IS_NEKO_BOX) { - software_name = "NekoBox"; - software_core_name = "sing-box"; - // replace default values - if (NekoGui::dataStore->log_level == "warning") NekoGui::dataStore->log_level = "info"; - if (NekoGui::dataStore->mux_protocol.isEmpty()) NekoGui::dataStore->mux_protocol = "h2mux"; - // - if (QDir("dashboard").count() == 0) { - QDir().mkdir("dashboard"); - QFile::copy(":/neko/dashboard-notice.html", "dashboard/index.html"); - } + if (QDir("dashboard").count() == 0) { + QDir().mkdir("dashboard"); + QFile::copy(":/neko/dashboard-notice.html", "dashboard/index.html"); } // top bar @@ -398,10 +389,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi if (NekoGui::dataStore->core_port <= 0) NekoGui::dataStore->core_port = 19810; auto core_path = QApplication::applicationDirPath() + "/"; - core_path += IS_NEKO_BOX ? "nekobox_core" : "nekoray_core"; + core_path += "nekobox_core"; QStringList args; - args.push_back(IS_NEKO_BOX ? "nekobox" : "nekoray"); + args.push_back("nekobox"); args.push_back("-port"); args.push_back(Int2String(NekoGui::dataStore->core_port)); if (NekoGui::dataStore->flag_debug) args.push_back("-debug"); @@ -726,20 +717,8 @@ void MainWindow::on_menu_exit_triggered() { void MainWindow::neko_set_spmode_system_proxy(bool enable, bool save) { if (enable != NekoGui::dataStore->spmode_system_proxy) { if (enable) { -#if defined(Q_OS_WIN) - if (!IS_NEKO_BOX && !IsValidPort(NekoGui::dataStore->inbound_http_port)) { - auto btn = QMessageBox::warning(this, software_name, - tr("Http inbound is not enabled, can't set system proxy."), - "OK", tr("Settings"), "", 0, 0); - if (btn == 1) { - on_menu_basic_settings_triggered(); - } - return; - } -#endif auto socks_port = NekoGui::dataStore->inbound_socks_port; - auto http_port = NekoGui::dataStore->inbound_http_port; - if (IS_NEKO_BOX) http_port = socks_port; + auto http_port = NekoGui::dataStore->inbound_socks_port; SetSystemProxy(http_port, socks_port); } else { ClearSystemProxy(); @@ -761,7 +740,7 @@ void MainWindow::neko_set_spmode_system_proxy(bool enable, bool save) { void MainWindow::neko_set_spmode_vpn(bool enable, bool save) { if (enable != NekoGui::dataStore->spmode_vpn) { if (enable) { - if (IS_NEKO_BOX_INTERNAL_TUN) { + if (NekoGui::dataStore->vpn_internal_tun) { bool requestPermission = !NekoGui::IsAdmin(); if (requestPermission) { #ifdef Q_OS_LINUX @@ -799,7 +778,7 @@ void MainWindow::neko_set_spmode_vpn(bool enable, bool save) { } } } else { - if (IS_NEKO_BOX_INTERNAL_TUN) { + if (NekoGui::dataStore->vpn_internal_tun) { // current core is sing-box } else { if (!StopVPNProcess()) { @@ -820,7 +799,7 @@ void MainWindow::neko_set_spmode_vpn(bool enable, bool save) { NekoGui::dataStore->spmode_vpn = enable; refresh_status(); - if (IS_NEKO_BOX_INTERNAL_TUN && NekoGui::dataStore->started_id >= 0) neko_start(NekoGui::dataStore->started_id); + if (NekoGui::dataStore->vpn_internal_tun && NekoGui::dataStore->started_id >= 0) neko_start(NekoGui::dataStore->started_id); } void MainWindow::refresh_status(const QString &traffic_update) { @@ -858,13 +837,8 @@ void MainWindow::refresh_status(const QString &traffic_update) { ui->label_running->setText(txt); } // - auto display_http = tr("None"); - if (IsValidPort(NekoGui::dataStore->inbound_http_port)) { - display_http = DisplayAddress(NekoGui::dataStore->inbound_address, NekoGui::dataStore->inbound_http_port); - } auto display_socks = DisplayAddress(NekoGui::dataStore->inbound_address, NekoGui::dataStore->inbound_socks_port); - auto inbound_txt = QString("Socks: %1\nHTTP: %2").arg(display_socks, display_http); - if (IS_NEKO_BOX) inbound_txt = QString("Mixed: %1").arg(display_socks); + auto inbound_txt = QString("Mixed: %1").arg(display_socks); ui->label_inbound->setText(inbound_txt); // ui->checkBox_VPN->setChecked(NekoGui::dataStore->spmode_vpn); @@ -1802,9 +1776,8 @@ bool MainWindow::StartVPNProcess() { return true; } // - auto protectPath = QDir::currentPath() + "/protect"; auto configPath = NekoGui::WriteVPNSingBoxConfig(); - auto scriptPath = NekoGui::WriteVPNLinuxScript(protectPath, configPath); + auto scriptPath = NekoGui::WriteVPNLinuxScript(configPath); // #ifdef Q_OS_WIN runOnNewThread([=] { @@ -1816,11 +1789,6 @@ bool MainWindow::StartVPNProcess() { runOnUiThread([=] { neko_set_spmode_vpn(false); }); }); #else - QFile::remove(protectPath); - if (QFile::exists(protectPath)) { - MessageBoxWarning("Error", "protect cannot be removed"); - return false; - } // auto vpn_process = new QProcess; QProcess::connect(vpn_process, &QProcess::stateChanged, this, [=](QProcess::ProcessState state) { diff --git a/sing-box/cmd/sing-box/cmd_rule_set_decompile.go b/sing-box/cmd/sing-box/cmd_rule_set_decompile.go new file mode 100644 index 0000000000..02af03dd67 --- /dev/null +++ b/sing-box/cmd/sing-box/cmd_rule_set_decompile.go @@ -0,0 +1,83 @@ +package main + +import ( + "io" + "os" + "strings" + + "github.com/sagernet/sing-box/common/srs" + C "github.com/sagernet/sing-box/constant" + "github.com/sagernet/sing-box/log" + "github.com/sagernet/sing-box/option" + "github.com/sagernet/sing/common/json" + + "github.com/spf13/cobra" +) + +var flagRuleSetDecompileOutput string + +const flagRuleSetDecompileDefaultOutput = ".json" + +var commandRuleSetDecompile = &cobra.Command{ + Use: "decompile [binary-path]", + Short: "Decompile rule-set binary to json", + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + err := decompileRuleSet(args[0]) + if err != nil { + log.Fatal(err) + } + }, +} + +func init() { + commandRuleSet.AddCommand(commandRuleSetDecompile) + commandRuleSetDecompile.Flags().StringVarP(&flagRuleSetDecompileOutput, "output", "o", flagRuleSetDecompileDefaultOutput, "Output file") +} + +func decompileRuleSet(sourcePath string) error { + var ( + reader io.Reader + err error + ) + if sourcePath == "stdin" { + reader = os.Stdin + } else { + reader, err = os.Open(sourcePath) + if err != nil { + return err + } + } + plainRuleSet, err := srs.Read(reader, true) + if err != nil { + return err + } + ruleSet := option.PlainRuleSetCompat{ + Version: C.RuleSetVersion1, + Options: plainRuleSet, + } + var outputPath string + if flagRuleSetDecompileOutput == flagRuleSetDecompileDefaultOutput { + if strings.HasSuffix(sourcePath, ".srs") { + outputPath = sourcePath[:len(sourcePath)-4] + ".json" + } else { + outputPath = sourcePath + ".json" + } + } else { + outputPath = flagRuleSetDecompileOutput + } + outputFile, err := os.Create(outputPath) + if err != nil { + return err + } + encoder := json.NewEncoder(outputFile) + encoder.SetIndent("", " ") + err = encoder.Encode(ruleSet) + if err != nil { + outputFile.Close() + os.Remove(outputPath) + return err + } + outputFile.Close() + return nil +} diff --git a/sing-box/cmd/sing-box/cmd_rule_set_match.go b/sing-box/cmd/sing-box/cmd_rule_set_match.go index 9f1767e056..937458f2c6 100644 --- a/sing-box/cmd/sing-box/cmd_rule_set_match.go +++ b/sing-box/cmd/sing-box/cmd_rule_set_match.go @@ -14,6 +14,7 @@ import ( E "github.com/sagernet/sing/common/exceptions" F "github.com/sagernet/sing/common/format" "github.com/sagernet/sing/common/json" + M "github.com/sagernet/sing/common/metadata" "github.com/spf13/cobra" ) @@ -21,8 +22,8 @@ import ( var flagRuleSetMatchFormat string var commandRuleSetMatch = &cobra.Command{ - Use: "match ", - Short: "Check if a domain matches the rule-set", + Use: "match ", + Short: "Check if an IP address or a domain matches the rule-set", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { err := ruleSetMatch(args[0], args[1]) @@ -74,15 +75,20 @@ func ruleSetMatch(sourcePath string, domain string) error { default: return E.New("unknown rule-set format: ", flagRuleSetMatchFormat) } + ipAddress := M.ParseAddr(domain) + var metadata adapter.InboundContext + if ipAddress.IsValid() { + metadata.Destination = M.SocksaddrFrom(ipAddress, 0) + } else { + metadata.Domain = domain + } for i, ruleOptions := range plainRuleSet.Rules { var currentRule adapter.HeadlessRule currentRule, err = route.NewHeadlessRule(nil, ruleOptions) if err != nil { return E.Cause(err, "parse rule_set.rules.[", i, "]") } - if currentRule.Match(&adapter.InboundContext{ - Domain: domain, - }) { + if currentRule.Match(&metadata) { println(F.ToString("match rules.[", i, "]: ", currentRule)) } } diff --git a/sing-box/common/srs/binary.go b/sing-box/common/srs/binary.go index ee209051de..6ccfccbd0b 100644 --- a/sing-box/common/srs/binary.go +++ b/sing-box/common/srs/binary.go @@ -39,7 +39,7 @@ const ( ruleItemFinal uint8 = 0xFF ) -func Read(reader io.Reader, recovery bool) (ruleSet option.PlainRuleSet, err error) { +func Read(reader io.Reader, recover bool) (ruleSet option.PlainRuleSet, err error) { var magicBytes [3]byte _, err = io.ReadFull(reader, magicBytes[:]) if err != nil { @@ -68,7 +68,7 @@ func Read(reader io.Reader, recovery bool) (ruleSet option.PlainRuleSet, err err } ruleSet.Rules = make([]option.HeadlessRule, length) for i := uint64(0); i < length; i++ { - ruleSet.Rules[i], err = readRule(bReader, recovery) + ruleSet.Rules[i], err = readRule(bReader, recover) if err != nil { err = E.Cause(err, "read rule[", i, "]") return @@ -101,10 +101,14 @@ func Write(writer io.Writer, ruleSet option.PlainRuleSet) error { return err } } + err = bWriter.Flush() + if err != nil { + return err + } return zWriter.Close() } -func readRule(reader varbin.Reader, recovery bool) (rule option.HeadlessRule, err error) { +func readRule(reader varbin.Reader, recover bool) (rule option.HeadlessRule, err error) { var ruleType uint8 err = binary.Read(reader, binary.BigEndian, &ruleType) if err != nil { @@ -113,10 +117,10 @@ func readRule(reader varbin.Reader, recovery bool) (rule option.HeadlessRule, er switch ruleType { case 0: rule.Type = C.RuleTypeDefault - rule.DefaultOptions, err = readDefaultRule(reader, recovery) + rule.DefaultOptions, err = readDefaultRule(reader, recover) case 1: rule.Type = C.RuleTypeLogical - rule.LogicalOptions, err = readLogicalRule(reader, recovery) + rule.LogicalOptions, err = readLogicalRule(reader, recover) default: err = E.New("unknown rule type: ", ruleType) } @@ -134,7 +138,7 @@ func writeRule(writer varbin.Writer, rule option.HeadlessRule) error { } } -func readDefaultRule(reader varbin.Reader, recovery bool) (rule option.DefaultHeadlessRule, err error) { +func readDefaultRule(reader varbin.Reader, recover bool) (rule option.DefaultHeadlessRule, err error) { var lastItemType uint8 for { var itemType uint8 @@ -161,6 +165,9 @@ func readDefaultRule(reader varbin.Reader, recovery bool) (rule option.DefaultHe return } rule.DomainMatcher = matcher + if recover { + rule.Domain, rule.DomainSuffix = matcher.Dump() + } case ruleItemDomainKeyword: rule.DomainKeyword, err = readRuleItemString(reader) case ruleItemDomainRegex: @@ -170,7 +177,7 @@ func readDefaultRule(reader varbin.Reader, recovery bool) (rule option.DefaultHe if err != nil { return } - if recovery { + if recover { rule.SourceIPCIDR = common.Map(rule.SourceIPSet.Prefixes(), netip.Prefix.String) } case ruleItemIPCIDR: @@ -178,7 +185,7 @@ func readDefaultRule(reader varbin.Reader, recovery bool) (rule option.DefaultHe if err != nil { return } - if recovery { + if recover { rule.IPCIDR = common.Map(rule.IPSet.Prefixes(), netip.Prefix.String) } case ruleItemSourcePort: diff --git a/sing-box/docs/changelog.md b/sing-box/docs/changelog.md index 6dcf8d6358..762c8cb395 100644 --- a/sing-box/docs/changelog.md +++ b/sing-box/docs/changelog.md @@ -2,6 +2,10 @@ icon: material/alert-decagram --- +#### 1.10.0-alpha.19 + +* Fixes and improvements + #### 1.10.0-alpha.18 * Add new `inline` rule-set type **1** diff --git a/sing-box/go.mod b/sing-box/go.mod index 0eead13721..c45159fb23 100644 --- a/sing-box/go.mod +++ b/sing-box/go.mod @@ -26,15 +26,15 @@ require ( github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f github.com/sagernet/quic-go v0.45.1-beta.2 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 - github.com/sagernet/sing v0.5.0-alpha.11.0.20240625144910-6bd878184516 + github.com/sagernet/sing v0.5.0-alpha.12 github.com/sagernet/sing-dns v0.3.0-beta.10 github.com/sagernet/sing-mux v0.2.0 github.com/sagernet/sing-quic v0.2.0-beta.12 github.com/sagernet/sing-shadowsocks v0.2.6 github.com/sagernet/sing-shadowsocks2 v0.2.0 github.com/sagernet/sing-shadowtls v0.1.4 - github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240626030247-7c4975c41279 - github.com/sagernet/sing-vmess v0.1.8 + github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240703164908-1f043289199d + github.com/sagernet/sing-vmess v0.1.11 github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 github.com/sagernet/tfo-go v0.0.0-20231209031829-7b5343ac1dc6 github.com/sagernet/utls v1.5.4 @@ -82,6 +82,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qpack v0.4.0 // indirect github.com/quic-go/qtls-go1-20 v0.4.1 // indirect + github.com/sagernet/fswatch v0.1.1 // indirect github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect github.com/sagernet/nftables v0.3.0-beta.4 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/sing-box/go.sum b/sing-box/go.sum index 6468fba5d8..bf79babdda 100644 --- a/sing-box/go.sum +++ b/sing-box/go.sum @@ -115,8 +115,8 @@ github.com/sagernet/quic-go v0.45.1-beta.2/go.mod h1:+N3FqM9DAzOWfe64uxXuBejVJwX github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc= github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo= -github.com/sagernet/sing v0.5.0-alpha.11.0.20240625144910-6bd878184516 h1:C5NYqSEQC2CcILDFhT31iZe5Kp5hFNEtdS9mnNWyW5c= -github.com/sagernet/sing v0.5.0-alpha.11.0.20240625144910-6bd878184516/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= +github.com/sagernet/sing v0.5.0-alpha.12 h1:pjffG3SUpuF9PLDCqPO2fOAUozXItIBmnMVTKQ/QMhM= +github.com/sagernet/sing v0.5.0-alpha.12/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= github.com/sagernet/sing-dns v0.3.0-beta.10 h1:Js61EjQXVpcu2VDegWEQTH1isCcVwJju8WEHYgG4tQ0= github.com/sagernet/sing-dns v0.3.0-beta.10/go.mod h1:nXE6EYMXahB5DV3AcXYbFfuorqF7tbQ86kxweSxRKM4= github.com/sagernet/sing-mux v0.2.0 h1:4C+vd8HztJCWNYfufvgL49xaOoOHXty2+EAjnzN3IYo= @@ -129,10 +129,10 @@ github.com/sagernet/sing-shadowsocks2 v0.2.0 h1:wpZNs6wKnR7mh1wV9OHwOyUr21VkS3wK github.com/sagernet/sing-shadowsocks2 v0.2.0/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ= github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k= github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4= -github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240626030247-7c4975c41279 h1:pkvZfS3PVdSJt30pbJIvYRIiyetwZ3zbxlAwMEetDDU= -github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240626030247-7c4975c41279/go.mod h1:81JwnnYw8X9W9XvmZetSTTiPgIE3SbAbnc+EHKwPJ5U= -github.com/sagernet/sing-vmess v0.1.8 h1:XVWad1RpTy9b5tPxdm5MCU8cGfrTGdR8qCq6HV2aCNc= -github.com/sagernet/sing-vmess v0.1.8/go.mod h1:vhx32UNzTDUkNwOyIjcZQohre1CaytquC5mPplId8uA= +github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240703164908-1f043289199d h1:2nBM9W9fOCM45hjlu1Fh9qyzBCgKEkq+SOuRCbCCs7c= +github.com/sagernet/sing-tun v0.4.0-beta.13.0.20240703164908-1f043289199d/go.mod h1:81JwnnYw8X9W9XvmZetSTTiPgIE3SbAbnc+EHKwPJ5U= +github.com/sagernet/sing-vmess v0.1.11 h1:Kq20MJOBrZzxyHko+/fPHuTszYxe41ClbiNt0TTaqP4= +github.com/sagernet/sing-vmess v0.1.11/go.mod h1:luTSsfyBGAc9VhtCqwjR+dt1QgqBhuYBCONB/POhF8I= github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 h1:DImB4lELfQhplLTxeq2z31Fpv8CQqqrUwTbrIRumZqQ= github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7/go.mod h1:FP9X2xjT/Az1EsG/orYYoC+5MojWnuI7hrffz8fGwwo= github.com/sagernet/tfo-go v0.0.0-20231209031829-7b5343ac1dc6 h1:z3SJQhVyU63FT26Wn/UByW6b7q8QKB0ZkPqsyqcz2PI= diff --git a/sing-box/inbound/tun.go b/sing-box/inbound/tun.go index 3da8eb7dd5..6cb65de249 100644 --- a/sing-box/inbound/tun.go +++ b/sing-box/inbound/tun.go @@ -356,7 +356,7 @@ func (t *Tun) PostStart() error { } t.routeExcludeAddressSet = append(t.routeExcludeAddressSet, ipSets...) } - monitor.Start("initiating auto-redirect") + monitor.Start("initialize auto-redirect") err := t.autoRedirect.Start() monitor.Finish() if err != nil { diff --git a/sing-box/inbound/vless.go b/sing-box/inbound/vless.go index 734562253d..567475647a 100644 --- a/sing-box/inbound/vless.go +++ b/sing-box/inbound/vless.go @@ -13,9 +13,9 @@ import ( "github.com/sagernet/sing-box/log" "github.com/sagernet/sing-box/option" "github.com/sagernet/sing-box/transport/v2ray" - "github.com/sagernet/sing-box/transport/vless" "github.com/sagernet/sing-vmess" "github.com/sagernet/sing-vmess/packetaddr" + "github.com/sagernet/sing-vmess/vless" "github.com/sagernet/sing/common" "github.com/sagernet/sing/common/auth" E "github.com/sagernet/sing/common/exceptions" diff --git a/sing-box/outbound/vless.go b/sing-box/outbound/vless.go index 506521f700..b3e94661e1 100644 --- a/sing-box/outbound/vless.go +++ b/sing-box/outbound/vless.go @@ -12,8 +12,8 @@ import ( "github.com/sagernet/sing-box/log" "github.com/sagernet/sing-box/option" "github.com/sagernet/sing-box/transport/v2ray" - "github.com/sagernet/sing-box/transport/vless" "github.com/sagernet/sing-vmess/packetaddr" + "github.com/sagernet/sing-vmess/vless" "github.com/sagernet/sing/common" "github.com/sagernet/sing/common/bufio" E "github.com/sagernet/sing/common/exceptions" diff --git a/sing-box/transport/v2raygrpclite/client.go b/sing-box/transport/v2raygrpclite/client.go index 588a813385..bd52c1d9df 100644 --- a/sing-box/transport/v2raygrpclite/client.go +++ b/sing-box/transport/v2raygrpclite/client.go @@ -100,7 +100,7 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) { conn.setup(nil, err) } else if response.StatusCode != 200 { response.Body.Close() - conn.setup(nil, E.New("unexpected status: ", response.Status)) + conn.setup(nil, E.New("v2ray-grpc: unexpected status: ", response.Status)) } else { conn.setup(response.Body, nil) } diff --git a/sing-box/transport/v2rayhttp/client.go b/sing-box/transport/v2rayhttp/client.go index 4fa141cc81..d817d37d62 100644 --- a/sing-box/transport/v2rayhttp/client.go +++ b/sing-box/transport/v2rayhttp/client.go @@ -146,7 +146,7 @@ func (c *Client) dialHTTP2(ctx context.Context) (net.Conn, error) { conn.Setup(nil, err) } else if response.StatusCode != 200 { response.Body.Close() - conn.Setup(nil, E.New("unexpected status: ", response.Status)) + conn.Setup(nil, E.New("v2ray-http: unexpected status: ", response.Status)) } else { conn.Setup(response.Body, nil) } diff --git a/sing-box/transport/v2rayhttp/conn.go b/sing-box/transport/v2rayhttp/conn.go index 184bc8ae20..f7f93f1b58 100644 --- a/sing-box/transport/v2rayhttp/conn.go +++ b/sing-box/transport/v2rayhttp/conn.go @@ -43,7 +43,7 @@ func (c *HTTPConn) Read(b []byte) (n int, err error) { return 0, E.Cause(err, "read response") } if response.StatusCode != 200 { - return 0, E.New("unexpected status: ", response.Status) + return 0, E.New("v2ray-http: unexpected status: ", response.Status) } if cacheLen := reader.Buffered(); cacheLen > 0 { c.responseCache = buf.NewSize(cacheLen) diff --git a/sing-box/transport/v2rayhttpupgrade/client.go b/sing-box/transport/v2rayhttpupgrade/client.go index c10e1b8fdc..1b72cdfc28 100644 --- a/sing-box/transport/v2rayhttpupgrade/client.go +++ b/sing-box/transport/v2rayhttpupgrade/client.go @@ -104,7 +104,7 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) { if response.StatusCode != 101 || !strings.EqualFold(response.Header.Get("Connection"), "upgrade") || !strings.EqualFold(response.Header.Get("Upgrade"), "websocket") { - return nil, E.New("unexpected status: ", response.Status) + return nil, E.New("v2ray-http-upgrade: unexpected status: ", response.Status) } if bufReader.Buffered() > 0 { buffer := buf.NewSize(bufReader.Buffered()) diff --git a/sing-box/transport/vless/client.go b/sing-box/transport/vless/client.go deleted file mode 100644 index 09150f6d48..0000000000 --- a/sing-box/transport/vless/client.go +++ /dev/null @@ -1,294 +0,0 @@ -package vless - -import ( - "encoding/binary" - "io" - "net" - "sync" - - "github.com/sagernet/sing-vmess" - "github.com/sagernet/sing/common" - "github.com/sagernet/sing/common/buf" - "github.com/sagernet/sing/common/bufio" - E "github.com/sagernet/sing/common/exceptions" - "github.com/sagernet/sing/common/logger" - M "github.com/sagernet/sing/common/metadata" - N "github.com/sagernet/sing/common/network" - - "github.com/gofrs/uuid/v5" -) - -type Client struct { - key [16]byte - flow string - logger logger.Logger -} - -func NewClient(userId string, flow string, logger logger.Logger) (*Client, error) { - user := uuid.FromStringOrNil(userId) - if user == uuid.Nil { - user = uuid.NewV5(user, userId) - } - switch flow { - case "", "xtls-rprx-vision": - default: - return nil, E.New("unsupported flow: " + flow) - } - return &Client{user, flow, logger}, nil -} - -func (c *Client) prepareConn(conn net.Conn, tlsConn net.Conn) (net.Conn, error) { - if c.flow == FlowVision { - protocolConn, err := NewVisionConn(conn, tlsConn, c.key, c.logger) - if err != nil { - return nil, E.Cause(err, "initialize vision") - } - conn = protocolConn - } - return conn, nil -} - -func (c *Client) DialConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error) { - remoteConn := NewConn(conn, c.key, vmess.CommandTCP, destination, c.flow) - protocolConn, err := c.prepareConn(remoteConn, conn) - if err != nil { - return nil, err - } - return protocolConn, common.Error(remoteConn.Write(nil)) -} - -func (c *Client) DialEarlyConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error) { - return c.prepareConn(NewConn(conn, c.key, vmess.CommandTCP, destination, c.flow), conn) -} - -func (c *Client) DialPacketConn(conn net.Conn, destination M.Socksaddr) (*PacketConn, error) { - serverConn := &PacketConn{Conn: conn, key: c.key, destination: destination, flow: c.flow} - return serverConn, common.Error(serverConn.Write(nil)) -} - -func (c *Client) DialEarlyPacketConn(conn net.Conn, destination M.Socksaddr) (*PacketConn, error) { - return &PacketConn{Conn: conn, key: c.key, destination: destination, flow: c.flow}, nil -} - -func (c *Client) DialXUDPPacketConn(conn net.Conn, destination M.Socksaddr) (vmess.PacketConn, error) { - remoteConn := NewConn(conn, c.key, vmess.CommandTCP, destination, c.flow) - protocolConn, err := c.prepareConn(remoteConn, conn) - if err != nil { - return nil, err - } - return vmess.NewXUDPConn(protocolConn, destination), common.Error(remoteConn.Write(nil)) -} - -func (c *Client) DialEarlyXUDPPacketConn(conn net.Conn, destination M.Socksaddr) (vmess.PacketConn, error) { - remoteConn := NewConn(conn, c.key, vmess.CommandMux, destination, c.flow) - protocolConn, err := c.prepareConn(remoteConn, conn) - if err != nil { - return nil, err - } - return vmess.NewXUDPConn(protocolConn, destination), common.Error(remoteConn.Write(nil)) -} - -var ( - _ N.EarlyConn = (*Conn)(nil) - _ N.VectorisedWriter = (*Conn)(nil) -) - -type Conn struct { - N.ExtendedConn - writer N.VectorisedWriter - request Request - requestWritten bool - responseRead bool -} - -func NewConn(conn net.Conn, uuid [16]byte, command byte, destination M.Socksaddr, flow string) *Conn { - return &Conn{ - ExtendedConn: bufio.NewExtendedConn(conn), - writer: bufio.NewVectorisedWriter(conn), - request: Request{ - UUID: uuid, - Command: command, - Destination: destination, - Flow: flow, - }, - } -} - -func (c *Conn) Read(b []byte) (n int, err error) { - if !c.responseRead { - err = ReadResponse(c.ExtendedConn) - if err != nil { - return - } - c.responseRead = true - } - return c.ExtendedConn.Read(b) -} - -func (c *Conn) ReadBuffer(buffer *buf.Buffer) error { - if !c.responseRead { - err := ReadResponse(c.ExtendedConn) - if err != nil { - return err - } - c.responseRead = true - } - return c.ExtendedConn.ReadBuffer(buffer) -} - -func (c *Conn) Write(b []byte) (n int, err error) { - if !c.requestWritten { - err = WriteRequest(c.ExtendedConn, c.request, b) - if err == nil { - n = len(b) - } - c.requestWritten = true - return - } - return c.ExtendedConn.Write(b) -} - -func (c *Conn) WriteBuffer(buffer *buf.Buffer) error { - if !c.requestWritten { - err := EncodeRequest(c.request, buf.With(buffer.ExtendHeader(RequestLen(c.request)))) - if err != nil { - return err - } - c.requestWritten = true - } - return c.ExtendedConn.WriteBuffer(buffer) -} - -func (c *Conn) WriteVectorised(buffers []*buf.Buffer) error { - if !c.requestWritten { - buffer := buf.NewSize(RequestLen(c.request)) - err := EncodeRequest(c.request, buffer) - if err != nil { - buffer.Release() - return err - } - c.requestWritten = true - return c.writer.WriteVectorised(append([]*buf.Buffer{buffer}, buffers...)) - } - return c.writer.WriteVectorised(buffers) -} - -func (c *Conn) ReaderReplaceable() bool { - return c.responseRead -} - -func (c *Conn) WriterReplaceable() bool { - return c.requestWritten -} - -func (c *Conn) NeedHandshake() bool { - return !c.requestWritten -} - -func (c *Conn) FrontHeadroom() int { - if c.requestWritten { - return 0 - } - return RequestLen(c.request) -} - -func (c *Conn) Upstream() any { - return c.ExtendedConn -} - -type PacketConn struct { - net.Conn - access sync.Mutex - key [16]byte - destination M.Socksaddr - flow string - requestWritten bool - responseRead bool -} - -func (c *PacketConn) Read(b []byte) (n int, err error) { - if !c.responseRead { - err = ReadResponse(c.Conn) - if err != nil { - return - } - c.responseRead = true - } - var length uint16 - err = binary.Read(c.Conn, binary.BigEndian, &length) - if err != nil { - return - } - if cap(b) < int(length) { - return 0, io.ErrShortBuffer - } - return io.ReadFull(c.Conn, b[:length]) -} - -func (c *PacketConn) Write(b []byte) (n int, err error) { - if !c.requestWritten { - c.access.Lock() - if c.requestWritten { - c.access.Unlock() - } else { - err = WritePacketRequest(c.Conn, Request{c.key, vmess.CommandUDP, c.destination, c.flow}, nil) - if err == nil { - n = len(b) - } - c.requestWritten = true - c.access.Unlock() - } - } - err = binary.Write(c.Conn, binary.BigEndian, uint16(len(b))) - if err != nil { - return - } - return c.Conn.Write(b) -} - -func (c *PacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error { - defer buffer.Release() - dataLen := buffer.Len() - binary.BigEndian.PutUint16(buffer.ExtendHeader(2), uint16(dataLen)) - if !c.requestWritten { - c.access.Lock() - if c.requestWritten { - c.access.Unlock() - } else { - err := WritePacketRequest(c.Conn, Request{c.key, vmess.CommandUDP, c.destination, c.flow}, buffer.Bytes()) - c.requestWritten = true - c.access.Unlock() - return err - } - } - return common.Error(c.Conn.Write(buffer.Bytes())) -} - -func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { - n, err = c.Read(p) - if err != nil { - return - } - if c.destination.IsFqdn() { - addr = c.destination - } else { - addr = c.destination.UDPAddr() - } - return -} - -func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { - return c.Write(p) -} - -func (c *PacketConn) FrontHeadroom() int { - return 2 -} - -func (c *PacketConn) NeedAdditionalReadDeadline() bool { - return true -} - -func (c *PacketConn) Upstream() any { - return c.Conn -} diff --git a/sing-box/transport/vless/constant.go b/sing-box/transport/vless/constant.go deleted file mode 100644 index fb27af5615..0000000000 --- a/sing-box/transport/vless/constant.go +++ /dev/null @@ -1,40 +0,0 @@ -package vless - -import ( - "bytes" - - "github.com/sagernet/sing/common/buf" -) - -var ( - tls13SupportedVersions = []byte{0x00, 0x2b, 0x00, 0x02, 0x03, 0x04} - tlsClientHandShakeStart = []byte{0x16, 0x03} - tlsServerHandShakeStart = []byte{0x16, 0x03, 0x03} - tlsApplicationDataStart = []byte{0x17, 0x03, 0x03} -) - -const ( - commandPaddingContinue byte = iota - commandPaddingEnd - commandPaddingDirect -) - -var tls13CipherSuiteDic = map[uint16]string{ - 0x1301: "TLS_AES_128_GCM_SHA256", - 0x1302: "TLS_AES_256_GCM_SHA384", - 0x1303: "TLS_CHACHA20_POLY1305_SHA256", - 0x1304: "TLS_AES_128_CCM_SHA256", - 0x1305: "TLS_AES_128_CCM_8_SHA256", -} - -func reshapeBuffer(b []byte) []*buf.Buffer { - const bufferLimit = 8192 - 21 - if len(b) < bufferLimit { - return []*buf.Buffer{buf.As(b)} - } - index := int32(bytes.LastIndex(b, tlsApplicationDataStart)) - if index <= 0 { - index = 8192 / 2 - } - return []*buf.Buffer{buf.As(b[:index]), buf.As(b[index:])} -} diff --git a/sing-box/transport/vless/protocol.go b/sing-box/transport/vless/protocol.go deleted file mode 100644 index 08a6793c07..0000000000 --- a/sing-box/transport/vless/protocol.go +++ /dev/null @@ -1,303 +0,0 @@ -package vless - -import ( - "bytes" - "encoding/binary" - "io" - - "github.com/sagernet/sing-vmess" - "github.com/sagernet/sing/common" - "github.com/sagernet/sing/common/buf" - E "github.com/sagernet/sing/common/exceptions" - M "github.com/sagernet/sing/common/metadata" - "github.com/sagernet/sing/common/rw" - "github.com/sagernet/sing/common/varbin" -) - -const ( - Version = 0 - FlowVision = "xtls-rprx-vision" -) - -type Request struct { - UUID [16]byte - Command byte - Destination M.Socksaddr - Flow string -} - -func ReadRequest(reader io.Reader) (*Request, error) { - var request Request - - var version uint8 - err := binary.Read(reader, binary.BigEndian, &version) - if err != nil { - return nil, err - } - if version != Version { - return nil, E.New("unknown version: ", version) - } - - _, err = io.ReadFull(reader, request.UUID[:]) - if err != nil { - return nil, err - } - - var addonsLen uint8 - err = binary.Read(reader, binary.BigEndian, &addonsLen) - if err != nil { - return nil, err - } - - if addonsLen > 0 { - addonsBytes := make([]byte, addonsLen) - _, err = io.ReadFull(reader, addonsBytes) - if err != nil { - return nil, err - } - - addons, err := readAddons(bytes.NewReader(addonsBytes)) - if err != nil { - return nil, err - } - request.Flow = addons.Flow - } - - err = binary.Read(reader, binary.BigEndian, &request.Command) - if err != nil { - return nil, err - } - - if request.Command != vmess.CommandMux { - request.Destination, err = vmess.AddressSerializer.ReadAddrPort(reader) - if err != nil { - return nil, err - } - } - - return &request, nil -} - -type Addons struct { - Flow string - Seed string -} - -func readAddons(reader varbin.Reader) (*Addons, error) { - protoHeader, err := reader.ReadByte() - if err != nil { - return nil, err - } - if protoHeader != 10 { - return nil, E.New("unknown protobuf message header: ", protoHeader) - } - - var addons Addons - - flowLen, err := binary.ReadUvarint(reader) - if err != nil { - if err == io.EOF { - return &addons, nil - } - return nil, err - } - flowBytes := make([]byte, flowLen) - _, err = io.ReadFull(reader, flowBytes) - if err != nil { - return nil, err - } - addons.Flow = string(flowBytes) - - seedLen, err := binary.ReadUvarint(reader) - if err != nil { - if err == io.EOF { - return &addons, nil - } - return nil, err - } - seedBytes := make([]byte, seedLen) - _, err = io.ReadFull(reader, seedBytes) - if err != nil { - return nil, err - } - addons.Seed = string(seedBytes) - - return &addons, nil -} - -func WriteRequest(writer io.Writer, request Request, payload []byte) error { - var requestLen int - requestLen += 1 // version - requestLen += 16 // uuid - requestLen += 1 // protobuf length - - var addonsLen int - if request.Flow != "" { - addonsLen += 1 // protobuf header - addonsLen += varbin.UvarintLen(uint64(len(request.Flow))) - addonsLen += len(request.Flow) - requestLen += addonsLen - } - requestLen += 1 // command - if request.Command != vmess.CommandMux { - requestLen += vmess.AddressSerializer.AddrPortLen(request.Destination) - } - requestLen += len(payload) - buffer := buf.NewSize(requestLen) - defer buffer.Release() - common.Must( - buffer.WriteByte(Version), - common.Error(buffer.Write(request.UUID[:])), - buffer.WriteByte(byte(addonsLen)), - ) - if addonsLen > 0 { - common.Must(buffer.WriteByte(10)) - binary.PutUvarint(buffer.Extend(varbin.UvarintLen(uint64(len(request.Flow)))), uint64(len(request.Flow))) - common.Must(common.Error(buffer.WriteString(request.Flow))) - } - common.Must( - buffer.WriteByte(request.Command), - ) - - if request.Command != vmess.CommandMux { - err := vmess.AddressSerializer.WriteAddrPort(buffer, request.Destination) - if err != nil { - return err - } - } - - common.Must1(buffer.Write(payload)) - return common.Error(writer.Write(buffer.Bytes())) -} - -func EncodeRequest(request Request, buffer *buf.Buffer) error { - var requestLen int - requestLen += 1 // version - requestLen += 16 // uuid - requestLen += 1 // protobuf length - - var addonsLen int - if request.Flow != "" { - addonsLen += 1 // protobuf header - addonsLen += varbin.UvarintLen(uint64(len(request.Flow))) - addonsLen += len(request.Flow) - requestLen += addonsLen - } - requestLen += 1 // command - if request.Command != vmess.CommandMux { - requestLen += vmess.AddressSerializer.AddrPortLen(request.Destination) - } - common.Must( - buffer.WriteByte(Version), - common.Error(buffer.Write(request.UUID[:])), - buffer.WriteByte(byte(addonsLen)), - ) - if addonsLen > 0 { - common.Must(buffer.WriteByte(10)) - binary.PutUvarint(buffer.Extend(varbin.UvarintLen(uint64(len(request.Flow)))), uint64(len(request.Flow))) - common.Must(common.Error(buffer.WriteString(request.Flow))) - } - common.Must( - buffer.WriteByte(request.Command), - ) - - if request.Command != vmess.CommandMux { - err := vmess.AddressSerializer.WriteAddrPort(buffer, request.Destination) - if err != nil { - return err - } - } - return nil -} - -func RequestLen(request Request) int { - var requestLen int - requestLen += 1 // version - requestLen += 16 // uuid - requestLen += 1 // protobuf length - - var addonsLen int - if request.Flow != "" { - addonsLen += 1 // protobuf header - addonsLen += varbin.UvarintLen(uint64(len(request.Flow))) - addonsLen += len(request.Flow) - requestLen += addonsLen - } - requestLen += 1 // command - if request.Command != vmess.CommandMux { - requestLen += vmess.AddressSerializer.AddrPortLen(request.Destination) - } - return requestLen -} - -func WritePacketRequest(writer io.Writer, request Request, payload []byte) error { - var requestLen int - requestLen += 1 // version - requestLen += 16 // uuid - requestLen += 1 // protobuf length - var addonsLen int - /*if request.Flow != "" { - addonsLen += 1 // protobuf header - addonsLen += varbin.UvarintLen(uint64(len(request.Flow))) - addonsLen += len(request.Flow) - requestLen += addonsLen - }*/ - requestLen += 1 // command - requestLen += vmess.AddressSerializer.AddrPortLen(request.Destination) - if len(payload) > 0 { - requestLen += 2 - requestLen += len(payload) - } - buffer := buf.NewSize(requestLen) - defer buffer.Release() - common.Must( - buffer.WriteByte(Version), - common.Error(buffer.Write(request.UUID[:])), - buffer.WriteByte(byte(addonsLen)), - ) - - if addonsLen > 0 { - common.Must(buffer.WriteByte(10)) - binary.PutUvarint(buffer.Extend(varbin.UvarintLen(uint64(len(request.Flow)))), uint64(len(request.Flow))) - common.Must(common.Error(buffer.WriteString(request.Flow))) - } - - common.Must(buffer.WriteByte(vmess.CommandUDP)) - - err := vmess.AddressSerializer.WriteAddrPort(buffer, request.Destination) - if err != nil { - return err - } - - if len(payload) > 0 { - common.Must( - binary.Write(buffer, binary.BigEndian, uint16(len(payload))), - common.Error(buffer.Write(payload)), - ) - } - - return common.Error(writer.Write(buffer.Bytes())) -} - -func ReadResponse(reader io.Reader) error { - var version byte - err := binary.Read(reader, binary.BigEndian, &version) - if err != nil { - return err - } - if version != Version { - return E.New("unknown version: ", version) - } - var protobufLength byte - err = binary.Read(reader, binary.BigEndian, &protobufLength) - if err != nil { - return err - } - if protobufLength > 0 { - err = rw.SkipN(reader, int(protobufLength)) - if err != nil { - return err - } - } - return nil -} diff --git a/sing-box/transport/vless/service.go b/sing-box/transport/vless/service.go deleted file mode 100644 index 7b69020279..0000000000 --- a/sing-box/transport/vless/service.go +++ /dev/null @@ -1,260 +0,0 @@ -package vless - -import ( - "context" - "encoding/binary" - "io" - "net" - - "github.com/sagernet/sing-vmess" - "github.com/sagernet/sing/common/auth" - "github.com/sagernet/sing/common/buf" - "github.com/sagernet/sing/common/bufio" - E "github.com/sagernet/sing/common/exceptions" - "github.com/sagernet/sing/common/logger" - M "github.com/sagernet/sing/common/metadata" - N "github.com/sagernet/sing/common/network" - - "github.com/gofrs/uuid/v5" -) - -type Service[T comparable] struct { - userMap map[[16]byte]T - userFlow map[T]string - logger logger.Logger - handler Handler -} - -type Handler interface { - N.TCPConnectionHandler - N.UDPConnectionHandler - E.Handler -} - -func NewService[T comparable](logger logger.Logger, handler Handler) *Service[T] { - return &Service[T]{ - logger: logger, - handler: handler, - } -} - -func (s *Service[T]) UpdateUsers(userList []T, userUUIDList []string, userFlowList []string) { - userMap := make(map[[16]byte]T) - userFlowMap := make(map[T]string) - for i, userName := range userList { - userID := uuid.FromStringOrNil(userUUIDList[i]) - if userID == uuid.Nil { - userID = uuid.NewV5(uuid.Nil, userUUIDList[i]) - } - userMap[userID] = userName - userFlowMap[userName] = userFlowList[i] - } - s.userMap = userMap - s.userFlow = userFlowMap -} - -var _ N.TCPConnectionHandler = (*Service[int])(nil) - -func (s *Service[T]) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error { - request, err := ReadRequest(conn) - if err != nil { - return err - } - user, loaded := s.userMap[request.UUID] - if !loaded { - return E.New("unknown UUID: ", uuid.FromBytesOrNil(request.UUID[:])) - } - ctx = auth.ContextWithUser(ctx, user) - metadata.Destination = request.Destination - - userFlow := s.userFlow[user] - if request.Flow == FlowVision && request.Command == vmess.NetworkUDP { - return E.New(FlowVision, " flow does not support UDP") - } else if request.Flow != userFlow { - return E.New("flow mismatch: expected ", flowName(userFlow), ", but got ", flowName(request.Flow)) - } - - if request.Command == vmess.CommandUDP { - return s.handler.NewPacketConnection(ctx, &serverPacketConn{ExtendedConn: bufio.NewExtendedConn(conn), destination: request.Destination}, metadata) - } - responseConn := &serverConn{ExtendedConn: bufio.NewExtendedConn(conn), writer: bufio.NewVectorisedWriter(conn)} - switch userFlow { - case FlowVision: - conn, err = NewVisionConn(responseConn, conn, request.UUID, s.logger) - if err != nil { - return E.Cause(err, "initialize vision") - } - case "": - conn = responseConn - default: - return E.New("unknown flow: ", userFlow) - } - switch request.Command { - case vmess.CommandTCP: - return s.handler.NewConnection(ctx, conn, metadata) - case vmess.CommandMux: - return vmess.HandleMuxConnection(ctx, conn, s.handler) - default: - return E.New("unknown command: ", request.Command) - } -} - -func flowName(value string) string { - if value == "" { - return "none" - } - return value -} - -var _ N.VectorisedWriter = (*serverConn)(nil) - -type serverConn struct { - N.ExtendedConn - writer N.VectorisedWriter - responseWritten bool -} - -func (c *serverConn) Read(b []byte) (n int, err error) { - return c.ExtendedConn.Read(b) -} - -func (c *serverConn) Write(b []byte) (n int, err error) { - if !c.responseWritten { - _, err = bufio.WriteVectorised(c.writer, [][]byte{{Version, 0}, b}) - if err == nil { - n = len(b) - } - c.responseWritten = true - return - } - return c.ExtendedConn.Write(b) -} - -func (c *serverConn) WriteBuffer(buffer *buf.Buffer) error { - if !c.responseWritten { - header := buffer.ExtendHeader(2) - header[0] = Version - header[1] = 0 - c.responseWritten = true - } - return c.ExtendedConn.WriteBuffer(buffer) -} - -func (c *serverConn) WriteVectorised(buffers []*buf.Buffer) error { - if !c.responseWritten { - err := c.writer.WriteVectorised(append([]*buf.Buffer{buf.As([]byte{Version, 0})}, buffers...)) - c.responseWritten = true - return err - } - return c.writer.WriteVectorised(buffers) -} - -func (c *serverConn) NeedAdditionalReadDeadline() bool { - return true -} - -func (c *serverConn) FrontHeadroom() int { - if c.responseWritten { - return 0 - } - return 2 -} - -func (c *serverConn) ReaderReplaceable() bool { - return true -} - -func (c *serverConn) WriterReplaceable() bool { - return c.responseWritten -} - -func (c *serverConn) Upstream() any { - return c.ExtendedConn -} - -type serverPacketConn struct { - N.ExtendedConn - responseWriter io.Writer - responseWritten bool - destination M.Socksaddr -} - -func (c *serverPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { - n, err = c.ExtendedConn.Read(p) - if err != nil { - return - } - if c.destination.IsFqdn() { - addr = c.destination - } else { - addr = c.destination.UDPAddr() - } - return -} - -func (c *serverPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { - if !c.responseWritten { - if c.responseWriter == nil { - var packetLen [2]byte - binary.BigEndian.PutUint16(packetLen[:], uint16(len(p))) - _, err = bufio.WriteVectorised(bufio.NewVectorisedWriter(c.ExtendedConn), [][]byte{{Version, 0}, packetLen[:], p}) - if err == nil { - n = len(p) - } - c.responseWritten = true - return - } else { - _, err = c.responseWriter.Write([]byte{Version, 0}) - if err != nil { - return - } - c.responseWritten = true - } - } - return c.ExtendedConn.Write(p) -} - -func (c *serverPacketConn) ReadPacket(buffer *buf.Buffer) (destination M.Socksaddr, err error) { - var packetLen uint16 - err = binary.Read(c.ExtendedConn, binary.BigEndian, &packetLen) - if err != nil { - return - } - - _, err = buffer.ReadFullFrom(c.ExtendedConn, int(packetLen)) - if err != nil { - return - } - - destination = c.destination - return -} - -func (c *serverPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error { - if !c.responseWritten { - if c.responseWriter == nil { - var packetLen [2]byte - binary.BigEndian.PutUint16(packetLen[:], uint16(buffer.Len())) - err := bufio.NewVectorisedWriter(c.ExtendedConn).WriteVectorised([]*buf.Buffer{buf.As([]byte{Version, 0}), buf.As(packetLen[:]), buffer}) - c.responseWritten = true - return err - } else { - _, err := c.responseWriter.Write([]byte{Version, 0}) - if err != nil { - return err - } - c.responseWritten = true - } - } - packetLen := buffer.Len() - binary.BigEndian.PutUint16(buffer.ExtendHeader(2), uint16(packetLen)) - return c.ExtendedConn.WriteBuffer(buffer) -} - -func (c *serverPacketConn) FrontHeadroom() int { - return 2 -} - -func (c *serverPacketConn) Upstream() any { - return c.ExtendedConn -} diff --git a/sing-box/transport/vless/vision.go b/sing-box/transport/vless/vision.go deleted file mode 100644 index 5ee2d0dff5..0000000000 --- a/sing-box/transport/vless/vision.go +++ /dev/null @@ -1,380 +0,0 @@ -package vless - -import ( - "bytes" - "crypto/rand" - "crypto/tls" - "io" - "math/big" - "net" - "reflect" - "time" - "unsafe" - - C "github.com/sagernet/sing-box/constant" - "github.com/sagernet/sing/common" - "github.com/sagernet/sing/common/buf" - "github.com/sagernet/sing/common/bufio" - E "github.com/sagernet/sing/common/exceptions" - "github.com/sagernet/sing/common/logger" - N "github.com/sagernet/sing/common/network" -) - -var tlsRegistry []func(conn net.Conn) (loaded bool, netConn net.Conn, reflectType reflect.Type, reflectPointer uintptr) - -func init() { - tlsRegistry = append(tlsRegistry, func(conn net.Conn) (loaded bool, netConn net.Conn, reflectType reflect.Type, reflectPointer uintptr) { - tlsConn, loaded := common.Cast[*tls.Conn](conn) - if !loaded { - return - } - return true, tlsConn.NetConn(), reflect.TypeOf(tlsConn).Elem(), uintptr(unsafe.Pointer(tlsConn)) - }) -} - -const xrayChunkSize = 8192 - -type VisionConn struct { - net.Conn - reader *bufio.ChunkReader - writer N.VectorisedWriter - input *bytes.Reader - rawInput *bytes.Buffer - netConn net.Conn - logger logger.Logger - - userUUID [16]byte - isTLS bool - numberOfPacketToFilter int - isTLS12orAbove bool - remainingServerHello int32 - cipher uint16 - enableXTLS bool - isPadding bool - directWrite bool - writeUUID bool - withinPaddingBuffers bool - remainingContent int - remainingPadding int - currentCommand byte - directRead bool - remainingReader io.Reader -} - -func NewVisionConn(conn net.Conn, tlsConn net.Conn, userUUID [16]byte, logger logger.Logger) (*VisionConn, error) { - var ( - loaded bool - reflectType reflect.Type - reflectPointer uintptr - netConn net.Conn - ) - for _, tlsCreator := range tlsRegistry { - loaded, netConn, reflectType, reflectPointer = tlsCreator(tlsConn) - if loaded { - break - } - } - if !loaded { - return nil, C.ErrTLSRequired - } - input, _ := reflectType.FieldByName("input") - rawInput, _ := reflectType.FieldByName("rawInput") - return &VisionConn{ - Conn: conn, - reader: bufio.NewChunkReader(conn, xrayChunkSize), - writer: bufio.NewVectorisedWriter(conn), - input: (*bytes.Reader)(unsafe.Pointer(reflectPointer + input.Offset)), - rawInput: (*bytes.Buffer)(unsafe.Pointer(reflectPointer + rawInput.Offset)), - netConn: netConn, - logger: logger, - - userUUID: userUUID, - numberOfPacketToFilter: 8, - remainingServerHello: -1, - isPadding: true, - writeUUID: true, - withinPaddingBuffers: true, - remainingContent: -1, - remainingPadding: -1, - }, nil -} - -func (c *VisionConn) Read(p []byte) (n int, err error) { - if c.remainingReader != nil { - n, err = c.remainingReader.Read(p) - if err == io.EOF { - err = nil - c.remainingReader = nil - } - if n > 0 { - return - } - } - if c.directRead { - return c.netConn.Read(p) - } - var bufferBytes []byte - var chunkBuffer *buf.Buffer - if len(p) > xrayChunkSize { - n, err = c.Conn.Read(p) - if err != nil { - return - } - bufferBytes = p[:n] - } else { - chunkBuffer, err = c.reader.ReadChunk() - if err != nil { - return 0, err - } - bufferBytes = chunkBuffer.Bytes() - } - if c.withinPaddingBuffers || c.numberOfPacketToFilter > 0 { - buffers := c.unPadding(bufferBytes) - if chunkBuffer != nil { - buffers = common.Map(buffers, func(it *buf.Buffer) *buf.Buffer { - return it.ToOwned() - }) - chunkBuffer.Reset() - } - if c.remainingContent == 0 && c.remainingPadding == 0 { - if c.currentCommand == commandPaddingEnd { - c.withinPaddingBuffers = false - c.remainingContent = -1 - c.remainingPadding = -1 - } else if c.currentCommand == commandPaddingDirect { - c.withinPaddingBuffers = false - c.directRead = true - - inputBuffer, err := io.ReadAll(c.input) - if err != nil { - return 0, err - } - buffers = append(buffers, buf.As(inputBuffer)) - - rawInputBuffer, err := io.ReadAll(c.rawInput) - if err != nil { - return 0, err - } - - buffers = append(buffers, buf.As(rawInputBuffer)) - - c.logger.Trace("XtlsRead readV") - } else if c.currentCommand == commandPaddingContinue { - c.withinPaddingBuffers = true - } else { - return 0, E.New("unknown command ", c.currentCommand) - } - } else if c.remainingContent > 0 || c.remainingPadding > 0 { - c.withinPaddingBuffers = true - } else { - c.withinPaddingBuffers = false - } - if c.numberOfPacketToFilter > 0 { - c.filterTLS(buf.ToSliceMulti(buffers)) - } - c.remainingReader = io.MultiReader(common.Map(buffers, func(it *buf.Buffer) io.Reader { return it })...) - return c.Read(p) - } else { - if c.numberOfPacketToFilter > 0 { - c.filterTLS([][]byte{bufferBytes}) - } - if chunkBuffer != nil { - n = copy(p, bufferBytes) - chunkBuffer.Advance(n) - } - return - } -} - -func (c *VisionConn) Write(p []byte) (n int, err error) { - if c.numberOfPacketToFilter > 0 { - c.filterTLS([][]byte{p}) - } - if c.isPadding { - inputLen := len(p) - buffers := reshapeBuffer(p) - var specIndex int - for i, buffer := range buffers { - if c.isTLS && buffer.Len() > 6 && bytes.Equal(tlsApplicationDataStart, buffer.To(3)) { - var command byte = commandPaddingEnd - if c.enableXTLS { - c.directWrite = true - specIndex = i - command = commandPaddingDirect - } - c.isPadding = false - buffers[i] = c.padding(buffer, command) - break - } else if !c.isTLS12orAbove && c.numberOfPacketToFilter <= 1 { - c.isPadding = false - buffers[i] = c.padding(buffer, commandPaddingEnd) - break - } - buffers[i] = c.padding(buffer, commandPaddingContinue) - } - if c.directWrite { - encryptedBuffer := buffers[:specIndex+1] - err = c.writer.WriteVectorised(encryptedBuffer) - if err != nil { - return - } - buffers = buffers[specIndex+1:] - c.writer = bufio.NewVectorisedWriter(c.netConn) - c.logger.Trace("XtlsWrite writeV ", specIndex, " ", buf.LenMulti(encryptedBuffer), " ", len(buffers)) - time.Sleep(5 * time.Millisecond) // wtf - } - err = c.writer.WriteVectorised(buffers) - if err == nil { - n = inputLen - } - return - } - if c.directWrite { - return c.netConn.Write(p) - } else { - return c.Conn.Write(p) - } -} - -func (c *VisionConn) filterTLS(buffers [][]byte) { - for _, buffer := range buffers { - c.numberOfPacketToFilter-- - if len(buffer) > 6 { - if buffer[0] == 22 && buffer[1] == 3 && buffer[2] == 3 { - c.isTLS = true - if buffer[5] == 2 { - c.isTLS12orAbove = true - c.remainingServerHello = (int32(buffer[3])<<8 | int32(buffer[4])) + 5 - if len(buffer) >= 79 && c.remainingServerHello >= 79 { - sessionIdLen := int32(buffer[43]) - cipherSuite := buffer[43+sessionIdLen+1 : 43+sessionIdLen+3] - c.cipher = uint16(cipherSuite[0])<<8 | uint16(cipherSuite[1]) - } else { - c.logger.Trace("XtlsFilterTls short server hello, tls 1.2 or older? ", len(buffer), " ", c.remainingServerHello) - } - } - } else if bytes.Equal(tlsClientHandShakeStart, buffer[:2]) && buffer[5] == 1 { - c.isTLS = true - c.logger.Trace("XtlsFilterTls found tls client hello! ", len(buffer)) - } - } - if c.remainingServerHello > 0 { - end := int(c.remainingServerHello) - if end > len(buffer) { - end = len(buffer) - } - c.remainingServerHello -= int32(end) - if bytes.Contains(buffer[:end], tls13SupportedVersions) { - cipher, ok := tls13CipherSuiteDic[c.cipher] - if ok && cipher != "TLS_AES_128_CCM_8_SHA256" { - c.enableXTLS = true - } - c.logger.Trace("XtlsFilterTls found tls 1.3! ", len(buffer), " ", c.cipher, " ", c.enableXTLS) - c.numberOfPacketToFilter = 0 - return - } else if c.remainingServerHello == 0 { - c.logger.Trace("XtlsFilterTls found tls 1.2! ", len(buffer)) - c.numberOfPacketToFilter = 0 - return - } - } - if c.numberOfPacketToFilter == 0 { - c.logger.Trace("XtlsFilterTls stop filtering ", len(buffer)) - } - } -} - -func (c *VisionConn) padding(buffer *buf.Buffer, command byte) *buf.Buffer { - contentLen := 0 - paddingLen := 0 - if buffer != nil { - contentLen = buffer.Len() - } - if contentLen < 900 && c.isTLS { - l, _ := rand.Int(rand.Reader, big.NewInt(500)) - paddingLen = int(l.Int64()) + 900 - contentLen - } else { - l, _ := rand.Int(rand.Reader, big.NewInt(256)) - paddingLen = int(l.Int64()) - } - var bufferLen int - if c.writeUUID { - bufferLen += 16 - } - bufferLen += 5 - if buffer != nil { - bufferLen += buffer.Len() - } - bufferLen += paddingLen - newBuffer := buf.NewSize(bufferLen) - if c.writeUUID { - common.Must1(newBuffer.Write(c.userUUID[:])) - c.writeUUID = false - } - common.Must1(newBuffer.Write([]byte{command, byte(contentLen >> 8), byte(contentLen), byte(paddingLen >> 8), byte(paddingLen)})) - if buffer != nil { - common.Must1(newBuffer.Write(buffer.Bytes())) - buffer.Release() - } - newBuffer.Extend(paddingLen) - c.logger.Trace("XtlsPadding ", contentLen, " ", paddingLen, " ", command) - return newBuffer -} - -func (c *VisionConn) unPadding(buffer []byte) []*buf.Buffer { - var bufferIndex int - if c.remainingContent == -1 && c.remainingPadding == -1 { - if len(buffer) >= 21 && bytes.Equal(c.userUUID[:], buffer[:16]) { - bufferIndex = 16 - c.remainingContent = 0 - c.remainingPadding = 0 - c.currentCommand = 0 - } - } - if c.remainingContent == -1 && c.remainingPadding == -1 { - return []*buf.Buffer{buf.As(buffer)} - } - var buffers []*buf.Buffer - for bufferIndex < len(buffer) { - if c.remainingContent <= 0 && c.remainingPadding <= 0 { - if c.currentCommand == 1 { - buffers = append(buffers, buf.As(buffer[bufferIndex:])) - break - } else { - paddingInfo := buffer[bufferIndex : bufferIndex+5] - c.currentCommand = paddingInfo[0] - c.remainingContent = int(paddingInfo[1])<<8 | int(paddingInfo[2]) - c.remainingPadding = int(paddingInfo[3])<<8 | int(paddingInfo[4]) - bufferIndex += 5 - c.logger.Trace("Xtls Unpadding new block ", bufferIndex, " ", c.remainingContent, " padding ", c.remainingPadding, " ", c.currentCommand) - } - } else if c.remainingContent > 0 { - end := c.remainingContent - if end > len(buffer)-bufferIndex { - end = len(buffer) - bufferIndex - } - buffers = append(buffers, buf.As(buffer[bufferIndex:bufferIndex+end])) - c.remainingContent -= end - bufferIndex += end - } else { - end := c.remainingPadding - if end > len(buffer)-bufferIndex { - end = len(buffer) - bufferIndex - } - c.remainingPadding -= end - bufferIndex += end - } - if bufferIndex == len(buffer) { - break - } - } - return buffers -} - -func (c *VisionConn) NeedAdditionalReadDeadline() bool { - return true -} - -func (c *VisionConn) Upstream() any { - return c.Conn -} diff --git a/sing-box/transport/vless/vision_reality.go b/sing-box/transport/vless/vision_reality.go deleted file mode 100644 index fa04c42222..0000000000 --- a/sing-box/transport/vless/vision_reality.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build with_reality_server - -package vless - -import ( - "net" - "reflect" - "unsafe" - - "github.com/sagernet/reality" - "github.com/sagernet/sing/common" -) - -func init() { - tlsRegistry = append(tlsRegistry, func(conn net.Conn) (loaded bool, netConn net.Conn, reflectType reflect.Type, reflectPointer uintptr) { - tlsConn, loaded := common.Cast[*reality.Conn](conn) - if !loaded { - return - } - return true, tlsConn.NetConn(), reflect.TypeOf(tlsConn).Elem(), uintptr(unsafe.Pointer(tlsConn)) - }) -} diff --git a/sing-box/transport/vless/vision_utls.go b/sing-box/transport/vless/vision_utls.go deleted file mode 100644 index e2469c881c..0000000000 --- a/sing-box/transport/vless/vision_utls.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build with_utls - -package vless - -import ( - "net" - "reflect" - "unsafe" - - "github.com/sagernet/sing/common" - utls "github.com/sagernet/utls" -) - -func init() { - tlsRegistry = append(tlsRegistry, func(conn net.Conn) (loaded bool, netConn net.Conn, reflectType reflect.Type, reflectPointer uintptr) { - tlsConn, loaded := common.Cast[*utls.UConn](conn) - if !loaded { - return - } - return true, tlsConn.NetConn(), reflect.TypeOf(tlsConn.Conn).Elem(), uintptr(unsafe.Pointer(tlsConn.Conn)) - }) -} diff --git a/yass/README.md b/yass/README.md index 0393a8e0ae..069b1dbd03 100644 --- a/yass/README.md +++ b/yass/README.md @@ -80,11 +80,6 @@ These ca certificates are provided in both builtin ca bundle support and supplem ### Supplementary Support for DigiCert Global Root G2 ca which is missing on some machines These ca certificates are provided in both builtin ca bundle support and supplementary ca bundle support (bundled). -### Specify Rate Limit (Command Line only) -Pass `--limit_rate rate` to command line. -Limits the _rate_ of response transmission to a client. -Uint can be `(none)`, `k` and `m`. - ### Specify TCP Congestion Algorithm (Command Line only) Pass `--congestion_algorithm algo` to command line. Specify _algo_ as TCP congestion control algorithm for underlying TCP connections (Linux only). diff --git a/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java b/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java index a6afb68770..e2aebe9e33 100644 --- a/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java +++ b/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java @@ -136,6 +136,9 @@ public class MainActivity extends AppCompatActivity { EditText dotHostEditText = findViewById(R.id.dotHostEditText); dotHostEditText.setText(String.format(getLocale(), "%s", YassUtils.getDoTHost())); + EditText limitRateEditText = findViewById(R.id.limitRateEditText); + limitRateEditText.setText(String.format(getLocale(), "%s", YassUtils.getLimitRate())); + EditText timeoutEditText = findViewById(R.id.timeoutEditText); timeoutEditText.setText(String.format(getLocale(), "%d", YassUtils.getTimeout())); @@ -180,6 +183,7 @@ public class MainActivity extends AppCompatActivity { Spinner cipherSpinner = findViewById(R.id.cipherSpinner); EditText dohUrlEditText = findViewById(R.id.dohUrlEditText); EditText dotHostEditText = findViewById(R.id.dotHostEditText); + EditText limitRateEditText = findViewById(R.id.limitRateEditText); EditText timeoutEditText = findViewById(R.id.timeoutEditText); return YassUtils.saveConfig(serverHostEditText.getText().toString(), @@ -190,6 +194,7 @@ public class MainActivity extends AppCompatActivity { cipherSpinner.getSelectedItemPosition(), dohUrlEditText.getText().toString(), dotHostEditText.getText().toString(), + limitRateEditText.getText().toString(), timeoutEditText.getText().toString()); } diff --git a/yass/android/yass/src/main/java/it/gui/yass/YassUtils.java b/yass/android/yass/src/main/java/it/gui/yass/YassUtils.java index 9c699f6d67..b819322200 100644 --- a/yass/android/yass/src/main/java/it/gui/yass/YassUtils.java +++ b/yass/android/yass/src/main/java/it/gui/yass/YassUtils.java @@ -20,11 +20,13 @@ public class YassUtils { public static native String getDoTHost(); + public static native String getLimitRate(); + public static native int getTimeout(); public static native String saveConfig(String serverHost, String serverSNI, String serverPort, String username, String password, int cipher, String doh_url, - String dot_host, String timeout); + String dot_host, String limit_rate, String timeout); public static native void setEnablePostQuantumKyber(boolean enable_post_quantum_kyber); } diff --git a/yass/android/yass/src/main/res/layout/activity_main.xml b/yass/android/yass/src/main/res/layout/activity_main.xml index 76ab19ef27..295133da2b 100644 --- a/yass/android/yass/src/main/res/layout/activity_main.xml +++ b/yass/android/yass/src/main/res/layout/activity_main.xml @@ -191,6 +191,28 @@ android:inputType="text" /> + + + + + + + TLS的Kyber后量子密钥协商 选项 选项 + 限制速率 \ No newline at end of file diff --git a/yass/android/yass/src/main/res/values/strings.xml b/yass/android/yass/src/main/res/values/strings.xml index 721091f03b..be5bbb0e4e 100644 --- a/yass/android/yass/src/main/res/values/strings.xml +++ b/yass/android/yass/src/main/res/values/strings.xml @@ -26,4 +26,5 @@ Kyber post-quantum key agreement for TLS Options Options + Limit Rate diff --git a/yass/harmony/entry/src/main/cpp/types/libyass/index.d.ts b/yass/harmony/entry/src/main/cpp/types/libyass/index.d.ts index b0e8f6b6f6..d5b7d76bcf 100644 --- a/yass/harmony/entry/src/main/cpp/types/libyass/index.d.ts +++ b/yass/harmony/entry/src/main/cpp/types/libyass/index.d.ts @@ -8,6 +8,7 @@ export const getCipher: () => string; export const getCipherStrings: () => string[]; export const getDoHUrl: () => string; export const getDoTHost: () => string; +export const getLimitRate: () => string; export const getTimeout: () => number; export const init: (temp_dir: string, data_dir: string) => void; export const destroy: () => void; @@ -15,4 +16,4 @@ export const startWorker: (cb: (err_msg: string, port: number) => void) => void; export const stopWorker: (cb: () => void) => void; export const saveConfig: (server_host: string, server_sni: string, server_port: string, username: string, password: string, cipher: string, doh_url: string, - dot_host: string, timeout: string) => string; + dot_host: string, limit_rate: string, timeout: string) => string; diff --git a/yass/harmony/entry/src/main/ets/pages/DetailPage.ets b/yass/harmony/entry/src/main/ets/pages/DetailPage.ets index 7eafc2b611..32f1040fd3 100644 --- a/yass/harmony/entry/src/main/ets/pages/DetailPage.ets +++ b/yass/harmony/entry/src/main/ets/pages/DetailPage.ets @@ -156,7 +156,7 @@ struct DetailPage { let err_msg = yass.saveConfig(this.dataParam.serverHost, this.dataParam.serverSNI, this.dataParam.serverPort.toString(), this.dataParam.username, this.dataParam.password, this.dataParam.cipher, this.dataParam.dohUrl, this.dataParam.dotHost, - this.dataParam.timeout.toString()); + this.dataParam.limitRate, this.dataParam.timeout.toString()); if (err_msg != '') { this.onStartFailedWithMsg(err_msg); return; @@ -218,4 +218,4 @@ struct DetailPage { */ return "0.0.0.0"; } -} \ No newline at end of file +} diff --git a/yass/harmony/entry/src/main/ets/view/DetailListComponent.ets b/yass/harmony/entry/src/main/ets/view/DetailListComponent.ets index b5aebaba21..bc4bf890f6 100644 --- a/yass/harmony/entry/src/main/ets/view/DetailListComponent.ets +++ b/yass/harmony/entry/src/main/ets/view/DetailListComponent.ets @@ -143,6 +143,22 @@ export struct DetailListComponent { } .width(CommonConstants.ROW_WIDTH_PERCENT) .height($r('app.float.list_height')) + Row() { + Text($r('app.string.limit_rate')) + .fontSize($r('app.float.name_text_size')) + .fontColor($r('app.color.text')) + .width(CommonConstants.DETAIL_INPUT_WIDTH_PERCENT) + Blank() + TextInput({text: this.dataItem.limitRate}) + .width(CommonConstants.DETAIL_INPUT_WIDTH_PERCENT) + .fontSize($r('app.float.app_info_sub_title_size')) + .fontColor($r('app.color.text_opacity')) + .onChange((value: string) => { + this.dataItem.limitRate = value; + }) + } + .width(CommonConstants.ROW_WIDTH_PERCENT) + .height($r('app.float.list_height')) Row() { Text($r('app.string.timeout')) .fontSize($r('app.float.name_text_size')) diff --git a/yass/harmony/entry/src/main/ets/viewmodel/YassDataItem.ets b/yass/harmony/entry/src/main/ets/viewmodel/YassDataItem.ets index 4a8427fcab..0c96ccd5bc 100644 --- a/yass/harmony/entry/src/main/ets/viewmodel/YassDataItem.ets +++ b/yass/harmony/entry/src/main/ets/viewmodel/YassDataItem.ets @@ -13,5 +13,6 @@ export class YassDataItem { cipher: string = ''; dohUrl: string = ''; dotHost: string = ''; + limitRate: string = ''; timeout: number = 0; -} \ No newline at end of file +} diff --git a/yass/harmony/entry/src/main/ets/viewmodel/YassViewModel.ets b/yass/harmony/entry/src/main/ets/viewmodel/YassViewModel.ets index fb286d3f73..9497499f42 100644 --- a/yass/harmony/entry/src/main/ets/viewmodel/YassViewModel.ets +++ b/yass/harmony/entry/src/main/ets/viewmodel/YassViewModel.ets @@ -18,6 +18,7 @@ class YassViewModel { yassData.cipher = yass.getCipher(); yassData.dohUrl = yass.getDoHUrl(); yassData.dotHost = yass.getDoTHost(); + yassData.limitRate = yass.getLimitRate(); yassData.timeout = yass.getTimeout(); return yassData; } @@ -25,4 +26,4 @@ class YassViewModel { let yassViewModel = new YassViewModel(); -export default yassViewModel as YassViewModel; \ No newline at end of file +export default yassViewModel as YassViewModel; diff --git a/yass/harmony/entry/src/main/resources/base/element/string.json b/yass/harmony/entry/src/main/resources/base/element/string.json index 73e64ca746..97151d195d 100644 --- a/yass/harmony/entry/src/main/resources/base/element/string.json +++ b/yass/harmony/entry/src/main/resources/base/element/string.json @@ -60,6 +60,10 @@ "name": "cipher", "value": "Cipher/Method" }, + { + "name": "limit_rate", + "value": "Limit Rate" + }, { "name": "timeout", "value": "Timeout" @@ -105,4 +109,4 @@ "value": "DNS over TLS Host" } ] -} \ No newline at end of file +} diff --git a/yass/harmony/entry/src/main/resources/en_US/element/string.json b/yass/harmony/entry/src/main/resources/en_US/element/string.json index 8993141b10..2387a4e2df 100644 --- a/yass/harmony/entry/src/main/resources/en_US/element/string.json +++ b/yass/harmony/entry/src/main/resources/en_US/element/string.json @@ -60,6 +60,10 @@ "name": "cipher", "value": "Cipher/Method" }, + { + "name": "limit_rate", + "value": "Limit Rate" + }, { "name": "timeout", "value": "Timeout" @@ -105,4 +109,4 @@ "value": "DNS over TLS Host" } ] -} \ No newline at end of file +} diff --git a/yass/harmony/entry/src/main/resources/zh_CN/element/string.json b/yass/harmony/entry/src/main/resources/zh_CN/element/string.json index 8b76593cf0..3a51cf76ef 100644 --- a/yass/harmony/entry/src/main/resources/zh_CN/element/string.json +++ b/yass/harmony/entry/src/main/resources/zh_CN/element/string.json @@ -60,6 +60,10 @@ "name": "cipher", "value": "加密方式" }, + { + "name": "limit_rate", + "value": "限制速率" + }, { "name": "timeout", "value": "超时时间" @@ -105,4 +109,4 @@ "value": "基于 TLS 的 DNS (DoT) 域名" } ] -} \ No newline at end of file +} diff --git a/yass/src/android/jni.cpp b/yass/src/android/jni.cpp index 479605d87f..57ca4dc245 100644 --- a/yass/src/android/jni.cpp +++ b/yass/src/android/jni.cpp @@ -99,6 +99,10 @@ JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_getDoTHost(JNIEnv* env, job return env->NewStringUTF(absl::GetFlag(FLAGS_dot_host).c_str()); } +JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_getLimitRate(JNIEnv* env, jobject obj) { + return env->NewStringUTF(std::string(absl::GetFlag(FLAGS_limit_rate)).c_str()); +} + JNIEXPORT jint JNICALL Java_it_gui_yass_YassUtils_getTimeout(JNIEnv* env, jobject obj) { return absl::GetFlag(FLAGS_connect_timeout); } @@ -113,6 +117,7 @@ JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_saveConfig(JNIEnv* env, jint _method_idx, jobject _doh_url, jobject _dot_host, + jobject _limit_rate, jobject _timeout) { const char* server_host_str = env->GetStringUTFChars((jstring)_server_host, nullptr); std::string server_host = server_host_str != nullptr ? server_host_str : std::string(); @@ -153,12 +158,16 @@ JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_saveConfig(JNIEnv* env, std::string dot_host = dot_host_str != nullptr ? dot_host_str : std::string(); env->ReleaseStringUTFChars((jstring)_dot_host, dot_host_str); + const char* limit_rate_str = env->GetStringUTFChars((jstring)_limit_rate, nullptr); + std::string limit_rate = limit_rate_str != nullptr ? limit_rate_str : std::string(); + env->ReleaseStringUTFChars((jstring)_limit_rate, limit_rate_str); + const char* timeout_str = env->GetStringUTFChars((jstring)_timeout, nullptr); std::string timeout = timeout_str != nullptr ? timeout_str : std::string(); env->ReleaseStringUTFChars((jstring)_timeout, timeout_str); std::string err_msg = config::ReadConfigFromArgument(server_host, server_sni, server_port, username, password, method, - local_host, local_port, doh_url, dot_host, timeout); + local_host, local_port, doh_url, dot_host, limit_rate, timeout); if (err_msg.empty()) { return nullptr; diff --git a/yass/src/android/jni.hpp b/yass/src/android/jni.hpp index 71e4f58012..6be8e4a222 100644 --- a/yass/src/android/jni.hpp +++ b/yass/src/android/jni.hpp @@ -20,6 +20,7 @@ extern "C" JNIEXPORT jint JNICALL Java_it_gui_yass_YassUtils_getCipher(JNIEnv* e extern "C" JNIEXPORT jobjectArray JNICALL Java_it_gui_yass_YassUtils_getCipherStrings(JNIEnv* env, jobject obj); extern "C" JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_getDoHUrl(JNIEnv* env, jobject obj); extern "C" JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_getDoTHost(JNIEnv* env, jobject obj); +extern "C" JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_getLimitRate(JNIEnv* env, jobject obj); extern "C" JNIEXPORT jint JNICALL Java_it_gui_yass_YassUtils_getTimeout(JNIEnv* env, jobject obj); extern "C" JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_saveConfig(JNIEnv* env, @@ -32,6 +33,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_it_gui_yass_YassUtils_saveConfig(JNIEn jint method_idx, jobject doh_url, jobject dot_host, + jobject limit_rate, jobject connect_timeout); extern "C" JNIEXPORT void JNICALL diff --git a/yass/src/config/config.cpp b/yass/src/config/config.cpp index e96116dbab..1e0f532fc7 100644 --- a/yass/src/config/config.cpp +++ b/yass/src/config/config.cpp @@ -56,6 +56,7 @@ bool ReadConfig() { config_impl->Read("dot_host", &FLAGS_dot_host); config_impl->Read("connect_timeout", &FLAGS_connect_timeout); config_impl->Read("tcp_nodelay", &FLAGS_tcp_nodelay); + config_impl->Read("limit_rate", &FLAGS_limit_rate); config_impl->Read("tcp_keep_alive", &FLAGS_tcp_keep_alive); config_impl->Read("tcp_keep_alive_cnt", &FLAGS_tcp_keep_alive_cnt); @@ -124,6 +125,7 @@ bool SaveConfig() { all_fields_written &= config_impl->Write("timeout", FLAGS_connect_timeout); all_fields_written &= config_impl->Write("connect_timeout", FLAGS_connect_timeout); all_fields_written &= config_impl->Write("tcp_nodelay", FLAGS_tcp_nodelay); + all_fields_written &= config_impl->Write("limit_rate", FLAGS_limit_rate); all_fields_written &= config_impl->Write("tcp_keep_alive", FLAGS_tcp_keep_alive); all_fields_written &= config_impl->Write("tcp_keep_alive_cnt", FLAGS_tcp_keep_alive_cnt); @@ -158,7 +160,9 @@ std::string ReadConfigFromArgument(std::string_view server_host, std::string_view _local_port, std::string_view doh_url, std::string_view dot_host, + std::string_view _limit_rate, std::string_view _timeout) { + std::string err; std::ostringstream err_msg; if (server_host.empty() || server_host.size() >= TLSEXT_MAXLEN_host_name) { @@ -169,8 +173,8 @@ std::string ReadConfigFromArgument(std::string_view server_host, err_msg << ",Invalid Server Host: " << server_sni; } - auto server_port = StringToIntegerU(_server_port); - if (!server_port.has_value() || server_port.value() == 0u || server_port.value() > 65535u) { + PortFlag server_port; + if (!AbslParseFlag(_server_port, &server_port, &err)) { err_msg << ",Invalid Server Port: " << _server_port; } @@ -200,8 +204,8 @@ std::string ReadConfigFromArgument(std::string_view server_host, err_msg << ",Invalid Local Host: " << local_host; } - auto local_port = StringToIntegerU(_local_port); - if (!local_port.has_value() || local_port.value() > 65535u) { + PortFlag local_port; + if (!AbslParseFlag(_local_port, &local_port, &err)) { err_msg << ",Invalid Local Port: " << _local_port; } @@ -221,6 +225,11 @@ std::string ReadConfigFromArgument(std::string_view server_host, } } + RateFlag limit_rate; + if (!AbslParseFlag(_limit_rate, &limit_rate, &err)) { + err_msg << ",Invalid Rate Limit: " << _limit_rate; + } + auto timeout = StringToIntegerU(_timeout); if (!timeout.has_value()) { err_msg << ",Invalid Connect Timeout: " << _timeout; @@ -230,14 +239,15 @@ std::string ReadConfigFromArgument(std::string_view server_host, if (ret.empty()) { absl::SetFlag(&FLAGS_server_host, server_host); absl::SetFlag(&FLAGS_server_sni, server_sni); - absl::SetFlag(&FLAGS_server_port, server_port.value()); + absl::SetFlag(&FLAGS_server_port, server_port); absl::SetFlag(&FLAGS_username, username); absl::SetFlag(&FLAGS_password, password); absl::SetFlag(&FLAGS_method, method); absl::SetFlag(&FLAGS_local_host, local_host); - absl::SetFlag(&FLAGS_local_port, local_port.value()); + absl::SetFlag(&FLAGS_local_port, local_port); absl::SetFlag(&FLAGS_doh_url, doh_url); absl::SetFlag(&FLAGS_dot_host, dot_host); + absl::SetFlag(&FLAGS_limit_rate, limit_rate); absl::SetFlag(&FLAGS_connect_timeout, timeout.value()); } else { ret = ret.substr(1); @@ -255,7 +265,9 @@ std::string ReadConfigFromArgument(std::string_view server_host, std::string_view _local_port, std::string_view doh_url, std::string_view dot_host, + std::string_view _limit_rate, std::string_view _timeout) { + std::string err; std::ostringstream err_msg; if (server_host.empty() || server_host.size() >= TLSEXT_MAXLEN_host_name) { @@ -266,13 +278,13 @@ std::string ReadConfigFromArgument(std::string_view server_host, err_msg << ",Invalid Server Host: " << server_sni; } - auto server_port = StringToIntegerU(_server_port); - if (!server_port.has_value() || server_port.value() == 0u || server_port.value() > 65535u) { + PortFlag server_port; + if (!AbslParseFlag(_server_port, &server_port, &err)) { err_msg << ",Invalid Server Port: " << _server_port; } - auto method = to_cipher_method(method_string); - if (method == CRYPTO_INVALID) { + CipherMethodFlag method; + if (!AbslParseFlag(method_string, &method, &err)) { err_msg << ",Invalid Cipher: " << method_string; } @@ -298,8 +310,8 @@ std::string ReadConfigFromArgument(std::string_view server_host, err_msg << ",Invalid Local Host: " << local_host; } - auto local_port = StringToIntegerU(_local_port); - if (!local_port.has_value() || local_port.value() > 65535u) { + PortFlag local_port; + if (!AbslParseFlag(_local_port, &local_port, &err)) { err_msg << ",Invalid Local Port: " << _local_port; } @@ -319,6 +331,11 @@ std::string ReadConfigFromArgument(std::string_view server_host, } } + RateFlag limit_rate; + if (!AbslParseFlag(_limit_rate, &limit_rate, &err)) { + err_msg << ",Invalid Rate Limit: " << _limit_rate; + } + auto timeout = StringToIntegerU(_timeout); if (!timeout.has_value()) { err_msg << ",Invalid Connect Timeout: " << _timeout; @@ -328,14 +345,15 @@ std::string ReadConfigFromArgument(std::string_view server_host, if (ret.empty()) { absl::SetFlag(&FLAGS_server_host, server_host); absl::SetFlag(&FLAGS_server_sni, server_sni); - absl::SetFlag(&FLAGS_server_port, server_port.value()); + absl::SetFlag(&FLAGS_server_port, server_port); absl::SetFlag(&FLAGS_username, username); absl::SetFlag(&FLAGS_password, password); absl::SetFlag(&FLAGS_method, method); absl::SetFlag(&FLAGS_local_host, local_host); - absl::SetFlag(&FLAGS_local_port, local_port.value()); + absl::SetFlag(&FLAGS_local_port, local_port); absl::SetFlag(&FLAGS_doh_url, doh_url); absl::SetFlag(&FLAGS_dot_host, dot_host); + absl::SetFlag(&FLAGS_limit_rate, limit_rate); absl::SetFlag(&FLAGS_connect_timeout, timeout.value()); } else { ret = ret.substr(1); diff --git a/yass/src/config/config.hpp b/yass/src/config/config.hpp index ac08c932d7..28da7e4a9c 100644 --- a/yass/src/config/config.hpp +++ b/yass/src/config/config.hpp @@ -28,6 +28,7 @@ std::string ReadConfigFromArgument(std::string_view server_host, std::string_view local_port, std::string_view doh_url, std::string_view dot_host, + std::string_view limit_rate, std::string_view connect_timeout); std::string ReadConfigFromArgument(std::string_view server_host, @@ -40,6 +41,7 @@ std::string ReadConfigFromArgument(std::string_view server_host, std::string_view local_port, std::string_view doh_url, std::string_view dot_host, + std::string_view limit_rate, std::string_view connect_timeout); void SetClientUsageMessage(std::string_view exec_path); diff --git a/yass/src/config/config_core.cpp b/yass/src/config/config_core.cpp index 523e269941..dc60fcb3ee 100644 --- a/yass/src/config/config_core.cpp +++ b/yass/src/config/config_core.cpp @@ -11,18 +11,6 @@ #include "core/utils.hpp" -bool AbslParseFlag(absl::string_view text, PortFlag* flag, std::string* err); - -std::string AbslUnparseFlag(const PortFlag&); - -bool AbslParseFlag(absl::string_view text, CipherMethodFlag* flag, std::string* err); - -std::string AbslUnparseFlag(const CipherMethodFlag&); - -bool AbslParseFlag(absl::string_view text, RateFlag* flag, std::string* err); - -std::string AbslUnparseFlag(const RateFlag&); - // Within the implementation, `AbslParseFlag()` will, in turn invoke // `absl::ParseFlag()` on its constituent `int` and `std::string` types // (which have built-in Abseil flag support. @@ -128,19 +116,11 @@ static int64_t ngx_parse_size(const char* line, size_t len) { return size; } -static void humanReadableByteCountBin(std::ostream* ss, uint64_t bytes) { - if (bytes < 1024) { - *ss << bytes; - return; - } - if (bytes < 1024 * 1024) { - *ss << bytes / 1024 << "k"; - return; - } - *ss << bytes / 1024 / 1024 << "m"; -} - bool AbslParseFlag(absl::string_view text, RateFlag* flag, std::string* err) { + if (text.empty()) { + flag->rate = 0u; + return true; + } int64_t size = ngx_parse_size(text.data(), text.size()); if (size < 0) { *err = absl::StrCat("bad size: ", text); @@ -153,9 +133,7 @@ bool AbslParseFlag(absl::string_view text, RateFlag* flag, std::string* err) { // Similarly, for unparsing, we can simply invoke `absl::UnparseFlag()` on // the constituent types. std::string AbslUnparseFlag(const RateFlag& flag) { - std::ostringstream os; - humanReadableByteCountBin(&os, flag.rate); - return os.str(); + return flag; } ABSL_FLAG(std::string, server_host, "http2.github.io", "Remote server on given host"); diff --git a/yass/src/config/config_core.hpp b/yass/src/config/config_core.hpp index 2de522cf48..0f4ceb1816 100644 --- a/yass/src/config/config_core.hpp +++ b/yass/src/config/config_core.hpp @@ -5,6 +5,7 @@ #define H_CONFIG_CONFIG_CORE #include +#include #include #include #include @@ -23,4 +24,16 @@ ABSL_DECLARE_FLAG(PortFlag, local_port); ABSL_DECLARE_FLAG(uint32_t, parallel_max); ABSL_DECLARE_FLAG(RateFlag, limit_rate); // bytes per second +bool AbslParseFlag(absl::string_view text, PortFlag* flag, std::string* err); + +std::string AbslUnparseFlag(const PortFlag&); + +bool AbslParseFlag(absl::string_view text, CipherMethodFlag* flag, std::string* err); + +std::string AbslUnparseFlag(const CipherMethodFlag&); + +bool AbslParseFlag(absl::string_view text, RateFlag* flag, std::string* err); + +std::string AbslUnparseFlag(const RateFlag&); + #endif // H_CONFIG_CONFIG_CORE diff --git a/yass/src/config/config_export.hpp b/yass/src/config/config_export.hpp index d9e5dd85d5..7523c56653 100644 --- a/yass/src/config/config_export.hpp +++ b/yass/src/config/config_export.hpp @@ -4,22 +4,34 @@ #ifndef H_CONFIG_CONFIG_EXPORT #define H_CONFIG_CONFIG_EXPORT +#include #include +#include #include "crypto/crypter_export.hpp" struct PortFlag { - explicit PortFlag(uint16_t p) : port(p) {} + explicit PortFlag(uint16_t p = 0) : port(p) {} operator uint16_t() const { return port; } uint16_t port; }; struct CipherMethodFlag { - explicit CipherMethodFlag(cipher_method m) : method(m) {} + explicit CipherMethodFlag(cipher_method m = CRYPTO_INVALID) : method(m) {} + operator cipher_method() const { return method; } cipher_method method; }; struct RateFlag { - explicit RateFlag(uint64_t r) : rate(r) {} + explicit RateFlag(uint64_t r = 0u) : rate(r) {} + operator std::string() const { + if (rate % (1L << 20) == 0) { + return absl::StrCat(rate / (1L << 20), "m"); + } else if (rate % (1L << 10) == 0) { + return absl::StrCat(rate / (1L << 10), "k"); + } + return absl::StrCat(rate); + } + operator uint64_t() const { return rate; } uint64_t rate; }; diff --git a/yass/src/config/config_impl.cpp b/yass/src/config/config_impl.cpp index 4ddd0a7795..0620dd5d41 100644 --- a/yass/src/config/config_impl.cpp +++ b/yass/src/config/config_impl.cpp @@ -8,6 +8,7 @@ #include #include +#include "config/config_core.hpp" #include "config/config_export.hpp" #include "config/config_impl_apple.hpp" #include "config/config_impl_local.hpp" @@ -161,17 +162,35 @@ bool ConfigImpl::Read(const std::string& key, absl::Flag* valu std::cerr << "failed to load option " << key << std::endl; return false; } - auto cipher_method = to_cipher_method(real_value); - if (cipher_method == CRYPTO_INVALID) { + std::string err; + CipherMethodFlag method; + if (!AbslParseFlag(real_value, &method, &err)) { std::cerr << "invalid value for key: " << key << " value: " << to_masked_string(real_value, is_masked) << std::endl; return false; } - CipherMethodFlag method(cipher_method); absl::SetFlag(value, method); std::cerr << "loaded option " << key << ": " << to_masked_string(real_value, is_masked) << std::endl; return true; } +template <> +bool ConfigImpl::Read(const std::string& key, absl::Flag* value, bool is_masked) { + alignas(std::string) alignas(8) std::string real_value; + if (!ReadImpl(key, &real_value)) { + std::cerr << "failed to load option " << key << std::endl; + return false; + } + std::string err; + RateFlag limit_rate; + if (!AbslParseFlag(real_value, &limit_rate, &err)) { + std::cerr << "invalid value for key: " << key << " value: " << to_masked_string(real_value, is_masked) << std::endl; + return false; + } + absl::SetFlag(value, limit_rate); + std::cerr << "loaded option " << key << ": " << to_masked_string(real_value, is_masked) << std::endl; + return true; +} + template <> bool ConfigImpl::Read(const std::string& key, absl::Flag* value, bool is_masked) { // Use an int instead of a bool to guarantee that a non-zero value has @@ -232,6 +251,17 @@ bool ConfigImpl::Write(const std::string& key, const absl::Flag +bool ConfigImpl::Write(const std::string& key, const absl::Flag& value, bool is_masked) { + std::string real_value = absl::GetFlag(value); + if (!WriteImpl(key, real_value)) { + std::cerr << "failed to saved option " << key << ": " << to_masked_string(real_value, is_masked) << std::endl; + return false; + } + std::cerr << "saved option " << key << ": " << to_masked_string(real_value, is_masked) << std::endl; + return true; +} + template <> bool ConfigImpl::Write(const std::string& key, const absl::Flag& value, bool is_masked) { alignas(bool) alignas(8) bool real_value = absl::GetFlag(value); diff --git a/yass/src/gtk/yass.cpp b/yass/src/gtk/yass.cpp index 2fd6b0342f..e3f516671d 100644 --- a/yass/src/gtk/yass.cpp +++ b/yass/src/gtk/yass.cpp @@ -333,8 +333,9 @@ std::string YASSApp::SaveConfig() { auto local_port = main_window_->GetLocalPort(); auto doh_url = main_window_->GetDoHUrl(); auto dot_host = main_window_->GetDoTHost(); + auto limit_rate = main_window_->GetLimitRate(); auto connect_timeout = main_window_->GetTimeout(); return config::ReadConfigFromArgument(server_host, server_sni, server_port, username, password, method_string, - local_host, local_port, doh_url, dot_host, connect_timeout); + local_host, local_port, doh_url, dot_host, limit_rate, connect_timeout); } diff --git a/yass/src/gtk/yass_en.po b/yass/src/gtk/yass_en.po index 60d5635b79..eace356f46 100644 --- a/yass/src/gtk/yass_en.po +++ b/yass/src/gtk/yass_en.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-17 16:35+0800\n" +"POT-Creation-Date: 2024-07-03 11:24+0800\n" "PO-Revision-Date: 2023-09-15 11:18+0800\n" "Last-Translator: Chilledheart \n" "Language-Team: Chilledheart \n" @@ -17,162 +17,166 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: option_dialog.cpp:30 +#: option_dialog.cpp:27 msgid "TCP keep alive" msgstr "TCP keep alive" -#: option_dialog.cpp:31 +#: option_dialog.cpp:28 msgid "The number of TCP keep-alive probes" msgstr "The number of TCP keep-alive probes" -#: option_dialog.cpp:32 +#: option_dialog.cpp:29 msgid "TCP keep alive after idle" msgstr "TCP keep alive after idle" -#: option_dialog.cpp:33 +#: option_dialog.cpp:30 msgid "TCP keep alive interval" msgstr "TCP keep alive interval" -#: option_dialog.cpp:35 +#: option_dialog.cpp:32 msgid "Kyber post-quantum key agreement for TLS" msgstr "Kyber post-quantum key agreement for TLS" -#: option_dialog.cpp:56 +#: option_dialog.cpp:53 msgid "Okay" msgstr "Okay" -#: option_dialog.cpp:59 +#: option_dialog.cpp:56 msgid "Cancel" msgstr "Cancel" -#: yass.cpp:210 +#: yass.cpp:230 msgid "Connected with conns: " msgstr "Connected with conns: " -#: yass.cpp:212 +#: yass.cpp:232 msgid "Connecting" msgstr "Connecting" -#: yass.cpp:214 +#: yass.cpp:234 msgid "Failed to connect due to " msgstr "Failed to connect due to " -#: yass.cpp:216 +#: yass.cpp:236 msgid "Disconnecting" msgstr "Disconnecting" -#: yass.cpp:218 +#: yass.cpp:238 msgid "Disconnected with " msgstr "Disconnected with " -#: yass_window.cpp:65 +#: yass_window.cpp:66 msgid "File" msgstr "File" -#: yass_window.cpp:66 yass_window.cpp:276 yass_window.cpp:328 +#: yass_window.cpp:67 yass_window.cpp:310 yass_window.cpp:369 msgid "Option..." msgstr "Option..." -#: yass_window.cpp:67 yass_window.cpp:277 yass_window.cpp:329 +#: yass_window.cpp:68 yass_window.cpp:311 yass_window.cpp:370 msgid "Exit" msgstr "Exit" -#: yass_window.cpp:84 +#: yass_window.cpp:91 msgid "Help" msgstr "Help" -#: yass_window.cpp:85 +#: yass_window.cpp:92 msgid "About..." msgstr "About..." -#: yass_window.cpp:97 +#: yass_window.cpp:107 msgid "Start" msgstr "Start" -#: yass_window.cpp:103 +#: yass_window.cpp:113 msgid "Stop" msgstr "Stop" -#: yass_window.cpp:130 +#: yass_window.cpp:146 msgid "Server Host" msgstr "Server Host" -#: yass_window.cpp:131 +#: yass_window.cpp:147 msgid "Server SNI" msgstr "Server SNI" -#: yass_window.cpp:132 +#: yass_window.cpp:148 msgid "Server Port" msgstr "Server Port" -#: yass_window.cpp:133 +#: yass_window.cpp:149 msgid "Username" msgstr "Username" -#: yass_window.cpp:134 +#: yass_window.cpp:150 msgid "Password" msgstr "Password" -#: yass_window.cpp:135 +#: yass_window.cpp:151 msgid "Cipher/Method" msgstr "Cipher/Method" -#: yass_window.cpp:136 +#: yass_window.cpp:152 msgid "Local Host" msgstr "Local Host" -#: yass_window.cpp:137 +#: yass_window.cpp:153 msgid "Local Port" msgstr "Local Port" -#: yass_window.cpp:138 +#: yass_window.cpp:154 msgid "DNS over HTTPS URL" msgstr "DNS over HTTPS URL" -#: yass_window.cpp:139 +#: yass_window.cpp:155 msgid "DNS over TLS Host" msgstr "DNS over TLS Host" -#: yass_window.cpp:140 +#: yass_window.cpp:156 +msgid "Limit Rate" +msgstr "Limit Rate" + +#: yass_window.cpp:157 msgid "Timeout" msgstr "Timeout" -#: yass_window.cpp:141 +#: yass_window.cpp:158 msgid "Auto Start" msgstr "Auto Start" -#: yass_window.cpp:142 +#: yass_window.cpp:159 msgid "System Proxy" msgstr "System Proxy" -#: yass_window.cpp:236 +#: yass_window.cpp:262 msgid "READY" msgstr "READY" -#: yass_window.cpp:295 yass_window.cpp:327 +#: yass_window.cpp:335 yass_window.cpp:368 msgid "Show" msgstr "Show" -#: yass_window.cpp:470 +#: yass_window.cpp:530 msgid " tx rate: " msgstr " tx rate: " -#: yass_window.cpp:473 +#: yass_window.cpp:533 msgid " rx rate: " msgstr " rx rate: " -#: yass_window.cpp:580 +#: yass_window.cpp:644 msgid "YASS Option" msgstr "YASS Option" -#: yass_window.cpp:591 +#: yass_window.cpp:655 msgid "Last Change: " msgstr "Last Change: " -#: yass_window.cpp:594 +#: yass_window.cpp:658 msgid "Enabled Feature: " msgstr "Enabled Feature: " -#: yass_window.cpp:603 +#: yass_window.cpp:667 msgid "official-site" msgstr "official-site" diff --git a/yass/src/gtk/yass_window.cpp b/yass/src/gtk/yass_window.cpp index e5e3ec34de..7ab003a0ed 100644 --- a/yass/src/gtk/yass_window.cpp +++ b/yass/src/gtk/yass_window.cpp @@ -25,7 +25,7 @@ extern "C" void app_indicator_uninit(); YASSWindow::YASSWindow() : impl_(GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL))) { gtk_window_set_title(GTK_WINDOW(impl_), YASS_APP_PRODUCT_NAME); - gtk_window_set_default_size(GTK_WINDOW(impl_), 450, 420); + gtk_window_set_default_size(GTK_WINDOW(impl_), 530, 540); gtk_window_set_position(GTK_WINDOW(impl_), GTK_WIN_POS_CENTER); gtk_window_set_resizable(GTK_WINDOW(impl_), false); gtk_window_set_icon_name(GTK_WINDOW(impl_), "yass"); @@ -153,6 +153,7 @@ YASSWindow::YASSWindow() : impl_(GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)) auto local_port_label_ = gtk_label_new(_("Local Port")); auto doh_url_label_ = gtk_label_new(_("DNS over HTTPS URL")); auto dot_host_label_ = gtk_label_new(_("DNS over TLS Host")); + auto limit_rate_label_ = gtk_label_new(_("Limit Rate")); auto timeout_label_ = gtk_label_new(_("Timeout")); auto autostart_label_ = gtk_label_new(_("Auto Start")); auto systemproxy_label_ = gtk_label_new(_("System Proxy")); @@ -167,9 +168,10 @@ YASSWindow::YASSWindow() : impl_(GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)) gtk_grid_attach(right_panel_grid, GTK_WIDGET(local_port_label_), 0, 7, 1, 1); gtk_grid_attach(right_panel_grid, GTK_WIDGET(doh_url_label_), 0, 8, 1, 1); gtk_grid_attach(right_panel_grid, GTK_WIDGET(dot_host_label_), 0, 9, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(timeout_label_), 0, 10, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(autostart_label_), 0, 11, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(systemproxy_label_), 0, 12, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(limit_rate_label_), 0, 10, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(timeout_label_), 0, 11, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(autostart_label_), 0, 12, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(systemproxy_label_), 0, 13, 1, 1); server_host_ = GTK_ENTRY(gtk_entry_new()); server_sni_ = GTK_ENTRY(gtk_entry_new()); @@ -191,6 +193,7 @@ YASSWindow::YASSWindow() : impl_(GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)) local_port_ = GTK_ENTRY(gtk_entry_new()); doh_url_ = GTK_ENTRY(gtk_entry_new()); dot_host_ = GTK_ENTRY(gtk_entry_new()); + limit_rate_ = GTK_ENTRY(gtk_entry_new()); timeout_ = GTK_ENTRY(gtk_entry_new()); autostart_ = GTK_CHECK_BUTTON(gtk_check_button_new()); @@ -227,9 +230,10 @@ YASSWindow::YASSWindow() : impl_(GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)) gtk_grid_attach(right_panel_grid, GTK_WIDGET(local_port_), 1, 7, 1, 1); gtk_grid_attach(right_panel_grid, GTK_WIDGET(doh_url_), 1, 8, 1, 1); gtk_grid_attach(right_panel_grid, GTK_WIDGET(dot_host_), 1, 9, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(timeout_), 1, 10, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(autostart_), 1, 11, 1, 1); - gtk_grid_attach(right_panel_grid, GTK_WIDGET(systemproxy_), 1, 12, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(limit_rate_), 1, 10, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(timeout_), 1, 11, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(autostart_), 1, 12, 1, 1); + gtk_grid_attach(right_panel_grid, GTK_WIDGET(systemproxy_), 1, 13, 1, 1); #if GTK_CHECK_VERSION(3, 12, 0) gtk_widget_set_margin_start(GTK_WIDGET(right_panel_grid), 5); @@ -434,6 +438,7 @@ void YASSWindow::OnStartButtonClicked() { gtk_widget_set_sensitive(GTK_WIDGET(local_port_), false); gtk_widget_set_sensitive(GTK_WIDGET(doh_url_), false); gtk_widget_set_sensitive(GTK_WIDGET(dot_host_), false); + gtk_widget_set_sensitive(GTK_WIDGET(limit_rate_), false); gtk_widget_set_sensitive(GTK_WIDGET(timeout_), false); mApp->OnStart(); @@ -496,6 +501,10 @@ std::string YASSWindow::GetDoTHost() { return gtk_entry_get_text(dot_host_); } +std::string YASSWindow::GetLimitRate() { + return gtk_entry_get_text(limit_rate_); +} + std::string YASSWindow::GetTimeout() { return gtk_entry_get_text(timeout_); } @@ -550,6 +559,7 @@ void YASSWindow::StartFailed() { gtk_widget_set_sensitive(GTK_WIDGET(local_port_), true); gtk_widget_set_sensitive(GTK_WIDGET(doh_url_), true); gtk_widget_set_sensitive(GTK_WIDGET(dot_host_), true); + gtk_widget_set_sensitive(GTK_WIDGET(limit_rate_), true); gtk_widget_set_sensitive(GTK_WIDGET(timeout_), true); GtkDialog* alert_dialog = GTK_DIALOG(gtk_message_dialog_new(impl_, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, @@ -575,6 +585,7 @@ void YASSWindow::Stopped() { gtk_widget_set_sensitive(GTK_WIDGET(local_port_), true); gtk_widget_set_sensitive(GTK_WIDGET(doh_url_), true); gtk_widget_set_sensitive(GTK_WIDGET(dot_host_), true); + gtk_widget_set_sensitive(GTK_WIDGET(limit_rate_), true); gtk_widget_set_sensitive(GTK_WIDGET(timeout_), true); } @@ -589,6 +600,7 @@ void YASSWindow::LoadChanges() { auto local_port_str = std::to_string(absl::GetFlag(FLAGS_local_port)); auto doh_url_str = absl::GetFlag(FLAGS_doh_url); auto dot_host_str = absl::GetFlag(FLAGS_dot_host); + std::string limit_rate_str = absl::GetFlag(FLAGS_limit_rate); auto timeout_str = std::to_string(absl::GetFlag(FLAGS_connect_timeout)); gtk_entry_set_text(server_host_, server_host_str.c_str()); @@ -614,6 +626,7 @@ void YASSWindow::LoadChanges() { gtk_entry_set_text(local_port_, local_port_str.c_str()); gtk_entry_set_text(doh_url_, doh_url_str.c_str()); gtk_entry_set_text(dot_host_, dot_host_str.c_str()); + gtk_entry_set_text(limit_rate_, limit_rate_str.c_str()); gtk_entry_set_text(timeout_, timeout_str.c_str()); } diff --git a/yass/src/gtk/yass_window.hpp b/yass/src/gtk/yass_window.hpp index 1c32f9e9f6..09aedd68e3 100644 --- a/yass/src/gtk/yass_window.hpp +++ b/yass/src/gtk/yass_window.hpp @@ -45,6 +45,7 @@ class YASSWindow { GtkEntry* local_port_; GtkEntry* doh_url_; GtkEntry* dot_host_; + GtkEntry* limit_rate_; GtkEntry* timeout_; GtkCheckButton* autostart_; GtkCheckButton* systemproxy_; @@ -75,6 +76,7 @@ class YASSWindow { std::string GetLocalPort(); std::string GetDoHUrl(); std::string GetDoTHost(); + std::string GetLimitRate(); std::string GetTimeout(); std::string GetStatusMessage(); diff --git a/yass/src/gtk/yass_zh_CN.po b/yass/src/gtk/yass_zh_CN.po index fbc4d4d2f3..dd01c3cf05 100644 --- a/yass/src/gtk/yass_zh_CN.po +++ b/yass/src/gtk/yass_zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-17 16:35+0800\n" +"POT-Creation-Date: 2024-07-03 11:24+0800\n" "PO-Revision-Date: 2023-09-15 11:26+0800\n" "Last-Translator: Chilledheart \n" "Language-Team: Chilledheart \n" @@ -18,162 +18,166 @@ msgstr "" "X-Generator: Poedit 2.2.4\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: option_dialog.cpp:30 +#: option_dialog.cpp:27 msgid "TCP keep alive" msgstr "TCP 保活" -#: option_dialog.cpp:31 +#: option_dialog.cpp:28 msgid "The number of TCP keep-alive probes" msgstr "TCP 保活测量数" -#: option_dialog.cpp:32 +#: option_dialog.cpp:29 msgid "TCP keep alive after idle" msgstr "TCP 在闲置以后的保活次数" -#: option_dialog.cpp:33 +#: option_dialog.cpp:30 msgid "TCP keep alive interval" msgstr "TCP 保活间隔" -#: option_dialog.cpp:35 +#: option_dialog.cpp:32 msgid "Kyber post-quantum key agreement for TLS" msgstr "TLS的Kyber后量子密钥协商" -#: option_dialog.cpp:56 +#: option_dialog.cpp:53 msgid "Okay" msgstr "确认" -#: option_dialog.cpp:59 +#: option_dialog.cpp:56 msgid "Cancel" msgstr "取消" -#: yass.cpp:210 +#: yass.cpp:230 msgid "Connected with conns: " msgstr "已产生连接: " -#: yass.cpp:212 +#: yass.cpp:232 msgid "Connecting" msgstr "连接中" -#: yass.cpp:214 +#: yass.cpp:234 msgid "Failed to connect due to " msgstr "无法连接因为 " -#: yass.cpp:216 +#: yass.cpp:236 msgid "Disconnecting" msgstr "断开连接中" -#: yass.cpp:218 +#: yass.cpp:238 msgid "Disconnected with " msgstr "断开连接于服务器 " -#: yass_window.cpp:65 +#: yass_window.cpp:66 msgid "File" msgstr "文件" -#: yass_window.cpp:66 yass_window.cpp:276 yass_window.cpp:328 +#: yass_window.cpp:67 yass_window.cpp:310 yass_window.cpp:369 msgid "Option..." msgstr "选项..." -#: yass_window.cpp:67 yass_window.cpp:277 yass_window.cpp:329 +#: yass_window.cpp:68 yass_window.cpp:311 yass_window.cpp:370 msgid "Exit" msgstr "退出" -#: yass_window.cpp:84 +#: yass_window.cpp:91 msgid "Help" msgstr "帮助" -#: yass_window.cpp:85 +#: yass_window.cpp:92 msgid "About..." msgstr "关于..." -#: yass_window.cpp:97 +#: yass_window.cpp:107 msgid "Start" msgstr "启动" -#: yass_window.cpp:103 +#: yass_window.cpp:113 msgid "Stop" msgstr "停止" -#: yass_window.cpp:130 +#: yass_window.cpp:146 msgid "Server Host" msgstr "服务器域名" -#: yass_window.cpp:131 +#: yass_window.cpp:147 msgid "Server SNI" msgstr "服务器名称指示" -#: yass_window.cpp:132 +#: yass_window.cpp:148 msgid "Server Port" msgstr "服务器端口号" -#: yass_window.cpp:133 +#: yass_window.cpp:149 msgid "Username" msgstr "用户名" -#: yass_window.cpp:134 +#: yass_window.cpp:150 msgid "Password" msgstr "密码" -#: yass_window.cpp:135 +#: yass_window.cpp:151 msgid "Cipher/Method" msgstr "加密方式" -#: yass_window.cpp:136 +#: yass_window.cpp:152 msgid "Local Host" msgstr "本地域名" -#: yass_window.cpp:137 +#: yass_window.cpp:153 msgid "Local Port" msgstr "本地端口号" -#: yass_window.cpp:138 +#: yass_window.cpp:154 msgid "DNS over HTTPS URL" msgstr "基于 HTTPS 的 DNS (DoH) URL" -#: yass_window.cpp:139 +#: yass_window.cpp:155 msgid "DNS over TLS Host" msgstr "基于 TLS 的 DNS (DoT) 域名" -#: yass_window.cpp:140 +#: yass_window.cpp:156 +msgid "Limit Rate" +msgstr "限制速率" + +#: yass_window.cpp:157 msgid "Timeout" msgstr "超时时间" -#: yass_window.cpp:141 +#: yass_window.cpp:158 msgid "Auto Start" msgstr "随系统自启动" -#: yass_window.cpp:142 +#: yass_window.cpp:159 msgid "System Proxy" msgstr "系统代理" -#: yass_window.cpp:236 +#: yass_window.cpp:262 msgid "READY" msgstr "就绪" -#: yass_window.cpp:295 yass_window.cpp:327 +#: yass_window.cpp:335 yass_window.cpp:368 msgid "Show" msgstr "唤醒" -#: yass_window.cpp:470 +#: yass_window.cpp:530 msgid " tx rate: " msgstr " 上传速率: " -#: yass_window.cpp:473 +#: yass_window.cpp:533 msgid " rx rate: " msgstr " 下载速率: " -#: yass_window.cpp:580 +#: yass_window.cpp:644 msgid "YASS Option" msgstr "YASS 选项" -#: yass_window.cpp:591 +#: yass_window.cpp:655 msgid "Last Change: " msgstr "最后改动: " -#: yass_window.cpp:594 +#: yass_window.cpp:658 msgid "Enabled Feature: " msgstr "启用功能: " -#: yass_window.cpp:603 +#: yass_window.cpp:667 msgid "official-site" msgstr "官方网站" diff --git a/yass/src/gtk4/yass.cpp b/yass/src/gtk4/yass.cpp index 0ae6207647..c3d8e58f83 100644 --- a/yass/src/gtk4/yass.cpp +++ b/yass/src/gtk4/yass.cpp @@ -400,10 +400,11 @@ std::string YASSApp::SaveConfig() { auto local_port = main_window_->GetLocalPort(); auto doh_url = main_window_->GetDoHUrl(); auto dot_host = main_window_->GetDoTHost(); + auto limit_rate = main_window_->GetLimitRate(); auto connect_timeout = main_window_->GetTimeout(); return config::ReadConfigFromArgument(server_host, server_sni, server_port, username, password, method_string, - local_host, local_port, doh_url, dot_host, connect_timeout); + local_host, local_port, doh_url, dot_host, limit_rate, connect_timeout); } void YASSApp::OnAbout() { diff --git a/yass/src/gtk4/yass_en.po b/yass/src/gtk4/yass_en.po index a7f00d703d..b6b49f9890 100644 --- a/yass/src/gtk4/yass_en.po +++ b/yass/src/gtk4/yass_en.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-14 11:19+0800\n" +"POT-Creation-Date: 2024-07-03 11:14+0800\n" "PO-Revision-Date: 2023-05-24 14:35+0800\n" "Last-Translator: Chilledheart \n" "Language-Team: Chilledheart \n" @@ -17,59 +17,59 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: yass.cpp:245 +#: yass.cpp:297 msgid "Connected with conns: " msgstr "Connected with conns: " -#: yass.cpp:247 +#: yass.cpp:299 msgid "Connecting" msgstr "Connecting" -#: yass.cpp:249 +#: yass.cpp:301 msgid "Failed to connect due to " msgstr "Failed to connect due to " -#: yass.cpp:251 +#: yass.cpp:303 msgid "Disconnecting" msgstr "Disconnecting" -#: yass.cpp:253 +#: yass.cpp:305 msgid "Disconnected with " msgstr "Disconnected with " -#: yass.cpp:363 +#: yass.cpp:416 msgid "Last Change: " msgstr "Last Change: " -#: yass.cpp:366 +#: yass.cpp:419 msgid "Enabled Feature: " msgstr "Enabled Feature: " -#: yass.cpp:375 +#: yass.cpp:428 msgid "official-site" msgstr "official-site" -#: yass.cpp:381 +#: yass.cpp:434 msgid "YASS Option" msgstr "YASS Option" -#: yass_window.cpp:145 +#: yass_window.cpp:190 msgid "READY" msgstr "READY" -#: yass_window.cpp:258 +#: yass_window.cpp:314 msgid " tx rate: " msgstr " tx rate: " -#: yass_window.cpp:261 +#: yass_window.cpp:317 msgid " rx rate: " msgstr " rx rate: " -#: yass_window.cpp:295 +#: yass_window.cpp:352 msgid "Start Failed" msgstr "Start Failed" -#: yass_window.cpp:296 +#: yass_window.cpp:353 msgid "OK" msgstr "OK" @@ -162,21 +162,25 @@ msgid "DNS over TLS Host:" msgstr "DNS over TLS Host:" #: yass_window.ui:131 +msgid "Limit Rate:" +msgstr "Limit Rate:" + +#: yass_window.ui:141 msgid "Timeout:" msgstr "Timeout:" -#: yass_window.ui:141 +#: yass_window.ui:151 msgid "Auto Start:" msgstr "Auto Start:" -#: yass_window.ui:151 +#: yass_window.ui:161 msgid "System Proxy:" msgstr "System Proxy:" -#: yass_window.ui:265 +#: yass_window.ui:283 msgid "Start" msgstr "Start" -#: yass_window.ui:274 +#: yass_window.ui:292 msgid "Stop" msgstr "Stop" diff --git a/yass/src/gtk4/yass_window.cpp b/yass/src/gtk4/yass_window.cpp index fc06339e36..b0e1c7da24 100644 --- a/yass/src/gtk4/yass_window.cpp +++ b/yass/src/gtk4/yass_window.cpp @@ -41,6 +41,7 @@ struct _YASSGtkWindow { GtkWidget* local_port; GtkWidget* doh_url; GtkWidget* dot_host; + GtkWidget* limit_rate; GtkWidget* timeout; GtkWidget* autostart; GtkWidget* systemproxy; @@ -82,6 +83,7 @@ static void yass_window_dispose(GObject* object) { gtk_widget_unparent(window->local_port); gtk_widget_unparent(window->doh_url); gtk_widget_unparent(window->dot_host); + gtk_widget_unparent(window->limit_rate); gtk_widget_unparent(window->timeout); gtk_widget_unparent(window->autostart); gtk_widget_unparent(window->systemproxy); @@ -108,6 +110,7 @@ static void yass_window_class_init(YASSGtkWindowClass* cls) { gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, local_port); gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, doh_url); gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, dot_host); + gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, limit_rate); gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, timeout); gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, autostart); gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(cls), YASSGtkWindow, systemproxy); @@ -219,6 +222,7 @@ void YASSWindow::OnStartButtonClicked() { gtk_widget_set_sensitive(impl_->local_port, false); gtk_widget_set_sensitive(impl_->doh_url, false); gtk_widget_set_sensitive(impl_->dot_host, false); + gtk_widget_set_sensitive(impl_->limit_rate, false); gtk_widget_set_sensitive(impl_->timeout, false); mApp->OnStart(); @@ -281,6 +285,10 @@ std::string YASSWindow::GetDoTHost() { return gtk_editable_get_text(GTK_EDITABLE(impl_->dot_host)); } +std::string YASSWindow::GetLimitRate() { + return gtk_editable_get_text(GTK_EDITABLE(impl_->limit_rate)); +} + std::string YASSWindow::GetTimeout() { return gtk_editable_get_text(GTK_EDITABLE(impl_->timeout)); } @@ -336,6 +344,7 @@ void YASSWindow::StartFailed() { gtk_widget_set_sensitive(impl_->local_port, true); gtk_widget_set_sensitive(impl_->doh_url, true); gtk_widget_set_sensitive(impl_->dot_host, true); + gtk_widget_set_sensitive(impl_->limit_rate, true); gtk_widget_set_sensitive(impl_->timeout, true); // Gtk4 Message Dialog is deprecated since 4.10 @@ -372,6 +381,7 @@ void YASSWindow::Stopped() { gtk_widget_set_sensitive(impl_->local_port, true); gtk_widget_set_sensitive(impl_->doh_url, true); gtk_widget_set_sensitive(impl_->dot_host, true); + gtk_widget_set_sensitive(impl_->limit_rate, true); gtk_widget_set_sensitive(impl_->timeout, true); } @@ -386,6 +396,7 @@ void YASSWindow::LoadChanges() { auto local_port_str = std::to_string(absl::GetFlag(FLAGS_local_port)); auto doh_url_str = absl::GetFlag(FLAGS_doh_url); auto dot_host_str = absl::GetFlag(FLAGS_dot_host); + std::string limit_rate_str = absl::GetFlag(FLAGS_limit_rate); auto timeout_str = std::to_string(absl::GetFlag(FLAGS_connect_timeout)); gtk_editable_set_text(GTK_EDITABLE(impl_->server_host), server_host_str.c_str()); @@ -411,6 +422,7 @@ void YASSWindow::LoadChanges() { gtk_editable_set_text(GTK_EDITABLE(impl_->local_port), local_port_str.c_str()); gtk_editable_set_text(GTK_EDITABLE(impl_->doh_url), doh_url_str.c_str()); gtk_editable_set_text(GTK_EDITABLE(impl_->dot_host), dot_host_str.c_str()); + gtk_editable_set_text(GTK_EDITABLE(impl_->limit_rate), limit_rate_str.c_str()); gtk_editable_set_text(GTK_EDITABLE(impl_->timeout), timeout_str.c_str()); } diff --git a/yass/src/gtk4/yass_window.hpp b/yass/src/gtk4/yass_window.hpp index 0fa1e898c5..1732e5bb0d 100644 --- a/yass/src/gtk4/yass_window.hpp +++ b/yass/src/gtk4/yass_window.hpp @@ -51,6 +51,7 @@ class YASSWindow { std::string GetLocalPort(); std::string GetDoHUrl(); std::string GetDoTHost(); + std::string GetLimitRate(); std::string GetTimeout(); std::string GetStatusMessage(); diff --git a/yass/src/gtk4/yass_window.ui b/yass/src/gtk4/yass_window.ui index 6b75e9ccb9..cc5318ef61 100644 --- a/yass/src/gtk4/yass_window.ui +++ b/yass/src/gtk4/yass_window.ui @@ -128,7 +128,7 @@ - Timeout: + Limit Rate: 1 1 @@ -138,7 +138,7 @@ - Auto Start: + Timeout: 1 1 @@ -148,7 +148,7 @@ - System Proxy: + Auto Start: 1 1 @@ -156,6 +156,16 @@ + + + System Proxy: + 1 + + 1 + 13 + + + @@ -237,7 +247,7 @@ - + 2 10 @@ -245,7 +255,7 @@ - + 2 11 @@ -253,13 +263,21 @@ - + 2 12 + + + + 2 + 13 + + + Start diff --git a/yass/src/gtk4/yass_zh_CN.po b/yass/src/gtk4/yass_zh_CN.po index 84270feca9..bfbaab669e 100644 --- a/yass/src/gtk4/yass_zh_CN.po +++ b/yass/src/gtk4/yass_zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-14 11:19+0800\n" +"POT-Creation-Date: 2024-07-03 11:14+0800\n" "PO-Revision-Date: 2023-09-15 11:28+0800\n" "Last-Translator: Chilledheart \n" "Language-Team: Chilledheart \n" @@ -18,59 +18,59 @@ msgstr "" "X-Generator: Poedit 2.2.4\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: yass.cpp:245 +#: yass.cpp:297 msgid "Connected with conns: " msgstr "已产生连接: " -#: yass.cpp:247 +#: yass.cpp:299 msgid "Connecting" msgstr "连接中" -#: yass.cpp:249 +#: yass.cpp:301 msgid "Failed to connect due to " msgstr "无法连接因为 " -#: yass.cpp:251 +#: yass.cpp:303 msgid "Disconnecting" msgstr "断开连接中" -#: yass.cpp:253 +#: yass.cpp:305 msgid "Disconnected with " msgstr "断开连接于服务器 " -#: yass.cpp:363 +#: yass.cpp:416 msgid "Last Change: " msgstr "最后改动: " -#: yass.cpp:366 +#: yass.cpp:419 msgid "Enabled Feature: " msgstr "启用功能: " -#: yass.cpp:375 +#: yass.cpp:428 msgid "official-site" msgstr "官方网站" -#: yass.cpp:381 +#: yass.cpp:434 msgid "YASS Option" msgstr "YASS 选项" -#: yass_window.cpp:145 +#: yass_window.cpp:190 msgid "READY" msgstr "就绪" -#: yass_window.cpp:258 +#: yass_window.cpp:314 msgid " tx rate: " msgstr " 上传速率: " -#: yass_window.cpp:261 +#: yass_window.cpp:317 msgid " rx rate: " msgstr " 下载速率: " -#: yass_window.cpp:295 +#: yass_window.cpp:352 msgid "Start Failed" msgstr "启动失败" -#: yass_window.cpp:296 +#: yass_window.cpp:353 msgid "OK" msgstr "确认" @@ -163,21 +163,25 @@ msgid "DNS over TLS Host:" msgstr "基于 TLS 的 DNS (DoT) 域名:" #: yass_window.ui:131 +msgid "Limit Rate:" +msgstr "限制速率:" + +#: yass_window.ui:141 msgid "Timeout:" msgstr "超时时间:" -#: yass_window.ui:141 +#: yass_window.ui:151 msgid "Auto Start:" msgstr "随系统自启动:" -#: yass_window.ui:151 +#: yass_window.ui:161 msgid "System Proxy:" msgstr "系统代理:" -#: yass_window.ui:265 +#: yass_window.ui:283 msgid "Start" msgstr "启动" -#: yass_window.ui:274 +#: yass_window.ui:292 msgid "Stop" msgstr "停止" diff --git a/yass/src/harmony/yass.cpp b/yass/src/harmony/yass.cpp index 222dc7cef3..d17fcb4171 100644 --- a/yass/src/harmony/yass.cpp +++ b/yass/src/harmony/yass.cpp @@ -837,9 +837,10 @@ static napi_value getTransferRate(napi_env env, napi_callback_info info) { // method // doh_url // dot_host +// limit_rate // timeout static napi_value saveConfig(napi_env env, napi_callback_info info) { - napi_value args[9]{}; + napi_value args[10]{}; size_t argc = std::size(args); auto status = napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); if (status != napi_ok || argc != std::size(args)) { @@ -879,13 +880,14 @@ static napi_value saveConfig(napi_env env, napi_callback_info info) { std::string method = argList[5]; std::string doh_url = argList[6]; std::string dot_host = argList[7]; - std::string timeout = argList[8]; + std::string limit_rate = argList[8]; + std::string timeout = argList[9]; constexpr std::string_view local_host = "0.0.0.0"; constexpr std::string_view local_port = "0"; std::string err_msg = config::ReadConfigFromArgument(server_host, server_sni, server_port, username, password, method, - local_host, local_port, doh_url, dot_host, timeout); + local_host, local_port, doh_url, dot_host, limit_rate, timeout); napi_value result; status = napi_create_string_utf8(env, err_msg.c_str(), err_msg.size(), &result); @@ -1023,6 +1025,18 @@ static napi_value getDoTHost(napi_env env, napi_callback_info info) { return value; } +static napi_value getLimitRate(napi_env env, napi_callback_info info) { + napi_value value; + std::string str = std::string(absl::GetFlag(FLAGS_limit_rate)); + auto status = napi_create_string_utf8(env, str.c_str(), str.size(), &value); + if (status != napi_ok) { + napi_throw_error(env, nullptr, "napi_create_string_utf8 failed"); + return nullptr; + } + + return value; +} + static napi_value getTimeout(napi_env env, napi_callback_info info) { napi_value value; auto status = napi_create_int32(env, absl::GetFlag(FLAGS_connect_timeout), &value); @@ -1136,6 +1150,7 @@ static napi_value Init(napi_env env, napi_value exports) { {"getCipherStrings", nullptr, getCipherStrings, nullptr, nullptr, nullptr, napi_default, nullptr}, {"getDoHUrl", nullptr, getDoHUrl, nullptr, nullptr, nullptr, napi_default, nullptr}, {"getDoTHost", nullptr, getDoTHost, nullptr, nullptr, nullptr, napi_default, nullptr}, + {"getLimitRate", nullptr, getLimitRate, nullptr, nullptr, nullptr, napi_default, nullptr}, {"getTimeout", nullptr, getTimeout, nullptr, nullptr, nullptr, napi_default, nullptr}, {"init", nullptr, initRoutine, nullptr, nullptr, nullptr, napi_default, nullptr}, {"destroy", nullptr, destroyRoutine, nullptr, nullptr, nullptr, napi_default, nullptr}, @@ -1166,7 +1181,6 @@ extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { sigset_t saved_mask; if (pthread_sigmask(SIG_BLOCK, &sigpipe_mask, &saved_mask) == -1) { perror("pthread_sigmask failed"); - return -1; } napi_module_register(&yassModule); diff --git a/yass/src/ios/Base.lproj/Main.storyboard b/yass/src/ios/Base.lproj/Main.storyboard index c16d4d828a..84809fce19 100644 --- a/yass/src/ios/Base.lproj/Main.storyboard +++ b/yass/src/ios/Base.lproj/Main.storyboard @@ -3,7 +3,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -121,7 +121,23 @@ - + + + + + + + + + + + + @@ -129,7 +145,7 @@ - + - +