From 109b874dd4a688fae39ff13853ef9e4e702dbfe7 Mon Sep 17 00:00:00 2001 From: "github-action[bot]" Date: Mon, 25 Nov 2024 19:36:45 +0100 Subject: [PATCH] Update On Mon Nov 25 19:36:45 CET 2024 --- .github/update.log | 1 + clash-nyanpasu/backend/tauri/src/ipc.rs | 22 +- clash-nyanpasu/frontend/nyanpasu/package.json | 8 +- clash-nyanpasu/frontend/ui/package.json | 2 +- clash-nyanpasu/manifest/version.json | 6 +- clash-nyanpasu/pnpm-lock.yaml | 68 +-- lede/README.md | 12 +- lede/README_EN.md | 548 +++++++----------- lede/README_JA.md | 534 ++++++----------- lede/target/linux/bcm27xx/bcm2708/config-6.6 | 3 - lede/target/linux/bcm27xx/bcm2709/config-6.6 | 3 - lede/target/linux/bcm27xx/bcm2710/config-6.6 | 3 - lede/target/linux/bcm27xx/bcm2711/config-6.6 | 3 - lede/target/linux/bcm27xx/bcm2712/config-6.6 | 3 - ...m-Register-vcsm-cma-as-a-platform-dr.patch | 4 +- ...m-Register-bcm2835-codec-as-a-platfo.patch | 4 +- ...m-Set-up-dma-ranges-on-child-devices.patch | 2 +- ...e-the-old-dma-controller-for-OF-conf.patch | 4 +- ...hiq_arm-Give-vchiq-children-DT-nodes.patch | 2 +- ...q-Load-bcm2835_isp-driver-from-vchiq.patch | 4 +- ...vchiq_arm-Add-36-bit-address-support.patch | 30 +- ...chiq_arm-children-inherit-DMA-config.patch | 2 +- ...q_arm-Usa-a-DMA-pool-for-small-bulks.patch | 14 +- .../root/usr/share/passwall/0_default_config | 3 +- .../root/usr/share/passwall/rules/proxy_host | 1 + .../.github/workflows/build-msrv.yml | 6 +- .../workflows/build-nightly-release.yml | 35 +- .../.github/workflows/build-release.yml | 77 ++- shadowsocks-rust/Cargo.lock | 155 +++-- shadowsocks-rust/Cargo.toml | 2 +- shadowsocks-rust/Cross.toml | 34 +- shadowsocks-rust/build/build-host-release | 22 +- shadowsocks-rust/build/build-host-release.ps1 | 2 +- shadowsocks-rust/build/build-release | 38 +- shadowsocks-rust/build/build-release-zigbuild | 130 ----- .../crates/shadowsocks-service/Cargo.toml | 4 +- .../src/local/dns/dns_resolver.rs | 2 - .../src/local/net/udp/association.rs | 6 +- .../src/local/redir/redir_ext.rs | 2 - .../src/local/redir/tcprelay/sys/unix/bsd.rs | 2 - .../local/redir/tcprelay/sys/unix/linux.rs | 2 - .../local/redir/tcprelay/sys/windows/mod.rs | 2 - .../src/local/redir/udprelay/mod.rs | 2 - .../src/local/socks/server/socks5/udprelay.rs | 2 - .../shadowsocks-service/src/local/tun/udp.rs | 2 - .../src/local/tunnel/udprelay.rs | 2 - .../crates/shadowsocks/Cargo.toml | 5 +- .../shadowsocks/src/dns_resolver/resolver.rs | 12 +- sing-box/adapter/connections.go | 3 +- sing-box/box.go | 10 +- sing-box/docs/changelog.md | 2 +- sing-box/route/conn.go | 23 +- sing-box/route/conn_monitor.go | 4 + small/luci-app-mihomo/Makefile | 2 +- .../root/usr/share/passwall/0_default_config | 3 +- .../root/usr/share/passwall/rules/proxy_host | 1 + small/mihomo/Makefile | 10 +- small/mihomo/files/mihomo.init | 8 +- small/v2ray-geodata/Makefile | 4 +- small/v2raya/Makefile | 6 +- .../ServiceLib/Handler/AutoStartupHandler.cs | 4 + .../v2rayN/ServiceLib/Handler/CoreHandler.cs | 4 +- .../ServiceLib/Handler/CoreInfoHandler.cs | 8 + v2rayn/v2rayN/ServiceLib/Models/CoreInfo.cs | 2 + .../ServiceLib/Services/UpdateService.cs | 9 + .../ViewModels/CheckUpdateViewModel.cs | 2 +- .../ViewModels/StatusBarViewModel.cs | 5 + .../Views/OptionSettingWindow.axaml.cs | 8 +- xray-core/app/router/condition_geoip_test.go | 35 +- xray-core/app/router/condition_test.go | 22 +- xray-core/go.mod | 2 +- xray-core/go.sum | 4 +- xray-core/proxy/vless/inbound/inbound.go | 4 +- xray-core/testing/scenarios/common.go | 2 + xray-core/testing/scenarios/main_test.go | 12 + yass/openwrt/files/config.json.sample | 2 +- yass/openwrt/files/redir.json.sample | 2 +- yass/src/config/config.cpp | 11 +- yass/src/net/ssl_stream.hpp | 31 +- yass/src/net/stream.hpp | 15 +- yass/yass-redir.json.sample | 2 +- yass/yass-server.json.sample | 2 +- yass/yass.json.sample | 2 +- yt-dlp/yt_dlp/extractor/chaturbate.py | 15 +- 84 files changed, 945 insertions(+), 1168 deletions(-) delete mode 100755 shadowsocks-rust/build/build-release-zigbuild create mode 100644 xray-core/testing/scenarios/main_test.go diff --git a/.github/update.log b/.github/update.log index 34cd58a33e..98934f46c7 100644 --- a/.github/update.log +++ b/.github/update.log @@ -835,3 +835,4 @@ Update On Thu Nov 21 19:38:10 CET 2024 Update On Fri Nov 22 19:38:14 CET 2024 Update On Sat Nov 23 19:33:03 CET 2024 Update On Sun Nov 24 19:33:36 CET 2024 +Update On Mon Nov 25 19:36:34 CET 2024 diff --git a/clash-nyanpasu/backend/tauri/src/ipc.rs b/clash-nyanpasu/backend/tauri/src/ipc.rs index dce703db6e..b0407eb401 100644 --- a/clash-nyanpasu/backend/tauri/src/ipc.rs +++ b/clash-nyanpasu/backend/tauri/src/ipc.rs @@ -15,7 +15,8 @@ use chrono::Local; use log::debug; use nyanpasu_ipc::api::status::CoreState; use profile::item_type::ProfileItemType; -use serde_yaml::Mapping; +use serde::Deserialize; +use serde_yaml::{value::TaggedValue, Mapping}; use std::{borrow::Cow, collections::VecDeque, path::PathBuf, result::Result as StdResult}; use storage::{StorageOperationError, WebStorage}; use sysproxy::Sysproxy; @@ -118,8 +119,23 @@ pub async fn import_profile(url: String, option: Option) -> Result { let kind = item .get("type") - .and_then(|kind| serde_yaml::from_value::(kind.clone()).ok()) - .ok_or(anyhow!("the type field is null"))?; + .ok_or(anyhow!("the type field is not found"))?; + // FIXME: a workaround for serde_yaml, and it should be fixed by upstream + let kind = serde_yaml::from_value(match kind { + serde_yaml::Value::String(_) => kind.clone(), + serde_yaml::Value::Mapping(kind) => { + let tag = kind + .keys() + .next() + .ok_or(anyhow!("the type field is not found in mapping"))?; + serde_yaml::Value::Tagged(Box::new(TaggedValue { + tag: serde_yaml::value::Tag::new(tag.as_str().unwrap()), + value: kind.get(tag).unwrap().clone(), + })) + } + _ => return Err(anyhow!("the type field is not a string or mapping").into()), + }) + .context("failed to parse the profile type")?; let item = serde_yaml::Value::Mapping(item); tracing::trace!("create profile: {kind:?} with {item:?}"); let profile: Profile = match kind { diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index 7787fd786f..6645990957 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -29,7 +29,7 @@ "country-code-emoji": "2.3.0", "dayjs": "1.11.13", "framer-motion": "12.0.0-alpha.2", - "i18next": "24.0.0", + "i18next": "24.0.2", "jotai": "2.10.3", "json-schema": "0.4.0", "material-react-table": "3.0.1", @@ -52,10 +52,10 @@ "@csstools/normalize.css": "12.1.1", "@emotion/babel-plugin": "11.13.5", "@emotion/react": "11.13.5", - "@iconify/json": "2.2.275", + "@iconify/json": "2.2.276", "@monaco-editor/react": "4.6.0", - "@tanstack/react-router": "1.82.2", - "@tanstack/router-devtools": "1.82.2", + "@tanstack/react-router": "1.82.8", + "@tanstack/router-devtools": "1.82.8", "@tanstack/router-plugin": "1.81.9", "@tauri-apps/plugin-clipboard-manager": "2.0.0", "@tauri-apps/plugin-dialog": "2.0.1", diff --git a/clash-nyanpasu/frontend/ui/package.json b/clash-nyanpasu/frontend/ui/package.json index 2fc5566450..a7221cf46f 100644 --- a/clash-nyanpasu/frontend/ui/package.json +++ b/clash-nyanpasu/frontend/ui/package.json @@ -43,7 +43,7 @@ "clsx": "2.1.1", "d3-interpolate-path": "2.3.0", "sass": "1.81.0", - "tailwind-merge": "2.5.4", + "tailwind-merge": "2.5.5", "typescript-plugin-css-modules": "5.1.0", "vite-plugin-dts": "4.3.0" } diff --git a/clash-nyanpasu/manifest/version.json b/clash-nyanpasu/manifest/version.json index def8cd328c..6c5f5062b7 100644 --- a/clash-nyanpasu/manifest/version.json +++ b/clash-nyanpasu/manifest/version.json @@ -3,9 +3,9 @@ "latest": { "mihomo": "v1.18.10", "mihomo_alpha": "alpha-eb985b0", - "clash_rs": "v0.7.1", + "clash_rs": "v0.7.2", "clash_premium": "2023-09-05-gdcc8d87", - "clash_rs_alpha": "0.7.1-alpha+sha.a4b59dc" + "clash_rs_alpha": "0.7.2-alpha+sha.19ea847" }, "arch_template": { "mihomo": { @@ -69,5 +69,5 @@ "linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf" } }, - "updated_at": "2024-11-23T22:20:39.660Z" + "updated_at": "2024-11-24T22:20:35.622Z" } diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index a6fa7d3ed4..d919aff2ff 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -218,7 +218,7 @@ importers: version: link:../ui '@tanstack/router-zod-adapter': specifier: 1.81.5 - version: 1.81.5(@tanstack/react-router@1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(zod@3.23.8) + version: 1.81.5(@tanstack/react-router@1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(zod@3.23.8) '@tauri-apps/api': specifier: 2.1.1 version: 2.1.1 @@ -241,8 +241,8 @@ importers: specifier: 12.0.0-alpha.2 version: 12.0.0-alpha.2(@emotion/is-prop-valid@1.3.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) i18next: - specifier: 24.0.0 - version: 24.0.0(typescript@5.7.2) + specifier: 24.0.2 + version: 24.0.2(typescript@5.7.2) jotai: specifier: 2.10.3 version: 2.10.3(react@19.0.0-rc.1)(types-react@19.0.0-rc.1) @@ -275,7 +275,7 @@ importers: version: 7.4.0(c6eqiv3v4ro6nnqx6e4soqhoku) react-i18next: specifier: 15.1.1 - version: 15.1.1(i18next@24.0.0(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + version: 15.1.1(i18next@24.0.2(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) react-markdown: specifier: 9.0.1 version: 9.0.1(react@19.0.0-rc.1)(types-react@19.0.0-rc.1) @@ -305,17 +305,17 @@ importers: specifier: 11.13.5 version: 11.13.5(react@19.0.0-rc.1)(types-react@19.0.0-rc.1) '@iconify/json': - specifier: 2.2.275 - version: 2.2.275 + specifier: 2.2.276 + version: 2.2.276 '@monaco-editor/react': specifier: 4.6.0 version: 4.6.0(monaco-editor@0.52.0)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) '@tanstack/react-router': - specifier: 1.82.2 - version: 1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + specifier: 1.82.8 + version: 1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) '@tanstack/router-devtools': - specifier: 1.82.2 - version: 1.82.2(@tanstack/react-router@1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(csstype@3.1.3)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + specifier: 1.82.8 + version: 1.82.8(@tanstack/react-router@1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(csstype@3.1.3)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) '@tanstack/router-plugin': specifier: 1.81.9 version: 1.81.9(vite@5.4.11(@types/node@22.9.3)(less@4.2.0)(sass-embedded@1.78.0)(sass@1.81.0)(stylus@0.62.0)(terser@5.36.0)) @@ -468,7 +468,7 @@ importers: version: 4.1.2(react@19.0.0-rc.1) react-i18next: specifier: 15.1.1 - version: 15.1.1(i18next@24.0.0(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + version: 15.1.1(i18next@24.0.2(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) react-use: specifier: 17.5.1 version: 17.5.1(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) @@ -495,8 +495,8 @@ importers: specifier: 1.81.0 version: 1.81.0 tailwind-merge: - specifier: 2.5.4 - version: 2.5.4 + specifier: 2.5.5 + version: 2.5.5 typescript-plugin-css-modules: specifier: 5.1.0 version: 5.1.0(typescript@5.7.2) @@ -1727,8 +1727,8 @@ packages: '@vue/compiler-sfc': optional: true - '@iconify/json@2.2.275': - resolution: {integrity: sha512-eiw64zix2sLUoZWjEJAwe0EU/wtZPww3h4NOEdqXgyiLmV400MXbOB7A+osZDuNPIP1Iapxab+r1mxW75dTWEw==} + '@iconify/json@2.2.276': + resolution: {integrity: sha512-YXCcFQSgFTj/3rlK6Vlv9T5suFjWBQu5dt9k/aYbje/U21jNp7P2xf0CPiAn8iItU/9uDj9mi3UsITMShqeCug==} '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -2669,8 +2669,8 @@ packages: resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==} engines: {node: '>=12'} - '@tanstack/react-router@1.82.2': - resolution: {integrity: sha512-vnX0njd3202iHf4w2hmv1GyudI/4mqCxIfHQdKaj/mRtFj/lydTq4de6x6kZ1TiLf1ZN/mKvfViAzGwsN2HIxQ==} + '@tanstack/react-router@1.82.8': + resolution: {integrity: sha512-l4F9V0CeDxvV5TGUsagGK5Zt1+l9xa6P+/Hyj6l79mBgW21Vm4BU3sJ3pgg75379gDee3G2sqkViYGEgv6JRFA==} engines: {node: '>=12'} peerDependencies: '@tanstack/router-generator': 1.81.9 @@ -2699,11 +2699,11 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - '@tanstack/router-devtools@1.82.2': - resolution: {integrity: sha512-9R0cHGNF8oQMehBYzZZ+xyKWoBCgL4OZV7g0Bt3QJv+LusRQ57iYvA2uf0Cc5qfsba46l/ps0Z/UPLQWp55wfA==} + '@tanstack/router-devtools@1.82.8': + resolution: {integrity: sha512-fj0LMOF0MaDqxT17mTjSi09Bool2lYktdPeMoVB3eMr0Bgl4VvIuZ5vC96+4cODB4iExaf71/cBF5ozah8tFPA==} engines: {node: '>=12'} peerDependencies: - '@tanstack/react-router': ^1.82.2 + '@tanstack/react-router': ^1.82.8 react: '>=18' react-dom: '>=18' @@ -4849,8 +4849,8 @@ packages: hyphenate-style-name@1.1.0: resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==} - i18next@24.0.0: - resolution: {integrity: sha512-ORGCwMrXxpmB/AljFbGEe0UK/9Pz6umb9aZgLZ9qJGE+kjKhlnLj423WX2mt+N0MlEJ78pQXFMBmeMzrkLxriQ==} + i18next@24.0.2: + resolution: {integrity: sha512-D88xyIGcWAKwBTAs4RSqASi8NXR/NhCVSTM4LDbdoU8qb/5dcEZjNCLDhtQBB7Epw/Cp1w2vH/3ujoTbqLSs5g==} peerDependencies: typescript: ^5 peerDependenciesMeta: @@ -7149,8 +7149,8 @@ packages: resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} engines: {node: '>=10.0.0'} - tailwind-merge@2.5.4: - resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} + tailwind-merge@2.5.5: + resolution: {integrity: sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==} tailwindcss-textshadow@2.1.3: resolution: {integrity: sha512-FGVHfK+xnV879VSQDeRvY61Aa+b0GDiGaFBPwCOKvqIrK57GyepWJL1GydjtGOLHE9qqphFucRNj9fHramCzNg==} @@ -9122,7 +9122,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@iconify/json@2.2.275': + '@iconify/json@2.2.276': dependencies: '@iconify/types': 2.0.0 pathe: 1.1.2 @@ -10040,7 +10040,7 @@ snapshots: dependencies: remove-accents: 0.5.0 - '@tanstack/react-router@1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)': + '@tanstack/react-router@1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)': dependencies: '@tanstack/history': 1.81.9 '@tanstack/react-store': 0.5.6(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) @@ -10071,9 +10071,9 @@ snapshots: react: 19.0.0-rc.1 react-dom: 19.0.0-rc.1(react@19.0.0-rc.1) - '@tanstack/router-devtools@1.82.2(@tanstack/react-router@1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(csstype@3.1.3)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)': + '@tanstack/router-devtools@1.82.8(@tanstack/react-router@1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(csstype@3.1.3)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1)': dependencies: - '@tanstack/react-router': 1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + '@tanstack/react-router': 1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) clsx: 2.1.1 goober: 2.1.16(csstype@3.1.3) react: 19.0.0-rc.1 @@ -10113,9 +10113,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@tanstack/router-zod-adapter@1.81.5(@tanstack/react-router@1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(zod@3.23.8)': + '@tanstack/router-zod-adapter@1.81.5(@tanstack/react-router@1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1))(zod@3.23.8)': dependencies: - '@tanstack/react-router': 1.82.2(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) + '@tanstack/react-router': 1.82.8(@tanstack/router-generator@1.81.9)(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1) zod: 3.23.8 '@tanstack/store@0.5.5': {} @@ -12594,7 +12594,7 @@ snapshots: hyphenate-style-name@1.1.0: {} - i18next@24.0.0(typescript@5.7.2): + i18next@24.0.2(typescript@5.7.2): dependencies: '@babel/runtime': 7.26.0 optionalDependencies: @@ -14120,11 +14120,11 @@ snapshots: dependencies: react: 19.0.0-rc.1 - react-i18next@15.1.1(i18next@24.0.0(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1): + react-i18next@15.1.1(i18next@24.0.2(typescript@5.7.2))(react-dom@19.0.0-rc.1(react@19.0.0-rc.1))(react@19.0.0-rc.1): dependencies: '@babel/runtime': 7.26.0 html-parse-stringify: 3.0.1 - i18next: 24.0.0(typescript@5.7.2) + i18next: 24.0.2(typescript@5.7.2) react: 19.0.0-rc.1 optionalDependencies: react-dom: 19.0.0-rc.1(react@19.0.0-rc.1) @@ -14952,7 +14952,7 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 - tailwind-merge@2.5.4: {} + tailwind-merge@2.5.5: {} tailwindcss-textshadow@2.1.3: dependencies: diff --git a/lede/README.md b/lede/README.md index 70a6ab00e6..8461a5751e 100644 --- a/lede/README.md +++ b/lede/README.md @@ -15,7 +15,7 @@ I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_J ArmSoM-Sige 系列:软路由、单板计算机、小型服务器与智能家居的全能之选。 -[商品介绍页面 - ArmSom 品牌店 ](https://shop518100695.taobao.com/) +[商品介绍页面 - ArmSom 品牌店](https://shop518100695.taobao.com/) 购买链接: @@ -29,7 +29,7 @@ ArmSoM-Sige 系列:软路由、单板计算机、小型服务器与智能家 ## 编译命令 -1. 首先装好 Linux 系统,推荐 Debian 11 或 Ubuntu LTS +1. 首先装好 Linux 系统,推荐 Debian 或 Ubuntu LTS 2. 安装编译依赖 @@ -37,10 +37,10 @@ ArmSoM-Sige 系列:软路由、单板计算机、小型服务器与智能家 sudo apt update -y sudo apt full-upgrade -y sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ - bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ + bzip2 ccache clang cmake cpio curl device-tree-compiler flex gawk gettext gcc-multilib g++-multilib \ git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev \ libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev \ - libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 \ + libssl-dev libtool llvm lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 \ python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \ uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev ``` @@ -109,7 +109,7 @@ Build dependency: OpenWrt can only be built on a case-sensitive filesystem # 以管理员身份打开终端 PS > fsutil.exe file setCaseSensitiveInfo enable # 将本项目 git clone 到开启了大小写敏感的目录 中 -PS > git clone git@github.com:coolsnowwolf/lede.git +PS > git clone https://github.com/coolsnowwolf/lede ``` > 对已经 `git clone` 完成的项目目录执行 `fsutil.exe` 命令无法生效,大小写敏感只对新增的文件变更有效。 @@ -162,7 +162,7 @@ PS > git clone git@github.com:coolsnowwolf/lede.git ## 特别提示 -1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的; +1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒,安全干净才是固件应该做到的。 2. 想学习 OpenWrt 开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学 OpenWrt 开发入门培训班助你能学有所成 报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名") diff --git a/lede/README_EN.md b/lede/README_EN.md index 96c222f021..66f1f8aa4e 100644 --- a/lede/README_EN.md +++ b/lede/README_EN.md @@ -1,342 +1,206 @@ -# Welcome to Lean's git source of OpenWrt and packages - -I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) - -## Official Channels - - -If you have technical questions for discussion or sharing, feel free to join the following channels: -1. QQ Group: *OpenWRT Firmware Technical Research Group*, Group Number is `891659613`. Join the group: [Link](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群"). - - [Click to download QQ client](https://im.qq.com/pcqq). -2. Telegram Group: *OpenWRT Firmware Technical Research Group*. Join the group: [Link](https://t.me/JhKgAA6Hx1 "OP 编译官方大群"). - -## ArmSoM Sige Board Series Introduction - -ArmSoM-Sige Series: Your All-in-One Powerhouse for Soft Routing, SBCs, Mini Servers, and Home Automation. - -[ ArmSoM Store ](https://www.aliexpress.com/store/1102800175) - -Buy Link : -[![sige1-en](doc/sige-en.jpg)](https://aliexpress.com/item/3256807356692995.html) - -## Notice - -1. **Never compile OpenWRT as `root`** -2. If you are living in mainland China, please make sure you could visit the **REAL** Internet. -3. Default login IP is `192.168.1.1`, password is `password`. - -## How to Compile - - -1. Install a Linux distribution, Debian 11 or Ubuntu LTS is recommended. -2. Install dependencies: - - ```bash - sudo apt update -y - sudo apt full-upgrade -y - sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ - bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ - git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ - libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ - mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ - libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ - vim wget xmlto xxd zlib1g-dev python3-setuptools - ``` - - - -3. Clone the source code, update `feeds` and configure: - - ```bash - git clone https://github.com/coolsnowwolf/lede - cd lede - ./scripts/feeds update -a - ./scripts/feeds install -a - make menuconfig - ``` - -4. Download libraries and compile firmware - > (`-j` is the thread count, single-thread is recommended for the first build): - - ```bash - make -j8 download V=s - make -j1 V=s - ``` - - - -These commands are supposed to compile the source code successfully. -All source code of R23 is included, including IPK. - -You can use this source code freely, but please link this GitHub repository when redistributing. -Thank you for your cooperation! - - - -Rebuild: - -```bash -cd lede -git pull -./scripts/feeds update -a -./scripts/feeds install -a -make defconfig -make download -j8 -make V=s -j$(nproc) -``` - -If reconfiguration is need: - -```bash -rm -rf ./tmp && rm -rf .config -make menuconfig -make V=s -j$(nproc) -``` - -Build artifacts will be outputted to `bin/targets` directory. - -### If you are using WSL/WSL2 as your build environment - - -WSL's `PATH` potentially contain Windows paths with spaces, which may cause compilation failure. Please add the following lines to your local environment profiles before compiling: - -```bash -# Update and reload your profile, ~/.bashrc for example. -cat << EOF >> ~/.bashrc -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" -EOF -source ~/.bashrc -``` - - - -NTFS-formatted drives mounted to a WSL distribution will be case-insensitive by default. This will cause the following error when compiling in WSL/WSL2: - -```txt -Build dependency: OpenWrt can only be built on a case-sensitive filesystem -``` - -A simple solution is to create a case-sensitive directory for the repository before `git clone`: - -```powershell -# Open a terminal as administrator -PS > fsutil.exe file setCaseSensitiveInfo enable -# Clone this repository to the case-sensitive directory -PS > git clone git@github.com:coolsnowwolf/lede.git -``` - -> For directories that have already been `git clone`d, `fsutil.exe` will not take effect. Case sensitivity will only be enabled for new changes in the directory. - -### macOS Compilation - - -1. Install Xcode from AppStore -2. Install Homebrew: - ```bash - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -3. Install toolchain, dependencies and packages with Homebrew: - ```bash - brew unlink awk - brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz - brew install gcc@11 - ``` -4. Update your system environment: - - - mac with intel chip - - ```bash - echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc - ``` - - - mac with apple chip - - ```zsh - echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc - ``` -5. Reload your shell profile `source ~/.bashrc && bash`, then you can compile normally like Linux. - -## Declaration - -1. This source code doesn't contain any backdoors or closed source applications that can monitor/capture your HTTPS traffic. SSL security is the final castle of cyber security. Safety is what a firmware should do. -2. Want to learn OpenWRT development but don't know how to start? Can't motivate yourself for self-learning? Do not have enough fundamental knowledge? Learn OpenWRT development with Mr. Zuo through his Beginner OpenWRT Training Course. Click [here](http://forgotfun.org/2018/04/openwrt-training-2018.html) to register. -3. QCA IPQ60xx open source repository: -4. OpenWRT Archive repository: - -## Introduction to Software Routers - -Yingku R2 - N95/N300 Mini Four-Network HomeLab Server - -(Introduction page - Yingku Technology (support AliPay Huabei)): - -[Pre-sale link](https://item.taobao.com/item.htm?ft=t&id=719159813003) -
- - - -
-
- -## Donation - - -If this project did helped you, please consider donating to support the development of this project. - -
- -
-
+# Welcome to Lean's git source of OpenWrt and packages + +I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) + +## Official Channels + +If you have technical questions for discussion or sharing, feel free to join the following channels: + +1. QQ Group: *OpenWRT Firmware Technical Research Group*, Group Number is `891659613`. +Join the group: [Link](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群"). + - [Click to download QQ client](https://im.qq.com/pcqq). + +2. Telegram Group: *OpenWRT Firmware Technical Research Group*. +Join the group: [Link](https://t.me/JhKgAA6Hx1 "OP 编译官方大群"). + +## ArmSoM Sige Board Series Introduction + +ArmSoM-Sige Series: Your All-in-One Powerhouse for Soft Routing, SBCs, Mini Servers, and Home Automation. + +[ArmSoM Store](https://www.aliexpress.com/store/1102800175) + +Buy Link : +[![sige1-en](doc/sige-en.jpg)](https://aliexpress.com/item/3256807356692995.html) + +## Notice + +1. **Never compile OpenWRT as `root`** +2. If you are living in mainland China, please make sure you could visit the **REAL** Internet. +3. Default login IP is `192.168.1.1`, password is `password`. + +## How to Compile + +1. Install a Linux distribution, Debian or Ubuntu LTS is recommended. + +2. Install dependencies: + + ```bash + sudo apt update -y + sudo apt full-upgrade -y + sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ + bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ + git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ + libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ + mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ + libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ + vim wget xmlto xxd zlib1g-dev python3-setuptools + ``` + +3. Clone the source code, update `feeds` and configure: + + ```bash + git clone https://github.com/coolsnowwolf/lede + cd lede + ./scripts/feeds update -a + ./scripts/feeds install -a + make menuconfig + ``` + +4. Download libraries and compile firmware + > (`-j` is the thread count, single-thread is recommended for the first build): + + ```bash + make download -j8 + make V=s -j1 + ``` + +These commands are supposed to compile the source code successfully. +All source code of R23 is included, including IPK. + +You can use this source code freely, but please link this GitHub repository when redistributing. +Thank you for your cooperation! + +Rebuild: + +```bash +cd lede +git pull +./scripts/feeds update -a +./scripts/feeds install -a +make defconfig +make download -j8 +make V=s -j$(nproc) +``` + +If reconfiguration is need: + +```bash +rm -rf ./tmp && rm -rf .config +make menuconfig +make V=s -j$(nproc) +``` + +Build artifacts will be outputted to `bin/targets` directory. + +### If you are using WSL/WSL2 as your build environment + +WSL's `PATH` potentially contain Windows paths with spaces, which may cause compilation failure. +Please add the following lines to your local environment profiles before compiling: + +```bash +# Update and reload your profile, ~/.bashrc for example. +cat << EOF >> ~/.bashrc +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" +EOF +source ~/.bashrc +``` + +NTFS-formatted drives mounted to a WSL distribution will be case-insensitive by default. +This will cause the following error when compiling in WSL/WSL2: + +```txt +Build dependency: OpenWrt can only be built on a case-sensitive filesystem +``` + +A simple solution is to create a case-sensitive directory for the repository before `git clone`: + +```powershell +# Open a terminal as administrator +PS > fsutil.exe file setCaseSensitiveInfo enable +# Clone this repository to the case-sensitive directory +PS > git clone git@github.com:coolsnowwolf/lede.git +``` + +> For directories that have already been `git clone`, `fsutil.exe` will not take effect. +> Case sensitivity will only be enabled for new changes in the directory. + +### macOS Compilation + +1. Install Xcode from AppStore + +2. Install Homebrew: + + ```bash + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` + +3. Install toolchain, dependencies and packages with Homebrew: + + ```bash + brew unlink awk + brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz + brew install gcc@11 + ``` + +4. Update your system environment: + + - mac with intel chip + + ```bash + echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc + ``` + + - mac with apple chip + + ```zsh + echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc + ``` + +5. Reload your shell profile `source ~/.bashrc && bash`, then you can compile normally like Linux. + +## Declaration + +1. This source code doesn't contain any backdoors or closed source applications that can monitor/capture your HTTPS traffic. SSL security is the final castle of cyber security. Safety is what a firmware should do. +2. Want to learn OpenWRT development but don't know how to start? Can't motivate yourself for self-learning? Do not have enough fundamental knowledge? Learn OpenWRT development with Mr. Zuo through his Beginner OpenWRT Training Course. Click [here](http://forgotfun.org/2018/04/openwrt-training-2018.html) to register. +3. QCA IPQ60xx open source repository: +4. OpenWRT Archive repository: + +## Introduction to Software Routers + +Yingku R2 - N95/N300 Mini Four-Network HomeLab Server + +(Introduction page - Yingku Technology (support AliPay Huabei)): + +[Pre-sale link](https://item.taobao.com/item.htm?ft=t&id=719159813003) +
+ + + +
+
+ +## Donation + + +If this project did helped you, please consider donating to support the development of this project. + +
+ +
+
diff --git a/lede/README_JA.md b/lede/README_JA.md index 5b853886da..0ac6152e8b 100644 --- a/lede/README_JA.md +++ b/lede/README_JA.md @@ -1,343 +1,191 @@ -# OpenWrt とパッケージの Lean の git ソースへようこそ - -I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) - -## 公式チャンネル - - -ディスカッションや共有したい技術的な質問がある場合は、以下のチャンネルにお気軽にご参加ください: -1. QQ グループ: *OpenWRT ファームウェア技術研究グループ*、グループ番号は `891659613` です。グループに参加する: [リンク](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群")。 - - [クリックして QQ クライアントをダウンロードする](https://im.qq.com/pcqq)。 -2. Telegram グループ: *OpenWRT ファームウェア技術研究グループ*。グループに参加する: [リンク](https://t.me/JhKgAA6Hx1 "OP 编译官方大群")。 -3. Rockchip **RK3568** コンパイル済みファームウェアリリース (H68K を含む): [クリックしてダウンロード](https://github.com/coolsnowwolf/lede/releases/tag/20220716)。 - - - -4. Rockchip **RK3588**コンパイル済みファームウェアリリース(H68K を含む): [クリックしてダウンロード](https://github.com/coolsnowwolf/lede/releases/tag/20230609)。 - - -## 注意 - -1. **OpenWRT を決して `root` としてコンパイルしないこと** -2. 中国本土にお住まいの方は、ぜひ **REAL** インターネットをご覧ください。 -3. デフォルトのログイン IP は `192.168.1.1` で、パスワードは `password` です。 - -## コンパイル方法 - - -1. Linuxディストリビューションをインストールし、Debian 11 または Ubuntu LTS を推奨します。 -2. 依存関係をインストールする: - - ```bash - sudo apt update -y - sudo apt full-upgrade -y - sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ - bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ - git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ - libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ - mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ - libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ - vim wget xmlto xxd zlib1g-dev python3-setuptools - ``` - - - -3. ソースコードをクローンし、`feeds` を更新し、設定する: - - ```bash - git clone https://github.com/coolsnowwolf/lede - cd lede - ./scripts/feeds update -a - ./scripts/feeds install -a - make menuconfig - ``` - -4. ライブラリのダウンロードとファームウェアのコンパイル - > (`-j` はスレッドカウント、最初のビルドはシングルスレッドを推奨): - - ```bash - make -j8 download V=s - make -j1 V=s - ``` - - - -これらのコマンドは、ソースコードを正常にコンパイルするためのものです。 -R23 のソースコードは IPK を含めてすべて含まれています。 - -このソースコードはご自由にお使いいただけますが、再配布の際はこの GitHub リポジトリをリンクしてください。 -ご協力ありがとうございました! - - - -リビルド: - -```bash -cd lede -git pull -./scripts/feeds update -a -./scripts/feeds install -a -make defconfig -make download -j8 -make V=s -j$(nproc) -``` - -再設定が必要な場合: - -```bash -rm -rf ./tmp && rm -rf .config -make menuconfig -make V=s -j$(nproc) -``` - -ビルドの成果物は `bin/targets` ディレクトリに出力されます。 - -### WSL/WSL2 をビルド環境として使用している場合 - - -WSL の `PATH` には、Windows のパスが空白で含まれている可能性があり、コンパイルに失敗することがあります。コンパイルする前に、ローカルの環境プロファイルに以下の行を追加してください: - -```bash -# 例えば、~/.bashrc などのプロファイルを更新した後、再読み込みを行う。 -cat << EOF >> ~/.bashrc -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" -EOF -source ~/.bashrc -``` - - - -WSL ディストリビューションにマウントされた NTFS フォーマットのドライブは、デフォルトで大文字と小文字が区別されません。このため、WSL/WSL2 でコンパイルすると、次のようなエラーが発生します: - -```txt -Build dependency: OpenWrt can only be built on a case-sensitive filesystem -``` - -単純な解決策は、`git clone` の前に大文字小文字を区別してリポジトリ用のディレクトリを作成することです: - -```powershell -# 管理者としてターミナルを開く -PS > fsutil.exe file setCaseSensitiveInfo enable -# 大文字と小文字を区別して、このリポジトリを ディレクトリにクローンする -PS > git clone git@github.com:coolsnowwolf/lede.git -``` - -> すでに `git clone` されたディレクトリでは、`fsutil.exe` は有効になりません。大文字小文字の区別はディレクトリの新しい変更に対してのみ有効になります。 - -### macOS コンパイル - - -1. AppStore から Xcode をインストールする -2. Homebrew をインストールする: - ```bash - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -3. Homebrew でツールチェーン、依存関係、パッケージをインストールする: - ```bash - brew unlink awk - brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz - brew install gcc@11 - ``` -4. システム環境のアップデート: - - - MacのIntelシリコンバージョン - ```bash - echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc - ``` - - - MacのAppleシリコンバージョン - - ```zsh - echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc - echo 'export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc - ``` -5. シェルプロファイル `source ~/.bashrc && bash` を再読み込みすれば、Linux のように普通にコンパイルできます。 - -## 宣言 - -1. このソースコードには、HTTPS トラフィックを監視/キャプチャできるバックドアやクローズドソースアプリケーションは含まれていません。SSL セキュリティはサイバーセキュリティの最後の城です。安全性はファームウェアがすべきことです。 -2. OpenWRT の開発を学びたいが、何から始めたらいいかわからないですか?自己学習のモチベーションが上がらない?基礎知識が足りない?ズオ氏の初心者 OpenWRT トレーニングコースで一緒に OpenWRT 開発を学びましょう。お申し込みは[こちら](http://forgotfun.org/2018/04/openwrt-training-2018.html)をクリックしてください。 -3. QCA IPQ60xx オープンソースリポジトリ: -4. OpenWRT アーカイブリポジトリ: - -## ソフトウェアルーター入門 - -Yingku R2 - N95/N300 Mini Four-Network HomeLab Server - -(紹介ページ - Yingku Technology (support AliPay Huabei)): - -[先行販売リンク](https://item.taobao.com/item.htm?ft=t&id=719159813003) -
- - - -
-
- -## 寄付 - - -このプロジェクトがあなたのお役に立てたのであれば、このプロジェクトの発展を支援するための寄付をご検討ください。 - -
- -
-
+# OpenWrt とパッケージの Lean の git ソースへようこそ + +I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) + +## 公式チャンネル + +ディスカッションや共有したい技術的な質問がある場合は、以下のチャンネルにお気軽にご参加ください: + +1. QQ グループ: *OpenWRT ファームウェア技術研究グループ*、グループ番号は `891659613` です。 +グループに参加する: [リンク](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群")。 + - [クリックして QQ クライアントをダウンロードする](https://im.qq.com/pcqq)。 + +2. Telegram グループ: *OpenWRT ファームウェア技術研究グループ*。グループに参加する: [リンク](https://t.me/JhKgAA6Hx1 "OP 编译官方大群")。 + +## 注意 + +1. **OpenWRT を決して `root` としてコンパイルしないこと** +2. 中国本土にお住まいの方は、ぜひ **REAL** インターネットをご覧ください。 +3. デフォルトのログイン IP は `192.168.1.1` で、パスワードは `password` です。 + +## コンパイル方法 + +1. Linuxディストリビューションをインストールし、Debian または Ubuntu LTS を推奨します。 + +2. 依存関係をインストールする: + + ```bash + sudo apt update -y + sudo apt full-upgrade -y + sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ + bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ + git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ + libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ + mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ + libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ + vim wget xmlto xxd zlib1g-dev python3-setuptools + ``` + +3. ソースコードをクローンし、`feeds` を更新し、設定する: + + ```bash + git clone https://github.com/coolsnowwolf/lede + cd lede + ./scripts/feeds update -a + ./scripts/feeds install -a + make menuconfig + ``` + +4. ライブラリのダウンロードとファームウェアのコンパイル + > (`-j` はスレッドカウント、最初のビルドはシングルスレッドを推奨): + + ```bash + make download -j8 + make V=s -j1 + ``` + +これらのコマンドは、ソースコードを正常にコンパイルするためのものです。 +R23 のソースコードは IPK を含めてすべて含まれています。 + +このソースコードはご自由にお使いいただけますが、再配布の際はこの GitHub リポジトリをリンクしてください。 +ご協力ありがとうございました! + +リビルド: + +```bash +cd lede +git pull +./scripts/feeds update -a +./scripts/feeds install -a +make defconfig +make download -j8 +make V=s -j$(nproc) +``` + +再設定が必要な場合: + +```bash +rm -rf ./tmp && rm -rf .config +make menuconfig +make V=s -j$(nproc) +``` + +ビルドの成果物は `bin/targets` ディレクトリに出力されます。 + +### WSL/WSL2 をビルド環境として使用している場合 + +WSL の `PATH` には、Windows のパスが空白で含まれている可能性があり、コンパイルに失敗することがあります。 +コンパイルする前に、ローカルの環境プロファイルに以下の行を追加してください: + +```bash +# 例えば、~/.bashrc などのプロファイルを更新した後、再読み込みを行う。 +cat << EOF >> ~/.bashrc +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" +EOF +source ~/.bashrc +``` + +WSL ディストリビューションにマウントされた NTFS フォーマットのドライブは、デフォルトで大文字と小文字が区別されません。 +このため、WSL/WSL2 でコンパイルすると、次のようなエラーが発生します: + +```txt +Build dependency: OpenWrt can only be built on a case-sensitive filesystem +``` + +単純な解決策は、`git clone` の前に大文字小文字を区別してリポジトリ用のディレクトリを作成することです: + +```powershell +# 管理者としてターミナルを開く +PS > fsutil.exe file setCaseSensitiveInfo enable +# 大文字と小文字を区別して、このリポジトリを ディレクトリにクローンする +PS > git clone git@github.com:coolsnowwolf/lede.git +``` + +> すでに `git clone` されたディレクトリでは、`fsutil.exe` は有効になりません。 +> 大文字小文字の区別はディレクトリの新しい変更に対してのみ有効になります。 + +### macOS コンパイル + +1. AppStore から Xcode をインストールする + +2. Homebrew をインストールする: + + ```bash + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` + +3. Homebrew でツールチェーン、依存関係、パッケージをインストールする: + + ```bash + brew unlink awk + brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz + brew install gcc@11 + ``` + +4. システム環境のアップデート: + + - MacのIntelシリコンバージョン + + ```bash + echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc + ``` + + - MacのAppleシリコンバージョン + + ```zsh + echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc + echo 'export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc + ``` + +5. シェルプロファイル `source ~/.bashrc && bash` を再読み込みすれば、Linux のように普通にコンパイルできます。 + +## 宣言 + +1. このソースコードには、HTTPS トラフィックを監視/キャプチャできるバックドアやクローズドソースアプリケーションは含まれていません。SSL セキュリティはサイバーセキュリティの最後の城です。安全性はファームウェアがすべきことです。 +2. OpenWRT の開発を学びたいが、何から始めたらいいかわからないですか?自己学習のモチベーションが上がらない?基礎知識が足りない?ズオ氏の初心者 OpenWRT トレーニングコースで一緒に OpenWRT 開発を学びましょう。お申し込みは[こちら](http://forgotfun.org/2018/04/openwrt-training-2018.html)をクリックしてください。 +3. QCA IPQ60xx オープンソースリポジトリ: +4. OpenWRT アーカイブリポジトリ: + +## ソフトウェアルーター入門 + +Yingku R2 - N95/N300 Mini Four-Network HomeLab Server + +(紹介ページ - Yingku Technology (support AliPay Huabei)): + +[先行販売リンク](https://item.taobao.com/item.htm?ft=t&id=719159813003) +
+ + + +
+
+ +## 寄付 + +このプロジェクトがあなたのお役に立てたのであれば、このプロジェクトの発展を支援するための寄付をご検討ください。 + +
+ +
+
diff --git a/lede/target/linux/bcm27xx/bcm2708/config-6.6 b/lede/target/linux/bcm27xx/bcm2708/config-6.6 index 4872e44642..b587b5d719 100644 --- a/lede/target/linux/bcm27xx/bcm2708/config-6.6 +++ b/lede/target/linux/bcm27xx/bcm2708/config-6.6 @@ -55,8 +55,6 @@ CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -172,7 +170,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y diff --git a/lede/target/linux/bcm27xx/bcm2709/config-6.6 b/lede/target/linux/bcm27xx/bcm2709/config-6.6 index 23e93241df..4a295d52c8 100644 --- a/lede/target/linux/bcm27xx/bcm2709/config-6.6 +++ b/lede/target/linux/bcm27xx/bcm2709/config-6.6 @@ -69,8 +69,6 @@ CONFIG_BROADCOM_PHY=y CONFIG_BUFFER_HEAD=y # CONFIG_CACHE_L2X0 is not set CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -211,7 +209,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y diff --git a/lede/target/linux/bcm27xx/bcm2710/config-6.6 b/lede/target/linux/bcm27xx/bcm2710/config-6.6 index 5b7d6ae4f1..97f2f110b0 100644 --- a/lede/target/linux/bcm27xx/bcm2710/config-6.6 +++ b/lede/target/linux/bcm27xx/bcm2710/config-6.6 @@ -85,8 +85,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -218,7 +216,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y diff --git a/lede/target/linux/bcm27xx/bcm2711/config-6.6 b/lede/target/linux/bcm27xx/bcm2711/config-6.6 index 270763549a..f9b7469607 100644 --- a/lede/target/linux/bcm27xx/bcm2711/config-6.6 +++ b/lede/target/linux/bcm27xx/bcm2711/config-6.6 @@ -84,8 +84,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -219,7 +217,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_NUMA=y diff --git a/lede/target/linux/bcm27xx/bcm2712/config-6.6 b/lede/target/linux/bcm27xx/bcm2712/config-6.6 index a5eb6c4d0e..5abc41ff68 100644 --- a/lede/target/linux/bcm27xx/bcm2712/config-6.6 +++ b/lede/target/linux/bcm27xx/bcm2712/config-6.6 @@ -110,8 +110,6 @@ CONFIG_BUFFER_HEAD=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -262,7 +260,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC10_NO_ARRAY_BOUNDS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_NUMA=y diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0184-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0184-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch index 1029316504..741d377fc8 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0184-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0184-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson struct vchiq_drvdata { const unsigned int cache_line_size; -@@ -1838,6 +1839,7 @@ static int vchiq_probe(struct platform_d +@@ -1825,6 +1826,7 @@ static int vchiq_probe(struct platform_d goto error_exit; } @@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); -@@ -1853,6 +1855,7 @@ static void vchiq_remove(struct platform +@@ -1840,6 +1842,7 @@ static void vchiq_remove(struct platform { platform_device_unregister(bcm2835_audio); platform_device_unregister(bcm2835_camera); diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0185-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0185-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch index ab4fb514d6..5a3c91b780 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0185-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0185-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson static struct platform_device *vcsm_cma; struct vchiq_drvdata { -@@ -1840,6 +1841,7 @@ static int vchiq_probe(struct platform_d +@@ -1827,6 +1828,7 @@ static int vchiq_probe(struct platform_d } vcsm_cma = vchiq_register_child(pdev, "vcsm-cma"); @@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); -@@ -1855,6 +1857,7 @@ static void vchiq_remove(struct platform +@@ -1842,6 +1844,7 @@ static void vchiq_remove(struct platform { platform_device_unregister(bcm2835_audio); platform_device_unregister(bcm2835_camera); diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0190-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0190-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch index b008f90946..3abc4f19bf 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0190-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0190-staging-vchiq_arm-Set-up-dma-ranges-on-child-devices.patch @@ -18,7 +18,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -1790,6 +1790,12 @@ vchiq_register_child(struct platform_dev +@@ -1777,6 +1777,12 @@ vchiq_register_child(struct platform_dev child = NULL; } diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0191-staging-vchiq-Use-the-old-dma-controller-for-OF-conf.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0191-staging-vchiq-Use-the-old-dma-controller-for-OF-conf.patch index 85d1174a60..e5c5fdbc0b 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0191-staging-vchiq-Use-the-old-dma-controller-for-OF-conf.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0191-staging-vchiq-Use-the-old-dma-controller-for-OF-conf.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -1776,6 +1776,7 @@ vchiq_register_child(struct platform_dev +@@ -1763,6 +1763,7 @@ vchiq_register_child(struct platform_dev { struct platform_device_info pdevinfo; struct platform_device *child; @@ -25,7 +25,7 @@ Signed-off-by: Dave Stevenson memset(&pdevinfo, 0, sizeof(pdevinfo)); -@@ -1791,10 +1792,20 @@ vchiq_register_child(struct platform_dev +@@ -1778,10 +1779,20 @@ vchiq_register_child(struct platform_dev } /* diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0194-staging-vchiq_arm-Give-vchiq-children-DT-nodes.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0194-staging-vchiq_arm-Give-vchiq-children-DT-nodes.patch index eab0710367..9dba2dffca 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0194-staging-vchiq_arm-Give-vchiq-children-DT-nodes.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0194-staging-vchiq_arm-Give-vchiq-children-DT-nodes.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -1785,12 +1785,20 @@ vchiq_register_child(struct platform_dev +@@ -1772,12 +1772,20 @@ vchiq_register_child(struct platform_dev pdevinfo.id = PLATFORM_DEVID_NONE; pdevinfo.dma_mask = DMA_BIT_MASK(32); diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0209-staging-vchiq-Load-bcm2835_isp-driver-from-vchiq.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0209-staging-vchiq-Load-bcm2835_isp-driver-from-vchiq.patch index a33b39967f..b5f912c85b 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0209-staging-vchiq-Load-bcm2835_isp-driver-from-vchiq.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0209-staging-vchiq-Load-bcm2835_isp-driver-from-vchiq.patch @@ -21,7 +21,7 @@ Signed-off-by: Naushir Patuck struct vchiq_drvdata { const unsigned int cache_line_size; -@@ -1869,6 +1870,7 @@ static int vchiq_probe(struct platform_d +@@ -1856,6 +1857,7 @@ static int vchiq_probe(struct platform_d bcm2835_codec = vchiq_register_child(pdev, "bcm2835-codec"); bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); @@ -29,7 +29,7 @@ Signed-off-by: Naushir Patuck return 0; -@@ -1880,6 +1882,7 @@ error_exit: +@@ -1867,6 +1869,7 @@ error_exit: static void vchiq_remove(struct platform_device *pdev) { diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0297-staging-vchiq_arm-Add-36-bit-address-support.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0297-staging-vchiq_arm-Add-36-bit-address-support.patch index 0c1ee62fab..11147d9fd9 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0297-staging-vchiq_arm-Add-36-bit-address-support.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0297-staging-vchiq_arm-Add-36-bit-address-support.patch @@ -36,10 +36,10 @@ Signed-off-by: Phil Elwell + .use_36bit_addrs = true, +}; + - struct vchiq_2835_state { - int inited; - struct vchiq_arm_state arm_state; -@@ -147,10 +153,12 @@ static void __iomem *g_regs; + struct vchiq_pagelist_info { + struct pagelist *pagelist; + size_t pagelist_buffer_size; +@@ -142,10 +148,12 @@ static void __iomem *g_regs; * of 32. */ static unsigned int g_cache_line_size = 32; @@ -52,7 +52,7 @@ Signed-off-by: Phil Elwell static DEFINE_SEMAPHORE(g_free_fragments_mutex, 1); -@@ -180,7 +188,7 @@ static void +@@ -175,7 +183,7 @@ static void cleanup_pagelistinfo(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagelistinfo) { if (pagelistinfo->scatterlist_mapped) { @@ -61,7 +61,7 @@ Signed-off-by: Phil Elwell pagelistinfo->num_pages, pagelistinfo->dma_dir); } -@@ -340,7 +348,7 @@ create_pagelist(struct vchiq_instance *i +@@ -335,7 +343,7 @@ create_pagelist(struct vchiq_instance *i count -= len; } @@ -70,7 +70,7 @@ Signed-off-by: Phil Elwell scatterlist, num_pages, pagelistinfo->dma_dir); -@@ -354,22 +362,61 @@ create_pagelist(struct vchiq_instance *i +@@ -349,22 +357,61 @@ create_pagelist(struct vchiq_instance *i /* Combine adjacent blocks for performance */ k = 0; @@ -148,7 +148,7 @@ Signed-off-by: Phil Elwell } /* Partial cache lines (fragments) require special measures */ -@@ -413,7 +460,7 @@ free_pagelist(struct vchiq_instance *ins +@@ -408,7 +455,7 @@ free_pagelist(struct vchiq_instance *ins * NOTE: dma_unmap_sg must be called before the * cpu can touch any of the data/pages. */ @@ -157,7 +157,7 @@ Signed-off-by: Phil Elwell pagelistinfo->num_pages, pagelistinfo->dma_dir); pagelistinfo->scatterlist_mapped = 0; -@@ -468,6 +515,7 @@ free_pagelist(struct vchiq_instance *ins +@@ -463,6 +510,7 @@ free_pagelist(struct vchiq_instance *ins static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) { struct device *dev = &pdev->dev; @@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev); struct rpi_firmware *fw = drvdata->fw; struct vchiq_slot_zero *vchiq_slot_zero; -@@ -489,6 +537,24 @@ static int vchiq_platform_init(struct pl +@@ -484,6 +532,24 @@ static int vchiq_platform_init(struct pl g_cache_line_size = drvdata->cache_line_size; g_fragments_size = 2 * g_cache_line_size; @@ -190,7 +190,7 @@ Signed-off-by: Phil Elwell /* Allocate space for the channels in coherent memory */ slot_mem_size = PAGE_ALIGN(TOTAL_SLOTS * VCHIQ_SLOT_SIZE); frag_mem_size = PAGE_ALIGN(g_fragments_size * MAX_FRAGMENTS); -@@ -501,13 +567,14 @@ static int vchiq_platform_init(struct pl +@@ -496,13 +562,14 @@ static int vchiq_platform_init(struct pl } WARN_ON(((unsigned long)slot_mem & (PAGE_SIZE - 1)) != 0); @@ -206,7 +206,7 @@ Signed-off-by: Phil Elwell vchiq_slot_zero->platform_data[VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX] = MAX_FRAGMENTS; -@@ -541,7 +608,6 @@ static int vchiq_platform_init(struct pl +@@ -536,7 +603,6 @@ static int vchiq_platform_init(struct pl } /* Send the base address of the slots to VideoCore */ @@ -214,7 +214,7 @@ Signed-off-by: Phil Elwell err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT, &channelbase, sizeof(channelbase)); if (err) { -@@ -555,6 +621,8 @@ static int vchiq_platform_init(struct pl +@@ -550,6 +616,8 @@ static int vchiq_platform_init(struct pl return -ENXIO; } @@ -223,7 +223,7 @@ Signed-off-by: Phil Elwell vchiq_log_info(vchiq_arm_log_level, "vchiq_init - done (slots %pK, phys %pad)", vchiq_slot_zero, &slot_phys); -@@ -1768,6 +1836,7 @@ void vchiq_platform_conn_state_changed(s +@@ -1755,6 +1823,7 @@ void vchiq_platform_conn_state_changed(s static const struct of_device_id vchiq_of_match[] = { { .compatible = "brcm,bcm2835-vchiq", .data = &bcm2835_drvdata }, { .compatible = "brcm,bcm2836-vchiq", .data = &bcm2836_drvdata }, @@ -231,7 +231,7 @@ Signed-off-by: Phil Elwell {}, }; MODULE_DEVICE_TABLE(of, vchiq_of_match); -@@ -1800,22 +1869,8 @@ vchiq_register_child(struct platform_dev +@@ -1787,22 +1856,8 @@ vchiq_register_child(struct platform_dev child->dev.of_node = np; diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0298-staging-vchiq_arm-children-inherit-DMA-config.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0298-staging-vchiq_arm-children-inherit-DMA-config.patch index b6fb2e9eda..87bea65fc7 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0298-staging-vchiq_arm-children-inherit-DMA-config.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0298-staging-vchiq_arm-children-inherit-DMA-config.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -1869,8 +1869,18 @@ vchiq_register_child(struct platform_dev +@@ -1856,8 +1856,18 @@ vchiq_register_child(struct platform_dev child->dev.of_node = np; diff --git a/lede/target/linux/bcm27xx/patches-6.6/950-0299-staging-vchiq_arm-Usa-a-DMA-pool-for-small-bulks.patch b/lede/target/linux/bcm27xx/patches-6.6/950-0299-staging-vchiq_arm-Usa-a-DMA-pool-for-small-bulks.patch index bcd9dae853..162d333c61 100644 --- a/lede/target/linux/bcm27xx/patches-6.6/950-0299-staging-vchiq_arm-Usa-a-DMA-pool-for-small-bulks.patch +++ b/lede/target/linux/bcm27xx/patches-6.6/950-0299-staging-vchiq_arm-Usa-a-DMA-pool-for-small-bulks.patch @@ -37,7 +37,7 @@ Signed-off-by: Oliver Gjoneski /* Override the default prefix, which would be vchiq_arm (from the filename) */ #undef MODULE_PARAM_PREFIX #define MODULE_PARAM_PREFIX DEVICE_NAME "." -@@ -133,6 +136,7 @@ struct vchiq_pagelist_info { +@@ -128,6 +131,7 @@ struct vchiq_pagelist_info { struct pagelist *pagelist; size_t pagelist_buffer_size; dma_addr_t dma_addr; @@ -45,7 +45,7 @@ Signed-off-by: Oliver Gjoneski enum dma_data_direction dma_dir; unsigned int num_pages; unsigned int pages_need_release; -@@ -153,6 +157,7 @@ static void __iomem *g_regs; +@@ -148,6 +152,7 @@ static void __iomem *g_regs; * of 32. */ static unsigned int g_cache_line_size = 32; @@ -53,7 +53,7 @@ Signed-off-by: Oliver Gjoneski static unsigned int g_use_36bit_addrs = 0; static unsigned int g_fragments_size; static char *g_fragments_base; -@@ -195,8 +200,13 @@ cleanup_pagelistinfo(struct vchiq_instan +@@ -190,8 +195,13 @@ cleanup_pagelistinfo(struct vchiq_instan if (pagelistinfo->pages_need_release) unpin_user_pages(pagelistinfo->pages, pagelistinfo->num_pages); @@ -69,7 +69,7 @@ Signed-off-by: Oliver Gjoneski } static inline bool -@@ -231,6 +241,7 @@ create_pagelist(struct vchiq_instance *i +@@ -226,6 +236,7 @@ create_pagelist(struct vchiq_instance *i u32 *addrs; unsigned int num_pages, offset, i, k; int actual_pages; @@ -77,7 +77,7 @@ Signed-off-by: Oliver Gjoneski size_t pagelist_size; struct scatterlist *scatterlist, *sg; int dma_buffers; -@@ -260,8 +271,14 @@ create_pagelist(struct vchiq_instance *i +@@ -255,8 +266,14 @@ create_pagelist(struct vchiq_instance *i /* Allocate enough storage to hold the page pointers and the page * list */ @@ -94,7 +94,7 @@ Signed-off-by: Oliver Gjoneski vchiq_log_trace(vchiq_arm_log_level, "%s - %pK", __func__, pagelist); -@@ -282,6 +299,7 @@ create_pagelist(struct vchiq_instance *i +@@ -277,6 +294,7 @@ create_pagelist(struct vchiq_instance *i pagelistinfo->pagelist = pagelist; pagelistinfo->pagelist_buffer_size = pagelist_size; pagelistinfo->dma_addr = dma_addr; @@ -102,7 +102,7 @@ Signed-off-by: Oliver Gjoneski pagelistinfo->dma_dir = (type == PAGELIST_WRITE) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; pagelistinfo->num_pages = num_pages; -@@ -622,6 +640,13 @@ static int vchiq_platform_init(struct pl +@@ -617,6 +635,13 @@ static int vchiq_platform_init(struct pl } g_dma_dev = dma_dev ?: dev; diff --git a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/0_default_config b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/0_default_config index 3a48f1e25f..918aaa4a9d 100644 --- a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/0_default_config +++ b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/0_default_config @@ -163,7 +163,8 @@ domain:store.steampowered.com' config shunt_rules 'AIGC' option remarks 'AIGC' - option domain_list 'geosite:category-ai-chat-!cn' + option domain_list 'geosite:category-ai-chat-!cn +domain:apple-relay.apple.com' config shunt_rules 'Streaming' option remarks 'Streaming' diff --git a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/rules/proxy_host b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/rules/proxy_host index a70321f72a..72c498c54d 100644 --- a/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/rules/proxy_host +++ b/openwrt-passwall/luci-app-passwall/root/usr/share/passwall/rules/proxy_host @@ -2,6 +2,7 @@ engage.cloudflareclient.com github.com bing.com c.mi.com +apple-relay.apple.com #google googleapis.cn diff --git a/shadowsocks-rust/.github/workflows/build-msrv.yml b/shadowsocks-rust/.github/workflows/build-msrv.yml index 6f40ce893a..c0e4808c7c 100644 --- a/shadowsocks-rust/.github/workflows/build-msrv.yml +++ b/shadowsocks-rust/.github/workflows/build-msrv.yml @@ -28,9 +28,9 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.74 - rustup default 1.74 - rustup override set 1.74 + rustup toolchain install 1.75 + rustup default 1.75 + rustup override set 1.75 - name: Build with All Features Enabled (Unix) if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline" diff --git a/shadowsocks-rust/.github/workflows/build-nightly-release.yml b/shadowsocks-rust/.github/workflows/build-nightly-release.yml index 2160347f31..f6bb9a67a4 100644 --- a/shadowsocks-rust/.github/workflows/build-nightly-release.yml +++ b/shadowsocks-rust/.github/workflows/build-nightly-release.yml @@ -15,9 +15,13 @@ jobs: strategy: fail-fast: false matrix: - target: - - x86_64-unknown-linux-musl - - aarch64-unknown-linux-musl + platform: + - target: x86_64-unknown-linux-musl + toolchain: stable + - target: aarch64-unknown-linux-musl + toolchain: stable + - target: mips-unknown-linux-musl + toolchain: nightly steps: - uses: actions/checkout@v4 @@ -25,18 +29,17 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install stable - rustup default stable - rustup override set stable - rustup target add --toolchain stable ${{ matrix.target }} + rustup toolchain install ${{ matrix.platform.toolchain }} + rustup default ${{ matrix.platform.toolchain }} + rustup override set ${{ matrix.platform.toolchain }} - name: Install cross run: cargo install cross - - name: Build ${{ matrix.target }} + - name: Build ${{ matrix.platform.target }} timeout-minutes: 120 run: | - compile_target=${{ matrix.target }} + compile_target=${{ matrix.platform.target }} compile_features="-f full" @@ -51,13 +54,23 @@ jobs: fi fi + if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then + sudo apt-get update -y && sudo apt-get install -y upx; + if [[ "$?" == "0" ]]; then + compile_compress="-u" + fi + + compile_nightly="-n" + compile_features="-Z build-std=std,panic_abort,proc_macro" + fi + cd build - ./build-release -t ${{ matrix.target }} $compile_features $compile_compress + ./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly $compile_features - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.target }} + name: ${{ matrix.platform.target }} path: build/release/* build-unix: diff --git a/shadowsocks-rust/.github/workflows/build-release.yml b/shadowsocks-rust/.github/workflows/build-release.yml index c9958c0258..f5d1abef3d 100644 --- a/shadowsocks-rust/.github/workflows/build-release.yml +++ b/shadowsocks-rust/.github/workflows/build-release.yml @@ -21,19 +21,54 @@ jobs: strategy: fail-fast: false matrix: - target: - - i686-unknown-linux-musl - - x86_64-pc-windows-gnu - - x86_64-unknown-linux-gnu - - x86_64-unknown-linux-musl - - armv7-unknown-linux-musleabihf - - armv7-unknown-linux-gnueabihf - - arm-unknown-linux-gnueabi - - arm-unknown-linux-gnueabihf - - arm-unknown-linux-musleabi - - arm-unknown-linux-musleabihf - - aarch64-unknown-linux-gnu - - aarch64-unknown-linux-musl + platform: + - target: i686-unknown-linux-musl + toolchain: stable + - target: x86_64-pc-windows-gnu + toolchain: stable + - target: x86_64-unknown-linux-gnu + toolchain: stable + - target: x86_64-unknown-linux-musl + toolchain: stable + - target: armv7-unknown-linux-musleabihf + toolchain: stable + - target: armv7-unknown-linux-gnueabihf + toolchain: stable + - target: arm-unknown-linux-gnueabi + toolchain: stable + - target: arm-unknown-linux-gnueabihf + toolchain: stable + - target: arm-unknown-linux-musleabi + toolchain: stable + - target: arm-unknown-linux-musleabihf + toolchain: stable + - target: aarch64-unknown-linux-gnu + toolchain: stable + - target: aarch64-unknown-linux-musl + toolchain: stable + - target: mips-unknown-linux-gnu + toolchain: nightly + - target: mips-unknown-linux-musl + toolchain: nightly + - target: mipsel-unknown-linux-gnu + toolchain: nightly + - target: mipsel-unknown-linux-musl + toolchain: nightly + # FIXME: ring doesn't support mips64 CPU + # - target: mips64-unknown-linux-gnuabi64 + # toolchain: nightly + # - target: mips64-unknown-linux-muslabi64 + # toolchain: nightly + - target: mips64el-unknown-linux-gnuabi64 + toolchain: nightly + # FIXME: Link Error. + # = note: mips64el-linux-muslsf-gcc: error: crt1.o: No such file or directory + # mips64el-linux-muslsf-gcc: error: crti.o: No such file or directory + # mips64el-linux-muslsf-gcc: error: crtbegin.o: No such file or directory + # mips64el-linux-muslsf-gcc: error: crtend.o: No such file or directory + # mips64el-linux-muslsf-gcc: error: crtn.o: No such file or directory + # - target: mips64el-unknown-linux-muslabi64 + # toolchain: nightly steps: - uses: actions/checkout@v4 @@ -41,18 +76,17 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install stable - rustup default stable - rustup override set stable - rustup target add --toolchain stable ${{ matrix.target }} + rustup toolchain install ${{ matrix.platform.toolchain }} + rustup default ${{ matrix.platform.toolchain }} + rustup override set ${{ matrix.platform.toolchain }} - name: Install cross run: cargo install cross - - name: Build ${{ matrix.target }} + - name: Build ${{ matrix.platform.target }} timeout-minutes: 120 run: | - compile_target=${{ matrix.target }} + compile_target=${{ matrix.platform.target }} compile_features="-f full" @@ -65,10 +99,13 @@ jobs: if [[ "$?" == "0" ]]; then compile_compress="-u" fi + + compile_nightly="-n" + compile_features="-Z build-std=std,panic_abort,proc_macro" fi cd build - ./build-release -t ${{ matrix.target }} $compile_features $compile_compress + ./build-release -t ${{ matrix.platform.target }} $compile_features $compile_compress $compile_nightly $compile_features - name: Upload Github Assets uses: softprops/action-gh-release@v2 diff --git a/shadowsocks-rust/Cargo.lock b/shadowsocks-rust/Cargo.lock index cc983117a1..c4609e4bb1 100644 --- a/shadowsocks-rust/Cargo.lock +++ b/shadowsocks-rust/Cargo.lock @@ -212,7 +212,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -229,7 +229,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -411,7 +411,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -642,9 +642,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -740,7 +740,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -828,7 +828,28 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "dynosaur" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92fac44672fabad44990176319b9e94393f3a38b960b5ca2af6cd90f5ecd1497" +dependencies = [ + "dynosaur_derive", + "trait-variant", +] + +[[package]] +name = "dynosaur_derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16c187d1e575ef546d24f0fcd7701cc04abfe6b5e7e2758aabc450b99e835ac3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -888,7 +909,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -1119,7 +1140,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -1214,9 +1235,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -1270,9 +1291,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heapless" @@ -1663,7 +1684,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -1780,9 +1801,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" [[package]] name = "jemalloc-sys" @@ -1872,7 +1893,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1910,9 +1931,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -2191,7 +2212,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -2355,7 +2376,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -2386,7 +2407,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -2501,9 +2522,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2570,7 +2591,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2840,9 +2861,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -2853,9 +2874,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.17" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "log", "once_cell", @@ -2937,9 +2958,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3045,7 +3066,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3114,13 +3135,13 @@ version = "1.22.0" dependencies = [ "aes", "arc-swap", - "async-trait", "base64 0.22.1", "blake3", "bloomfilter", "byte_string", "bytes", "cfg-if", + "dynosaur", "env_logger", "futures", "hickory-resolver", @@ -3142,6 +3163,7 @@ dependencies = [ "thiserror 2.0.3", "tokio", "tokio-tfo", + "trait-variant", "url", "windows-sys 0.59.0", ] @@ -3220,7 +3242,6 @@ name = "shadowsocks-service" version = "1.22.0" dependencies = [ "arc-swap", - "async-trait", "brotli", "bson", "byte_string", @@ -3261,6 +3282,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "trait-variant", "tun2", "webpki-roots", "windows-sys 0.59.0", @@ -3439,9 +3461,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -3450,9 +3472,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] @@ -3465,7 +3487,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3526,7 +3548,7 @@ dependencies = [ "fastrand", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3565,7 +3587,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3576,7 +3598,7 @@ checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3683,7 +3705,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3763,7 +3785,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3806,6 +3828,17 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -3862,9 +3895,9 @@ checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -4011,7 +4044,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -4045,7 +4078,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4113,7 +4146,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4374,9 +4407,9 @@ checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -4386,13 +4419,13 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "synstructure", ] @@ -4414,27 +4447,27 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "synstructure", ] @@ -4463,7 +4496,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] diff --git a/shadowsocks-rust/Cargo.toml b/shadowsocks-rust/Cargo.toml index 67404a8c19..d353f2ade5 100644 --- a/shadowsocks-rust/Cargo.toml +++ b/shadowsocks-rust/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-rust" keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] license = "MIT" edition = "2021" -rust-version = "1.74" +rust-version = "1.75" [badges] maintenance = { status = "passively-maintained" } diff --git a/shadowsocks-rust/Cross.toml b/shadowsocks-rust/Cross.toml index 3035805387..4454243069 100644 --- a/shadowsocks-rust/Cross.toml +++ b/shadowsocks-rust/Cross.toml @@ -1,13 +1,31 @@ [build] -dockerfile = "./docker/linux-cross/Dockerfile" -pre-build = [ - "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable", - ". $HOME/.cargo/env", - "cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin", - "rm -rf $HOME/.cargo" -] - +# dockerfile = "./docker/linux-cross/Dockerfile" +# pre-build = [ +# "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable", +# ". $HOME/.cargo/env", +# "cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin", +# "rm -rf $HOME/.cargo" +# ] [build.env] passthrough = ["RUSTFLAGS"] +# MIPS targets are dropped to Tier 3 +# https://github.com/rust-lang/compiler-team/issues/648 +# FIXME: build-std with sequence is supported only on git +# [target.mips-unknown-linux-gnu] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mips-unknown-linux-musl] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mips64-unknown-linux-gnuabi64] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mips64-unknown-linux-muslabi64] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mips64el-unknown-linux-gnuabi64] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mips64el-unknown-linux-muslabi64] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mipsel-unknown-linux-gnu] +# build-std = ["std", "panic_abort", "proc_macro"] +# [target.mipsel-unknown-linux-musl] +# build-std = ["std", "panic_abort", "proc_macro"] diff --git a/shadowsocks-rust/build/build-host-release b/shadowsocks-rust/build/build-host-release index 34580f510b..265d6cedac 100755 --- a/shadowsocks-rust/build/build-host-release +++ b/shadowsocks-rust/build/build-host-release @@ -46,17 +46,6 @@ if [[ "${BUILD_TARGET}" == "" ]]; then BUILD_TARGET=$HOST_TRIPLE fi -TARGET_SUFFIX="" -if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then - TARGET_SUFFIX=".exe" -fi - -TARGETS=("sslocal${TARGET_SUFFIX}" "ssserver${TARGET_SUFFIX}" "ssurl${TARGET_SUFFIX}" "ssmanager${TARGET_SUFFIX}" "ssservice${TARGET_SUFFIX}") - -if [[ "${BUILD_FEATURES}" == *"winservice"* ]]; then - TARGETS+=("sswinservice${TARGET_SUFFIX}") -fi - RELEASE_FOLDER="${ROOT_DIR}/release" RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${BUILD_TARGET}" @@ -69,6 +58,17 @@ else cd "${ROOT_DIR}/../target/release" fi +TARGET_SUFFIX="" +if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then + TARGET_SUFFIX=".exe" +fi + +TARGETS=("sslocal${TARGET_SUFFIX}" "ssserver${TARGET_SUFFIX}" "ssurl${TARGET_SUFFIX}" "ssmanager${TARGET_SUFFIX}" "ssservice${TARGET_SUFFIX}") + +if [ -e "sswinservice${TARGET_SUFFIX}" ]; then + TARGETS+=("sswinservice${TARGET_SUFFIX}") +fi + if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then # For Windows, use zip diff --git a/shadowsocks-rust/build/build-host-release.ps1 b/shadowsocks-rust/build/build-host-release.ps1 index b1e8660568..b8cbd49120 100644 --- a/shadowsocks-rust/build/build-host-release.ps1 +++ b/shadowsocks-rust/build/build-host-release.ps1 @@ -48,7 +48,7 @@ $CompressParam = @{ LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe", "ssservice.exe" DestinationPath = "${PackagePath}" } -if ((${Features}).Contains("winservice")) { +if ([System.IO.File]::Exists("sswinservice.exe")) { $CompressParam.LiteralPath += "sswinservice.exe" } Compress-Archive @CompressParam diff --git a/shadowsocks-rust/build/build-release b/shadowsocks-rust/build/build-release index 73be4a2cd3..f58037164e 100755 --- a/shadowsocks-rust/build/build-release +++ b/shadowsocks-rust/build/build-release @@ -11,8 +11,10 @@ fi targets=() features=() use_upx=false +use_nightly=false +cargo_flags="" -while getopts "t:f:u" opt; do +while getopts "t:f:unZ:" opt; do case $opt in t) targets+=($OPTARG) @@ -23,8 +25,14 @@ while getopts "t:f:u" opt; do u) use_upx=true ;; + n) + use_nightly=true + ;; + Z) + cargo_flags="-Z $OPTARG" + ;; ?) - echo "Usage: $(basename $0) [-t ] [-f features] [-u]" + echo "Usage: $(basename $0) [-t ] [-f features] [-u] [-n]" ;; esac done @@ -47,6 +55,11 @@ if [[ "${use_upx}" = true ]]; then fi fi +build_command="cross" +if [[ "${use_nightly}" = true ]]; then + build_command="$build_command +nightly" +fi + function build() { cd "$CUR_DIR/.." @@ -59,14 +72,16 @@ function build() { if [[ "${TARGET_FEATURES}" != "" ]]; then echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..." - cross build --target "${TARGET}" \ - --features "${TARGET_FEATURES}" \ - --release + $build_command build --target "${TARGET}" \ + --features "${TARGET_FEATURES}" \ + --release \ + ${cargo_flags} else echo "* Building ${TARGET} package ${VERSION} ..." - cross build --target "${TARGET}" \ - --release + $build_command build --target "${TARGET}" \ + --release \ + ${cargo_flags} fi if [[ $? != "0" ]]; then @@ -107,12 +122,19 @@ function build() { echo "* Packaging ZIP in ${PKG_PATH} ..." cd ${RELEASE_DIR} + + sswinservice="" + if [ -e "sswinservice.exe" ]; then + sswinservice="sswinservice.exe" + fi + zip ${PKG_PATH} \ "sslocal.exe" \ "ssserver.exe" \ "ssurl.exe" \ "ssmanager.exe" \ - "ssservice.exe" + "ssservice.exe" \ + "${sswinservice}" if [[ $? != "0" ]]; then exit 1 diff --git a/shadowsocks-rust/build/build-release-zigbuild b/shadowsocks-rust/build/build-release-zigbuild deleted file mode 100755 index 0cd17fa044..0000000000 --- a/shadowsocks-rust/build/build-release-zigbuild +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash - -CUR_DIR=$( cd $( dirname $0 ) && pwd ) -VERSION=$(grep -E '^version' ${CUR_DIR}/../Cargo.toml | awk '{print $3}' | sed 's/"//g') - -## Disable macos ACL file -if [[ "$(uname -s)" == "Darwin" ]]; then - export COPYFILE_DISABLE=1 -fi - -targets=() -features=() -use_upx=false - -while getopts "t:f:u" opt; do - case $opt in - t) - targets+=($OPTARG) - ;; - f) - features+=($OPTARG) - ;; - u) - use_upx=true - ;; - ?) - echo "Usage: $(basename $0) [-t ] [-f features] [-u]" - ;; - esac -done - -features+=${EXTRA_FEATURES} - -if [[ "${#targets[@]}" == "0" ]]; then - echo "Specifying compile target with -t " - exit 1 -fi - -if [[ "${use_upx}" = true ]]; then - if [[ -z "$upx" ]] && command -v upx &> /dev/null; then - upx="upx -9" - fi - - if [[ "x$upx" == "x" ]]; then - echo "Couldn't find upx in PATH, consider specifying it with variable \$upx" - exit 1 - fi -fi - - -function build() { - cd "$CUR_DIR/.." - - TARGET=$1 - - RELEASE_DIR="target/${TARGET}/release" - TARGET_FEATURES="${features[@]}" - - if [[ "${TARGET_FEATURES}" != "" ]]; then - echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..." - - cargo zigbuild --target "${TARGET}" \ - --features "${TARGET_FEATURES}" \ - --release - else - echo "* Building ${TARGET} package ${VERSION} ..." - - cargo zigbuild --target "${TARGET}" \ - --release - fi - - if [[ $? != "0" ]]; then - exit 1 - fi - - PKG_DIR="${CUR_DIR}/release" - mkdir -p "${PKG_DIR}" - - if [[ "$TARGET" == *"-linux-"* ]]; then - PKG_NAME="shadowsocks-v${VERSION}.${TARGET}.tar.xz" - PKG_PATH="${PKG_DIR}/${PKG_NAME}" - - cd ${RELEASE_DIR} - - if [[ "${use_upx}" = true ]]; then - # Enable upx for MIPS. - $upx sslocal ssserver ssurl ssmanager ssservice #>/dev/null - fi - - echo "* Packaging XZ in ${PKG_PATH} ..." - tar -cJf ${PKG_PATH} \ - "sslocal" \ - "ssserver" \ - "ssurl" \ - "ssmanager" \ - "ssservice" - - if [[ $? != "0" ]]; then - exit 1 - fi - - cd "${PKG_DIR}" - shasum -a 256 "${PKG_NAME}" > "${PKG_NAME}.sha256" - elif [[ "$TARGET" == *"-windows-"* ]]; then - PKG_NAME="shadowsocks-v${VERSION}.${TARGET}.zip" - PKG_PATH="${PKG_DIR}/${PKG_NAME}" - - echo "* Packaging ZIP in ${PKG_PATH} ..." - cd ${RELEASE_DIR} - zip ${PKG_PATH} \ - "sslocal.exe" \ - "ssserver.exe" \ - "ssurl.exe" \ - "ssmanager.exe" \ - "ssservice.exe" - - if [[ $? != "0" ]]; then - exit 1 - fi - - cd "${PKG_DIR}" - shasum -a 256 "${PKG_NAME}" > "${PKG_NAME}.sha256" - fi - - echo "* Done build package ${PKG_NAME}" -} - -for target in "${targets[@]}"; do - build "$target"; -done diff --git a/shadowsocks-rust/crates/shadowsocks-service/Cargo.toml b/shadowsocks-rust/crates/shadowsocks-service/Cargo.toml index 5e87e32d2f..9c08924e5a 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/Cargo.toml +++ b/shadowsocks-rust/crates/shadowsocks-service/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-service" keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] license = "MIT" edition = "2021" -rust-version = "1.74" +rust-version = "1.75" [badges] maintenance = { status = "passively-maintained" } @@ -171,7 +171,7 @@ tokio-rustls = { version = "0.26", optional = true, default-features = false, fe "ring", ] } rustls-native-certs = { version = "0.8", optional = true } -async-trait = "0.1" +trait-variant = "0.1" socket2 = { version = "0.5", features = ["all"] } libc = "~0.2.141" diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/dns/dns_resolver.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/dns/dns_resolver.rs index 065c282055..6831578ecc 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/dns/dns_resolver.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/dns/dns_resolver.rs @@ -5,7 +5,6 @@ use std::{ net::{Ipv4Addr, Ipv6Addr, SocketAddr}, }; -use async_trait::async_trait; use futures::future; use hickory_resolver::proto::{ op::{Message, Query}, @@ -104,7 +103,6 @@ impl DnsResolver { } } -#[async_trait] impl DnsResolve for DnsResolver { async fn resolve(&self, host: &str, port: u16) -> io::Result> { let mut name = Name::from_utf8(host)?; diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/net/udp/association.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/net/udp/association.rs index 5ca4da94c6..d0563158ea 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/net/udp/association.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/net/udp/association.rs @@ -9,7 +9,6 @@ use std::{ time::Duration, }; -use async_trait::async_trait; use bytes::Bytes; use futures::future; use log::{debug, error, trace, warn}; @@ -35,10 +34,7 @@ use crate::{ }; /// Writer for sending packets back to client -/// -/// Currently it requires `async-trait` for `async fn` in trait, which will allocate a `Box`ed `Future` every call of `send_to`. -/// This performance issue could be solved when `generic_associated_types` and `generic_associated_types` are stabilized. -#[async_trait] +#[trait_variant::make(Send)] pub trait UdpInboundWrite { /// Sends packet `data` received from `remote_addr` back to `peer_addr` async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()>; diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/redir_ext.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/redir_ext.rs index 071a2d1aea..7caa03773e 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/redir_ext.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/redir_ext.rs @@ -8,14 +8,12 @@ use std::{ task::{Context, Poll}, }; -use async_trait::async_trait; use shadowsocks::net::AcceptOpts; use tokio::net::TcpListener; use crate::config::RedirType; /// Extension function for `TcpListener` for setting extra options before `bind()` -#[async_trait] pub trait TcpListenerRedirExt { // Create a TcpListener for transparent proxy // diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs index 1c011f4251..7c860c7b38 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs @@ -3,7 +3,6 @@ use std::{ net::SocketAddr, }; -use async_trait::async_trait; use log::warn; use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts}; use socket2::Protocol; @@ -17,7 +16,6 @@ use crate::{ }, }; -#[async_trait] impl TcpListenerRedirExt for TcpListener { async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result { match ty { diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs index f0d32c6008..dc12a3398f 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs @@ -5,7 +5,6 @@ use std::{ os::unix::io::AsRawFd, }; -use async_trait::async_trait; use log::warn; use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts}; use socket2::SockAddr; @@ -19,7 +18,6 @@ use crate::{ }, }; -#[async_trait] impl TcpListenerRedirExt for TcpListener { async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result { match ty { diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/windows/mod.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/windows/mod.rs index a15e239a1d..257168740a 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/windows/mod.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/tcprelay/sys/windows/mod.rs @@ -3,7 +3,6 @@ use std::{ net::SocketAddr, }; -use async_trait::async_trait; use shadowsocks::net::AcceptOpts; use tokio::net::{TcpListener, TcpStream}; @@ -12,7 +11,6 @@ use crate::{ local::redir::redir_ext::{TcpListenerRedirExt, TcpStreamRedirExt}, }; -#[async_trait] impl TcpListenerRedirExt for TcpListener { async fn bind_redir(_ty: RedirType, _addr: SocketAddr, _accept_opts: AcceptOpts) -> io::Result { let err = Error::new( diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs index 1c327a6c77..cb16e68001 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs @@ -7,7 +7,6 @@ use std::{ time::Duration, }; -use async_trait::async_trait; use log::{debug, error, info, trace, warn}; use lru_time_cache::LruCache; use shadowsocks::{ @@ -91,7 +90,6 @@ impl UdpRedirInboundWriter { } } -#[async_trait] impl UdpInboundWrite for UdpRedirInboundWriter { async fn send_to(&self, mut peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { // If IPv6 Transparent Proxy is supported on the current platform, diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs index 7d36091b08..5919023882 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs @@ -7,7 +7,6 @@ use std::{ time::Duration, }; -use async_trait::async_trait; use byte_string::ByteStr; use bytes::{BufMut, BytesMut}; use log::{debug, error, info, trace}; @@ -96,7 +95,6 @@ struct Socks5UdpInboundWriter { inbound: Arc, } -#[async_trait] impl UdpInboundWrite for Socks5UdpInboundWriter { async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { let remote_addr = match remote_addr { diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/tun/udp.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/tun/udp.rs index 924f22a496..2a25ba9de0 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/tun/udp.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/tun/udp.rs @@ -5,7 +5,6 @@ use std::{ time::Duration, }; -use async_trait::async_trait; use bytes::{BufMut, BytesMut}; use etherparse::PacketBuilder; use log::debug; @@ -93,7 +92,6 @@ impl UdpTunInboundWriter { } } -#[async_trait] impl UdpInboundWrite for UdpTunInboundWriter { async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { let addr = match *remote_addr { diff --git a/shadowsocks-rust/crates/shadowsocks-service/src/local/tunnel/udprelay.rs b/shadowsocks-rust/crates/shadowsocks-service/src/local/tunnel/udprelay.rs index daab725efd..4015a11951 100644 --- a/shadowsocks-rust/crates/shadowsocks-service/src/local/tunnel/udprelay.rs +++ b/shadowsocks-rust/crates/shadowsocks-service/src/local/tunnel/udprelay.rs @@ -2,7 +2,6 @@ use std::{io, net::SocketAddr, sync::Arc, time::Duration}; -use async_trait::async_trait; use log::{debug, error, info}; use shadowsocks::{ relay::{socks5::Address, udprelay::MAXIMUM_UDP_PAYLOAD_SIZE}, @@ -87,7 +86,6 @@ struct TunnelUdpInboundWriter { inbound: Arc, } -#[async_trait] impl UdpInboundWrite for TunnelUdpInboundWriter { async fn send_to(&self, peer_addr: SocketAddr, _remote_addr: &Address, data: &[u8]) -> io::Result<()> { self.inbound.send_to(data, peer_addr).await.map(|_| ()) diff --git a/shadowsocks-rust/crates/shadowsocks/Cargo.toml b/shadowsocks-rust/crates/shadowsocks/Cargo.toml index ba3928baed..b4382d7ae2 100644 --- a/shadowsocks-rust/crates/shadowsocks/Cargo.toml +++ b/shadowsocks-rust/crates/shadowsocks/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-core" keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] license = "MIT" edition = "2021" -rust-version = "1.74" +rust-version = "1.75" [badges] maintenance = { status = "passively-maintained" } @@ -71,7 +71,8 @@ serde_json = "1.0" percent-encoding = "2.1" futures = "0.3" -async-trait = "0.1" +trait-variant = "0.1" +dynosaur = "0.1.2" socket2 = { version = "0.5", features = ["all"] } tokio = { version = "1.9.0", features = [ diff --git a/shadowsocks-rust/crates/shadowsocks/src/dns_resolver/resolver.rs b/shadowsocks-rust/crates/shadowsocks/src/dns_resolver/resolver.rs index 04bb6d15dc..dfd78b45e0 100644 --- a/shadowsocks-rust/crates/shadowsocks/src/dns_resolver/resolver.rs +++ b/shadowsocks-rust/crates/shadowsocks/src/dns_resolver/resolver.rs @@ -11,7 +11,6 @@ use std::{ #[cfg(feature = "hickory-dns")] use arc_swap::ArcSwap; -use async_trait::async_trait; use cfg_if::cfg_if; #[cfg(feature = "hickory-dns")] use hickory_resolver::config::ResolverConfig; @@ -31,12 +30,17 @@ use crate::net::ConnectOpts; use super::hickory_dns_resolver::DnsResolver as HickoryDnsResolver; /// Abstract DNS resolver -#[async_trait] +#[trait_variant::make(Send)] +#[dynosaur::dynosaur(DynDnsResolve)] pub trait DnsResolve { /// Resolves `addr:port` to a list of `SocketAddr` async fn resolve(&self, addr: &str, port: u16) -> io::Result>; } +// Equivalent to (dyn DnsResolve + Send + Sync) +unsafe impl Send for DynDnsResolve<'_> {} +unsafe impl Sync for DynDnsResolve<'_> {} + #[cfg(feature = "hickory-dns")] #[derive(Debug)] pub struct HickoryDnsSystemResolver { @@ -63,7 +67,7 @@ pub enum DnsResolver { #[cfg(feature = "hickory-dns")] HickoryDns(HickoryDnsResolver), /// Customized Resolver - Custom(Box), + Custom(Box>), } impl Default for DnsResolver { @@ -282,7 +286,7 @@ impl DnsResolver { where R: DnsResolve + Send + Sync + 'static, { - DnsResolver::Custom(Box::new(custom) as Box) + DnsResolver::Custom(DynDnsResolve::boxed(custom)) } /// Resolve address into `SocketAddr`s diff --git a/sing-box/adapter/connections.go b/sing-box/adapter/connections.go index 52745a5827..0682d05a0f 100644 --- a/sing-box/adapter/connections.go +++ b/sing-box/adapter/connections.go @@ -8,8 +8,7 @@ import ( ) type ConnectionManager interface { - Start() error - Close() error + Lifecycle NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata InboundContext, onClose N.CloseHandlerFunc) NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata InboundContext, onClose N.CloseHandlerFunc) } diff --git a/sing-box/box.go b/sing-box/box.go index b47122c714..5dc76ebc7b 100644 --- a/sing-box/box.go +++ b/sing-box/box.go @@ -336,11 +336,11 @@ func (s *Box) preStart() error { if err != nil { return err } - err = adapter.Start(adapter.StartStateInitialize, s.network, s.router, s.outbound, s.inbound, s.endpoint) + err = adapter.Start(adapter.StartStateInitialize, s.network, s.connection, s.router, s.outbound, s.inbound, s.endpoint) if err != nil { return err } - err = adapter.Start(adapter.StartStateStart, s.outbound, s.network, s.router) + err = adapter.Start(adapter.StartStateStart, s.outbound, s.network, s.connection, s.router) if err != nil { return err } @@ -364,7 +364,7 @@ func (s *Box) start() error { if err != nil { return err } - err = adapter.Start(adapter.StartStatePostStart, s.outbound, s.network, s.router, s.inbound, s.endpoint) + err = adapter.Start(adapter.StartStatePostStart, s.outbound, s.network, s.connection, s.router, s.inbound, s.endpoint) if err != nil { return err } @@ -372,7 +372,7 @@ func (s *Box) start() error { if err != nil { return err } - err = adapter.Start(adapter.StartStateStarted, s.network, s.router, s.outbound, s.inbound, s.endpoint) + err = adapter.Start(adapter.StartStateStarted, s.network, s.connection, s.router, s.outbound, s.inbound, s.endpoint) if err != nil { return err } @@ -391,7 +391,7 @@ func (s *Box) Close() error { close(s.done) } err := common.Close( - s.inbound, s.outbound, s.router, s.network, + s.inbound, s.outbound, s.router, s.connection, s.network, ) for _, lifecycleService := range s.services { err = E.Append(err, lifecycleService.Close(), func(err error) error { diff --git a/sing-box/docs/changelog.md b/sing-box/docs/changelog.md index 3e775bc181..707432f150 100644 --- a/sing-box/docs/changelog.md +++ b/sing-box/docs/changelog.md @@ -2,7 +2,7 @@ icon: material/alert-decagram --- -#### 1.11.0-alpha.23 +#### 1.11.0-alpha.24 * Fixes and improvements diff --git a/sing-box/route/conn.go b/sing-box/route/conn.go index a3d4d96530..4a2192e0da 100644 --- a/sing-box/route/conn.go +++ b/sing-box/route/conn.go @@ -34,7 +34,10 @@ func NewConnectionManager(logger logger.ContextLogger) *ConnectionManager { } } -func (m *ConnectionManager) Start() error { +func (m *ConnectionManager) Start(stage adapter.StartStage) error { + if stage != adapter.StartStateInitialize { + return nil + } return m.monitor.Start() } @@ -75,6 +78,7 @@ func (m *ConnectionManager) NewConnection(ctx context.Context, this N.Dialer, co func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader, destination io.Writer, direction bool, done *atomic.Bool, onClose N.CloseHandlerFunc) { originSource := source + originDestination := destination var readCounters, writeCounters []N.CountFunc for { source, readCounters = N.UnwrapCountReader(source, readCounters) @@ -92,7 +96,7 @@ func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader onClose(err) } } - common.Close(source, destination) + common.Close(originSource, originDestination) return } for _, counter := range readCounters { @@ -108,17 +112,20 @@ func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader } _, err := bufio.CopyWithCounters(destination, source, originSource, readCounters, writeCounters) if err != nil { - common.Close(destination, source) - } else if _, dstDuplex := destination.(N.WriteCloser); dstDuplex { - N.CloseWrite(destination) + common.Close(originSource, originDestination) + } else if duplexDst, isDuplex := destination.(N.WriteCloser); isDuplex { + err = duplexDst.CloseWrite() + if err != nil { + common.Close(originSource, originDestination) + } } else { - common.Close(destination) + common.Close(originDestination) } if done.Swap(true) { if onClose != nil { onClose(err) } - common.Close(source, destination) + common.Close(originSource, originDestination) } if !direction { if err == nil { @@ -220,10 +227,10 @@ func (m *ConnectionManager) NewPacketConnection(ctx context.Context, this N.Dial ctx, conn = canceler.NewPacketConn(ctx, conn, udpTimeout) } destination := bufio.NewPacketConn(remotePacketConn) + var done atomic.Bool if ctx.Done() != nil { onClose = N.AppendClose(onClose, m.monitor.Add(ctx, conn)) } - var done atomic.Bool go m.packetConnectionCopy(ctx, conn, destination, false, &done, onClose) go m.packetConnectionCopy(ctx, destination, conn, true, &done, onClose) } diff --git a/sing-box/route/conn_monitor.go b/sing-box/route/conn_monitor.go index 04df3ddafd..9e271b82a0 100644 --- a/sing-box/route/conn_monitor.go +++ b/sing-box/route/conn_monitor.go @@ -68,6 +68,9 @@ func (m *ConnectionMonitor) Close() error { m.access.Lock() defer m.access.Unlock() close(m.reloadChan) + for element := m.connections.Front(); element != nil; element = element.Next() { + element.Value.closer.Close() + } return nil } @@ -96,6 +99,7 @@ func (m *ConnectionMonitor) monitor() { if len(selectCases) < m.connections.Len()+1 { selectCases = make([]reflect.SelectCase, 0, m.connections.Len()+1) } + elements = elements[:0] selectCases = selectCases[:1] selectCases[0] = rootCase for element := m.connections.Front(); element != nil; element = element.Next() { diff --git a/small/luci-app-mihomo/Makefile b/small/luci-app-mihomo/Makefile index 81cfaed920..7ad2374acd 100644 --- a/small/luci-app-mihomo/Makefile +++ b/small/luci-app-mihomo/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.13.0 +PKG_VERSION:=1.13.1 LUCI_TITLE:=LuCI Support for mihomo LUCI_DEPENDS:=+luci-base +mihomo diff --git a/small/luci-app-passwall/root/usr/share/passwall/0_default_config b/small/luci-app-passwall/root/usr/share/passwall/0_default_config index 3a48f1e25f..918aaa4a9d 100644 --- a/small/luci-app-passwall/root/usr/share/passwall/0_default_config +++ b/small/luci-app-passwall/root/usr/share/passwall/0_default_config @@ -163,7 +163,8 @@ domain:store.steampowered.com' config shunt_rules 'AIGC' option remarks 'AIGC' - option domain_list 'geosite:category-ai-chat-!cn' + option domain_list 'geosite:category-ai-chat-!cn +domain:apple-relay.apple.com' config shunt_rules 'Streaming' option remarks 'Streaming' diff --git a/small/luci-app-passwall/root/usr/share/passwall/rules/proxy_host b/small/luci-app-passwall/root/usr/share/passwall/rules/proxy_host index a70321f72a..72c498c54d 100644 --- a/small/luci-app-passwall/root/usr/share/passwall/rules/proxy_host +++ b/small/luci-app-passwall/root/usr/share/passwall/rules/proxy_host @@ -2,6 +2,7 @@ engage.cloudflareclient.com github.com bing.com c.mi.com +apple-relay.apple.com #google googleapis.cn diff --git a/small/mihomo/Makefile b/small/mihomo/Makefile index 2ed6cfae96..29305e1157 100644 --- a/small/mihomo/Makefile +++ b/small/mihomo/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mihomo -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_DATE:=2024-11-14 -PKG_SOURCE_VERSION:=de19f927e86573a7a97159e3b9925049f06d4563 -PKG_MIRROR_HASH:=931d397995b2da9e97f3f050d4650fa9013980d6c523df40bca3b58822a42409 +PKG_SOURCE_DATE:=2024-11-24 +PKG_SOURCE_VERSION:=eb985b002e5aa61c4c2208646f33180c4fc938f9 +PKG_MIRROR_HASH:=058ca55e42cbebecfa0b65b5b8f792bfba8c5240cfa43c44a017d0bdab498230 PKG_LICENSE:=MIT PKG_MAINTAINER:=Joseph Mory @@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_BUILD_FLAGS:=no-mips16 -PKG_BUILD_VERSION:=alpha-de19f92 +PKG_BUILD_VERSION:=alpha-eb985b0 PKG_BUILD_TIME:=$(shell date -u -Iseconds) GO_PKG:=github.com/metacubex/mihomo diff --git a/small/mihomo/files/mihomo.init b/small/mihomo/files/mihomo.init index 2e620fda64..2b641f488e 100644 --- a/small/mihomo/files/mihomo.init +++ b/small/mihomo/files/mihomo.init @@ -159,8 +159,14 @@ start_service() { cp -f "$profile_file" "$RUN_PROFILE_PATH" elif [[ "$profile" == "subscription:"* ]]; then local subscription_section; subscription_section="${profile/subscription:/}" + local subscription_name subscription_prefer + config_get subscription_name "$subscription_section" "name" + config_get subscription_prefer "$subscription_section" "prefer" "remote" + log "Use Subscription: $subscription_name." local subscription_file; subscription_file="$SUBSCRIPTIONS_DIR/$subscription_section.yaml" - update_subscription "$subscription_section" + if [ "$subscription_prefer" == "remote" ] || [[ "$subscription_prefer" == "local" && ! -f "$subscription_file" ]]; then + update_subscription "$subscription_section" + fi if [ ! -f "$subscription_file" ]; then log "Subscription file not found." log "Exiting..." diff --git a/small/v2ray-geodata/Makefile b/small/v2ray-geodata/Makefile index 93084791ea..e1a8103940 100644 --- a/small/v2ray-geodata/Makefile +++ b/small/v2ray-geodata/Makefile @@ -30,13 +30,13 @@ define Download/geosite HASH:=f04433837b88a3f49d7cd6517c91e8f5de4e4496f3d88ef3b7c6be5bb63f4c6f endef -GEOSITE_IRAN_VER:=202411180037 +GEOSITE_IRAN_VER:=202411250037 GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER) define Download/geosite-ir URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/ URL_FILE:=iran.dat FILE:=$(GEOSITE_IRAN_FILE) - HASH:=f0a632368bdfd3a50745bbe4e30e8971508f98911ea05d4a7bb4e6f77ce6a225 + HASH:=2062e9541a5cf34368265e1aac57b5f750ceb9c925a141002db735000602801f endef define Package/v2ray-geodata/template diff --git a/small/v2raya/Makefile b/small/v2raya/Makefile index eb282c4038..b1cc1c1abb 100644 --- a/small/v2raya/Makefile +++ b/small/v2raya/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2rayA -PKG_VERSION:=2.2.6.2 +PKG_VERSION:=2.2.6.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=3086649d78699f52f21e6cd79e9fe1760f9dd07f8be3507023ec7cdf429a4972 +PKG_HASH:=62add8605c42e8e91b5fae22e3b05d146cdeea8fec44089fc1bf0ae29fc76dc0 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/service PKG_LICENSE:=AGPL-3.0-only @@ -60,7 +60,7 @@ define Download/v2raya-web URL:=https://github.com/v2rayA/v2rayA/releases/download/v$(PKG_VERSION)/ URL_FILE:=web.tar.gz FILE:=$(WEB_FILE) - HASH:=611cbc151c2f652110987b2c3728ec6920ca80a72fd1dc56ef6f59315348577b + HASH:=e8bca04deaec72e3323310bc114fa4936474adcbb6638ec2e31dbdf88beabdae endef define Build/Prepare diff --git a/v2rayn/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs b/v2rayn/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs index 42ec00863b..6708a38e57 100644 --- a/v2rayn/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs +++ b/v2rayn/v2rayN/ServiceLib/Handler/AutoStartupHandler.cs @@ -25,6 +25,10 @@ namespace ServiceLib.Handler await SetTaskLinux(); } } + else if(Utils.IsOSX()) + { + //TODO + } return true; } diff --git a/v2rayn/v2rayN/ServiceLib/Handler/CoreHandler.cs b/v2rayn/v2rayN/ServiceLib/Handler/CoreHandler.cs index 57e94557a2..dc59716797 100644 --- a/v2rayn/v2rayN/ServiceLib/Handler/CoreHandler.cs +++ b/v2rayn/v2rayN/ServiceLib/Handler/CoreHandler.cs @@ -23,7 +23,7 @@ namespace ServiceLib.Handler Environment.SetEnvironmentVariable("V2RAY_LOCATION_ASSET", Utils.GetBinPath(""), EnvironmentVariableTarget.Process); Environment.SetEnvironmentVariable("XRAY_LOCATION_ASSET", Utils.GetBinPath(""), EnvironmentVariableTarget.Process); - if (Utils.IsLinux()) + if (Utils.IsLinux() || Utils.IsOSX()) { var coreInfo = CoreInfoHandler.Instance.GetCoreInfo(); foreach (var it in coreInfo) @@ -258,7 +258,7 @@ namespace ServiceLib.Handler { return _config.TunModeItem.EnableTun && eCoreType == ECoreType.sing_box - && Utils.IsLinux() + && (Utils.IsLinux() || Utils.IsOSX()) //&& _config.TunModeItem.LinuxSudoPwd.IsNotEmpty() ; } diff --git a/v2rayn/v2rayN/ServiceLib/Handler/CoreInfoHandler.cs b/v2rayn/v2rayN/ServiceLib/Handler/CoreInfoHandler.cs index 5b8fa6063e..d8399b06a3 100644 --- a/v2rayn/v2rayN/ServiceLib/Handler/CoreInfoHandler.cs +++ b/v2rayn/v2rayN/ServiceLib/Handler/CoreInfoHandler.cs @@ -42,6 +42,8 @@ DownloadUrlWinArm64 = Global.NUrl + "/download/{0}/v2rayN-windows-arm64.zip", DownloadUrlLinux64 = Global.NUrl + "/download/{0}/v2rayN-linux-64.zip", DownloadUrlLinuxArm64 = Global.NUrl + "/download/{0}/v2rayN-linux-arm64.zip", + DownloadUrlOSX64 = Global.NUrl + "/download/{0}/v2rayN-macos-64.zip", + DownloadUrlOSXArm64 = Global.NUrl + "/download/{0}/v2rayN-macos-arm64.zip", }); _coreInfo.Add(new CoreInfo @@ -79,6 +81,8 @@ DownloadUrlWinArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-windows-arm64-v8a.zip", DownloadUrlLinux64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-64.zip", DownloadUrlLinuxArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-arm64-v8a.zip", + DownloadUrlOSX64 = Global.XrayCoreUrl + "/download/{0}/Xray-macos-64.zip", + DownloadUrlOSXArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-macos-arm64-v8a.zip", Match = "Xray", VersionArg = "-version", RedirectInfo = true, @@ -95,6 +99,8 @@ DownloadUrlWinArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-windows-arm64-{0}.zip", DownloadUrlLinux64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-amd64-compatible-{0}.gz", DownloadUrlLinuxArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-arm64-{0}.gz", + DownloadUrlOSX64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-darwin-amd64-compatible-{0}.gz", + DownloadUrlOSXArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-darwin-arm64-{0}.gz", Match = "Mihomo", VersionArg = "-v", RedirectInfo = true, @@ -140,6 +146,8 @@ DownloadUrlWinArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip", DownloadUrlLinux64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz", DownloadUrlLinuxArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-arm64.tar.gz", + DownloadUrlOSX64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-darwin-amd64.tar.gz", + DownloadUrlOSXArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz", Match = "sing-box", VersionArg = "version", }); diff --git a/v2rayn/v2rayN/ServiceLib/Models/CoreInfo.cs b/v2rayn/v2rayN/ServiceLib/Models/CoreInfo.cs index f7e673d62a..1afcd0b661 100644 --- a/v2rayn/v2rayN/ServiceLib/Models/CoreInfo.cs +++ b/v2rayn/v2rayN/ServiceLib/Models/CoreInfo.cs @@ -12,6 +12,8 @@ public string? DownloadUrlWinArm64 { get; set; } public string? DownloadUrlLinux64 { get; set; } public string? DownloadUrlLinuxArm64 { get; set; } + public string? DownloadUrlOSX64 { get; set; } + public string? DownloadUrlOSXArm64 { get; set; } public string? Match { get; set; } public string? VersionArg { get; set; } public bool RedirectInfo { get; set; } diff --git a/v2rayn/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayn/v2rayN/ServiceLib/Services/UpdateService.cs index 6474db7c68..7ce7975fc3 100644 --- a/v2rayn/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayn/v2rayN/ServiceLib/Services/UpdateService.cs @@ -450,6 +450,15 @@ namespace ServiceLib.Services _ => null, }; } + else if (Utils.IsOSX()) + { + return RuntimeInformation.ProcessArchitecture switch + { + Architecture.Arm64 => coreInfo?.DownloadUrlOSXArm64, + Architecture.X64 => coreInfo?.DownloadUrlOSX64, + _ => null, + }; + } return null; } diff --git a/v2rayn/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayn/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index 5890d614bd..dcfc122e17 100644 --- a/v2rayn/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayn/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -262,7 +262,7 @@ namespace ServiceLib.ViewModels FileManager.ZipExtractToFile(fileName, toPath, _config.GuiItem.IgnoreGeoUpdateCore ? "geo" : ""); } - if (Utils.IsLinux()) + if (Utils.IsLinux() || Utils.IsOSX()) { var filesList = (new DirectoryInfo(toPath)).GetFiles().Select(u => u.FullName).ToList(); foreach (var file in filesList) diff --git a/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index 73ee08665d..456524f2e3 100644 --- a/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -437,6 +437,11 @@ namespace ServiceLib.ViewModels { return _config.TunModeItem.LinuxSudoPwd.IsNotEmpty(); } + else if (Utils.IsOSX()) + { + //TODO + return false; + } return false; } diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs index 4fff78f41f..8642defe88 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs @@ -169,6 +169,12 @@ namespace v2rayN.Desktop.Views { tabSystemproxy.IsVisible = false; } + + if (Utils.IsOSX()) + { + togAutoRun.IsVisible = false; + //TODO + } } private async Task UpdateViewHandler(EViewAction action, object? obj) @@ -202,7 +208,7 @@ namespace v2rayN.Desktop.Views { return lstFonts; } - else if (Utils.IsLinux()) + else if (Utils.IsLinux() || Utils.IsOSX()) { var result = await Utils.GetLinuxFontFamily("zh"); if (result.IsNullOrEmpty()) diff --git a/xray-core/app/router/condition_geoip_test.go b/xray-core/app/router/condition_geoip_test.go index 63bd222ec9..07f40b83e9 100644 --- a/xray-core/app/router/condition_geoip_test.go +++ b/xray-core/app/router/condition_geoip_test.go @@ -1,6 +1,7 @@ package router_test import ( + "fmt" "os" "path/filepath" "testing" @@ -13,16 +14,25 @@ import ( "google.golang.org/protobuf/proto" ) -func init() { - wd, err := os.Getwd() - common.Must(err) +func getAssetPath(file string) (string, error) { + path := platform.GetAssetLocation(file) + _, err := os.Stat(path) + if os.IsNotExist(err) { + path := filepath.Join("..", "..", "resources", file) + _, err := os.Stat(path) + if os.IsNotExist(err) { + return "", fmt.Errorf("can't find %s in standard asset locations or {project_root}/resources", file) + } + if err != nil { + return "", fmt.Errorf("can't stat %s: %v", path, err) + } + return path, nil + } + if err != nil { + return "", fmt.Errorf("can't stat %s: %v", path, err) + } - if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) { - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "resources", "geoip.dat"))) - } - if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && os.IsNotExist(err) { - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "resources", "geosite.dat"))) - } + return path, nil } func TestGeoIPMatcherContainer(t *testing.T) { @@ -217,10 +227,15 @@ func TestGeoIPMatcher6US(t *testing.T) { } func loadGeoIP(country string) ([]*router.CIDR, error) { - geoipBytes, err := filesystem.ReadAsset("geoip.dat") + path, err := getAssetPath("geoip.dat") if err != nil { return nil, err } + geoipBytes, err := filesystem.ReadFile(path) + if err != nil { + return nil, err + } + var geoipList router.GeoIPList if err := proto.Unmarshal(geoipBytes, &geoipList); err != nil { return nil, err diff --git a/xray-core/app/router/condition_test.go b/xray-core/app/router/condition_test.go index 75ee86dd51..97d05db96b 100644 --- a/xray-core/app/router/condition_test.go +++ b/xray-core/app/router/condition_test.go @@ -1,8 +1,6 @@ package router_test import ( - "os" - "path/filepath" "strconv" "testing" @@ -10,7 +8,6 @@ import ( "github.com/xtls/xray-core/common" "github.com/xtls/xray-core/common/errors" "github.com/xtls/xray-core/common/net" - "github.com/xtls/xray-core/common/platform" "github.com/xtls/xray-core/common/platform/filesystem" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol/http" @@ -20,18 +17,6 @@ import ( "google.golang.org/protobuf/proto" ) -func init() { - wd, err := os.Getwd() - common.Must(err) - - if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) { - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) - } - if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && os.IsNotExist(err) { - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "release", "config", "geosite.dat"))) - } -} - func withBackground() routing.Context { return &routing_session.Context{} } @@ -316,10 +301,15 @@ func TestRoutingRule(t *testing.T) { } func loadGeoSite(country string) ([]*Domain, error) { - geositeBytes, err := filesystem.ReadAsset("geosite.dat") + path, err := getAssetPath("geosite.dat") if err != nil { return nil, err } + geositeBytes, err := filesystem.ReadFile(path) + if err != nil { + return nil, err + } + var geositeList GeoSiteList if err := proto.Unmarshal(geositeBytes, &geositeList); err != nil { return nil, err diff --git a/xray-core/go.mod b/xray-core/go.mod index c93cbb75a7..facbf223cb 100644 --- a/xray-core/go.mod +++ b/xray-core/go.mod @@ -17,7 +17,7 @@ require ( github.com/sagernet/sing v0.5.1 github.com/sagernet/sing-shadowsocks v0.2.7 github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e github.com/vishvananda/netlink v1.3.0 github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d diff --git a/xray-core/go.sum b/xray-core/go.sum index fbad852bf8..576197f431 100644 --- a/xray-core/go.sum +++ b/xray-core/go.sum @@ -62,8 +62,8 @@ github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1 github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI= github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk= diff --git a/xray-core/proxy/vless/inbound/inbound.go b/xray-core/proxy/vless/inbound/inbound.go index 48849eb27a..a2415a44cd 100644 --- a/xray-core/proxy/vless/inbound/inbound.go +++ b/xray-core/proxy/vless/inbound/inbound.go @@ -491,12 +491,12 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s rawInput = (*bytes.Buffer)(unsafe.Pointer(p + r.Offset)) } } else { - return errors.New(account.ID.String() + " is not able to use " + requestAddons.Flow).AtWarning() + return errors.New("account " + account.ID.String() + " is not able to use the flow " + requestAddons.Flow).AtWarning() } case "": inbound.CanSpliceCopy = 3 if account.Flow == vless.XRV && (request.Command == protocol.RequestCommandTCP || isMuxAndNotXUDP(request, first)) { - return errors.New(account.ID.String() + " is not able to use \"\". Note that the pure TLS proxy has certain TLS in TLS characters.").AtWarning() + return errors.New("account " + account.ID.String() + " is rejected since the client flow is empty. Note that the pure TLS proxy has certain TLS in TLS characters.").AtWarning() } default: return errors.New("unknown request flow " + requestAddons.Flow).AtWarning() diff --git a/xray-core/testing/scenarios/common.go b/xray-core/testing/scenarios/common.go index 8d629c59ba..dc54105a81 100644 --- a/xray-core/testing/scenarios/common.go +++ b/xray-core/testing/scenarios/common.go @@ -96,6 +96,7 @@ func InitializeServerConfig(config *core.Config) (*exec.Cmd, error) { var ( testBinaryPath string + testBinaryCleanFn func() testBinaryPathGen sync.Once ) @@ -108,6 +109,7 @@ func genTestBinaryPath() { return err } tempDir = dir + testBinaryCleanFn = func() { os.RemoveAll(dir) } return nil })) file := filepath.Join(tempDir, "xray.test") diff --git a/xray-core/testing/scenarios/main_test.go b/xray-core/testing/scenarios/main_test.go new file mode 100644 index 0000000000..269081c630 --- /dev/null +++ b/xray-core/testing/scenarios/main_test.go @@ -0,0 +1,12 @@ +package scenarios + +import ( + "testing" +) + +func TestMain(m *testing.M) { + genTestBinaryPath() + defer testBinaryCleanFn() + + m.Run() +} diff --git a/yass/openwrt/files/config.json.sample b/yass/openwrt/files/config.json.sample index c17f99acb3..9b470d2575 100644 --- a/yass/openwrt/files/config.json.sample +++ b/yass/openwrt/files/config.json.sample @@ -5,7 +5,7 @@ "server": "http2.github.io", "server_sni": "", "server_port": 443, - "timeout": 0, + "connect_timeout": 2000, "username": "username", "password": "password", "insecure_mode": false, diff --git a/yass/openwrt/files/redir.json.sample b/yass/openwrt/files/redir.json.sample index 98e246064d..a68fdf4bea 100644 --- a/yass/openwrt/files/redir.json.sample +++ b/yass/openwrt/files/redir.json.sample @@ -5,7 +5,7 @@ "server": "http2.github.io", "server_sni": "", "server_port": 443, - "timeout": 0, + "connect_timeout": 2000, "username": "username", "password": "password", "insecure_mode": false, diff --git a/yass/src/config/config.cpp b/yass/src/config/config.cpp index 7a3feac9bf..7b84dbb718 100644 --- a/yass/src/config/config.cpp +++ b/yass/src/config/config.cpp @@ -49,6 +49,9 @@ bool ReadConfig() { config_impl->Read("doh_url", &FLAGS_doh_url); config_impl->Read("dot_host", &FLAGS_dot_host); + if (config_impl->HasKey("timeout")) { + config_impl->Read("timeout", &FLAGS_connect_timeout); + } config_impl->Read("connect_timeout", &FLAGS_connect_timeout); config_impl->Read("tcp_nodelay", &FLAGS_tcp_nodelay); config_impl->Read("limit_rate", &FLAGS_limit_rate); @@ -123,7 +126,7 @@ bool SaveConfig() { static_cast(config_impl->Delete("threads")); all_fields_written &= config_impl->Write("doh_url", FLAGS_doh_url); all_fields_written &= config_impl->Write("dot_host", FLAGS_dot_host); - all_fields_written &= config_impl->Write("timeout", FLAGS_connect_timeout); + static_cast(config_impl->Delete("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); @@ -173,7 +176,7 @@ std::string ValidateConfig() { auto doh_url = absl::GetFlag(FLAGS_doh_url); auto dot_host = absl::GetFlag(FLAGS_dot_host); // auto limit_rate = absl::GetFlag(FLAGS_limit_rate); - // auto timeout = absl::GetFlag(FLAGS_connect_timeout); + auto timeout = absl::GetFlag(FLAGS_connect_timeout); // TODO validate other configurations as well @@ -231,6 +234,10 @@ std::string ValidateConfig() { } } + if (timeout < 0) { + err_msg << ",Invalid Connect Timeout: " << timeout; + } + auto ret = err_msg.str(); if (ret.empty()) { return ret; diff --git a/yass/src/net/ssl_stream.hpp b/yass/src/net/ssl_stream.hpp index a760a12c75..a476bea717 100644 --- a/yass/src/net/ssl_stream.hpp +++ b/yass/src/net/ssl_stream.hpp @@ -39,16 +39,12 @@ class ssl_stream : public stream { bool https_fallback, SSL_CTX* ssl_ctx) : stream(io_context, host_ips, host_sni, port, channel), - https_fallback_(https_fallback), enable_tls_(true), - ssl_socket_(SSLSocket::Create(ssl_socket_data_index, - ssl_client_session_cache, - &io_context, - &socket_, - ssl_ctx, - https_fallback, - host_sni, - port)) {} + ssl_socket_data_index_(ssl_socket_data_index), + ssl_client_session_cache_(ssl_client_session_cache), + ssl_ctx_(ssl_ctx), + https_fallback_(https_fallback), + ssl_socket_(nullptr) {} ~ssl_stream() override {} @@ -72,7 +68,11 @@ class ssl_stream : public stream { void s_close(asio::error_code& ec) override { ec = asio::error_code(); - ssl_socket_->Disconnect(); + if (ssl_socket_) { + ssl_socket_->Disconnect(); + } else { + stream::s_close(ec); + } } void on_async_connected(Channel* channel, asio::error_code ec) override { @@ -81,6 +81,8 @@ class ssl_stream : public stream { return; } scoped_refptr self(this); + ssl_socket_ = SSLSocket::Create(ssl_socket_data_index_, ssl_client_session_cache_, &io_context_, &socket_, ssl_ctx_, + https_fallback_, host_sni_, port_); ssl_socket_->Connect([this, channel, self](int rv) { if (closed_) { DCHECK(!user_connect_callback_); @@ -89,7 +91,7 @@ class ssl_stream : public stream { asio::error_code ec; if (rv < 0) { ec = asio::error::connection_refused; - on_async_connected(channel, ec); + stream::on_async_connected(channel, ec); return; } @@ -124,8 +126,13 @@ class ssl_stream : public stream { } private: - bool https_fallback_; const bool enable_tls_; + + const int ssl_socket_data_index_; + SSLClientSessionCache* const ssl_client_session_cache_; + SSL_CTX* const ssl_ctx_; + + bool https_fallback_; scoped_refptr ssl_socket_; }; diff --git a/yass/src/net/stream.hpp b/yass/src/net/stream.hpp index 9a01f26685..c1f1b00d16 100644 --- a/yass/src/net/stream.hpp +++ b/yass/src/net/stream.hpp @@ -401,10 +401,6 @@ class stream : public gurl_base::RefCountedThreadSafe { VLOG(1) << "trying endpoint (" << domain() << "): " << endpoint; endpoints_.pop_front(); endpoint_ = std::move(endpoint); - if (socket_.is_open()) { - asio::error_code ec; - socket_.close(ec); - } on_resolve(channel); } @@ -418,6 +414,11 @@ class stream : public gurl_base::RefCountedThreadSafe { on_async_connect_callback(asio::error::network_unreachable); return; } + // avoid asio::error::already_open error + if (socket_.is_open()) { + asio::error_code ec; + s_close(ec); + } asio::error_code ec; socket_.open(endpoint_.protocol(), ec); if (ec) { @@ -572,9 +573,9 @@ class stream : public gurl_base::RefCountedThreadSafe { net::Resolver resolver_; protected: - std::string host_ips_; - std::string host_sni_; - uint16_t port_; + const std::string host_ips_; + const std::string host_sni_; + const uint16_t port_; asio::ip::tcp::endpoint endpoint_; asio::io_context& io_context_; asio::ip::tcp::socket socket_; diff --git a/yass/yass-redir.json.sample b/yass/yass-redir.json.sample index 98e246064d..a68fdf4bea 100644 --- a/yass/yass-redir.json.sample +++ b/yass/yass-redir.json.sample @@ -5,7 +5,7 @@ "server": "http2.github.io", "server_sni": "", "server_port": 443, - "timeout": 0, + "connect_timeout": 2000, "username": "username", "password": "password", "insecure_mode": false, diff --git a/yass/yass-server.json.sample b/yass/yass-server.json.sample index ef6b27e4d2..89753e0ae0 100644 --- a/yass/yass-server.json.sample +++ b/yass/yass-server.json.sample @@ -2,7 +2,7 @@ "method": "http2", "server": "localhost", "server_port": 443, - "timeout": 0, + "connect_timeout": 2000, "username": "username", "password": "password", "private_key_file": "/etc/yass/private_key.pem", diff --git a/yass/yass.json.sample b/yass/yass.json.sample index c17f99acb3..9b470d2575 100644 --- a/yass/yass.json.sample +++ b/yass/yass.json.sample @@ -5,7 +5,7 @@ "server": "http2.github.io", "server_sni": "", "server_port": 443, - "timeout": 0, + "connect_timeout": 2000, "username": "username", "password": "password", "insecure_mode": false, diff --git a/yt-dlp/yt_dlp/extractor/chaturbate.py b/yt-dlp/yt_dlp/extractor/chaturbate.py index a40b7d39c7..d031d3985e 100644 --- a/yt-dlp/yt_dlp/extractor/chaturbate.py +++ b/yt-dlp/yt_dlp/extractor/chaturbate.py @@ -59,16 +59,15 @@ class ChaturbateIE(InfoExtractor): 'Accept': 'application/json', }, fatal=False, impersonate=True) or {} - status = response.get('room_status') - if status != 'public': - if error := self._ERROR_MAP.get(status): - raise ExtractorError(error, expected=True) - self.report_warning('Falling back to webpage extraction') - return None - m3u8_url = response.get('url') if not m3u8_url: - self.raise_geo_restricted() + status = response.get('room_status') + if error := self._ERROR_MAP.get(status): + raise ExtractorError(error, expected=True) + if status == 'public': + self.raise_geo_restricted() + self.report_warning(f'Got status "{status}" from API; falling back to webpage extraction') + return None return { 'id': video_id,