docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err)
<mask> conn := &dhcpConn{} <mask> n, err := conn.WriteTo(nil, &unexpectedAddrType{}) <mask> require.Error(t, err) <mask> <mask> testutil.AssertErrorMsg(t, "peer is of unexpected type *dhcpd.unexpectedAddrType", err) <mask> assert.Zero(t, n) <mask> }) <mask> } <mask> <mask> func TestBuildEtherPkt(...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
t.Run("bad_payload", func(t *testing.T) {
<mask> assert.Equal(t, wantType, layer.LayerType()) <mask> } <mask> }) <mask> <mask> t.Run("non-serializable", func(t *testing.T) { <mask> // Create an invalid DHCP packet. <mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Erro...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
pkt, err := conn.buildEtherPkt(invalidPayload, peer) require.NoError(t, err)
<mask> <mask> t.Run("non-serializable", func(t *testing.T) { <mask> // Create an invalid DHCP packet. <mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Error(t, err) <mask> <mask> assert.ErrorIs(t, err, errInvalidPktDHCP) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
assert.NotEmpty(t, pkt)
<mask> invalidPayload := []byte{1, 2, 3, 4} <mask> pkt, err := conn.buildEtherPkt(invalidPayload, nil) <mask> require.Error(t, err) <mask> <mask> assert.ErrorIs(t, err, errInvalidPktDHCP) <mask> assert.Empty(t, pkt) <mask> }) <mask> <mask> t.Run("serializing_error", func(t *testing.T) { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix_test.go
// minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes // according to RFC-2131. // // See https://datatracker.ietf.org/doc/html/rfc2131#section-2. const minDHCPMsgSize = 576
<mask> } <mask> <mask> // send writes resp for peer to conn considering the req's parameters according <mask> // to RFC-2131. <mask> // <mask> // See https://datatracker.ietf.org/doc/html/rfc2131#section-4.1. <mask> func (s *v4Server) send(peer net.Addr, conn net.PacketConn, req, resp *dhcpv4.DHCPv4) { <mask> ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/v4.go
pktData := resp.ToBytes() pktLen := len(pktData) if pktLen < minDHCPMsgSize { // Expand the packet to match the minimum DHCP message length. Although // the dhpcv4 package deals with the BOOTP's lower packet length // constraint, it seems some clients expecting the length being at least // 576 bytes as per ...
<mask> default: <mask> // Go on since peer is already set to broadcast. <mask> } <mask> <mask> log.Debug("dhcpv4: sending to %s: %s", peer, resp.Summary()) <mask> if _, err := conn.WriteTo(resp.ToBytes(), peer); err != nil { <mask> log.Error("dhcpv4: conn.Write to %s failed: %s", peer, err) <mask> } ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/v4.go
log.Error("initializing tls: %s", err) onConfigModified()
<mask> config.Users = nil <mask> <mask> Context.tls, err = newTLSManager(config.TLS) <mask> if err != nil { <mask> log.Fatalf("initializing tls: %s", err) <mask> } <mask> <mask> Context.web, err = initWeb(opts, clientBuildFS) <mask> fatalOnError(err) <mask> </s> Pull request: 5189-run-bad-cert Me...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/home.go
// newTLSManager initializes the manager of TLS configuration. m is always // non-nil while any returned error indicates that the TLS configuration isn't // valid. Thus TLS may be initialized later, e.g. via the web UI.
<mask> confLock sync.Mutex <mask> conf tlsConfigSettings <mask> } <mask> <mask> // newTLSManager initializes the TLS configuration. <mask> func newTLSManager(conf tlsConfigSettings) (m *tlsManager, err error) { <mask> m = &tlsManager{ <mask> status: &tlsConfigStatus{}, <mask> conf: conf, <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/tls.go
m.conf.Enabled = false return m, err
<mask> <mask> if m.conf.Enabled { <mask> err = m.load() <mask> if err != nil { <mask> return nil, err <mask> } <mask> <mask> m.setCertFileTime() <mask> } <mask> </s> Pull request: 5189-run-bad-cert Merge in DNS/adguard-home from 5189-run-bad-cert to master Closes #5189. Squashed commit of ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53a366ed463cf8cea1dec0e9619376cdb778ac52
internal/home/tls.go
<mask> "strings" <mask> "sync" <mask> "time" <mask> <mask> "github.com/bluele/gcache" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { </s> Fix #597 - [bugfix] querylog_top: Empty domain gets to the Top Queried domains
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
"github.com/bluele/gcache"
<mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type hourTop struct { <mask> domains gcache.Cache <mask> blocked gcache.Cache </s> Fix #597 - [bugfix] querylog_top: Empty domain gets to the Top Queried domains </s> remove "github.com...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
// if question hostname is empty, do nothing if hostname == "" { return nil }
<mask> } <mask> <mask> hostname := strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")) <mask> <mask> // get value, if not set, crate one <mask> d.hoursReadLock() <mask> defer d.hoursReadUnlock() <mask> err := d.hours[hour].incrementDomains(hostname) </s> Fix #597 - [bugfix] querylog_top: Empty...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53d680a5dfb027831bdbfc91bde5272d4d849a1a
dnsforward/querylog_top.go
<mask> } <mask> <mask> func (s *Server) handleDHCP4Request(p dhcp4.Packet, options dhcp4.Options) dhcp4.Packet { <mask> var lease *Lease <mask> var err error <mask> <mask> reqIP := net.IP(options[dhcp4.OptionRequestedIPAddress]) <mask> log.Tracef("Message from client: Request. IP: %s ReqIP: %s HW: %s",...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd.go
log.Tracef("Lease for %s isn't found", p.CHAddr()) return dhcp4.ReplyPacket(p, dhcp4.NAK, s.ipnet.IP, nil, 0, nil)
<mask> } <mask> <mask> lease = s.findLease(p) <mask> if lease == nil { <mask> lease, err = s.reserveLease(p) <mask> if err != nil { <mask> log.Tracef("Couldn't find free lease: %s", err) <mask> // couldn't find lease, don't respond <mask> return nil <mask> } <mask> } <mask> <mask> if ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd.go
lease = s.findLease(p)
<mask> p.SetCHAddr(hw) <mask> lease, _ = s.reserveLease(p) <mask> check(t, bytes.Equal(lease.HWAddr, hw), "lease.HWAddr") <mask> check(t, bytes.Equal(lease.IP, []byte{1, 1, 1, 1}), "lease.IP") <mask> <mask> // Try to reserve another IP for the same machine - no new IP must be reserved <mask> hw = []byte{1...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
// Try to commit a lease for an IP without prior Discover-Offer packets
<mask> var opt dhcp4.Options <mask> <mask> p = make(dhcp4.Packet, 241) <mask> <mask> // Commit a lease for an IP without prior Discover-Offer packets <mask> hw = []byte{2, 2, 3, 4, 5, 6} <mask> p.SetCHAddr(hw) <mask> p.SetCIAddr([]byte{0, 0, 0, 0}) <mask> opt = make(dhcp4.Options, 10) <mask> opt[dhc...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.NAK)}), "dhcp4.NAK")
<mask> opt = make(dhcp4.Options, 10) <mask> opt[dhcp4.OptionRequestedIPAddress] = []byte{1, 1, 1, 1} <mask> p2 = s.handleDHCP4Request(p, opt) <mask> opt = p2.ParseOptions() <mask> check(t, bytes.Equal(opt[dhcp4.OptionDHCPMessageType], []byte{byte(dhcp4.ACK)}), "dhcp4.ACK") <mask> check(t, bytes.Equal(p2.YIA...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/542a67b84edc067d864164fbb9f566447a97ccb8
dhcpd/dhcpd_test.go
"dev": true, "optional": true
<mask> }, <mask> "ansi-regex": { <mask> "version": "2.1.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "aproba": { <mask> "version": "1.2.0", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "balanced-match": { <mask> "version": "1.0.0", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "brace-expansion": { <mask> "version": "1.1.11", <mask> "bundled": true, <mask> "dev": true, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "brace-expansion": { <mask> "version": "1.1.11", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "balanced-match": "^1.0.0", <mask> "concat-map": "0.0.1" <mask> } <mask> }, <mask> "...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "code-point-at": { <mask> "version": "1.1.0", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "concat-map": { <mask> "version": "0.0.1", <mask> "bundled": true, <mask> "dev": true </s> npm...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "concat-map": { <mask> "version": "0.0.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "console-control-strings": { <mask> "version": "1.1.0", <mask> "bundled": true, <mask> "dev": true...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "console-control-strings": { <mask> "version": "1.1.0", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "core-util-is": { <mask> "version": "1.0.2", <mask> "bundled": true, <mask> "dev": tr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "inherits": { <mask> "version": "2.0.3", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "ini": { <mask> "version": "1.3.5", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0 unco...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "number-is-nan": "^1.0.0" <mask> } <mask> }, </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true </s> add "...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "brace-expansion": "^1.1.7" <mask> } <mask> }, <mask> "minimist": { </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "minimist": { <mask> "version": "0.0.8", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "minipass": { <mask> "version": "2.2.4", <mask> "bundled": true, <mask> "dev": true, </s> npm 6.7.0...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "version": "2.2.4", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "safe-buffer": "^5.1.1", <mask> "yallist": "^3.0.0" <mask> } </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those change...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "minimist": "0.0.8" <mask> } <mask> }, <mask> "ms": { <mask> "version": "2.0.0", </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes....
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "number-is-nan": { <mask> "version": "1.0.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "object-assign": { <mask> "version": "4.1.1", <mask> "bundled": true, <mask> "dev": true, </s>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "wrappy": "1" <mask> } <mask> }, <mask> "os-homedir": { </s> npm 6.7.0 unconditionally modifies package-lock.json. Commit those changes. </s> remove "dev": true ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "safe-buffer": { <mask> "version": "5.1.1", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "safer-buffer": { <mask> "version": "2.1.2", <mask> "bundled": true, <mask> "dev": true, </s> np...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "string-width": { <mask> "version": "1.0.2", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "code-point-at": "^1.0.0", <mask> "is-fullwidth-code-point": "^1.0.0", <mask> "strip-ansi": "^3.0.0" </...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"optional": true,
<mask> "strip-ansi": { <mask> "version": "3.0.1", <mask> "bundled": true, <mask> "dev": true, <mask> "requires": { <mask> "ansi-regex": "^2.0.0" <mask> } <mask> }, <mask> "strip-json-comments": { <mask> "version": ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "wrappy": { <mask> "version": "1.0.2", <mask> "bundled": true, <mask> "dev": true <mask> }, <mask> "yallist": { <mask> "version": "3.0.2", <mask> "bundled": true, <mask> "dev": true </s> npm 6.7.0 unc...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
"dev": true, "optional": true
<mask> }, <mask> "yallist": { <mask> "version": "3.0.2", <mask> "bundled": true, <mask> "dev": true <mask> } <mask> } <mask> }, <mask> "function-bind": { <mask> "version": "1.1.1", </s> npm 6.7.0 unconditionally modifies package-lock.j...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/548f5395661a735ef38911bf9958e6e095c9d1ed
client/package-lock.json
<mask> ReqECS: pctx.ReqECS, <mask> Answer: pctx.Res, <mask> OrigAnswer: dctx.origResp, <mask> Result: dctx.result, <mask> Elapsed: elapsed, <mask> ClientID: dctx.clientID, <mask> ClientIP: ip, <mask> AuthenticatedData: dctx.resp...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/dnsforward/stats.go
Elapsed: elapsed,
<mask> Result: dctx.result, <mask> ClientID: dctx.clientID, <mask> ClientIP: ip, <mask> AuthenticatedData: dctx.responseAD, <mask> } <mask> <mask> switch pctx.Proto { <mask> case proxy.ProtoHTTPS: </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed co...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/dnsforward/stats.go
Anonymizer: anonymizer,
<mask> return fmt.Errorf("init stats: %w", err) <mask> } <mask> <mask> conf := querylog.Config{ <mask> ConfigModified: onConfigModified, <mask> HTTPRegister: httpRegister, <mask> FindClient: Context.clients.findMultiple, <mask> BaseDir: baseDir, <mask> RotationIvl: ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/home/dns.go
<mask> MemSize: config.DNS.QueryLogMemSize, <mask> Enabled: config.DNS.QueryLogEnabled, <mask> FileEnabled: config.DNS.QueryLogFileEnabled, <mask> AnonymizeClientIP: config.DNS.AnonymizeClientIP, <mask> Anonymizer: anonymizer, <mask> } <mask> Context.queryLog = queryl...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/home/dns.go
<mask> "golang.org/x/net/idna" <mask> ) <mask> <mask> type qlogConfig struct { <mask> Enabled bool `json:"enabled"` <mask> // Use float64 here to support fractional numbers and not mess the API <mask> // users by changing the units. <mask> Interval float64 `json:"interval"` <mask> AnonymizeClie...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/http.go
Enabled bool `json:"enabled"`
<mask> // Use float64 here to support fractional numbers and not mess the API <mask> // users by changing the units. <mask> Interval float64 `json:"interval"` <mask> AnonymizeClientIP bool `json:"anonymize_client_ip"` <mask> } <mask> <mask> // Register web handlers <mask> func (l *queryLog) ini...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/http.go
log.Debug("querylog: cleared")
<mask> if err != nil && !errors.Is(err, os.ErrNotExist) { <mask> log.Error("removing log file %q: %s", l.logFile, err) <mask> } <mask> <mask> log.Debug("Query log: cleared") <mask> } <mask> <mask> func (l *queryLog) Add(params *AddParams) { <mask> if !l.conf.Enabled { <mask> return </s> Pull reques...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/qlog.go
<mask> Question: &q, <mask> Answer: &a, <mask> OrigAnswer: &a, <mask> Result: &res, <mask> ClientIP: client, <mask> Upstream: "upstream", <mask> } <mask> <mask> l.Add(params) <mask> } </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed commit of the following: ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/qlog_test.go
ClientIP: client,
<mask> Result: &res, <mask> Upstream: "upstream", <mask> } <mask> <mask> l.Add(params) <mask> } </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed commit of the following: commit 70b70c78c85311363535536c7ea12336b21accf8 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed M...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/qlog_test.go
// Config is the query log configuration structure.
<mask> // WriteDiskConfig - write configuration <mask> WriteDiskConfig(c *Config) <mask> } <mask> <mask> // Config - configuration object <mask> type Config struct { <mask> // ConfigModified is called when the configuration is changed, for <mask> // example by HTTP requests. <mask> ConfigModified func() ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
// Anonymizer processes the IP addresses to anonymize those if needed. Anonymizer *aghnet.IPMut
<mask> } <mask> <mask> // Config is the query log configuration structure. <mask> type Config struct { <mask> // ConfigModified is called when the configuration is changed, for <mask> // example by HTTP requests. <mask> ConfigModified func() <mask> <mask> // HTTPRegister registers an HTTP handler. <mask...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
<mask> <mask> // AnonymizeClientIP tells if the query log should anonymize clients' IP <mask> // addresses. <mask> AnonymizeClientIP bool <mask> <mask> // Anonymizer processes the IP addresses to anonymize those if needed. <mask> Anonymizer *aghnet.IPMut <mask> } <mask> <mask> // AddParams is the para...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
<mask> <mask> // Result is the filtering result (optional). <mask> Result *filtering.Result <mask> <mask> // Elapsed is the time spent for processing the request. <mask> Elapsed time.Duration <mask> <mask> ClientID string <mask> <mask> ClientIP net.IP <mask> <mask> // Upstream is the URL of the ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
<mask> Elapsed time.Duration <mask> <mask> ClientID string <mask> <mask> ClientIP net.IP <mask> <mask> // Upstream is the URL of the upstream DNS server. <mask> Upstream string <mask> <mask> ClientProto ClientProto <mask> </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed comm...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
ClientIP net.IP // Elapsed is the time spent for processing the request. Elapsed time.Duration
<mask> Upstream string <mask> <mask> ClientProto ClientProto <mask> <mask> // Cached indicates if the response is served from cache. <mask> Cached bool <mask> <mask> // AuthenticatedData shows if the response had the AD bit set. </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed com...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/querylog.go
func (l *queryLog) search(params *searchParams) (entries []*logEntry, oldest time.Time) {
<mask> } <mask> <mask> // search - searches log entries in the query log using specified parameters <mask> // returns the list of entries found + time of the oldest entry <mask> func (l *queryLog) search(params *searchParams) ([]*logEntry, time.Time) { <mask> now := time.Now() <mask> <mask> if params.limit ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/search.go
entries = append(memoryEntries, fileEntries...)
<mask> <mask> totalLimit := params.offset + params.limit <mask> <mask> // now let's get a unified collection <mask> entries := append(memoryEntries, fileEntries...) <mask> if len(entries) > totalLimit { <mask> // remove extra records <mask> entries = entries[:totalLimit] <mask> } <mask> </s> Pull...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/search.go
if len(entries) > 0 {
<mask> oldest = time.Time{} <mask> } <mask> } <mask> <mask> if len(entries) > 0 && len(entries) <= totalLimit { <mask> // Update oldest after merging in the memory buffer. <mask> oldest = entries[len(entries)-1].Time <mask> } <mask> <mask> log.Debug("QueryLog: prepared data (%d/%d) older than %...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/search.go
log.Debug( "querylog: prepared data (%d/%d) older than %s in %s", len(entries), total, params.olderThan, time.Since(now), )
<mask> // Update oldest after merging in the memory buffer. <mask> oldest = entries[len(entries)-1].Time <mask> } <mask> <mask> log.Debug("QueryLog: prepared data (%d/%d) older than %s in %s", <mask> len(entries), total, params.olderThan, time.Since(now)) <mask> <mask> return entries, oldest <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/search.go
oldestNano = 0
<mask> <mask> e, ts, err = l.readNextEntry(r, params, cache) <mask> if err != nil { <mask> if err == io.EOF { <mask> break <mask> } <mask> <mask> log.Error("querylog: reading next entry: %s", err) </s> Pull request: querylog: fix oldest calc Updates #4591. Squashed commit of the following:...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/549b20bdea3c3215bb355ffc39546f7bb3260d80
internal/querylog/search.go
<mask> *.snap <mask> /agh-backup/ <mask> /bin/ <mask> /build/* <mask> /build2/* <mask> /data/ <mask> /dist/ <mask> /filtering/tests/filtering.TestLotsOfRules*.pprof <mask> /filtering/tests/top-1m.csv <mask> /launchpad_credentials </s> Pull request 1717: remove-client2 Merge in DNS/adguard-home from remove-c...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
.gitignore
<mask> leases.db <mask> node_modules/ <mask> <mask> !/build/gitkeep <mask> !/build2/gitkeep </s> Pull request 1717: remove-client2 Merge in DNS/adguard-home from remove-client2 to master Squashed commit of the following: commit 0a0923494b0d1003e4f02f3a5f93d5248f0f2ded Author: Ainar Garipov <A.Garipov@AdGuard....
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
.gitignore
<mask> # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html. <mask> .POSIX: <mask> <mask> CHANNEL = development <mask> CLIENT_BETA_DIR = client2 <mask> CLIENT_DIR = client <mask> COMMIT = $$( git rev-parse --short HEAD ) <mask> DIST_DIR = dist <mask> # Don't name this macro "GO", because...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
Makefile
<mask> SIGN = 1 <mask> VERBOSE = 0 <mask> VERSION = v0.0.0 <mask> YARN = yarn <mask> YARN_FLAGS = --cwd $(CLIENT_BETA_DIR) <mask> YARN_INSTALL_FLAGS = $(YARN_FLAGS) --network-timeout 120000 --silent\ <mask> --ignore-engines --ignore-optional --ignore-platform\ <mask> --ignore-scripts <mask> <mask> NEXTAPI ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
Makefile
<mask> init: ; git config core.hooksPath ./scripts/hooks <mask> <mask> js-build: <mask> $(NPM) $(NPM_FLAGS) run build-prod <mask> $(YARN) $(YARN_FLAGS) build <mask> js-deps: <mask> $(NPM) $(NPM_INSTALL_FLAGS) ci <mask> $(YARN) $(YARN_INSTALL_FLAGS) install <mask> <mask> # TODO(a.garipov): Remove the le...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
Makefile
<mask> $(NPM) $(NPM_FLAGS) run build-prod <mask> $(YARN) $(YARN_FLAGS) build <mask> js-deps: <mask> $(NPM) $(NPM_INSTALL_FLAGS) ci <mask> $(YARN) $(YARN_INSTALL_FLAGS) install <mask> <mask> # TODO(a.garipov): Remove the legacy client tasks support once the new <mask> # client is done and the old one is rem...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
Makefile
<mask> # TODO(a.garipov): Remove the legacy client tasks support once the new <mask> # client is done and the old one is removed. <mask> js-lint: ; $(NPM) $(NPM_FLAGS) run lint <mask> js-test: ; $(NPM) $(NPM_FLAGS) run test <mask> js-beta-lint: ; $(YARN) $(YARN_FLAGS) lint <mask> js-beta-test: ; # TODO(v.abdulmya...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
Makefile
<mask> // BindHost is the address for the web interface server to listen on. <mask> BindHost netip.Addr `yaml:"bind_host"` <mask> // BindPort is the port for the web interface server to listen on. <mask> BindPort int `yaml:"bind_port"` <mask> // BetaBindPort is the port for the new client's web interface serv...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/config.go
<mask> // <mask> // TODO(a.garipov, e.burkov): This global is awful and must be removed. <mask> var config = &configuration{ <mask> BindPort: 3000, <mask> BetaBindPort: 0, <mask> BindHost: netip.IPv4Unspecified(), <mask> AuthAttempts: 5, <mask> AuthBlockMin: 15, <mask...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/config.go
addPorts(tcpPorts, tcpPort(config.BindPort))
<mask> return err <mask> } <mask> <mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts(tcpPorts, tcpPort(config.BindPort), tcpPort(config.BetaBindPort)) <mask> <mask> udpPorts := aghalg.UniqChecker[udpPort]{} <mask> addPorts(udpPorts, udpPort(config.DNS.Port)) <mask> <mask> if config.TL...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/config.go
<mask> "os" <mask> "os/exec" <mask> "path/filepath" <mask> "runtime" <mask> "strings" <mask> "time" <mask> "unicode/utf8" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghalg" <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" </s> Pull request 1717: remove-client2 Merge in ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/controlinstall.go
addPorts(tcpPorts, port)
<mask> defer func() { err = errors.Annotate(err, "validating ports: %w") }() <mask> <mask> portInt := req.Web.Port <mask> port := tcpPort(portInt) <mask> addPorts(tcpPorts, tcpPort(config.BetaBindPort), port) <mask> if err = tcpPorts.Validate(); err != nil { <mask> // Reset the value for the port to 1 to...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/controlinstall.go
<mask> // configuration structures. <mask> func copyInstallSettings(dst, src *configuration) { <mask> dst.BindHost = src.BindHost <mask> dst.BindPort = src.BindPort <mask> dst.BetaBindPort = src.BetaBindPort <mask> dst.DNS.BindHosts = src.DNS.BindHosts <mask> dst.DNS.Port = src.DNS.Port <mask> } <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/controlinstall.go
<mask> ctx, cancel := context.WithTimeout(context.Background(), timeout) <mask> defer cancel() <mask> <mask> shutdownSrv(ctx, web.httpServer) <mask> shutdownSrv(ctx, web.httpServerBeta) <mask> }(shutdownTimeout) <mask> } <mask> <mask> // decodeApplyConfigReq decodes the configuration, validates some...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/controlinstall.go
<mask> Context.mux.HandleFunc("/control/install/get_addresses", preInstall(ensureGET(web.handleInstallGetAddresses))) <mask> Context.mux.HandleFunc("/control/install/check_config", preInstall(ensurePOST(web.handleInstallCheckConfig))) <mask> Context.mux.HandleFunc("/control/install/configure", preInstall(ensurePO...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/controlinstall.go
<mask> <mask> func setupContext(opts options) { <mask> setupContextFlags(opts) <mask> <mask> switch version.Channel() { <mask> case version.ChannelEdge, version.ChannelDevelopment: <mask> config.BetaBindPort = 3001 <mask> default: <mask> // Go on. <mask> } <mask> <mask> Context.tlsRoots = aghtl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
addPorts(tcpPorts, tcpPort(opts.bindPort))
<mask> Context.clients.Init(config.Clients.Persistent, Context.dhcpServer, Context.etcHosts, arpdb) <mask> <mask> if opts.bindPort != 0 { <mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts(tcpPorts, tcpPort(opts.bindPort), tcpPort(config.BetaBindPort)) <mask> <mask> udpPorts := aghalg.Uni...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
var clientFS fs.FS
<mask> return nil <mask> } <mask> <mask> func initWeb(opts options, clientBuildFS fs.FS) (web *Web, err error) { <mask> var clientFS, clientBetaFS fs.FS <mask> if opts.localFrontend { <mask> log.Info("warning: using local frontend files") <mask> <mask> clientFS = os.DirFS("build/static") <mask> cli...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
<mask> if opts.localFrontend { <mask> log.Info("warning: using local frontend files") <mask> <mask> clientFS = os.DirFS("build/static") <mask> clientBetaFS = os.DirFS("build2/static") <mask> } else { <mask> clientFS, err = fs.Sub(clientBuildFS, "build/static") <mask> if err != nil { <mask> retu...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
<mask> clientFS, err = fs.Sub(clientBuildFS, "build/static") <mask> if err != nil { <mask> return nil, fmt.Errorf("getting embedded client subdir: %w", err) <mask> } <mask> <mask> clientBetaFS, err = fs.Sub(clientBuildFS, "build2/static") <mask> if err != nil { <mask> return nil, fmt.Errorf("ge...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
firstRun: Context.firstRun, BindHost: config.BindHost, BindPort: config.BindPort,
<mask> } <mask> } <mask> <mask> webConf := webConfig{ <mask> firstRun: Context.firstRun, <mask> BindHost: config.BindHost, <mask> BindPort: config.BindPort, <mask> BetaBindPort: config.BetaBindPort, <mask> <mask> ReadTimeout: readTimeout, <mask> ReadHeaderTimeout: readHdrT...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
clientFS: clientFS,
<mask> ReadTimeout: readTimeout, <mask> ReadHeaderTimeout: readHdrTimeout, <mask> WriteTimeout: writeTimeout, <mask> <mask> clientFS: clientFS, <mask> clientBetaFS: clientBetaFS, <mask> <mask> serveHTTP3: config.DNS.ServeHTTP3, <mask> } <mask> <mask> web = newWeb(&webConf) </...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
// port. At least one address is printed with the value of port. Output // example:
<mask> return opts <mask> } <mask> <mask> // printWebAddrs prints addresses built from proto, addr, and an appropriate <mask> // port. At least one address is printed with the value of port. If the value <mask> // of betaPort is 0, the second address is not printed. Output example: <mask> // <mask> // Go t...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
// go to http://127.0.0.1:80 func printWebAddrs(proto, addr string, port int) { log.Printf("go to %s://%s", proto, netutil.JoinHostPort(addr, port))
<mask> // printWebAddrs prints addresses built from proto, addr, and an appropriate <mask> // port. At least one address is printed with the value of port. If the value <mask> // of betaPort is 0, the second address is not printed. Output example: <mask> // <mask> // Go to http://127.0.0.1:80 <mask> // Go to h...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
printWebAddrs(proto, tlsConf.ServerName, tlsConf.PortHTTPS)
<mask> } <mask> <mask> // TODO(e.burkov): Inspect and perhaps merge with the previous condition. <mask> if proto == aghhttp.SchemeHTTPS && tlsConf.ServerName != "" { <mask> printWebAddrs(proto, tlsConf.ServerName, tlsConf.PortHTTPS, 0) <mask> <mask> return <mask> } <mask> <mask> bindhost := config...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
printWebAddrs(proto, bindhost.String(), port)
<mask> } <mask> <mask> bindhost := config.BindHost <mask> if !bindhost.IsUnspecified() { <mask> printWebAddrs(proto, bindhost.String(), port, config.BetaBindPort) <mask> <mask> return <mask> } <mask> <mask> ifaces, err := aghnet.GetValidNetInterfacesForWeb() </s> Pull request 1717: remove-client2...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
printWebAddrs(proto, bindhost.String(), port)
<mask> log.Error("web: getting iface ips: %s", err) <mask> // That's weird, but we'll ignore it. <mask> // <mask> // TODO(e.burkov): Find out when it happens. <mask> printWebAddrs(proto, bindhost.String(), port, config.BetaBindPort) <mask> <mask> return <mask> } <mask> <mask> for _, iface := r...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
printWebAddrs(proto, addr.String(), config.BindPort)
<mask> } <mask> <mask> for _, iface := range ifaces { <mask> for _, addr := range iface.Addresses { <mask> printWebAddrs(proto, addr.String(), config.BindPort, config.BetaBindPort) <mask> } <mask> } <mask> } <mask> <mask> // ------------------- </s> Pull request 1717: remove-client2 Merge in DNS...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/home.go
<mask> <mask> h.ServeHTTP(w, rr) <mask> }) <mask> } <mask> <mask> // wrapIndexBeta returns handler that deals with new client. <mask> func (web *Web) wrapIndexBeta(http.Handler) (wrapped http.Handler) { <mask> return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { <mask> h, pattern := C...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/middlewares.go
<mask> <mask> if setts.Enabled { <mask> err = validatePorts( <mask> tcpPort(config.BindPort), <mask> tcpPort(config.BetaBindPort), <mask> tcpPort(setts.PortHTTPS), <mask> tcpPort(setts.PortDNSOverTLS), <mask> tcpPort(setts.PortDNSCrypt), <mask> udpPort(config.DNS.Port), <mask> udpPort...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/tls.go
<mask> <mask> if req.Enabled { <mask> err = validatePorts( <mask> tcpPort(config.BindPort), <mask> tcpPort(config.BetaBindPort), <mask> tcpPort(req.PortHTTPS), <mask> tcpPort(req.PortDNSOverTLS), <mask> tcpPort(req.PortDNSCrypt), <mask> udpPort(config.DNS.Port), <mask> udpPort(req.Por...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/tls.go
bindPort, dohPort, dotPort, dnscryptTCPPort tcpPort,
<mask> <mask> // validatePorts validates the uniqueness of TCP and UDP ports for AdGuard Home <mask> // DNS protocols. <mask> func validatePorts( <mask> bindPort, betaBindPort, dohPort, dotPort, dnscryptTCPPort tcpPort, <mask> dnsPort, doqPort udpPort, <mask> ) (err error) { <mask> tcpPorts := aghalg.UniqCh...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/tls.go
<mask> tcpPorts := aghalg.UniqChecker[tcpPort]{} <mask> addPorts( <mask> tcpPorts, <mask> tcpPort(bindPort), <mask> tcpPort(betaBindPort), <mask> tcpPort(dohPort), <mask> tcpPort(dotPort), <mask> tcpPort(dnscryptTCPPort), <mask> ) <mask> </s> Pull request 1717: remove-client2 Merge in DNS/ad...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/tls.go
clientFS fs.FS
<mask> writeTimeout = 60 * time.Second <mask> ) <mask> <mask> type webConfig struct { <mask> clientFS fs.FS <mask> clientBetaFS fs.FS <mask> <mask> BindHost netip.Addr <mask> BindPort int <mask> BetaBindPort int <mask> PortHTTPS int </s> Pull request 1717: remove-client2 Merge in DN...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
BindHost netip.Addr BindPort int PortHTTPS int
<mask> type webConfig struct { <mask> clientFS fs.FS <mask> clientBetaFS fs.FS <mask> <mask> BindHost netip.Addr <mask> BindPort int <mask> BetaBindPort int <mask> PortHTTPS int <mask> <mask> // ReadTimeout is an option to pass to http.Server for setting an <mask> // appropriate fiel...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> <mask> // TODO(a.garipov): Refactor all these servers. <mask> httpServer *http.Server <mask> <mask> // httpServerBeta is a server for new client. <mask> httpServerBeta *http.Server <mask> <mask> // handlerBeta is the handler for new client. <mask> handlerBeta http.Handler <mask> <mask> // i...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> conf: conf, <mask> } <mask> <mask> clientFS := http.FileServer(http.FS(conf.clientFS)) <mask> betaClientFS := http.FileServer(http.FS(conf.clientBetaFS)) <mask> <mask> // if not configured, redirect / to /install.html, otherwise redirect /install.html to / <mask> Context.mux.Handle("/", withMidd...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> betaClientFS := http.FileServer(http.FS(conf.clientBetaFS)) <mask> <mask> // if not configured, redirect / to /install.html, otherwise redirect /install.html to / <mask> Context.mux.Handle("/", withMiddlewares(clientFS, gziphandler.GzipHandler, optionalAuthHandler, postInstallHandler)) <mask> w.handler...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> // add handlers for /install paths, we only need them when we're not configured yet <mask> if conf.firstRun { <mask> log.Info("This is the first launch of AdGuard Home, redirecting everything to /install.html ") <mask> Context.mux.Handle("/install.html", preInstallHandler(clientFS)) <mask> w.install...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> log.Info("This is the first launch of AdGuard Home, redirecting everything to /install.html ") <mask> Context.mux.Handle("/install.html", preInstallHandler(clientFS)) <mask> w.installerBeta = preInstallHandler(betaClientFS) <mask> w.registerInstallHandlers() <mask> // This must be removed in API v...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> <mask> errs <- web.httpServer.ListenAndServe() <mask> }() <mask> <mask> web.startBetaServer(hostStr) <mask> <mask> err := <-errs <mask> if !errors.Is(err, http.ErrServerClosed) { <mask> cleanupAlways() <mask> log.Fatal(err) <mask> } </s> Pull request 1717: remove-client2 Merge ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> // address, so go back to the start of the loop. <mask> } <mask> } <mask> <mask> // startBetaServer starts the beta HTTP server if necessary. <mask> func (web *Web) startBetaServer(hostStr string) { <mask> if web.conf.BetaBindPort == 0 { <mask> return <mask> } <mask> <mask> // Use an h2c han...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
<mask> <mask> shutdownSrv(ctx, web.httpsServer.server) <mask> shutdownSrv3(web.httpsServer.server3) <mask> shutdownSrv(ctx, web.httpServer) <mask> shutdownSrv(ctx, web.httpServerBeta) <mask> <mask> log.Info("stopped http server") <mask> } <mask> <mask> func (web *Web) tlsServerLoop() { </s> Pull requ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
internal/home/web.go
//go:embed build
<mask> // Embed the prebuilt client here since we strive to keep .go files inside the <mask> // internal directory and the embed package is unable to embed files located <mask> // outside of the same or underlying directory. <mask> <mask> //go:embed build build2 <mask> var clientBuildFS embed.FS <mask> <mask>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/54a141abdeca00005a75f4af141645520b3f6b52
main.go