Update On Mon Nov 25 19:36:45 CET 2024

This commit is contained in:
github-action[bot]
2024-11-25 19:36:45 +01:00
parent d1d2d4712c
commit 109b874dd4
84 changed files with 945 additions and 1168 deletions
+1
View File
@@ -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 Fri Nov 22 19:38:14 CET 2024
Update On Sat Nov 23 19:33:03 CET 2024 Update On Sat Nov 23 19:33:03 CET 2024
Update On Sun Nov 24 19:33:36 CET 2024 Update On Sun Nov 24 19:33:36 CET 2024
Update On Mon Nov 25 19:36:34 CET 2024
+19 -3
View File
@@ -15,7 +15,8 @@ use chrono::Local;
use log::debug; use log::debug;
use nyanpasu_ipc::api::status::CoreState; use nyanpasu_ipc::api::status::CoreState;
use profile::item_type::ProfileItemType; 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 std::{borrow::Cow, collections::VecDeque, path::PathBuf, result::Result as StdResult};
use storage::{StorageOperationError, WebStorage}; use storage::{StorageOperationError, WebStorage};
use sysproxy::Sysproxy; use sysproxy::Sysproxy;
@@ -118,8 +119,23 @@ pub async fn import_profile(url: String, option: Option<RemoteProfileOptionsBuil
pub async fn create_profile(item: Mapping, file_data: Option<String>) -> Result { pub async fn create_profile(item: Mapping, file_data: Option<String>) -> Result {
let kind = item let kind = item
.get("type") .get("type")
.and_then(|kind| serde_yaml::from_value::<ProfileItemType>(kind.clone()).ok()) .ok_or(anyhow!("the type field is not found"))?;
.ok_or(anyhow!("the type field is null"))?; // 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); let item = serde_yaml::Value::Mapping(item);
tracing::trace!("create profile: {kind:?} with {item:?}"); tracing::trace!("create profile: {kind:?} with {item:?}");
let profile: Profile = match kind { let profile: Profile = match kind {
@@ -29,7 +29,7 @@
"country-code-emoji": "2.3.0", "country-code-emoji": "2.3.0",
"dayjs": "1.11.13", "dayjs": "1.11.13",
"framer-motion": "12.0.0-alpha.2", "framer-motion": "12.0.0-alpha.2",
"i18next": "24.0.0", "i18next": "24.0.2",
"jotai": "2.10.3", "jotai": "2.10.3",
"json-schema": "0.4.0", "json-schema": "0.4.0",
"material-react-table": "3.0.1", "material-react-table": "3.0.1",
@@ -52,10 +52,10 @@
"@csstools/normalize.css": "12.1.1", "@csstools/normalize.css": "12.1.1",
"@emotion/babel-plugin": "11.13.5", "@emotion/babel-plugin": "11.13.5",
"@emotion/react": "11.13.5", "@emotion/react": "11.13.5",
"@iconify/json": "2.2.275", "@iconify/json": "2.2.276",
"@monaco-editor/react": "4.6.0", "@monaco-editor/react": "4.6.0",
"@tanstack/react-router": "1.82.2", "@tanstack/react-router": "1.82.8",
"@tanstack/router-devtools": "1.82.2", "@tanstack/router-devtools": "1.82.8",
"@tanstack/router-plugin": "1.81.9", "@tanstack/router-plugin": "1.81.9",
"@tauri-apps/plugin-clipboard-manager": "2.0.0", "@tauri-apps/plugin-clipboard-manager": "2.0.0",
"@tauri-apps/plugin-dialog": "2.0.1", "@tauri-apps/plugin-dialog": "2.0.1",
+1 -1
View File
@@ -43,7 +43,7 @@
"clsx": "2.1.1", "clsx": "2.1.1",
"d3-interpolate-path": "2.3.0", "d3-interpolate-path": "2.3.0",
"sass": "1.81.0", "sass": "1.81.0",
"tailwind-merge": "2.5.4", "tailwind-merge": "2.5.5",
"typescript-plugin-css-modules": "5.1.0", "typescript-plugin-css-modules": "5.1.0",
"vite-plugin-dts": "4.3.0" "vite-plugin-dts": "4.3.0"
} }
+3 -3
View File
@@ -3,9 +3,9 @@
"latest": { "latest": {
"mihomo": "v1.18.10", "mihomo": "v1.18.10",
"mihomo_alpha": "alpha-eb985b0", "mihomo_alpha": "alpha-eb985b0",
"clash_rs": "v0.7.1", "clash_rs": "v0.7.2",
"clash_premium": "2023-09-05-gdcc8d87", "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": { "arch_template": {
"mihomo": { "mihomo": {
@@ -69,5 +69,5 @@
"linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf" "linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf"
} }
}, },
"updated_at": "2024-11-23T22:20:39.660Z" "updated_at": "2024-11-24T22:20:35.622Z"
} }
+34 -34
View File
@@ -218,7 +218,7 @@ importers:
version: link:../ui version: link:../ui
'@tanstack/router-zod-adapter': '@tanstack/router-zod-adapter':
specifier: 1.81.5 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': '@tauri-apps/api':
specifier: 2.1.1 specifier: 2.1.1
version: 2.1.1 version: 2.1.1
@@ -241,8 +241,8 @@ importers:
specifier: 12.0.0-alpha.2 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) 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: i18next:
specifier: 24.0.0 specifier: 24.0.2
version: 24.0.0(typescript@5.7.2) version: 24.0.2(typescript@5.7.2)
jotai: jotai:
specifier: 2.10.3 specifier: 2.10.3
version: 2.10.3(react@19.0.0-rc.1)(types-react@19.0.0-rc.1) 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) version: 7.4.0(c6eqiv3v4ro6nnqx6e4soqhoku)
react-i18next: react-i18next:
specifier: 15.1.1 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: react-markdown:
specifier: 9.0.1 specifier: 9.0.1
version: 9.0.1(react@19.0.0-rc.1)(types-react@19.0.0-rc.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 specifier: 11.13.5
version: 11.13.5(react@19.0.0-rc.1)(types-react@19.0.0-rc.1) version: 11.13.5(react@19.0.0-rc.1)(types-react@19.0.0-rc.1)
'@iconify/json': '@iconify/json':
specifier: 2.2.275 specifier: 2.2.276
version: 2.2.275 version: 2.2.276
'@monaco-editor/react': '@monaco-editor/react':
specifier: 4.6.0 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) 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': '@tanstack/react-router':
specifier: 1.82.2 specifier: 1.82.8
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) 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': '@tanstack/router-devtools':
specifier: 1.82.2 specifier: 1.82.8
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) 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': '@tanstack/router-plugin':
specifier: 1.81.9 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)) 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) version: 4.1.2(react@19.0.0-rc.1)
react-i18next: react-i18next:
specifier: 15.1.1 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: react-use:
specifier: 17.5.1 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) 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 specifier: 1.81.0
version: 1.81.0 version: 1.81.0
tailwind-merge: tailwind-merge:
specifier: 2.5.4 specifier: 2.5.5
version: 2.5.4 version: 2.5.5
typescript-plugin-css-modules: typescript-plugin-css-modules:
specifier: 5.1.0 specifier: 5.1.0
version: 5.1.0(typescript@5.7.2) version: 5.1.0(typescript@5.7.2)
@@ -1727,8 +1727,8 @@ packages:
'@vue/compiler-sfc': '@vue/compiler-sfc':
optional: true optional: true
'@iconify/json@2.2.275': '@iconify/json@2.2.276':
resolution: {integrity: sha512-eiw64zix2sLUoZWjEJAwe0EU/wtZPww3h4NOEdqXgyiLmV400MXbOB7A+osZDuNPIP1Iapxab+r1mxW75dTWEw==} resolution: {integrity: sha512-YXCcFQSgFTj/3rlK6Vlv9T5suFjWBQu5dt9k/aYbje/U21jNp7P2xf0CPiAn8iItU/9uDj9mi3UsITMShqeCug==}
'@iconify/types@2.0.0': '@iconify/types@2.0.0':
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
@@ -2669,8 +2669,8 @@ packages:
resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==} resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==}
engines: {node: '>=12'} engines: {node: '>=12'}
'@tanstack/react-router@1.82.2': '@tanstack/react-router@1.82.8':
resolution: {integrity: sha512-vnX0njd3202iHf4w2hmv1GyudI/4mqCxIfHQdKaj/mRtFj/lydTq4de6x6kZ1TiLf1ZN/mKvfViAzGwsN2HIxQ==} resolution: {integrity: sha512-l4F9V0CeDxvV5TGUsagGK5Zt1+l9xa6P+/Hyj6l79mBgW21Vm4BU3sJ3pgg75379gDee3G2sqkViYGEgv6JRFA==}
engines: {node: '>=12'} engines: {node: '>=12'}
peerDependencies: peerDependencies:
'@tanstack/router-generator': 1.81.9 '@tanstack/router-generator': 1.81.9
@@ -2699,11 +2699,11 @@ packages:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^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': '@tanstack/router-devtools@1.82.8':
resolution: {integrity: sha512-9R0cHGNF8oQMehBYzZZ+xyKWoBCgL4OZV7g0Bt3QJv+LusRQ57iYvA2uf0Cc5qfsba46l/ps0Z/UPLQWp55wfA==} resolution: {integrity: sha512-fj0LMOF0MaDqxT17mTjSi09Bool2lYktdPeMoVB3eMr0Bgl4VvIuZ5vC96+4cODB4iExaf71/cBF5ozah8tFPA==}
engines: {node: '>=12'} engines: {node: '>=12'}
peerDependencies: peerDependencies:
'@tanstack/react-router': ^1.82.2 '@tanstack/react-router': ^1.82.8
react: '>=18' react: '>=18'
react-dom: '>=18' react-dom: '>=18'
@@ -4849,8 +4849,8 @@ packages:
hyphenate-style-name@1.1.0: hyphenate-style-name@1.1.0:
resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==} resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==}
i18next@24.0.0: i18next@24.0.2:
resolution: {integrity: sha512-ORGCwMrXxpmB/AljFbGEe0UK/9Pz6umb9aZgLZ9qJGE+kjKhlnLj423WX2mt+N0MlEJ78pQXFMBmeMzrkLxriQ==} resolution: {integrity: sha512-D88xyIGcWAKwBTAs4RSqASi8NXR/NhCVSTM4LDbdoU8qb/5dcEZjNCLDhtQBB7Epw/Cp1w2vH/3ujoTbqLSs5g==}
peerDependencies: peerDependencies:
typescript: ^5 typescript: ^5
peerDependenciesMeta: peerDependenciesMeta:
@@ -7149,8 +7149,8 @@ packages:
resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==}
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
tailwind-merge@2.5.4: tailwind-merge@2.5.5:
resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} resolution: {integrity: sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==}
tailwindcss-textshadow@2.1.3: tailwindcss-textshadow@2.1.3:
resolution: {integrity: sha512-FGVHfK+xnV879VSQDeRvY61Aa+b0GDiGaFBPwCOKvqIrK57GyepWJL1GydjtGOLHE9qqphFucRNj9fHramCzNg==} resolution: {integrity: sha512-FGVHfK+xnV879VSQDeRvY61Aa+b0GDiGaFBPwCOKvqIrK57GyepWJL1GydjtGOLHE9qqphFucRNj9fHramCzNg==}
@@ -9122,7 +9122,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@iconify/json@2.2.275': '@iconify/json@2.2.276':
dependencies: dependencies:
'@iconify/types': 2.0.0 '@iconify/types': 2.0.0
pathe: 1.1.2 pathe: 1.1.2
@@ -10040,7 +10040,7 @@ snapshots:
dependencies: dependencies:
remove-accents: 0.5.0 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: dependencies:
'@tanstack/history': 1.81.9 '@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) '@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: 19.0.0-rc.1
react-dom: 19.0.0-rc.1(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: 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 clsx: 2.1.1
goober: 2.1.16(csstype@3.1.3) goober: 2.1.16(csstype@3.1.3)
react: 19.0.0-rc.1 react: 19.0.0-rc.1
@@ -10113,9 +10113,9 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - 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: 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 zod: 3.23.8
'@tanstack/store@0.5.5': {} '@tanstack/store@0.5.5': {}
@@ -12594,7 +12594,7 @@ snapshots:
hyphenate-style-name@1.1.0: {} hyphenate-style-name@1.1.0: {}
i18next@24.0.0(typescript@5.7.2): i18next@24.0.2(typescript@5.7.2):
dependencies: dependencies:
'@babel/runtime': 7.26.0 '@babel/runtime': 7.26.0
optionalDependencies: optionalDependencies:
@@ -14120,11 +14120,11 @@ snapshots:
dependencies: dependencies:
react: 19.0.0-rc.1 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: dependencies:
'@babel/runtime': 7.26.0 '@babel/runtime': 7.26.0
html-parse-stringify: 3.0.1 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 react: 19.0.0-rc.1
optionalDependencies: optionalDependencies:
react-dom: 19.0.0-rc.1(react@19.0.0-rc.1) react-dom: 19.0.0-rc.1(react@19.0.0-rc.1)
@@ -14952,7 +14952,7 @@ snapshots:
string-width: 4.2.3 string-width: 4.2.3
strip-ansi: 6.0.1 strip-ansi: 6.0.1
tailwind-merge@2.5.4: {} tailwind-merge@2.5.5: {}
tailwindcss-textshadow@2.1.3: tailwindcss-textshadow@2.1.3:
dependencies: dependencies:
+6 -6
View File
@@ -15,7 +15,7 @@ I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_J
ArmSoM-Sige 系列:软路由、单板计算机、小型服务器与智能家居的全能之选。 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. 安装编译依赖 2. 安装编译依赖
@@ -37,10 +37,10 @@ ArmSoM-Sige 系列:软路由、单板计算机、小型服务器与智能家
sudo apt update -y sudo apt update -y
sudo apt full-upgrade -y sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ 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 \ 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 \ 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 \ python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \
uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev 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 <your_local_lede_path> enable PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
# 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中 # 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path> PS > git clone https://github.com/coolsnowwolf/lede <your_local_lede_path>
``` ```
> 对已经 `git clone` 完成的项目目录执行 `fsutil.exe` 命令无法生效,大小写敏感只对新增的文件变更有效。 > 对已经 `git clone` 完成的项目目录执行 `fsutil.exe` 命令无法生效,大小写敏感只对新增的文件变更有效。
@@ -162,7 +162,7 @@ PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
## 特别提示 ## 特别提示
1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒安全干净才是固件应该做到的 1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒安全干净才是固件应该做到的
2. 想学习 OpenWrt 开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学 OpenWrt 开发入门培训班助你能学有所成 2. 想学习 OpenWrt 开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学 OpenWrt 开发入门培训班助你能学有所成
报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名") 报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名")
+206 -342
View File
@@ -1,342 +1,206 @@
# Welcome to Lean's git source of OpenWrt and packages # Welcome to Lean's git source of OpenWrt and packages
I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md)
## Official Channels ## Official Channels
<!--
如有技术问题需要讨论或者交流,欢迎加入以下群: If you have technical questions for discussion or sharing, feel free to join the following channels:
1. QQ 讨论群: Op固件技术研究群 ,号码 891659613 ,加群链接:[点击加入](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群")
2. TG 讨论群: OP 编译官方大群 ,加群链接:[点击加入](https://t.me/JhKgAA6Hx1 "OP 编译官方大群") 1. QQ Group: *OpenWRT Firmware Technical Research Group*, Group Number is `891659613`.
3. Rockchip RK3568 预编译固件发布 Release 下载更新地址 (包括 H68K )<https://github.com/coolsnowwolf/lede/releases/tag/20220716> Join the group: [Link](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群").
--> - [Click to download QQ client](https://im.qq.com/pcqq).
If you have technical questions for discussion or sharing, feel free to join the following channels: 2. Telegram Group: *OpenWRT Firmware Technical Research Group*.
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固件技术研究群"). Join the group: [Link](https://t.me/JhKgAA6Hx1 "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 Board Series Introduction ArmSoM-Sige Series: Your All-in-One Powerhouse for Soft Routing, SBCs, Mini Servers, and Home Automation.
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)
[ ArmSoM Store ](https://www.aliexpress.com/store/1102800175) Buy Link
[![sige1-en](doc/sige-en.jpg)](https://aliexpress.com/item/3256807356692995.html)
Buy Link
[![sige1-en](doc/sige-en.jpg)](https://aliexpress.com/item/3256807356692995.html) ## Notice
## Notice 1. **Never compile OpenWRT as `root`**
<!-- 2. If you are living in mainland China, please make sure you could visit the **REAL** Internet.
1. **不要用 root 用户进行编译** 3. Default login IP is `192.168.1.1`, password is `password`.
2. 国内用户编译前最好准备好梯子
3. 默认登陆IP 192.168.1.1 密码 password ## How to Compile
-->
1. **Never compile OpenWRT as `root`** 1. Install a Linux distribution, Debian or Ubuntu LTS is recommended.
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`. 2. Install dependencies:
## How to Compile ```bash
<!-- sudo apt update -y
1. 首先装好 Linux 系统,推荐 Debian 11 或 Ubuntu LTS sudo apt full-upgrade -y
2. 安装编译依赖 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 \
```bash git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
sudo apt update -y libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
sudo apt full-upgrade -y mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ vim wget xmlto xxd zlib1g-dev python3-setuptools
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 python3 python3-pyelftools \ 3. Clone the source code, update `feeds` and configure:
libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
vim wget xmlto xxd zlib1g-dev python3-setuptools ```bash
``` git clone https://github.com/coolsnowwolf/lede
--> cd lede
./scripts/feeds update -a
1. Install a Linux distribution, Debian 11 or Ubuntu LTS is recommended. ./scripts/feeds install -a
2. Install dependencies: make menuconfig
```
```bash
sudo apt update -y 4. Download libraries and compile firmware
sudo apt full-upgrade -y > (`-j` is the thread count, single-thread is recommended for the first build):
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 \ ```bash
git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ make download -j8
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ make V=s -j1
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 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.
3. 下载源代码,更新 feeds 并选择配置 Thank you for your cooperation!
```bash Rebuild:
git clone https://github.com/coolsnowwolf/lede
cd lede ```bash
./scripts/feeds update -a cd lede
./scripts/feeds install -a git pull
make menuconfig ./scripts/feeds update -a
``` ./scripts/feeds install -a
make defconfig
4. 下载 dl 库,编译固件 make download -j8
(-j 后面是线程数,第一次编译推荐用单线程) make V=s -j$(nproc)
```
```bash
make download -j8 If reconfiguration is need:
make V=s -j1
``` ```bash
--> rm -rf ./tmp && rm -rf .config
make menuconfig
3. Clone the source code, update `feeds` and configure: make V=s -j$(nproc)
```
```bash
git clone https://github.com/coolsnowwolf/lede Build artifacts will be outputted to `bin/targets` directory.
cd lede
./scripts/feeds update -a ### If you are using WSL/WSL2 as your build environment
./scripts/feeds install -a
make menuconfig 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:
4. Download libraries and compile firmware ```bash
> (`-j` is the thread count, single-thread is recommended for the first build): # Update and reload your profile, ~/.bashrc for example.
cat << EOF >> ~/.bashrc
```bash export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
make -j8 download V=s EOF
make -j1 V=s source ~/.bashrc
``` ```
<!-- NTFS-formatted drives mounted to a WSL distribution will be case-insensitive by default.
本套代码保证肯定可以编译成功。里面包括了 R23 所有源代码,包括 IPK 的。 This will cause the following error when compiling in WSL/WSL2:
你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作! ```txt
--> Build dependency: OpenWrt can only be built on a case-sensitive filesystem
```
These commands are supposed to compile the source code successfully.
All source code of R23 is included, including IPK. A simple solution is to create a case-sensitive directory for the repository before `git clone`:
You can use this source code freely, but please link this GitHub repository when redistributing. ```powershell
Thank you for your cooperation! # Open a terminal as administrator
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
<!-- # Clone this repository to the case-sensitive directory <your_local_lede_path>
二次编译: PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
```
```bash
cd lede > For directories that have already been `git clone`, `fsutil.exe` will not take effect.
git pull > Case sensitivity will only be enabled for new changes in the directory.
./scripts/feeds update -a
./scripts/feeds install -a ### macOS Compilation
make defconfig
make download -j8 1. Install Xcode from AppStore
make V=s -j$(nproc)
``` 2. Install Homebrew:
如果需要重新配置: ```bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```bash ```
rm -rf ./tmp && rm -rf .config
make menuconfig 3. Install toolchain, dependencies and packages with Homebrew:
make V=s -j$(nproc)
``` ```bash
brew unlink awk
编译完成后输出路径:bin/targets brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz
--> brew install gcc@11
```
Rebuild:
4. Update your system environment:
```bash
cd lede - mac with intel chip
git pull
./scripts/feeds update -a ```bash
./scripts/feeds install -a echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
make defconfig echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
make download -j8 echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
make V=s -j$(nproc) 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
If reconfiguration is need: echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc
```
```bash
rm -rf ./tmp && rm -rf .config - mac with apple chip
make menuconfig
make V=s -j$(nproc) ```zsh
``` echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
Build artifacts will be outputted to `bin/targets` directory. echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
### If you are using WSL/WSL2 as your build environment 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
由于 WSL 的 PATH 中包含带有空格的 Windows 路径,有可能会导致编译失败,请在 `make` 前面加上: ```
```bash 5. Reload your shell profile `source ~/.bashrc && bash`, then you can compile normally like Linux.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
``` ## Declaration
-->
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: 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.
```bash 3. QCA IPQ60xx open source repository: <https://github.com/coolsnowwolf/openwrt-gl-ax1800>
# Update and reload your profile, ~/.bashrc for example. 4. OpenWRT Archive repository: <https://github.com/coolsnowwolf/openwrt>
cat << EOF >> ~/.bashrc
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" ## Introduction to Software Routers
EOF
source ~/.bashrc Yingku R2 - N95/N300 Mini Four-Network HomeLab Server
```
(Introduction page - Yingku Technology (support AliPay Huabei)):
<!--
由于默认情况下,装载到 WSL 发行版的 NTFS 格式的驱动器将不区分大小写,因此大概率在 WSL/WSL2 的编译检查中会返回以下错误: [Pre-sale link](https://item.taobao.com/item.htm?ft=t&id=719159813003)
<div align="left">
```txt <a href="https://item.taobao.com/item.htm?ft=t&id=719159813003">
Build dependency: OpenWrt can only be built on a case-sensitive filesystem <img src="doc/r1.jpg" width = "600" alt="" align=center />
``` </a>
</div>
一个比较简洁的解决方法是,在 `git clone` 前先创建 Repository 目录,并为其启用大小写敏感: <br>
```powershell ## Donation
# 以管理员身份打开终端
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable <!--
# 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中 如果你觉得此项目对你有帮助,可以捐助我们,以鼓励项目能持续发展,更加完善
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
``` ![star](doc/star.png)
-->
> 对已经 `git clone` 完成的项目目录执行 `fsutil.exe` 命令无法生效,大小写敏感只对新增的文件变更有效。 If this project did helped you, please consider donating to support the development of this project.
-->
<div align="left">
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: <img src="./doc/star.png" width = "400" alt="" align=center />
</div>
```txt <br>
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 <your_local_lede_path> enable
# Clone this repository to the case-sensitive directory <your_local_lede_path>
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
```
> 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. 在 AppStore 中安装 Xcode
2. 安装 Homebrew
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
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. 然后输入以下命令,添加到系统环境变量中:
```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
```
5. 重新加载一下 shell 启动文件 `source ~/.bashrc`,然后输入 `bash` 进入 bash shell,就可以和 Linux 一样正常编译了
-->
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. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的;
2. 想学习 OpenWrt 开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学 OpenWrt 开发入门培训班助你能学有所成
报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名")
3. QCA IPQ60xx 开源仓库地址:<https://github.com/coolsnowwolf/openwrt-gl-ax1800>
4. 存档版本仓库地址:<https://github.com/coolsnowwolf/openwrt>
-->
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: <https://github.com/coolsnowwolf/openwrt-gl-ax1800>
4. OpenWRT Archive repository: <https://github.com/coolsnowwolf/openwrt>
## Introduction to Software Routers
<!--
硬酷R2 - N95/N300迷你四网HomeLab服务器
(商品介绍页面 - 硬酷科技(支持花呗)):
[预售链接](https://item.taobao.com/item.htm?ft=t&id=719159813003)
[![r1](doc/r1.jpg)](https://item.taobao.com/item.htm?ft=t&id=719159813003)
-->
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)
<div align="left">
<a href="https://item.taobao.com/item.htm?ft=t&id=719159813003">
<img src="doc/r1.jpg" width = "600" alt="" align=center />
</a>
</div>
<br>
## Donation
<!--
如果你觉得此项目对你有帮助,可以捐助我们,以鼓励项目能持续发展,更加完善
![star](doc/star.png)
-->
If this project did helped you, please consider donating to support the development of this project.
<div align="left">
<img src="./doc/star.png" width = "400" alt="" align=center />
</div>
<br>
+191 -343
View File
@@ -1,343 +1,191 @@
# OpenWrt とパッケージの Lean の git ソースへようこそ # OpenWrt とパッケージの Lean の git ソースへようこそ
I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md) I18N: [English](README_EN.md) | [简体中文](README.md) | [日本語](README_JA.md)
## 公式チャンネル ## 公式チャンネル
<!--
如有技术问题需要讨论或者交流,欢迎加入以下群: ディスカッションや共有したい技術的な質問がある場合は、以下のチャンネルにお気軽にご参加ください:
1. QQ 讨论群: Op固件技术研究群 ,号码 891659613 ,加群链接:[点击加入](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群")
2. TG 讨论群: OP 编译官方大群 ,加群链接:[点击加入](https://t.me/JhKgAA6Hx1 "OP 编译官方大群") 1. QQ グループ: *OpenWRT ファームウェア技術研究グループ*、グループ番号は `891659613` です。
3. Rockchip RK3568 预编译固件发布 Release 下载更新地址 (包括 H68K )<https://github.com/coolsnowwolf/lede/releases/tag/20220716> グループに参加する: [リンク](https://jq.qq.com/?_wv=1027&k=XL8SK5aC "Op固件技术研究群")。
--> - [クリックして QQ クライアントをダウンロードする](https://im.qq.com/pcqq)。
ディスカッションや共有したい技術的な質問がある場合は、以下のチャンネルにお気軽にご参加ください: 2. Telegram グループ: *OpenWRT ファームウェア技術研究グループ*。グループに参加する: [リンク](https://t.me/JhKgAA6Hx1 "OP 编译官方大群")。
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)。 1. **OpenWRT を決して `root` としてコンパイルしないこと**
2. 中国本土にお住まいの方は、ぜひ **REAL** インターネットをご覧ください。
<div align="left"> 3. デフォルトのログイン IP は `192.168.1.1` で、パスワードは `password` です。
<a href="https://item.taobao.com/item.htm?spm=a230r.1.14.11.4bb55247rdHEAP&id=702787603594&ns=1&abbucket=17#detail
"> ## コンパイル方法
<img style="margin: 0px 0px 0px 40px;" src="https://github.com/coolsnowwolf/lede/blob/master/doc/h68k.jpg?raw=true" width=600 />
</a> 1. Linuxディストリビューションをインストールし、Debian または Ubuntu LTS を推奨します。
</div>
2. 依存関係をインストールする:
4. Rockchip **RK3588**コンパイル済みファームウェアリリース(H68K を含む): [クリックしてダウンロード](https://github.com/coolsnowwolf/lede/releases/tag/20230609)。
```bash
sudo apt update -y
## 注意 sudo apt full-upgrade -y
<!-- sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
1. **不要用 root 用户进行编译** bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
2. 国内用户编译前最好准备好梯子 git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
3. 默认登陆IP 192.168.1.1 密码 password 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 \
1. **OpenWRT を決して `root` としてコンパイルしないこと** libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
2. 中国本土にお住まいの方は、ぜひ **REAL** インターネットをご覧ください。 vim wget xmlto xxd zlib1g-dev python3-setuptools
3. デフォルトのログイン IP は `192.168.1.1` で、パスワードは `password` です。 ```
## コンパイル方法 3. ソースコードをクローンし、`feeds` を更新し、設定する:
<!--
1. 首先装好 Linux 系统,推荐 Debian 11 或 Ubuntu LTS ```bash
2. 安装编译依赖 git clone https://github.com/coolsnowwolf/lede
cd lede
```bash ./scripts/feeds update -a
sudo apt update -y ./scripts/feeds install -a
sudo apt full-upgrade -y make menuconfig
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 \ 4. ライブラリのダウンロードとファームウェアのコンパイル
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ > (`-j` はスレッドカウント、最初のビルドはシングルスレッドを推奨):
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pyelftools \
libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ ```bash
vim wget xmlto xxd zlib1g-dev python3-setuptools make download -j8
``` make V=s -j1
--> ```
1. Linuxディストリビューションをインストールし、Debian 11 または Ubuntu LTS を推奨します。 これらのコマンドは、ソースコードを正常にコンパイルするためのものです。
2. 依存関係をインストールする: R23 のソースコードは IPK を含めてすべて含まれています。
```bash このソースコードはご自由にお使いいただけますが、再配布の際はこの GitHub リポジトリをリンクしてください。
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 \ ```bash
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ cd lede
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ git pull
libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ ./scripts/feeds update -a
vim wget xmlto xxd zlib1g-dev python3-setuptools ./scripts/feeds install -a
``` make defconfig
make download -j8
<!-- make V=s -j$(nproc)
3. 下载源代码,更新 feeds 并选择配置 ```
```bash 再設定が必要な場合:
git clone https://github.com/coolsnowwolf/lede
cd lede ```bash
./scripts/feeds update -a rm -rf ./tmp && rm -rf .config
./scripts/feeds install -a make menuconfig
make menuconfig make V=s -j$(nproc)
``` ```
4. 下载 dl 库,编译固件 ビルドの成果物は `bin/targets` ディレクトリに出力されます。
(-j 后面是线程数,第一次编译推荐用单线程)
### WSL/WSL2 をビルド環境として使用している場合
```bash
make download -j8 WSL の `PATH` には、Windows のパスが空白で含まれている可能性があり、コンパイルに失敗することがあります。
make V=s -j1 コンパイルする前に、ローカルの環境プロファイルに以下の行を追加してください:
```
--> ```bash
# 例えば、~/.bashrc などのプロファイルを更新した後、再読み込みを行う。
3. ソースコードをクローンし、`feeds` を更新し、設定する: cat << EOF >> ~/.bashrc
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
```bash EOF
git clone https://github.com/coolsnowwolf/lede source ~/.bashrc
cd lede ```
./scripts/feeds update -a
./scripts/feeds install -a WSL ディストリビューションにマウントされた NTFS フォーマットのドライブは、デフォルトで大文字と小文字が区別されません。
make menuconfig このため、WSL/WSL2 でコンパイルすると、次のようなエラーが発生します:
```
```txt
4. ライブラリのダウンロードとファームウェアのコンパイル Build dependency: OpenWrt can only be built on a case-sensitive filesystem
> (`-j` はスレッドカウント、最初のビルドはシングルスレッドを推奨): ```
```bash 単純な解決策は、`git clone` の前に大文字小文字を区別してリポジトリ用のディレクトリを作成することです:
make -j8 download V=s
make -j1 V=s ```powershell
``` # 管理者としてターミナルを開く
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
<!-- # 大文字と小文字を区別して、このリポジトリを <your_local_lede_path> ディレクトリにクローンする
本套代码保证肯定可以编译成功。里面包括了 R23 所有源代码,包括 IPK 的。 PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
```
你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作!
--> > すでに `git clone` されたディレクトリでは、`fsutil.exe` は有効になりません。
> 大文字小文字の区別はディレクトリの新しい変更に対してのみ有効になります。
これらのコマンドは、ソースコードを正常にコンパイルするためのものです。
R23 のソースコードは IPK を含めてすべて含まれています。 ### macOS コンパイル
このソースコードはご自由にお使いいただけますが、再配布の際はこの GitHub リポジトリをリンクしてください。 1. AppStore から Xcode をインストールする
ご協力ありがとうございました!
2. Homebrew をインストールする:
<!--
二次编译: ```bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```bash ```
cd lede
git pull 3. Homebrew でツールチェーン、依存関係、パッケージをインストールする:
./scripts/feeds update -a
./scripts/feeds install -a ```bash
make defconfig brew unlink awk
make download -j8 brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz
make V=s -j$(nproc) brew install gcc@11
``` ```
如果需要重新配置: 4. システム環境のアップデート:
```bash - MacのIntelシリコンバージョン
rm -rf ./tmp && rm -rf .config
make menuconfig ```bash
make V=s -j$(nproc) 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
编译完成后输出路径:bin/targets 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
```
```bash
cd lede - MacのAppleシリコンバージョン
git pull
./scripts/feeds update -a ```zsh
./scripts/feeds install -a echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
make defconfig echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
make download -j8 echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
make V=s -j$(nproc) 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
```
```bash
rm -rf ./tmp && rm -rf .config 5. シェルプロファイル `source ~/.bashrc && bash` を再読み込みすれば、Linux のように普通にコンパイルできます。
make menuconfig
make V=s -j$(nproc) ## 宣言
```
1. このソースコードには、HTTPS トラフィックを監視/キャプチャできるバックドアやクローズドソースアプリケーションは含まれていません。SSL セキュリティはサイバーセキュリティの最後の城です。安全性はファームウェアがすべきことです。
ビルドの成果物は `bin/targets` ディレクトリに出力されます 2. OpenWRT の開発を学びたいが、何から始めたらいいかわからないですか?自己学習のモチベーションが上がらない?基礎知識が足りない?ズオ氏の初心者 OpenWRT トレーニングコースで一緒に OpenWRT 開発を学びましょう。お申し込みは[こちら](http://forgotfun.org/2018/04/openwrt-training-2018.html)をクリックしてください
3. QCA IPQ60xx オープンソースリポジトリ: <https://github.com/coolsnowwolf/openwrt-gl-ax1800>
### WSL/WSL2 をビルド環境として使用している場合 4. OpenWRT アーカイブリポジトリ: <https://github.com/coolsnowwolf/openwrt>
<!-- ## ソフトウェアルーター入門
由于 WSL 的 PATH 中包含带有空格的 Windows 路径,有可能会导致编译失败,请在 `make` 前面加上:
Yingku R2 - N95/N300 Mini Four-Network HomeLab Server
```bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin (紹介ページ - Yingku Technology (support AliPay Huabei)):
```
--> [先行販売リンク](https://item.taobao.com/item.htm?ft=t&id=719159813003)
WSL の `PATH` には、Windows のパスが空白で含まれている可能性があり、コンパイルに失敗することがあります。コンパイルする前に、ローカルの環境プロファイルに以下の行を追加してください: <div align="left">
<a href="https://item.taobao.com/item.htm?ft=t&id=719159813003">
```bash <img src="doc/r1.jpg" width = "600" alt="" align=center />
# 例えば、~/.bashrc などのプロファイルを更新した後、再読み込みを行う。 </a>
cat << EOF >> ~/.bashrc </div>
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH" <br>
EOF
source ~/.bashrc ## 寄付
```
このプロジェクトがあなたのお役に立てたのであれば、このプロジェクトの発展を支援するための寄付をご検討ください。
<!--
由于默认情况下,装载到 WSL 发行版的 NTFS 格式的驱动器将不区分大小写,因此大概率在 WSL/WSL2 的编译检查中会返回以下错误: <div align="left">
<img src="./doc/star.png" width = "400" alt="" align=center />
```txt </div>
Build dependency: OpenWrt can only be built on a case-sensitive filesystem <br>
```
一个比较简洁的解决方法是,在 `git clone` 前先创建 Repository 目录,并为其启用大小写敏感:
```powershell
# 以管理员身份打开终端
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
# 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
```
> 对已经 `git clone` 完成的项目目录执行 `fsutil.exe` 命令无法生效,大小写敏感只对新增的文件变更有效。
-->
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 <your_local_lede_path> enable
# 大文字と小文字を区別して、このリポジトリを <your_local_lede_path> ディレクトリにクローンする
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>
```
> すでに `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. 然后输入以下命令,添加到系统环境变量中:
```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
```
5. 重新加载一下 shell 启动文件 `source ~/.bashrc`,然后输入 `bash` 进入 bash shell,就可以和 Linux 一样正常编译了
-->
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 开发入门培训班助你能学有所成
报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名")
3. QCA IPQ60xx 开源仓库地址:<https://github.com/coolsnowwolf/openwrt-gl-ax1800>
4. 存档版本仓库地址:<https://github.com/coolsnowwolf/openwrt>
-->
1. このソースコードには、HTTPS トラフィックを監視/キャプチャできるバックドアやクローズドソースアプリケーションは含まれていません。SSL セキュリティはサイバーセキュリティの最後の城です。安全性はファームウェアがすべきことです。
2. OpenWRT の開発を学びたいが、何から始めたらいいかわからないですか?自己学習のモチベーションが上がらない?基礎知識が足りない?ズオ氏の初心者 OpenWRT トレーニングコースで一緒に OpenWRT 開発を学びましょう。お申し込みは[こちら](http://forgotfun.org/2018/04/openwrt-training-2018.html)をクリックしてください。
3. QCA IPQ60xx オープンソースリポジトリ: <https://github.com/coolsnowwolf/openwrt-gl-ax1800>
4. OpenWRT アーカイブリポジトリ: <https://github.com/coolsnowwolf/openwrt>
## ソフトウェアルーター入門
<!--
硬酷R2 - N95/N300迷你四网HomeLab服务器
(商品介绍页面 - 硬酷科技(支持花呗)):
[预售链接](https://item.taobao.com/item.htm?ft=t&id=719159813003)
[![r1](doc/r1.jpg)](https://item.taobao.com/item.htm?ft=t&id=719159813003)
-->
Yingku R2 - N95/N300 Mini Four-Network HomeLab Server
(紹介ページ - Yingku Technology (support AliPay Huabei)):
[先行販売リンク](https://item.taobao.com/item.htm?ft=t&id=719159813003)
<div align="left">
<a href="https://item.taobao.com/item.htm?ft=t&id=719159813003">
<img src="doc/r1.jpg" width = "600" alt="" align=center />
</a>
</div>
<br>
## 寄付
<!--
如果你觉得此项目对你有帮助,可以捐助我们,以鼓励项目能持续发展,更加完善
![star](doc/star.png)
-->
このプロジェクトがあなたのお役に立てたのであれば、このプロジェクトの発展を支援するための寄付をご検討ください。
<div align="left">
<img src="./doc/star.png" width = "400" alt="" align=center />
</div>
<br>
@@ -55,8 +55,6 @@ CONFIG_BRCM_CHAR_DRIVERS=y
CONFIG_BUFFER_HEAD=y CONFIG_BUFFER_HEAD=y
# CONFIG_CACHE_L2X0 is not set # CONFIG_CACHE_L2X0 is not set
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_CLKSRC_MMIO=y CONFIG_CLKSRC_MMIO=y
CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y CONFIG_CLK_BCM2835=y
@@ -172,7 +170,6 @@ CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y CONFIG_FW_CACHE=y
CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS=y
@@ -69,8 +69,6 @@ CONFIG_BROADCOM_PHY=y
CONFIG_BUFFER_HEAD=y CONFIG_BUFFER_HEAD=y
# CONFIG_CACHE_L2X0 is not set # CONFIG_CACHE_L2X0 is not set
CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
CONFIG_CC_NO_ARRAY_BOUNDS=y
CONFIG_CLKSRC_MMIO=y CONFIG_CLKSRC_MMIO=y
CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y CONFIG_CLK_BCM2835=y
@@ -211,7 +209,6 @@ CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y CONFIG_FW_CACHE=y
CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_ARCH_TOPOLOGY=y
CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG=y
@@ -85,8 +85,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y
CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CAVIUM_ERRATUM_27456=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=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_CLKSRC_MMIO=y
CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y CONFIG_CLK_BCM2835=y
@@ -218,7 +216,6 @@ CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y CONFIG_FW_CACHE=y
CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_ARCH_TOPOLOGY=y
@@ -84,8 +84,6 @@ CONFIG_CAVIUM_ERRATUM_23154=y
CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CAVIUM_ERRATUM_27456=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=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_CLKSRC_MMIO=y
CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y CONFIG_CLK_BCM2835=y
@@ -219,7 +217,6 @@ CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y CONFIG_FW_CACHE=y
CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_NUMA=y CONFIG_GENERIC_ARCH_NUMA=y
@@ -110,8 +110,6 @@ CONFIG_BUFFER_HEAD=y
CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=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_CLKSRC_MMIO=y
CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2711_DVP=y
CONFIG_CLK_BCM2835=y CONFIG_CLK_BCM2835=y
@@ -262,7 +260,6 @@ CONFIG_FWNODE_MDIO=y
CONFIG_FW_CACHE=y CONFIG_FW_CACHE=y
CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y CONFIG_FW_LOADER_SYSFS=y
CONFIG_GCC10_NO_ARRAY_BOUNDS=y
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_ARCH_NUMA=y CONFIG_GENERIC_ARCH_NUMA=y
@@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
struct vchiq_drvdata { struct vchiq_drvdata {
const unsigned int cache_line_size; 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; goto error_exit;
} }
@@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera");
bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); 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_audio);
platform_device_unregister(bcm2835_camera); platform_device_unregister(bcm2835_camera);
@@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
static struct platform_device *vcsm_cma; static struct platform_device *vcsm_cma;
struct vchiq_drvdata { 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"); vcsm_cma = vchiq_register_child(pdev, "vcsm-cma");
@@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera");
bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); 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_audio);
platform_device_unregister(bcm2835_camera); platform_device_unregister(bcm2835_camera);
@@ -18,7 +18,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/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; child = NULL;
} }
@@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/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_info pdevinfo;
struct platform_device *child; struct platform_device *child;
@@ -25,7 +25,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
memset(&pdevinfo, 0, sizeof(pdevinfo)); 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
} }
/* /*
@@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/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.id = PLATFORM_DEVID_NONE;
pdevinfo.dma_mask = DMA_BIT_MASK(32); pdevinfo.dma_mask = DMA_BIT_MASK(32);
@@ -21,7 +21,7 @@ Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
struct vchiq_drvdata { struct vchiq_drvdata {
const unsigned int cache_line_size; 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_codec = vchiq_register_child(pdev, "bcm2835-codec");
bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera"); bcm2835_camera = vchiq_register_child(pdev, "bcm2835-camera");
bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio"); bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio");
@@ -29,7 +29,7 @@ Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
return 0; return 0;
@@ -1880,6 +1882,7 @@ error_exit: @@ -1867,6 +1869,7 @@ error_exit:
static void vchiq_remove(struct platform_device *pdev) static void vchiq_remove(struct platform_device *pdev)
{ {
@@ -36,10 +36,10 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
+ .use_36bit_addrs = true, + .use_36bit_addrs = true,
+}; +};
+ +
struct vchiq_2835_state { struct vchiq_pagelist_info {
int inited; struct pagelist *pagelist;
struct vchiq_arm_state arm_state; size_t pagelist_buffer_size;
@@ -147,10 +153,12 @@ static void __iomem *g_regs; @@ -142,10 +148,12 @@ static void __iomem *g_regs;
* of 32. * of 32.
*/ */
static unsigned int g_cache_line_size = 32; static unsigned int g_cache_line_size = 32;
@@ -52,7 +52,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
static DEFINE_SEMAPHORE(g_free_fragments_mutex, 1); 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) cleanup_pagelistinfo(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagelistinfo)
{ {
if (pagelistinfo->scatterlist_mapped) { if (pagelistinfo->scatterlist_mapped) {
@@ -61,7 +61,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pagelistinfo->num_pages, pagelistinfo->dma_dir); 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; count -= len;
} }
@@ -70,7 +70,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
scatterlist, scatterlist,
num_pages, num_pages,
pagelistinfo->dma_dir); 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 */ /* Combine adjacent blocks for performance */
k = 0; k = 0;
@@ -148,7 +148,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
} }
/* Partial cache lines (fragments) require special measures */ /* 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 * NOTE: dma_unmap_sg must be called before the
* cpu can touch any of the data/pages. * cpu can touch any of the data/pages.
*/ */
@@ -157,7 +157,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pagelistinfo->num_pages, pagelistinfo->dma_dir); pagelistinfo->num_pages, pagelistinfo->dma_dir);
pagelistinfo->scatterlist_mapped = 0; 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) static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
@@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev); struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
struct rpi_firmware *fw = drvdata->fw; struct rpi_firmware *fw = drvdata->fw;
struct vchiq_slot_zero *vchiq_slot_zero; 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_cache_line_size = drvdata->cache_line_size;
g_fragments_size = 2 * g_cache_line_size; g_fragments_size = 2 * g_cache_line_size;
@@ -190,7 +190,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
/* Allocate space for the channels in coherent memory */ /* Allocate space for the channels in coherent memory */
slot_mem_size = PAGE_ALIGN(TOTAL_SLOTS * VCHIQ_SLOT_SIZE); slot_mem_size = PAGE_ALIGN(TOTAL_SLOTS * VCHIQ_SLOT_SIZE);
frag_mem_size = PAGE_ALIGN(g_fragments_size * MAX_FRAGMENTS); 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); WARN_ON(((unsigned long)slot_mem & (PAGE_SIZE - 1)) != 0);
@@ -206,7 +206,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
vchiq_slot_zero->platform_data[VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX] = vchiq_slot_zero->platform_data[VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX] =
MAX_FRAGMENTS; 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 */ /* Send the base address of the slots to VideoCore */
@@ -214,7 +214,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT, err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT,
&channelbase, sizeof(channelbase)); &channelbase, sizeof(channelbase));
if (err) { 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; return -ENXIO;
} }
@@ -223,7 +223,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
vchiq_log_info(vchiq_arm_log_level, "vchiq_init - done (slots %pK, phys %pad)", vchiq_log_info(vchiq_arm_log_level, "vchiq_init - done (slots %pK, phys %pad)",
vchiq_slot_zero, &slot_phys); 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[] = { static const struct of_device_id vchiq_of_match[] = {
{ .compatible = "brcm,bcm2835-vchiq", .data = &bcm2835_drvdata }, { .compatible = "brcm,bcm2835-vchiq", .data = &bcm2835_drvdata },
{ .compatible = "brcm,bcm2836-vchiq", .data = &bcm2836_drvdata }, { .compatible = "brcm,bcm2836-vchiq", .data = &bcm2836_drvdata },
@@ -231,7 +231,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
{}, {},
}; };
MODULE_DEVICE_TABLE(of, vchiq_of_match); 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; child->dev.of_node = np;
@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/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; child->dev.of_node = np;
@@ -37,7 +37,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
/* Override the default prefix, which would be vchiq_arm (from the filename) */ /* Override the default prefix, which would be vchiq_arm (from the filename) */
#undef MODULE_PARAM_PREFIX #undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX DEVICE_NAME "." #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; struct pagelist *pagelist;
size_t pagelist_buffer_size; size_t pagelist_buffer_size;
dma_addr_t dma_addr; dma_addr_t dma_addr;
@@ -45,7 +45,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
enum dma_data_direction dma_dir; enum dma_data_direction dma_dir;
unsigned int num_pages; unsigned int num_pages;
unsigned int pages_need_release; 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. * of 32.
*/ */
static unsigned int g_cache_line_size = 32; static unsigned int g_cache_line_size = 32;
@@ -53,7 +53,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
static unsigned int g_use_36bit_addrs = 0; static unsigned int g_use_36bit_addrs = 0;
static unsigned int g_fragments_size; static unsigned int g_fragments_size;
static char *g_fragments_base; 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) if (pagelistinfo->pages_need_release)
unpin_user_pages(pagelistinfo->pages, pagelistinfo->num_pages); unpin_user_pages(pagelistinfo->pages, pagelistinfo->num_pages);
@@ -69,7 +69,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
} }
static inline bool 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; u32 *addrs;
unsigned int num_pages, offset, i, k; unsigned int num_pages, offset, i, k;
int actual_pages; int actual_pages;
@@ -77,7 +77,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
size_t pagelist_size; size_t pagelist_size;
struct scatterlist *scatterlist, *sg; struct scatterlist *scatterlist, *sg;
int dma_buffers; 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 /* Allocate enough storage to hold the page pointers and the page
* list * list
*/ */
@@ -94,7 +94,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
vchiq_log_trace(vchiq_arm_log_level, "%s - %pK", __func__, pagelist); 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 = pagelist;
pagelistinfo->pagelist_buffer_size = pagelist_size; pagelistinfo->pagelist_buffer_size = pagelist_size;
pagelistinfo->dma_addr = dma_addr; pagelistinfo->dma_addr = dma_addr;
@@ -102,7 +102,7 @@ Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
pagelistinfo->dma_dir = (type == PAGELIST_WRITE) ? pagelistinfo->dma_dir = (type == PAGELIST_WRITE) ?
DMA_TO_DEVICE : DMA_FROM_DEVICE; DMA_TO_DEVICE : DMA_FROM_DEVICE;
pagelistinfo->num_pages = num_pages; 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; g_dma_dev = dma_dev ?: dev;
@@ -163,7 +163,8 @@ domain:store.steampowered.com'
config shunt_rules 'AIGC' config shunt_rules 'AIGC'
option remarks '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' config shunt_rules 'Streaming'
option remarks 'Streaming' option remarks 'Streaming'
@@ -2,6 +2,7 @@ engage.cloudflareclient.com
github.com github.com
bing.com bing.com
c.mi.com c.mi.com
apple-relay.apple.com
#google #google
googleapis.cn googleapis.cn
+3 -3
View File
@@ -28,9 +28,9 @@ jobs:
- name: Install Rust - name: Install Rust
run: | run: |
rustup set profile minimal rustup set profile minimal
rustup toolchain install 1.74 rustup toolchain install 1.75
rustup default 1.74 rustup default 1.75
rustup override set 1.74 rustup override set 1.75
- name: Build with All Features Enabled (Unix) - name: Build with All Features Enabled (Unix)
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline" run: cargo build --verbose --features "full-extra local-flow-stat utility-url-outline"
+24 -11
View File
@@ -15,9 +15,13 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
target: platform:
- x86_64-unknown-linux-musl - target: x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl toolchain: stable
- target: aarch64-unknown-linux-musl
toolchain: stable
- target: mips-unknown-linux-musl
toolchain: nightly
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -25,18 +29,17 @@ jobs:
- name: Install Rust - name: Install Rust
run: | run: |
rustup set profile minimal rustup set profile minimal
rustup toolchain install stable rustup toolchain install ${{ matrix.platform.toolchain }}
rustup default stable rustup default ${{ matrix.platform.toolchain }}
rustup override set stable rustup override set ${{ matrix.platform.toolchain }}
rustup target add --toolchain stable ${{ matrix.target }}
- name: Install cross - name: Install cross
run: cargo install cross run: cargo install cross
- name: Build ${{ matrix.target }} - name: Build ${{ matrix.platform.target }}
timeout-minutes: 120 timeout-minutes: 120
run: | run: |
compile_target=${{ matrix.target }} compile_target=${{ matrix.platform.target }}
compile_features="-f full" compile_features="-f full"
@@ -51,13 +54,23 @@ jobs:
fi fi
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 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 - name: Upload Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.target }} name: ${{ matrix.platform.target }}
path: build/release/* path: build/release/*
build-unix: build-unix:
+57 -20
View File
@@ -21,19 +21,54 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
target: platform:
- i686-unknown-linux-musl - target: i686-unknown-linux-musl
- x86_64-pc-windows-gnu toolchain: stable
- x86_64-unknown-linux-gnu - target: x86_64-pc-windows-gnu
- x86_64-unknown-linux-musl toolchain: stable
- armv7-unknown-linux-musleabihf - target: x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf toolchain: stable
- arm-unknown-linux-gnueabi - target: x86_64-unknown-linux-musl
- arm-unknown-linux-gnueabihf toolchain: stable
- arm-unknown-linux-musleabi - target: armv7-unknown-linux-musleabihf
- arm-unknown-linux-musleabihf toolchain: stable
- aarch64-unknown-linux-gnu - target: armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-musl 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -41,18 +76,17 @@ jobs:
- name: Install Rust - name: Install Rust
run: | run: |
rustup set profile minimal rustup set profile minimal
rustup toolchain install stable rustup toolchain install ${{ matrix.platform.toolchain }}
rustup default stable rustup default ${{ matrix.platform.toolchain }}
rustup override set stable rustup override set ${{ matrix.platform.toolchain }}
rustup target add --toolchain stable ${{ matrix.target }}
- name: Install cross - name: Install cross
run: cargo install cross run: cargo install cross
- name: Build ${{ matrix.target }} - name: Build ${{ matrix.platform.target }}
timeout-minutes: 120 timeout-minutes: 120
run: | run: |
compile_target=${{ matrix.target }} compile_target=${{ matrix.platform.target }}
compile_features="-f full" compile_features="-f full"
@@ -65,10 +99,13 @@ jobs:
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
compile_compress="-u" compile_compress="-u"
fi fi
compile_nightly="-n"
compile_features="-Z build-std=std,panic_abort,proc_macro"
fi fi
cd build 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 - name: Upload Github Assets
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
+94 -61
View File
@@ -212,7 +212,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -229,7 +229,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -411,7 +411,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -642,9 +642,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.15" version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@@ -740,7 +740,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -828,7 +828,28 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "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]] [[package]]
@@ -888,7 +909,7 @@ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -1119,7 +1140,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -1214,9 +1235,9 @@ dependencies = [
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.4.6" version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e"
dependencies = [ dependencies = [
"atomic-waker", "atomic-waker",
"bytes", "bytes",
@@ -1270,9 +1291,9 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.15.1" version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
[[package]] [[package]]
name = "heapless" name = "heapless"
@@ -1663,7 +1684,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -1780,9 +1801,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.11" version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2"
[[package]] [[package]]
name = "jemalloc-sys" name = "jemalloc-sys"
@@ -1872,7 +1893,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.48.5", "windows-targets 0.52.6",
] ]
[[package]] [[package]]
@@ -1910,9 +1931,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]] [[package]]
name = "litemap" name = "litemap"
version = "0.7.3" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
@@ -2191,7 +2212,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -2355,7 +2376,7 @@ dependencies = [
"pest_meta", "pest_meta",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -2386,7 +2407,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -2501,9 +2522,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.89" version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -2570,7 +2591,7 @@ dependencies = [
"once_cell", "once_cell",
"socket2", "socket2",
"tracing", "tracing",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -2840,9 +2861,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.40" version = "0.38.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"errno", "errno",
@@ -2853,9 +2874,9 @@ dependencies = [
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.23.17" version = "0.23.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f"
dependencies = [ dependencies = [
"log", "log",
"once_cell", "once_cell",
@@ -2937,9 +2958,9 @@ dependencies = [
[[package]] [[package]]
name = "schannel" name = "schannel"
version = "0.1.26" version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d"
dependencies = [ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@@ -3045,7 +3066,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3114,13 +3135,13 @@ version = "1.22.0"
dependencies = [ dependencies = [
"aes", "aes",
"arc-swap", "arc-swap",
"async-trait",
"base64 0.22.1", "base64 0.22.1",
"blake3", "blake3",
"bloomfilter", "bloomfilter",
"byte_string", "byte_string",
"bytes", "bytes",
"cfg-if", "cfg-if",
"dynosaur",
"env_logger", "env_logger",
"futures", "futures",
"hickory-resolver", "hickory-resolver",
@@ -3142,6 +3163,7 @@ dependencies = [
"thiserror 2.0.3", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-tfo", "tokio-tfo",
"trait-variant",
"url", "url",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@@ -3220,7 +3242,6 @@ name = "shadowsocks-service"
version = "1.22.0" version = "1.22.0"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"async-trait",
"brotli", "brotli",
"bson", "bson",
"byte_string", "byte_string",
@@ -3261,6 +3282,7 @@ dependencies = [
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tokio-rustls", "tokio-rustls",
"trait-variant",
"tun2", "tun2",
"webpki-roots", "webpki-roots",
"windows-sys 0.59.0", "windows-sys 0.59.0",
@@ -3439,9 +3461,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.87" version = "2.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3450,9 +3472,9 @@ dependencies = [
[[package]] [[package]]
name = "sync_wrapper" name = "sync_wrapper"
version = "1.0.1" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
dependencies = [ dependencies = [
"futures-core", "futures-core",
] ]
@@ -3465,7 +3487,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3526,7 +3548,7 @@ dependencies = [
"fastrand", "fastrand",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -3565,7 +3587,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3576,7 +3598,7 @@ checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3683,7 +3705,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3763,7 +3785,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
@@ -3806,6 +3828,17 @@ dependencies = [
"tracing-log", "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]] [[package]]
name = "try-lock" name = "try-lock"
version = "0.2.5" version = "0.2.5"
@@ -3862,9 +3895,9 @@ checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.13" version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]] [[package]]
name = "unicode-normalization" name = "unicode-normalization"
@@ -4011,7 +4044,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -4045,7 +4078,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -4113,7 +4146,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -4374,9 +4407,9 @@ checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"
[[package]] [[package]]
name = "yoke" name = "yoke"
version = "0.7.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40"
dependencies = [ dependencies = [
"serde", "serde",
"stable_deref_trait", "stable_deref_trait",
@@ -4386,13 +4419,13 @@ dependencies = [
[[package]] [[package]]
name = "yoke-derive" name = "yoke-derive"
version = "0.7.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
"synstructure", "synstructure",
] ]
@@ -4414,27 +4447,27 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
name = "zerofrom" name = "zerofrom"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e"
dependencies = [ dependencies = [
"zerofrom-derive", "zerofrom-derive",
] ]
[[package]] [[package]]
name = "zerofrom-derive" name = "zerofrom-derive"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
"synstructure", "synstructure",
] ]
@@ -4463,7 +4496,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.87", "syn 2.0.89",
] ]
[[package]] [[package]]
+1 -1
View File
@@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-rust"
keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"]
license = "MIT" license = "MIT"
edition = "2021" edition = "2021"
rust-version = "1.74" rust-version = "1.75"
[badges] [badges]
maintenance = { status = "passively-maintained" } maintenance = { status = "passively-maintained" }
+26 -8
View File
@@ -1,13 +1,31 @@
[build] [build]
dockerfile = "./docker/linux-cross/Dockerfile" # dockerfile = "./docker/linux-cross/Dockerfile"
pre-build = [ # pre-build = [
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable", # "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable",
". $HOME/.cargo/env", # ". $HOME/.cargo/env",
"cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin", # "cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin",
"rm -rf $HOME/.cargo" # "rm -rf $HOME/.cargo"
] # ]
[build.env] [build.env]
passthrough = ["RUSTFLAGS"] 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"]
+11 -11
View File
@@ -46,17 +46,6 @@ if [[ "${BUILD_TARGET}" == "" ]]; then
BUILD_TARGET=$HOST_TRIPLE BUILD_TARGET=$HOST_TRIPLE
fi 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_FOLDER="${ROOT_DIR}/release"
RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${BUILD_TARGET}" RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${BUILD_TARGET}"
@@ -69,6 +58,17 @@ else
cd "${ROOT_DIR}/../target/release" cd "${ROOT_DIR}/../target/release"
fi 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 if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then
# For Windows, use zip # For Windows, use zip
@@ -48,7 +48,7 @@ $CompressParam = @{
LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe", "ssservice.exe" LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe", "ssservice.exe"
DestinationPath = "${PackagePath}" DestinationPath = "${PackagePath}"
} }
if ((${Features}).Contains("winservice")) { if ([System.IO.File]::Exists("sswinservice.exe")) {
$CompressParam.LiteralPath += "sswinservice.exe" $CompressParam.LiteralPath += "sswinservice.exe"
} }
Compress-Archive @CompressParam Compress-Archive @CompressParam
+30 -8
View File
@@ -11,8 +11,10 @@ fi
targets=() targets=()
features=() features=()
use_upx=false 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 case $opt in
t) t)
targets+=($OPTARG) targets+=($OPTARG)
@@ -23,8 +25,14 @@ while getopts "t:f:u" opt; do
u) u)
use_upx=true use_upx=true
;; ;;
n)
use_nightly=true
;;
Z)
cargo_flags="-Z $OPTARG"
;;
?) ?)
echo "Usage: $(basename $0) [-t <target-triple>] [-f features] [-u]" echo "Usage: $(basename $0) [-t <target-triple>] [-f features] [-u] [-n]"
;; ;;
esac esac
done done
@@ -47,6 +55,11 @@ if [[ "${use_upx}" = true ]]; then
fi fi
fi fi
build_command="cross"
if [[ "${use_nightly}" = true ]]; then
build_command="$build_command +nightly"
fi
function build() { function build() {
cd "$CUR_DIR/.." cd "$CUR_DIR/.."
@@ -59,14 +72,16 @@ function build() {
if [[ "${TARGET_FEATURES}" != "" ]]; then if [[ "${TARGET_FEATURES}" != "" ]]; then
echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..." echo "* Building ${TARGET} package ${VERSION} with features \"${TARGET_FEATURES}\" ..."
cross build --target "${TARGET}" \ $build_command build --target "${TARGET}" \
--features "${TARGET_FEATURES}" \ --features "${TARGET_FEATURES}" \
--release --release \
${cargo_flags}
else else
echo "* Building ${TARGET} package ${VERSION} ..." echo "* Building ${TARGET} package ${VERSION} ..."
cross build --target "${TARGET}" \ $build_command build --target "${TARGET}" \
--release --release \
${cargo_flags}
fi fi
if [[ $? != "0" ]]; then if [[ $? != "0" ]]; then
@@ -107,12 +122,19 @@ function build() {
echo "* Packaging ZIP in ${PKG_PATH} ..." echo "* Packaging ZIP in ${PKG_PATH} ..."
cd ${RELEASE_DIR} cd ${RELEASE_DIR}
sswinservice=""
if [ -e "sswinservice.exe" ]; then
sswinservice="sswinservice.exe"
fi
zip ${PKG_PATH} \ zip ${PKG_PATH} \
"sslocal.exe" \ "sslocal.exe" \
"ssserver.exe" \ "ssserver.exe" \
"ssurl.exe" \ "ssurl.exe" \
"ssmanager.exe" \ "ssmanager.exe" \
"ssservice.exe" "ssservice.exe" \
"${sswinservice}"
if [[ $? != "0" ]]; then if [[ $? != "0" ]]; then
exit 1 exit 1
@@ -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 <target-triple>] [-f features] [-u]"
;;
esac
done
features+=${EXTRA_FEATURES}
if [[ "${#targets[@]}" == "0" ]]; then
echo "Specifying compile target with -t <target-triple>"
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
@@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-service"
keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"]
license = "MIT" license = "MIT"
edition = "2021" edition = "2021"
rust-version = "1.74" rust-version = "1.75"
[badges] [badges]
maintenance = { status = "passively-maintained" } maintenance = { status = "passively-maintained" }
@@ -171,7 +171,7 @@ tokio-rustls = { version = "0.26", optional = true, default-features = false, fe
"ring", "ring",
] } ] }
rustls-native-certs = { version = "0.8", optional = true } rustls-native-certs = { version = "0.8", optional = true }
async-trait = "0.1" trait-variant = "0.1"
socket2 = { version = "0.5", features = ["all"] } socket2 = { version = "0.5", features = ["all"] }
libc = "~0.2.141" libc = "~0.2.141"
@@ -5,7 +5,6 @@ use std::{
net::{Ipv4Addr, Ipv6Addr, SocketAddr}, net::{Ipv4Addr, Ipv6Addr, SocketAddr},
}; };
use async_trait::async_trait;
use futures::future; use futures::future;
use hickory_resolver::proto::{ use hickory_resolver::proto::{
op::{Message, Query}, op::{Message, Query},
@@ -104,7 +103,6 @@ impl DnsResolver {
} }
} }
#[async_trait]
impl DnsResolve for DnsResolver { impl DnsResolve for DnsResolver {
async fn resolve(&self, host: &str, port: u16) -> io::Result<Vec<SocketAddr>> { async fn resolve(&self, host: &str, port: u16) -> io::Result<Vec<SocketAddr>> {
let mut name = Name::from_utf8(host)?; let mut name = Name::from_utf8(host)?;
@@ -9,7 +9,6 @@ use std::{
time::Duration, time::Duration,
}; };
use async_trait::async_trait;
use bytes::Bytes; use bytes::Bytes;
use futures::future; use futures::future;
use log::{debug, error, trace, warn}; use log::{debug, error, trace, warn};
@@ -35,10 +34,7 @@ use crate::{
}; };
/// Writer for sending packets back to client /// Writer for sending packets back to client
/// #[trait_variant::make(Send)]
/// 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]
pub trait UdpInboundWrite { pub trait UdpInboundWrite {
/// Sends packet `data` received from `remote_addr` back to `peer_addr` /// 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<()>; async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()>;
@@ -8,14 +8,12 @@ use std::{
task::{Context, Poll}, task::{Context, Poll},
}; };
use async_trait::async_trait;
use shadowsocks::net::AcceptOpts; use shadowsocks::net::AcceptOpts;
use tokio::net::TcpListener; use tokio::net::TcpListener;
use crate::config::RedirType; use crate::config::RedirType;
/// Extension function for `TcpListener` for setting extra options before `bind()` /// Extension function for `TcpListener` for setting extra options before `bind()`
#[async_trait]
pub trait TcpListenerRedirExt { pub trait TcpListenerRedirExt {
// Create a TcpListener for transparent proxy // Create a TcpListener for transparent proxy
// //
@@ -3,7 +3,6 @@ use std::{
net::SocketAddr, net::SocketAddr,
}; };
use async_trait::async_trait;
use log::warn; use log::warn;
use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts}; use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts};
use socket2::Protocol; use socket2::Protocol;
@@ -17,7 +16,6 @@ use crate::{
}, },
}; };
#[async_trait]
impl TcpListenerRedirExt for TcpListener { impl TcpListenerRedirExt for TcpListener {
async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result<TcpListener> { async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result<TcpListener> {
match ty { match ty {
@@ -5,7 +5,6 @@ use std::{
os::unix::io::AsRawFd, os::unix::io::AsRawFd,
}; };
use async_trait::async_trait;
use log::warn; use log::warn;
use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts}; use shadowsocks::net::{is_dual_stack_addr, set_tcp_fastopen, AcceptOpts};
use socket2::SockAddr; use socket2::SockAddr;
@@ -19,7 +18,6 @@ use crate::{
}, },
}; };
#[async_trait]
impl TcpListenerRedirExt for TcpListener { impl TcpListenerRedirExt for TcpListener {
async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result<TcpListener> { async fn bind_redir(ty: RedirType, addr: SocketAddr, accept_opts: AcceptOpts) -> io::Result<TcpListener> {
match ty { match ty {
@@ -3,7 +3,6 @@ use std::{
net::SocketAddr, net::SocketAddr,
}; };
use async_trait::async_trait;
use shadowsocks::net::AcceptOpts; use shadowsocks::net::AcceptOpts;
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};
@@ -12,7 +11,6 @@ use crate::{
local::redir::redir_ext::{TcpListenerRedirExt, TcpStreamRedirExt}, local::redir::redir_ext::{TcpListenerRedirExt, TcpStreamRedirExt},
}; };
#[async_trait]
impl TcpListenerRedirExt for TcpListener { impl TcpListenerRedirExt for TcpListener {
async fn bind_redir(_ty: RedirType, _addr: SocketAddr, _accept_opts: AcceptOpts) -> io::Result<TcpListener> { async fn bind_redir(_ty: RedirType, _addr: SocketAddr, _accept_opts: AcceptOpts) -> io::Result<TcpListener> {
let err = Error::new( let err = Error::new(
@@ -7,7 +7,6 @@ use std::{
time::Duration, time::Duration,
}; };
use async_trait::async_trait;
use log::{debug, error, info, trace, warn}; use log::{debug, error, info, trace, warn};
use lru_time_cache::LruCache; use lru_time_cache::LruCache;
use shadowsocks::{ use shadowsocks::{
@@ -91,7 +90,6 @@ impl UdpRedirInboundWriter {
} }
} }
#[async_trait]
impl UdpInboundWrite for UdpRedirInboundWriter { impl UdpInboundWrite for UdpRedirInboundWriter {
async fn send_to(&self, mut peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { 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, // If IPv6 Transparent Proxy is supported on the current platform,
@@ -7,7 +7,6 @@ use std::{
time::Duration, time::Duration,
}; };
use async_trait::async_trait;
use byte_string::ByteStr; use byte_string::ByteStr;
use bytes::{BufMut, BytesMut}; use bytes::{BufMut, BytesMut};
use log::{debug, error, info, trace}; use log::{debug, error, info, trace};
@@ -96,7 +95,6 @@ struct Socks5UdpInboundWriter {
inbound: Arc<UdpSocket>, inbound: Arc<UdpSocket>,
} }
#[async_trait]
impl UdpInboundWrite for Socks5UdpInboundWriter { impl UdpInboundWrite for Socks5UdpInboundWriter {
async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> {
let remote_addr = match remote_addr { let remote_addr = match remote_addr {
@@ -5,7 +5,6 @@ use std::{
time::Duration, time::Duration,
}; };
use async_trait::async_trait;
use bytes::{BufMut, BytesMut}; use bytes::{BufMut, BytesMut};
use etherparse::PacketBuilder; use etherparse::PacketBuilder;
use log::debug; use log::debug;
@@ -93,7 +92,6 @@ impl UdpTunInboundWriter {
} }
} }
#[async_trait]
impl UdpInboundWrite for UdpTunInboundWriter { impl UdpInboundWrite for UdpTunInboundWriter {
async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> { async fn send_to(&self, peer_addr: SocketAddr, remote_addr: &Address, data: &[u8]) -> io::Result<()> {
let addr = match *remote_addr { let addr = match *remote_addr {
@@ -2,7 +2,6 @@
use std::{io, net::SocketAddr, sync::Arc, time::Duration}; use std::{io, net::SocketAddr, sync::Arc, time::Duration};
use async_trait::async_trait;
use log::{debug, error, info}; use log::{debug, error, info};
use shadowsocks::{ use shadowsocks::{
relay::{socks5::Address, udprelay::MAXIMUM_UDP_PAYLOAD_SIZE}, relay::{socks5::Address, udprelay::MAXIMUM_UDP_PAYLOAD_SIZE},
@@ -87,7 +86,6 @@ struct TunnelUdpInboundWriter {
inbound: Arc<UdpSocket>, inbound: Arc<UdpSocket>,
} }
#[async_trait]
impl UdpInboundWrite for TunnelUdpInboundWriter { impl UdpInboundWrite for TunnelUdpInboundWriter {
async fn send_to(&self, peer_addr: SocketAddr, _remote_addr: &Address, data: &[u8]) -> io::Result<()> { async fn send_to(&self, peer_addr: SocketAddr, _remote_addr: &Address, data: &[u8]) -> io::Result<()> {
self.inbound.send_to(data, peer_addr).await.map(|_| ()) self.inbound.send_to(data, peer_addr).await.map(|_| ())
@@ -9,7 +9,7 @@ documentation = "https://docs.rs/shadowsocks-core"
keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"] keywords = ["shadowsocks", "proxy", "socks", "socks5", "firewall"]
license = "MIT" license = "MIT"
edition = "2021" edition = "2021"
rust-version = "1.74" rust-version = "1.75"
[badges] [badges]
maintenance = { status = "passively-maintained" } maintenance = { status = "passively-maintained" }
@@ -71,7 +71,8 @@ serde_json = "1.0"
percent-encoding = "2.1" percent-encoding = "2.1"
futures = "0.3" futures = "0.3"
async-trait = "0.1" trait-variant = "0.1"
dynosaur = "0.1.2"
socket2 = { version = "0.5", features = ["all"] } socket2 = { version = "0.5", features = ["all"] }
tokio = { version = "1.9.0", features = [ tokio = { version = "1.9.0", features = [
@@ -11,7 +11,6 @@ use std::{
#[cfg(feature = "hickory-dns")] #[cfg(feature = "hickory-dns")]
use arc_swap::ArcSwap; use arc_swap::ArcSwap;
use async_trait::async_trait;
use cfg_if::cfg_if; use cfg_if::cfg_if;
#[cfg(feature = "hickory-dns")] #[cfg(feature = "hickory-dns")]
use hickory_resolver::config::ResolverConfig; use hickory_resolver::config::ResolverConfig;
@@ -31,12 +30,17 @@ use crate::net::ConnectOpts;
use super::hickory_dns_resolver::DnsResolver as HickoryDnsResolver; use super::hickory_dns_resolver::DnsResolver as HickoryDnsResolver;
/// Abstract DNS resolver /// Abstract DNS resolver
#[async_trait] #[trait_variant::make(Send)]
#[dynosaur::dynosaur(DynDnsResolve)]
pub trait DnsResolve { pub trait DnsResolve {
/// Resolves `addr:port` to a list of `SocketAddr` /// Resolves `addr:port` to a list of `SocketAddr`
async fn resolve(&self, addr: &str, port: u16) -> io::Result<Vec<SocketAddr>>; async fn resolve(&self, addr: &str, port: u16) -> io::Result<Vec<SocketAddr>>;
} }
// Equivalent to (dyn DnsResolve + Send + Sync)
unsafe impl Send for DynDnsResolve<'_> {}
unsafe impl Sync for DynDnsResolve<'_> {}
#[cfg(feature = "hickory-dns")] #[cfg(feature = "hickory-dns")]
#[derive(Debug)] #[derive(Debug)]
pub struct HickoryDnsSystemResolver { pub struct HickoryDnsSystemResolver {
@@ -63,7 +67,7 @@ pub enum DnsResolver {
#[cfg(feature = "hickory-dns")] #[cfg(feature = "hickory-dns")]
HickoryDns(HickoryDnsResolver), HickoryDns(HickoryDnsResolver),
/// Customized Resolver /// Customized Resolver
Custom(Box<dyn DnsResolve + Send + Sync>), Custom(Box<DynDnsResolve<'static>>),
} }
impl Default for DnsResolver { impl Default for DnsResolver {
@@ -282,7 +286,7 @@ impl DnsResolver {
where where
R: DnsResolve + Send + Sync + 'static, R: DnsResolve + Send + Sync + 'static,
{ {
DnsResolver::Custom(Box::new(custom) as Box<dyn DnsResolve + Send + Sync>) DnsResolver::Custom(DynDnsResolve::boxed(custom))
} }
/// Resolve address into `SocketAddr`s /// Resolve address into `SocketAddr`s
+1 -2
View File
@@ -8,8 +8,7 @@ import (
) )
type ConnectionManager interface { type ConnectionManager interface {
Start() error Lifecycle
Close() error
NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata InboundContext, onClose N.CloseHandlerFunc) 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) NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata InboundContext, onClose N.CloseHandlerFunc)
} }
+5 -5
View File
@@ -336,11 +336,11 @@ func (s *Box) preStart() error {
if err != nil { if err != nil {
return err 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 { if err != nil {
return err 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 { if err != nil {
return err return err
} }
@@ -364,7 +364,7 @@ func (s *Box) start() error {
if err != nil { if err != nil {
return err 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 { if err != nil {
return err return err
} }
@@ -372,7 +372,7 @@ func (s *Box) start() error {
if err != nil { if err != nil {
return err 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 { if err != nil {
return err return err
} }
@@ -391,7 +391,7 @@ func (s *Box) Close() error {
close(s.done) close(s.done)
} }
err := common.Close( 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 { for _, lifecycleService := range s.services {
err = E.Append(err, lifecycleService.Close(), func(err error) error { err = E.Append(err, lifecycleService.Close(), func(err error) error {
+1 -1
View File
@@ -2,7 +2,7 @@
icon: material/alert-decagram icon: material/alert-decagram
--- ---
#### 1.11.0-alpha.23 #### 1.11.0-alpha.24
* Fixes and improvements * Fixes and improvements
+15 -8
View File
@@ -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() 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) { func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader, destination io.Writer, direction bool, done *atomic.Bool, onClose N.CloseHandlerFunc) {
originSource := source originSource := source
originDestination := destination
var readCounters, writeCounters []N.CountFunc var readCounters, writeCounters []N.CountFunc
for { for {
source, readCounters = N.UnwrapCountReader(source, readCounters) source, readCounters = N.UnwrapCountReader(source, readCounters)
@@ -92,7 +96,7 @@ func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader
onClose(err) onClose(err)
} }
} }
common.Close(source, destination) common.Close(originSource, originDestination)
return return
} }
for _, counter := range readCounters { 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) _, err := bufio.CopyWithCounters(destination, source, originSource, readCounters, writeCounters)
if err != nil { if err != nil {
common.Close(destination, source) common.Close(originSource, originDestination)
} else if _, dstDuplex := destination.(N.WriteCloser); dstDuplex { } else if duplexDst, isDuplex := destination.(N.WriteCloser); isDuplex {
N.CloseWrite(destination) err = duplexDst.CloseWrite()
if err != nil {
common.Close(originSource, originDestination)
}
} else { } else {
common.Close(destination) common.Close(originDestination)
} }
if done.Swap(true) { if done.Swap(true) {
if onClose != nil { if onClose != nil {
onClose(err) onClose(err)
} }
common.Close(source, destination) common.Close(originSource, originDestination)
} }
if !direction { if !direction {
if err == nil { if err == nil {
@@ -220,10 +227,10 @@ func (m *ConnectionManager) NewPacketConnection(ctx context.Context, this N.Dial
ctx, conn = canceler.NewPacketConn(ctx, conn, udpTimeout) ctx, conn = canceler.NewPacketConn(ctx, conn, udpTimeout)
} }
destination := bufio.NewPacketConn(remotePacketConn) destination := bufio.NewPacketConn(remotePacketConn)
var done atomic.Bool
if ctx.Done() != nil { if ctx.Done() != nil {
onClose = N.AppendClose(onClose, m.monitor.Add(ctx, conn)) 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, conn, destination, false, &done, onClose)
go m.packetConnectionCopy(ctx, destination, conn, true, &done, onClose) go m.packetConnectionCopy(ctx, destination, conn, true, &done, onClose)
} }
+4
View File
@@ -68,6 +68,9 @@ func (m *ConnectionMonitor) Close() error {
m.access.Lock() m.access.Lock()
defer m.access.Unlock() defer m.access.Unlock()
close(m.reloadChan) close(m.reloadChan)
for element := m.connections.Front(); element != nil; element = element.Next() {
element.Value.closer.Close()
}
return nil return nil
} }
@@ -96,6 +99,7 @@ func (m *ConnectionMonitor) monitor() {
if len(selectCases) < m.connections.Len()+1 { if len(selectCases) < m.connections.Len()+1 {
selectCases = make([]reflect.SelectCase, 0, m.connections.Len()+1) selectCases = make([]reflect.SelectCase, 0, m.connections.Len()+1)
} }
elements = elements[:0]
selectCases = selectCases[:1] selectCases = selectCases[:1]
selectCases[0] = rootCase selectCases[0] = rootCase
for element := m.connections.Front(); element != nil; element = element.Next() { for element := m.connections.Front(); element != nil; element = element.Next() {
+1 -1
View File
@@ -1,6 +1,6 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_VERSION:=1.13.0 PKG_VERSION:=1.13.1
LUCI_TITLE:=LuCI Support for mihomo LUCI_TITLE:=LuCI Support for mihomo
LUCI_DEPENDS:=+luci-base +mihomo LUCI_DEPENDS:=+luci-base +mihomo
@@ -163,7 +163,8 @@ domain:store.steampowered.com'
config shunt_rules 'AIGC' config shunt_rules 'AIGC'
option remarks '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' config shunt_rules 'Streaming'
option remarks 'Streaming' option remarks 'Streaming'
@@ -2,6 +2,7 @@ engage.cloudflareclient.com
github.com github.com
bing.com bing.com
c.mi.com c.mi.com
apple-relay.apple.com
#google #google
googleapis.cn googleapis.cn
+5 -5
View File
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mihomo PKG_NAME:=mihomo
PKG_RELEASE:=3 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git
PKG_SOURCE_DATE:=2024-11-14 PKG_SOURCE_DATE:=2024-11-24
PKG_SOURCE_VERSION:=de19f927e86573a7a97159e3b9925049f06d4563 PKG_SOURCE_VERSION:=eb985b002e5aa61c4c2208646f33180c4fc938f9
PKG_MIRROR_HASH:=931d397995b2da9e97f3f050d4650fa9013980d6c523df40bca3b58822a42409 PKG_MIRROR_HASH:=058ca55e42cbebecfa0b65b5b8f792bfba8c5240cfa43c44a017d0bdab498230
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_MAINTAINER:=Joseph Mory <morytyann@gmail.com> PKG_MAINTAINER:=Joseph Mory <morytyann@gmail.com>
@@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16 PKG_BUILD_FLAGS:=no-mips16
PKG_BUILD_VERSION:=alpha-de19f92 PKG_BUILD_VERSION:=alpha-eb985b0
PKG_BUILD_TIME:=$(shell date -u -Iseconds) PKG_BUILD_TIME:=$(shell date -u -Iseconds)
GO_PKG:=github.com/metacubex/mihomo GO_PKG:=github.com/metacubex/mihomo
+7 -1
View File
@@ -159,8 +159,14 @@ start_service() {
cp -f "$profile_file" "$RUN_PROFILE_PATH" cp -f "$profile_file" "$RUN_PROFILE_PATH"
elif [[ "$profile" == "subscription:"* ]]; then elif [[ "$profile" == "subscription:"* ]]; then
local subscription_section; subscription_section="${profile/subscription:/}" 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" 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 if [ ! -f "$subscription_file" ]; then
log "Subscription file not found." log "Subscription file not found."
log "Exiting..." log "Exiting..."
+2 -2
View File
@@ -30,13 +30,13 @@ define Download/geosite
HASH:=f04433837b88a3f49d7cd6517c91e8f5de4e4496f3d88ef3b7c6be5bb63f4c6f HASH:=f04433837b88a3f49d7cd6517c91e8f5de4e4496f3d88ef3b7c6be5bb63f4c6f
endef endef
GEOSITE_IRAN_VER:=202411180037 GEOSITE_IRAN_VER:=202411250037
GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER) GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER)
define Download/geosite-ir define Download/geosite-ir
URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/ URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/
URL_FILE:=iran.dat URL_FILE:=iran.dat
FILE:=$(GEOSITE_IRAN_FILE) FILE:=$(GEOSITE_IRAN_FILE)
HASH:=f0a632368bdfd3a50745bbe4e30e8971508f98911ea05d4a7bb4e6f77ce6a225 HASH:=2062e9541a5cf34368265e1aac57b5f750ceb9c925a141002db735000602801f
endef endef
define Package/v2ray-geodata/template define Package/v2ray-geodata/template
+3 -3
View File
@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=v2rayA PKG_NAME:=v2rayA
PKG_VERSION:=2.2.6.2 PKG_VERSION:=2.2.6.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/v2rayA/v2rayA/tar.gz/v$(PKG_VERSION)? 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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/service
PKG_LICENSE:=AGPL-3.0-only 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:=https://github.com/v2rayA/v2rayA/releases/download/v$(PKG_VERSION)/
URL_FILE:=web.tar.gz URL_FILE:=web.tar.gz
FILE:=$(WEB_FILE) FILE:=$(WEB_FILE)
HASH:=611cbc151c2f652110987b2c3728ec6920ca80a72fd1dc56ef6f59315348577b HASH:=e8bca04deaec72e3323310bc114fa4936474adcbb6638ec2e31dbdf88beabdae
endef endef
define Build/Prepare define Build/Prepare
@@ -25,6 +25,10 @@ namespace ServiceLib.Handler
await SetTaskLinux(); await SetTaskLinux();
} }
} }
else if(Utils.IsOSX())
{
//TODO
}
return true; return true;
} }
@@ -23,7 +23,7 @@ namespace ServiceLib.Handler
Environment.SetEnvironmentVariable("V2RAY_LOCATION_ASSET", Utils.GetBinPath(""), EnvironmentVariableTarget.Process); Environment.SetEnvironmentVariable("V2RAY_LOCATION_ASSET", Utils.GetBinPath(""), EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("XRAY_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(); var coreInfo = CoreInfoHandler.Instance.GetCoreInfo();
foreach (var it in coreInfo) foreach (var it in coreInfo)
@@ -258,7 +258,7 @@ namespace ServiceLib.Handler
{ {
return _config.TunModeItem.EnableTun return _config.TunModeItem.EnableTun
&& eCoreType == ECoreType.sing_box && eCoreType == ECoreType.sing_box
&& Utils.IsLinux() && (Utils.IsLinux() || Utils.IsOSX())
//&& _config.TunModeItem.LinuxSudoPwd.IsNotEmpty() //&& _config.TunModeItem.LinuxSudoPwd.IsNotEmpty()
; ;
} }
@@ -42,6 +42,8 @@
DownloadUrlWinArm64 = Global.NUrl + "/download/{0}/v2rayN-windows-arm64.zip", DownloadUrlWinArm64 = Global.NUrl + "/download/{0}/v2rayN-windows-arm64.zip",
DownloadUrlLinux64 = Global.NUrl + "/download/{0}/v2rayN-linux-64.zip", DownloadUrlLinux64 = Global.NUrl + "/download/{0}/v2rayN-linux-64.zip",
DownloadUrlLinuxArm64 = Global.NUrl + "/download/{0}/v2rayN-linux-arm64.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 _coreInfo.Add(new CoreInfo
@@ -79,6 +81,8 @@
DownloadUrlWinArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-windows-arm64-v8a.zip", DownloadUrlWinArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-windows-arm64-v8a.zip",
DownloadUrlLinux64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-64.zip", DownloadUrlLinux64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-64.zip",
DownloadUrlLinuxArm64 = Global.XrayCoreUrl + "/download/{0}/Xray-linux-arm64-v8a.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", Match = "Xray",
VersionArg = "-version", VersionArg = "-version",
RedirectInfo = true, RedirectInfo = true,
@@ -95,6 +99,8 @@
DownloadUrlWinArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-windows-arm64-{0}.zip", DownloadUrlWinArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-windows-arm64-{0}.zip",
DownloadUrlLinux64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-amd64-compatible-{0}.gz", DownloadUrlLinux64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-amd64-compatible-{0}.gz",
DownloadUrlLinuxArm64 = Global.MihomoCoreUrl + "/download/{0}/mihomo-linux-arm64-{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", Match = "Mihomo",
VersionArg = "-v", VersionArg = "-v",
RedirectInfo = true, RedirectInfo = true,
@@ -140,6 +146,8 @@
DownloadUrlWinArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip", DownloadUrlWinArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip",
DownloadUrlLinux64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz", DownloadUrlLinux64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz",
DownloadUrlLinuxArm64 = Global.SingboxCoreUrl + "/download/{0}/sing-box-{1}-linux-arm64.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", Match = "sing-box",
VersionArg = "version", VersionArg = "version",
}); });
@@ -12,6 +12,8 @@
public string? DownloadUrlWinArm64 { get; set; } public string? DownloadUrlWinArm64 { get; set; }
public string? DownloadUrlLinux64 { get; set; } public string? DownloadUrlLinux64 { get; set; }
public string? DownloadUrlLinuxArm64 { get; set; } public string? DownloadUrlLinuxArm64 { get; set; }
public string? DownloadUrlOSX64 { get; set; }
public string? DownloadUrlOSXArm64 { get; set; }
public string? Match { get; set; } public string? Match { get; set; }
public string? VersionArg { get; set; } public string? VersionArg { get; set; }
public bool RedirectInfo { get; set; } public bool RedirectInfo { get; set; }
@@ -450,6 +450,15 @@ namespace ServiceLib.Services
_ => null, _ => null,
}; };
} }
else if (Utils.IsOSX())
{
return RuntimeInformation.ProcessArchitecture switch
{
Architecture.Arm64 => coreInfo?.DownloadUrlOSXArm64,
Architecture.X64 => coreInfo?.DownloadUrlOSX64,
_ => null,
};
}
return null; return null;
} }
@@ -262,7 +262,7 @@ namespace ServiceLib.ViewModels
FileManager.ZipExtractToFile(fileName, toPath, _config.GuiItem.IgnoreGeoUpdateCore ? "geo" : ""); 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(); var filesList = (new DirectoryInfo(toPath)).GetFiles().Select(u => u.FullName).ToList();
foreach (var file in filesList) foreach (var file in filesList)
@@ -437,6 +437,11 @@ namespace ServiceLib.ViewModels
{ {
return _config.TunModeItem.LinuxSudoPwd.IsNotEmpty(); return _config.TunModeItem.LinuxSudoPwd.IsNotEmpty();
} }
else if (Utils.IsOSX())
{
//TODO
return false;
}
return false; return false;
} }
@@ -169,6 +169,12 @@ namespace v2rayN.Desktop.Views
{ {
tabSystemproxy.IsVisible = false; tabSystemproxy.IsVisible = false;
} }
if (Utils.IsOSX())
{
togAutoRun.IsVisible = false;
//TODO
}
} }
private async Task<bool> UpdateViewHandler(EViewAction action, object? obj) private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
@@ -202,7 +208,7 @@ namespace v2rayN.Desktop.Views
{ {
return lstFonts; return lstFonts;
} }
else if (Utils.IsLinux()) else if (Utils.IsLinux() || Utils.IsOSX())
{ {
var result = await Utils.GetLinuxFontFamily("zh"); var result = await Utils.GetLinuxFontFamily("zh");
if (result.IsNullOrEmpty()) if (result.IsNullOrEmpty())
+25 -10
View File
@@ -1,6 +1,7 @@
package router_test package router_test
import ( import (
"fmt"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
@@ -13,16 +14,25 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
func init() { func getAssetPath(file string) (string, error) {
wd, err := os.Getwd() path := platform.GetAssetLocation(file)
common.Must(err) _, 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) { return path, nil
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")))
}
} }
func TestGeoIPMatcherContainer(t *testing.T) { func TestGeoIPMatcherContainer(t *testing.T) {
@@ -217,10 +227,15 @@ func TestGeoIPMatcher6US(t *testing.T) {
} }
func loadGeoIP(country string) ([]*router.CIDR, error) { func loadGeoIP(country string) ([]*router.CIDR, error) {
geoipBytes, err := filesystem.ReadAsset("geoip.dat") path, err := getAssetPath("geoip.dat")
if err != nil { if err != nil {
return nil, err return nil, err
} }
geoipBytes, err := filesystem.ReadFile(path)
if err != nil {
return nil, err
}
var geoipList router.GeoIPList var geoipList router.GeoIPList
if err := proto.Unmarshal(geoipBytes, &geoipList); err != nil { if err := proto.Unmarshal(geoipBytes, &geoipList); err != nil {
return nil, err return nil, err
+6 -16
View File
@@ -1,8 +1,6 @@
package router_test package router_test
import ( import (
"os"
"path/filepath"
"strconv" "strconv"
"testing" "testing"
@@ -10,7 +8,6 @@ import (
"github.com/xtls/xray-core/common" "github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/errors" "github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net" "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/platform/filesystem"
"github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/protocol/http" "github.com/xtls/xray-core/common/protocol/http"
@@ -20,18 +17,6 @@ import (
"google.golang.org/protobuf/proto" "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 { func withBackground() routing.Context {
return &routing_session.Context{} return &routing_session.Context{}
} }
@@ -316,10 +301,15 @@ func TestRoutingRule(t *testing.T) {
} }
func loadGeoSite(country string) ([]*Domain, error) { func loadGeoSite(country string) ([]*Domain, error) {
geositeBytes, err := filesystem.ReadAsset("geosite.dat") path, err := getAssetPath("geosite.dat")
if err != nil { if err != nil {
return nil, err return nil, err
} }
geositeBytes, err := filesystem.ReadFile(path)
if err != nil {
return nil, err
}
var geositeList GeoSiteList var geositeList GeoSiteList
if err := proto.Unmarshal(geositeBytes, &geositeList); err != nil { if err := proto.Unmarshal(geositeBytes, &geositeList); err != nil {
return nil, err return nil, err
+1 -1
View File
@@ -17,7 +17,7 @@ require (
github.com/sagernet/sing v0.5.1 github.com/sagernet/sing v0.5.1
github.com/sagernet/sing-shadowsocks v0.2.7 github.com/sagernet/sing-shadowsocks v0.2.7
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 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/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e
github.com/vishvananda/netlink v1.3.0 github.com/vishvananda/netlink v1.3.0
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d
+2 -2
View File
@@ -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/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/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.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.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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 h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI=
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= 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= github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
+2 -2
View File
@@ -491,12 +491,12 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
rawInput = (*bytes.Buffer)(unsafe.Pointer(p + r.Offset)) rawInput = (*bytes.Buffer)(unsafe.Pointer(p + r.Offset))
} }
} else { } 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 "": case "":
inbound.CanSpliceCopy = 3 inbound.CanSpliceCopy = 3
if account.Flow == vless.XRV && (request.Command == protocol.RequestCommandTCP || isMuxAndNotXUDP(request, first)) { 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: default:
return errors.New("unknown request flow " + requestAddons.Flow).AtWarning() return errors.New("unknown request flow " + requestAddons.Flow).AtWarning()
+2
View File
@@ -96,6 +96,7 @@ func InitializeServerConfig(config *core.Config) (*exec.Cmd, error) {
var ( var (
testBinaryPath string testBinaryPath string
testBinaryCleanFn func()
testBinaryPathGen sync.Once testBinaryPathGen sync.Once
) )
@@ -108,6 +109,7 @@ func genTestBinaryPath() {
return err return err
} }
tempDir = dir tempDir = dir
testBinaryCleanFn = func() { os.RemoveAll(dir) }
return nil return nil
})) }))
file := filepath.Join(tempDir, "xray.test") file := filepath.Join(tempDir, "xray.test")
+12
View File
@@ -0,0 +1,12 @@
package scenarios
import (
"testing"
)
func TestMain(m *testing.M) {
genTestBinaryPath()
defer testBinaryCleanFn()
m.Run()
}
+1 -1
View File
@@ -5,7 +5,7 @@
"server": "http2.github.io", "server": "http2.github.io",
"server_sni": "", "server_sni": "",
"server_port": 443, "server_port": 443,
"timeout": 0, "connect_timeout": 2000,
"username": "username", "username": "username",
"password": "password", "password": "password",
"insecure_mode": false, "insecure_mode": false,
+1 -1
View File
@@ -5,7 +5,7 @@
"server": "http2.github.io", "server": "http2.github.io",
"server_sni": "", "server_sni": "",
"server_port": 443, "server_port": 443,
"timeout": 0, "connect_timeout": 2000,
"username": "username", "username": "username",
"password": "password", "password": "password",
"insecure_mode": false, "insecure_mode": false,
+9 -2
View File
@@ -49,6 +49,9 @@ bool ReadConfig() {
config_impl->Read("doh_url", &FLAGS_doh_url); config_impl->Read("doh_url", &FLAGS_doh_url);
config_impl->Read("dot_host", &FLAGS_dot_host); config_impl->Read("dot_host", &FLAGS_dot_host);
if (config_impl->HasKey<int32_t>("timeout")) {
config_impl->Read("timeout", &FLAGS_connect_timeout);
}
config_impl->Read("connect_timeout", &FLAGS_connect_timeout); config_impl->Read("connect_timeout", &FLAGS_connect_timeout);
config_impl->Read("tcp_nodelay", &FLAGS_tcp_nodelay); config_impl->Read("tcp_nodelay", &FLAGS_tcp_nodelay);
config_impl->Read("limit_rate", &FLAGS_limit_rate); config_impl->Read("limit_rate", &FLAGS_limit_rate);
@@ -123,7 +126,7 @@ bool SaveConfig() {
static_cast<void>(config_impl->Delete("threads")); static_cast<void>(config_impl->Delete("threads"));
all_fields_written &= config_impl->Write("doh_url", FLAGS_doh_url); 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("dot_host", FLAGS_dot_host);
all_fields_written &= config_impl->Write("timeout", FLAGS_connect_timeout); static_cast<void>(config_impl->Delete("timeout"));
all_fields_written &= config_impl->Write("connect_timeout", FLAGS_connect_timeout); all_fields_written &= config_impl->Write("connect_timeout", FLAGS_connect_timeout);
all_fields_written &= config_impl->Write("tcp_nodelay", FLAGS_tcp_nodelay); all_fields_written &= config_impl->Write("tcp_nodelay", FLAGS_tcp_nodelay);
all_fields_written &= config_impl->Write("limit_rate", FLAGS_limit_rate); 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 doh_url = absl::GetFlag(FLAGS_doh_url);
auto dot_host = absl::GetFlag(FLAGS_dot_host); auto dot_host = absl::GetFlag(FLAGS_dot_host);
// auto limit_rate = absl::GetFlag(FLAGS_limit_rate); // 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 // 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(); auto ret = err_msg.str();
if (ret.empty()) { if (ret.empty()) {
return ret; return ret;
+19 -12
View File
@@ -39,16 +39,12 @@ class ssl_stream : public stream {
bool https_fallback, bool https_fallback,
SSL_CTX* ssl_ctx) SSL_CTX* ssl_ctx)
: stream(io_context, host_ips, host_sni, port, channel), : stream(io_context, host_ips, host_sni, port, channel),
https_fallback_(https_fallback),
enable_tls_(true), enable_tls_(true),
ssl_socket_(SSLSocket::Create(ssl_socket_data_index, ssl_socket_data_index_(ssl_socket_data_index),
ssl_client_session_cache, ssl_client_session_cache_(ssl_client_session_cache),
&io_context, ssl_ctx_(ssl_ctx),
&socket_, https_fallback_(https_fallback),
ssl_ctx, ssl_socket_(nullptr) {}
https_fallback,
host_sni,
port)) {}
~ssl_stream() override {} ~ssl_stream() override {}
@@ -72,7 +68,11 @@ class ssl_stream : public stream {
void s_close(asio::error_code& ec) override { void s_close(asio::error_code& ec) override {
ec = asio::error_code(); 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 { void on_async_connected(Channel* channel, asio::error_code ec) override {
@@ -81,6 +81,8 @@ class ssl_stream : public stream {
return; return;
} }
scoped_refptr<stream> self(this); scoped_refptr<stream> 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) { ssl_socket_->Connect([this, channel, self](int rv) {
if (closed_) { if (closed_) {
DCHECK(!user_connect_callback_); DCHECK(!user_connect_callback_);
@@ -89,7 +91,7 @@ class ssl_stream : public stream {
asio::error_code ec; asio::error_code ec;
if (rv < 0) { if (rv < 0) {
ec = asio::error::connection_refused; ec = asio::error::connection_refused;
on_async_connected(channel, ec); stream::on_async_connected(channel, ec);
return; return;
} }
@@ -124,8 +126,13 @@ class ssl_stream : public stream {
} }
private: private:
bool https_fallback_;
const bool enable_tls_; 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<SSLSocket> ssl_socket_; scoped_refptr<SSLSocket> ssl_socket_;
}; };
+8 -7
View File
@@ -401,10 +401,6 @@ class stream : public gurl_base::RefCountedThreadSafe<stream> {
VLOG(1) << "trying endpoint (" << domain() << "): " << endpoint; VLOG(1) << "trying endpoint (" << domain() << "): " << endpoint;
endpoints_.pop_front(); endpoints_.pop_front();
endpoint_ = std::move(endpoint); endpoint_ = std::move(endpoint);
if (socket_.is_open()) {
asio::error_code ec;
socket_.close(ec);
}
on_resolve(channel); on_resolve(channel);
} }
@@ -418,6 +414,11 @@ class stream : public gurl_base::RefCountedThreadSafe<stream> {
on_async_connect_callback(asio::error::network_unreachable); on_async_connect_callback(asio::error::network_unreachable);
return; return;
} }
// avoid asio::error::already_open error
if (socket_.is_open()) {
asio::error_code ec;
s_close(ec);
}
asio::error_code ec; asio::error_code ec;
socket_.open(endpoint_.protocol(), ec); socket_.open(endpoint_.protocol(), ec);
if (ec) { if (ec) {
@@ -572,9 +573,9 @@ class stream : public gurl_base::RefCountedThreadSafe<stream> {
net::Resolver resolver_; net::Resolver resolver_;
protected: protected:
std::string host_ips_; const std::string host_ips_;
std::string host_sni_; const std::string host_sni_;
uint16_t port_; const uint16_t port_;
asio::ip::tcp::endpoint endpoint_; asio::ip::tcp::endpoint endpoint_;
asio::io_context& io_context_; asio::io_context& io_context_;
asio::ip::tcp::socket socket_; asio::ip::tcp::socket socket_;
+1 -1
View File
@@ -5,7 +5,7 @@
"server": "http2.github.io", "server": "http2.github.io",
"server_sni": "", "server_sni": "",
"server_port": 443, "server_port": 443,
"timeout": 0, "connect_timeout": 2000,
"username": "username", "username": "username",
"password": "password", "password": "password",
"insecure_mode": false, "insecure_mode": false,
+1 -1
View File
@@ -2,7 +2,7 @@
"method": "http2", "method": "http2",
"server": "localhost", "server": "localhost",
"server_port": 443, "server_port": 443,
"timeout": 0, "connect_timeout": 2000,
"username": "username", "username": "username",
"password": "password", "password": "password",
"private_key_file": "/etc/yass/private_key.pem", "private_key_file": "/etc/yass/private_key.pem",
+1 -1
View File
@@ -5,7 +5,7 @@
"server": "http2.github.io", "server": "http2.github.io",
"server_sni": "", "server_sni": "",
"server_port": 443, "server_port": 443,
"timeout": 0, "connect_timeout": 2000,
"username": "username", "username": "username",
"password": "password", "password": "password",
"insecure_mode": false, "insecure_mode": false,
+7 -8
View File
@@ -59,16 +59,15 @@ class ChaturbateIE(InfoExtractor):
'Accept': 'application/json', 'Accept': 'application/json',
}, fatal=False, impersonate=True) or {} }, 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') m3u8_url = response.get('url')
if not m3u8_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 { return {
'id': video_id, 'id': video_id,