From 53b5fedbc35eb59e450da0891ace3c206203fbad Mon Sep 17 00:00:00 2001 From: seiuneko <25706824+seiuneko@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:47:35 +0800 Subject: [PATCH 1/3] optimize: reduce memory usage by reading kallsyms only in the trace command (#700) --- cmd/trace.go | 3 +++ trace/kallsyms.go | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/trace.go b/cmd/trace.go index 0c67775f5..2bd47fff2 100644 --- a/cmd/trace.go +++ b/cmd/trace.go @@ -31,6 +31,9 @@ func init() { traceCmd := &cobra.Command{ Use: "trace", Short: "To trace traffic", + PreRun: func(cmd *cobra.Command, args []string) { + trace.ReadKallsyms() + }, Run: func(cmd *cobra.Command, args []string) { internal.AutoSu() diff --git a/trace/kallsyms.go b/trace/kallsyms.go index aa575d919..c920cb87d 100644 --- a/trace/kallsyms.go +++ b/trace/kallsyms.go @@ -26,11 +26,7 @@ var kallsyms []Symbol var kallsymsByName map[string]Symbol = make(map[string]Symbol) var kallsymsByAddr map[uint64]Symbol = make(map[uint64]Symbol) -func init() { - readKallsyms() -} - -func readKallsyms() { +func ReadKallsyms() { file, err := os.Open("/proc/kallsyms") if err != nil { logrus.Fatalf("failed to open /proc/kallsyms: %v", err) From 81088e2fdbe330662a85d1d4ca25cdbd24b7cc96 Mon Sep 17 00:00:00 2001 From: "dae-prow[bot]" <136105375+dae-prow[bot]@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:11:50 -0500 Subject: [PATCH 2/3] ci(release): draft release v0.9.0rc2 (#705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dae-prow-robot Co-authored-by: Sumire (菫) <151038614+sumire88@users.noreply.github.com> --- CHANGELOGS.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 79128ca1c..cd6d731ee 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -14,6 +14,7 @@ curl --silent "https://api.github.com/repos/daeuniverse/dae/releases" | jq -r '. +- [v0.9.0rc2 (Pre-release)](#v090rc2-pre-release) - [v0.9.0rc1 (Pre-release)](#v090rc1-pre-release) - [v0.8.0 (Latest)](#v080-latest) - [v0.7.4](#v074) @@ -46,6 +47,36 @@ curl --silent "https://api.github.com/repos/daeuniverse/dae/releases" | jq -r '. - [v0.1.0](#v010) +### v0.9.0rc2 (Pre-release) + +> Release date: 2024/11/25 + +#### Features + +- feat/optimize(hy2): support human-readable bandwidth configuration in [#666](https://github.com/daeuniverse/dae/pull/666) by (@douglarek) +- feat(dns): support DoH, DoT, DoH3, DoQ in [#649](https://github.com/daeuniverse/dae/pull/649) by (@EkkoG) +- optimize: reduce memory usage by reading kallsyms only in the trace command in [#700](https://github.com/daeuniverse/dae/pull/700) by (@seiuneko) + +#### Bug Fixes + +- fix(routing): Fix MergeAndSortRulesOptimizer in [#682](https://github.com/daeuniverse/dae/pull/682) by (@jschwinger233) + +#### Others + +- ci(workflows/bpf-test): add BPF test to cover route logic in [#671](https://github.com/daeuniverse/dae/pull/671) by (@jschwinger233) +- refactor/optimize(bpf): rework bpf route with bpf_loop in [#580](https://github.com/daeuniverse/dae/pull/580) by (@mzz2017) +- docs(dns): add docs for #649 in [#687](https://github.com/daeuniverse/dae/pull/687) by (@EkkoG) +- docs(dns): fix typo in [#688](https://github.com/daeuniverse/dae/pull/688) by (@EkkoG) +- ci(release): draft release v0.9.0rc1 in [#690](https://github.com/daeuniverse/dae/pull/690) by (@dae-prow) + +**Example Config**: https://github.com/daeuniverse/dae/blob/v0.9.0rc2/example.dae + +**Full Changelog**: https://github.com/daeuniverse/dae/compare/v0.8.0...v0.9.0rc2 + +#### New Contributors + +- @seiuneko made their first contribution in [#700](https://github.com/daeuniverse/dae/pull/700) + ### v0.9.0rc1 (Pre-release) > Release date: 2024/11/03 From b159aedce5e769277ece743164d700a3955fa00c Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Mon, 25 Nov 2024 14:24:07 +0200 Subject: [PATCH 3/3] docs: update sources in `desc.go` (#697) Signed-off-by: Emmanuel Ferdman --- config/desc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/desc.go b/config/desc.go index 121bf6cba..42242df9d 100644 --- a/config/desc.go +++ b/config/desc.go @@ -10,9 +10,9 @@ type Desc map[string]string var SectionSummaryDesc = Desc{ "subscription": "Subscriptions defined here will be resolved as nodes and merged as a part of the global node pool.\nSupport to give the subscription a tag, and filter nodes from a given subscription in the group section.", "node": "Nodes defined here will be merged as a part of the global node pool.", - "dns": "See more at https://github.com/daeuniverse/dae/blob/main/docs/dns.md.", + "dns": "See more at https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/dns.md.", "group": "Node group. Groups defined here can be used as outbounds in section \"routing\".", - "routing": `Traffic follows this routing. See https://github.com/daeuniverse/dae/blob/main/docs/routing.md for full examples. + "routing": `Traffic follows this routing. See https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md for full examples. Notice: domain traffic split will fail if DNS traffic is not taken over by dae. Built-in outbound: direct, must_direct, block. Available functions: domain, sip, dip, sport, dport, ipversion, l4proto, pname, mac. @@ -48,12 +48,12 @@ var GlobalDesc = Desc{ "wan_interface": "The WAN interface to bind. Use it if you want to proxy localhost. Use \"auto\" to auto detect.", "allow_insecure": "Allow insecure TLS certificates. It is not recommended to turn it on unless you have to.", "dial_mode": `Optional values of dial_mode are: -1. "ip". Dial proxy using the IP from DNS directly. This allows your ipv4, ipv6 to choose the optimal path respectively, and makes the IP version requested by the application meet expectations. For example, if you use curl -4 ip.sb, you will request IPv4 via proxy and get a IPv4 echo. And curl -6 ip.sb will request IPv6. This may solve some wierd full-cone problem if your are be your node support that.Sniffing will be disabled in this mode. +1. "ip". Dial proxy using the IP from DNS directly. This allows your ipv4, ipv6 to choose the optimal path respectively, and makes the IP version requested by the application meet expectations. For example, if you use curl -4 ip.sb, you will request IPv4 via proxy and get a IPv4 echo. And curl -6 ip.sb will request IPv6. This may solve some weird full-cone problem if your are be your node support that.Sniffing will be disabled in this mode. 2. "domain". Dial proxy using the domain from sniffing. This will relieve DNS pollution problem to a great extent if have impure DNS environment. Generally, this mode brings faster proxy response time because proxy will re-resolve the domain in remote, thus get better IP result to connect. This policy does not impact routing. That is to say, domain rewrite will be after traffic split of routing and dae will not re-route it. 3. "domain+". Based on domain mode but do not check the reality of sniffed domain. It is useful for users whose DNS requests do not go through dae but want faster proxy response time. Notice that, if DNS requests do not go through dae, dae cannot split traffic by domain. 4. "domain++". Based on domain+ mode but force to re-route traffic using sniffed domain to partially recover domain based traffic split ability. It doesn't work for direct traffic and consumes more CPU resources.`, "disable_waiting_network": "Disable waiting for network before pulling subscriptions.", - "auto_config_kernel_parameter": "Automatically configure Linux kernel parameters like ip_forward and send_redirects. Check out https://github.com/daeuniverse/dae/blob/main/docs/getting-started/kernel-parameters.md to see what will dae do.", + "auto_config_kernel_parameter": "Automatically configure Linux kernel parameters like ip_forward and send_redirects. Check out https://github.com/daeuniverse/dae/blob/main/docs/en/user-guide/kernel-parameters.md to see what will dae do.", "sniffing_timeout": "Timeout to waiting for first data sending for sniffing. It is always 0 if dial_mode is ip. Set it higher is useful in high latency LAN network.", "tls_implementation": "TLS implementation. \"tls\" is to use Go's crypto/tls. \"utls\" is to use uTLS, which can imitate browser's Client Hello.", "utls_imitate": "The Client Hello ID for uTLS to imitate. This takes effect only if tls_implementation is utls. See more: https://github.com/daeuniverse/dae/blob/331fa23c16/component/outbound/transport/tls/utls.go#L17",