mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-02 22:12:53 +03:00
Pull request 2094: AG-27796 upd golibs
Squashed commit of the following: commit a205c1302e3979d1c4270b11d253b6bc0d292216 Merge: de289ff4f214175eb4
Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Dec 7 16:36:53 2023 +0300 Merge branch 'master' into AG-27796-upd-golibs commit de289ff4f3199bc2dffb029a9804cabe86b3b886 Merge: b2322093ca0ec0b2b5
Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Dec 6 12:12:35 2023 +0300 Merge branch 'master' into AG-27796-upd-golibs commit b2322093cea0ecdf34be66b56a9ab0fd7b32c7b9 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Dec 5 19:20:30 2023 +0300 filtering: imp cognit commit 563aa45824a2cc9d63d2c394f6a60f053e5d6d3b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Dec 4 17:02:56 2023 +0300 all: imp code commit 064a00bce4340caa4cea052fa8234cedb8dcea01 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 18:41:07 2023 +0300 all: upd golibs
This commit is contained in:
parent
214175eb41
commit
ce868268bc
18 changed files with 168 additions and 682 deletions
internal/home
|
@ -35,8 +35,10 @@ import (
|
|||
"github.com/AdguardTeam/AdGuardHome/internal/version"
|
||||
"github.com/AdguardTeam/dnsproxy/upstream"
|
||||
"github.com/AdguardTeam/golibs/errors"
|
||||
"github.com/AdguardTeam/golibs/hostsfile"
|
||||
"github.com/AdguardTeam/golibs/log"
|
||||
"github.com/AdguardTeam/golibs/netutil"
|
||||
"github.com/AdguardTeam/golibs/osutil"
|
||||
"github.com/AdguardTeam/golibs/stringutil"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
@ -231,11 +233,12 @@ func setupHostsContainer() (err error) {
|
|||
return fmt.Errorf("initing hosts watcher: %w", err)
|
||||
}
|
||||
|
||||
Context.etcHosts, err = aghnet.NewHostsContainer(
|
||||
aghos.RootDirFS(),
|
||||
hostsWatcher,
|
||||
aghnet.DefaultHostsPaths()...,
|
||||
)
|
||||
paths, err := hostsfile.DefaultHostsPaths()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting default system hosts paths: %w", err)
|
||||
}
|
||||
|
||||
Context.etcHosts, err = aghnet.NewHostsContainer(osutil.RootDirFS(), hostsWatcher, paths...)
|
||||
if err != nil {
|
||||
closeErr := hostsWatcher.Close()
|
||||
if errors.Is(err, aghnet.ErrNoHostsPaths) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue