AdGuardHome/internal/client/persistent.go

326 lines
8.5 KiB
Go
Raw Normal View History

package client
import (
"context"
"encoding"
"fmt"
"log/slog"
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
"net"
"net/netip"
"slices"
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
"strings"
Pull request: 1163 safesearch vol.2 Merge in DNS/adguard-home from 1163-safesearch-1-2-1 to master Squashed commit of the following: commit d3a5ebef35210019842145074e898129b42f1f2c Merge: b85264ae c6706445 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 15 09:17:53 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 # Conflicts: # CHANGELOG.md commit b85264aefc5f191ac6cb194b519f03ba15829a4e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Mar 14 00:16:07 2023 +0700 home: imp code commit ac2ed7a5ce8db40628e7d4d1c8634641e5f38b0b Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 23:02:06 2023 +0700 all: changelog commit f0fccafcb01f50c7051df53bbe9b02cab75aa71e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 22:42:36 2023 +0700 all: changelog commit 37df29bf6372939644fb28e3d70365496e0cb4f6 Merge: b227b277 595484e0 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 22:38:57 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 commit b227b2775b4866d69241ad87acf99700715552cb Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 16:56:01 2023 +0700 all: imp docs commit 6fd39fc3565c3f4bc7a7113d17733c20dfe24d8d Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 16:55:03 2023 +0700 home: imp code commit 3bb3bb7c7dcf97b2a5602a7d2b6770c08b4d863d Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 12:16:53 2023 +0700 home: imp docs commit 5f573a56a9fd9942ad677fa0fae6b24228dab653 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 11:56:47 2023 +0700 home: imp code commit 23eeb5552cf2510596b2311cc3eda53ac678ffcc Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Mar 10 10:57:33 2023 +0700 home: imp code commit 643de2fca1b5917c61fe83e1e472222404f3cd21 Merge: dada6e63 a2053526 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 21:03:08 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 commit dada6e63ca5324d30775e2da1727da891743f654 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 17:09:03 2023 +0700 all: imp docs commit 81a180d99dd9a995440d5f4e2ebca34678e7d0c7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 15:12:43 2023 +0700 all: imp code commit fa84877bc777004d246d71d0a9ae0bd9ee568a91 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 10:53:05 2023 +0700 all: imp code commit 6d7e02e745d72921a693d4f09eec7ce21c2aefd4 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 10:40:02 2023 +0700 all: imp docs commit 0a4332997070fb8d2fb3a34d32b92f57a325ff06 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Mar 7 22:00:52 2023 +0700 safesearch: fix merge commit 145c2222ba4cf7f8909b816d83829d2217c94243 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 2 11:41:48 2023 +0700 safesearch: fix merge commit 14c6a8005fe15b5d5a39f91b17c96d8670975811 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 1 12:50:09 2023 +0700 all: docs commit 2a85c8831866bf1c34c423a289461fc1e32667b5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 1 12:47:00 2023 +0700 all: use safesearch package
2023-03-15 14:31:07 +03:00
"github.com/AdguardTeam/AdGuardHome/internal/filtering"
"github.com/AdguardTeam/dnsproxy/proxy"
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
"github.com/AdguardTeam/dnsproxy/upstream"
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/logutil/slogutil"
"github.com/AdguardTeam/golibs/netutil"
"github.com/google/uuid"
)
// UID is the type for the unique IDs of persistent clients.
type UID uuid.UUID
// NewUID returns a new persistent client UID. Any error returned is an error
// from the cryptographic randomness reader.
func NewUID() (uid UID, err error) {
uuidv7, err := uuid.NewV7()
return UID(uuidv7), err
}
Pull request 2138: AG-27492-client-persistent-storage Squashed commit of the following: commit 37e33ec761cfa30164125af2c5bb40789412355e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Feb 14 15:25:25 2024 +0300 aghalg: imp code commit 6b2f09a44298b474ec1bdf3d027fb4941d2f7bea Merge: b8ea924aa 37736289e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Feb 14 15:04:59 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-storage commit b8ea924aa7ed4c052760a6068f945d83d184e7e3 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Feb 13 19:07:52 2024 +0300 home: imp tests commit aa6fec03b1a1ead96bc76919b7ad51ae19626633 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Feb 13 14:54:28 2024 +0300 home: imp docs commit 10637fdec47d0b035cf5c7949ddcd9ec564851a3 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 8 20:16:11 2024 +0300 all: imp code commit b45c7d868ddb1be73e119b3260e2a866d57baa91 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Feb 7 19:15:11 2024 +0300 aghalg: add tests commit 7abe33dbaa7221ddbc8b7d802dbfa7f951d90cf8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Feb 6 20:50:22 2024 +0300 all: imp code, tests commit 4a44e993c9bd393d2cb9853108eae1ad91e64402 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 14:59:11 2024 +0300 all: persistent client index commit 66b16e216e03e9f3d5e69496a89b18a9d732b564 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 15:06:05 2024 +0300 aghalg: ordered map
2024-02-15 14:08:05 +03:00
// MustNewUID is a wrapper around [NewUID] that panics if there is an error.
func MustNewUID() (uid UID) {
uid, err := NewUID()
if err != nil {
panic(fmt.Errorf("unexpected uuidv7 error: %w", err))
}
return uid
}
// type check
var _ encoding.TextMarshaler = UID{}
// MarshalText implements the [encoding.TextMarshaler] for UID.
func (uid UID) MarshalText() ([]byte, error) {
return uuid.UUID(uid).MarshalText()
}
// type check
var _ encoding.TextUnmarshaler = (*UID)(nil)
// UnmarshalText implements the [encoding.TextUnmarshaler] interface for UID.
func (uid *UID) UnmarshalText(data []byte) error {
return (*uuid.UUID)(uid).UnmarshalText(data)
}
// Persistent contains information about persistent clients.
type Persistent struct {
// UpstreamConfig is the custom upstream configuration for this client. If
Pull request: custom upstreams cache Merge in DNS/adguard-home from custom-ups-cache to master Squashed commit of the following: commit 98428a87520f70cb522701d8eccfe4c529be1e40 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 10:53:32 2023 +0200 all: upd dep commit 775a639af4a2a45220b17e8b0037edc126ff62e4 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:52:31 2023 +0200 dnsforward: imp test commit e9e2a58b48e8588dfcb28df319d4651e1fe77af5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:44:46 2023 +0200 docs: changelog commit a6d67218f037c8fec29e5fa2967476d63c3cfc32 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:37:17 2023 +0200 all: upd dep commit b101ff6e0cf393dacdee6fb68d33ba8f11c36280 Merge: d61f4eb88 8bb1aad73 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Nov 16 15:54:05 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit d61f4eb8871f8ae8504259998bf9015b29001cfb Merge: 567a8a4af fdf60eeed Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Nov 13 10:32:22 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit 567a8a4af34ad001d0e6d7d2efdc123205569e8c Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Nov 13 10:30:24 2023 +0200 home: imp code commit a3c16facbebc166e5c0c731c1e892b61c0950d9e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:34:04 2023 +0200 all: imp code commit 84160eafee1d0f2d0cd3f025f2d5070e4f597ad6 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:31:26 2023 +0200 all: conf custom ups cache commit b7f6581901ebad96c87e765a305a1fa5b336efbb Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:29:47 2023 +0200 all: conf custom ups cache commit d07df945d4e7614a679ef5dc77756096abf1e66c Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:26:29 2023 +0200 all: docs commit 998124bac08889c7d354dd1a099929726725bccc Merge: f665e2f85 53170d871 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:24:28 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit f665e2f85bce12d95f80aba6614b6bfd4874b122 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:22:46 2023 +0200 all: conf custom ups cache commit a4b26973bef4f3b339198ffbe52a50baca303daf Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Nov 9 12:46:39 2023 +0200 all: conf custom ups cache
2023-11-17 15:51:51 +03:00
// it's nil, it has not been initialized yet. If it's non-nil and empty,
// there are no valid upstreams. If it's non-nil and non-empty, these
// upstream must be used.
UpstreamConfig *proxy.CustomUpstreamConfig
// SafeSearch handles search engine hosts rewrites.
Pull request: AG-31778-fix-safesearch-https Squashed commit of the following: commit 85ea3d985e83209e3b49119959aedd330df24d23 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 18 15:19:38 2024 +0200 all: imp docs commit b0695daddbcf191454c5e829ca4d19def8ddacbf Merge: a79f98f2f 48c6242a7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:06:49 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit a79f98f2f215a4a79ca4d186c0da33db936429dc Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:05:34 2024 +0200 dnsforward: imp code commit b901a1169cc78313298d70cce770cd1523ccbf9f Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 11:03:52 2024 +0200 dnsforward: imp code commit fb6e66971b1b984147ec400ceaff856e7b5710c7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 10:08:51 2024 +0200 all: safesearch rewrites commit 88add21831fff7e04539f5dd299832883a6f3995 Merge: b78ad8f74 201ac73cf Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 09:43:20 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit b78ad8f748c7fa52533e0541cae16bd51c201370 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Apr 12 13:34:39 2024 +0200 all: safesearch rewrites commit fb3efbb053242c537ca872542006917b8e8ac1ff Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:15:37 2024 +0200 safesearch: imp code commit 1193c704f4d30be4a2cc66e84a31c9a6020ab269 Merge: 14e823d7c ff7c715c5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:13:44 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit 14e823d7cc13c275c2ed04704883a94b95e29963 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:11:43 2024 +0200 all: safesearch https commit cd403a2897ae56a9059a78f24b104af5805d84ab Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 12:09:27 2024 +0200 Revert "all: safesearch https" This reverts commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1. commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 12:41:47 2024 +0200 all: safesearch https commit 5f42688fbab566973acc8dc414a992819492a9ac Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:22:30 2024 +0200 filtering: imp code commit eb9bd9f47cd71cafe8eee4698a8a0d5d25dea3d3 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:19:22 2024 +0200 all: changelog commit 0c77c705a942fe83d3809a7efbc8a6baf5886762 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 08:55:22 2024 +0200 safesearch: imp tests commit 492a93fbb5ff54678e22a15577f509b2327c2ebe Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:45:16 2024 +0200 all: changelog commit a665e7246d11503c47d48ccc714e6862f764e930 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:41:24 2024 +0200 safesearch: https req
2024-04-22 10:48:26 +03:00
SafeSearch filtering.SafeSearch
Pull request: 1163 safesearch vol.2 Merge in DNS/adguard-home from 1163-safesearch-1-2-1 to master Squashed commit of the following: commit d3a5ebef35210019842145074e898129b42f1f2c Merge: b85264ae c6706445 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 15 09:17:53 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 # Conflicts: # CHANGELOG.md commit b85264aefc5f191ac6cb194b519f03ba15829a4e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Mar 14 00:16:07 2023 +0700 home: imp code commit ac2ed7a5ce8db40628e7d4d1c8634641e5f38b0b Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 23:02:06 2023 +0700 all: changelog commit f0fccafcb01f50c7051df53bbe9b02cab75aa71e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 22:42:36 2023 +0700 all: changelog commit 37df29bf6372939644fb28e3d70365496e0cb4f6 Merge: b227b277 595484e0 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 22:38:57 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 commit b227b2775b4866d69241ad87acf99700715552cb Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 16:56:01 2023 +0700 all: imp docs commit 6fd39fc3565c3f4bc7a7113d17733c20dfe24d8d Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 16:55:03 2023 +0700 home: imp code commit 3bb3bb7c7dcf97b2a5602a7d2b6770c08b4d863d Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 12:16:53 2023 +0700 home: imp docs commit 5f573a56a9fd9942ad677fa0fae6b24228dab653 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Mar 13 11:56:47 2023 +0700 home: imp code commit 23eeb5552cf2510596b2311cc3eda53ac678ffcc Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Mar 10 10:57:33 2023 +0700 home: imp code commit 643de2fca1b5917c61fe83e1e472222404f3cd21 Merge: dada6e63 a2053526 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 21:03:08 2023 +0700 Merge remote-tracking branch 'origin/master' into 1163-safesearch-1-2-1 commit dada6e63ca5324d30775e2da1727da891743f654 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 17:09:03 2023 +0700 all: imp docs commit 81a180d99dd9a995440d5f4e2ebca34678e7d0c7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 15:12:43 2023 +0700 all: imp code commit fa84877bc777004d246d71d0a9ae0bd9ee568a91 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 10:53:05 2023 +0700 all: imp code commit 6d7e02e745d72921a693d4f09eec7ce21c2aefd4 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 9 10:40:02 2023 +0700 all: imp docs commit 0a4332997070fb8d2fb3a34d32b92f57a325ff06 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Mar 7 22:00:52 2023 +0700 safesearch: fix merge commit 145c2222ba4cf7f8909b816d83829d2217c94243 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Mar 2 11:41:48 2023 +0700 safesearch: fix merge commit 14c6a8005fe15b5d5a39f91b17c96d8670975811 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 1 12:50:09 2023 +0700 all: docs commit 2a85c8831866bf1c34c423a289461fc1e32667b5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Mar 1 12:47:00 2023 +0700 all: use safesearch package
2023-03-15 14:31:07 +03:00
Pull request 2235: 7069-fix-blocked-services Updates #7069. Squashed commit of the following: commit 0f87493966124af4fa4b28eb1f67281343dd8242 Merge: 87f06b864 28a6c24db Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 14:09:18 2024 +0300 Merge branch 'master' into 7069-fix-blocked-services commit 87f06b86432bba4d2e2583010784746452b7690f Merge: c2440752c 66877c92d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 13:47:28 2024 +0300 Merge branch 'master' into 7069-fix-blocked-services commit c2440752c8a223e8ab2e4a519da9259d888ca06f Merge: 17a9c14e2 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:42:48 2024 +0300 Merge branch 'master' into 7069-fix-blocked-services commit 17a9c14e29a38ed513a827d9b5351d66f1e6cb48 Merge: 11160bc62 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 11 13:41:00 2024 +0300 Merge branch 'master' into 7069-fix-blocked-services commit 11160bc62b08fd6e984d38d5600fa62c3564668f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 11 13:36:56 2024 +0300 all: imp docs commit 491287164d31606c93dcbeb4f1e351df0960309b Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 10 14:03:22 2024 +0300 home: imp code commit 0caf8b15797c28447039736cc9641ccddee5cac0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 10 13:35:54 2024 +0300 all: upd chlog commit 46f793b2591dce54a9566ccb9cb723ab5c60cd6a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 10 13:27:22 2024 +0300 home: fix blocked services
2024-06-18 14:27:25 +03:00
// BlockedServices is the configuration of blocked services of a client. It
// must not be nil after initialization.
Pull request 1883: 951-blocked-services-client-schedule Updates #951. Squashed commit of the following: commit 94e4766932940a99c5265489bccb46d0ed6cec25 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 17:21:41 2023 +0300 chlog: upd docs commit b4022c33860c258bf29650413f0c972b849a1758 Merge: cfa24ff01 e7e638443 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 16:33:20 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit cfa24ff0190b2bc12736700eeff815525fbaf5fe Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 15:04:10 2023 +0300 chlog: imp docs commit dad27590d5eefde82758d58fc06a20c139492db8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 17:38:08 2023 +0300 home: imp err msg commit 7d9ba98c4477000fc2e0f06c3462fe9cd0c65293 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 16:58:00 2023 +0300 all: add tests commit 8e952fc4e3b3d433b29efe47c88d6b7806e99ff8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 16:36:10 2023 +0300 schedule: add todo commit 723573a98d5b930334a5fa125eb12593f4a2430d Merge: 2151ab2a6 e54fc9b1e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:40:03 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 2151ab2a627b9833ba6cce9621f72b29d326da75 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:37:49 2023 +0300 all: add tests commit 81ab341db3e4053f09b181d8111c0da197bdac05 Merge: aa7ae41a8 66345e855 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 22 17:59:01 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit aa7ae41a868045fe24e390b25f15551fd8821529 Merge: 304389a48 06d465b0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:10:11 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 304389a487f728e8ced293ea811a4e0026a37f0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:05:31 2023 +0300 home: imp err msg commit 29cfc7ae2a0bbd5ec3205eae3f6f810519787f26 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 20:42:59 2023 +0300 all: imp err handling commit 8543868eef6442fd30131d9567b66222999101e9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 18:21:50 2023 +0300 all: upd chlog commit c5b614d45e5cf25c30c52343f48139fb34c77539 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 14:37:47 2023 +0300 all: add blocked services schedule
2023-06-27 18:03:07 +03:00
BlockedServices *filtering.BlockedServices
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
// Name of the persistent client. Must not be empty.
Name string
// Tags is a list of client tags that categorize the client.
Tags []string
// Upstreams is a list of custom upstream DNS servers for the client.
Pull request 1883: 951-blocked-services-client-schedule Updates #951. Squashed commit of the following: commit 94e4766932940a99c5265489bccb46d0ed6cec25 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 17:21:41 2023 +0300 chlog: upd docs commit b4022c33860c258bf29650413f0c972b849a1758 Merge: cfa24ff01 e7e638443 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 16:33:20 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit cfa24ff0190b2bc12736700eeff815525fbaf5fe Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 15:04:10 2023 +0300 chlog: imp docs commit dad27590d5eefde82758d58fc06a20c139492db8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 17:38:08 2023 +0300 home: imp err msg commit 7d9ba98c4477000fc2e0f06c3462fe9cd0c65293 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 16:58:00 2023 +0300 all: add tests commit 8e952fc4e3b3d433b29efe47c88d6b7806e99ff8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 16:36:10 2023 +0300 schedule: add todo commit 723573a98d5b930334a5fa125eb12593f4a2430d Merge: 2151ab2a6 e54fc9b1e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:40:03 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 2151ab2a627b9833ba6cce9621f72b29d326da75 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:37:49 2023 +0300 all: add tests commit 81ab341db3e4053f09b181d8111c0da197bdac05 Merge: aa7ae41a8 66345e855 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 22 17:59:01 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit aa7ae41a868045fe24e390b25f15551fd8821529 Merge: 304389a48 06d465b0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:10:11 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 304389a487f728e8ced293ea811a4e0026a37f0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:05:31 2023 +0300 home: imp err msg commit 29cfc7ae2a0bbd5ec3205eae3f6f810519787f26 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 20:42:59 2023 +0300 all: imp err handling commit 8543868eef6442fd30131d9567b66222999101e9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 18:21:50 2023 +0300 all: upd chlog commit c5b614d45e5cf25c30c52343f48139fb34c77539 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 14:37:47 2023 +0300 all: add blocked services schedule
2023-06-27 18:03:07 +03:00
Upstreams []string
// IPs is a list of IP addresses that identify the client. The client must
// have at least one ID (IP, subnet, MAC, or ClientID).
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
IPs []netip.Addr
// Subnets identifying the client. The client must have at least one ID
// (IP, subnet, MAC, or ClientID).
//
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
// TODO(s.chzhen): Use netutil.Prefix.
Subnets []netip.Prefix
// MACs identifying the client. The client must have at least one ID (IP,
// subnet, MAC, or ClientID).
MACs []net.HardwareAddr
// ClientIDs identifying the client. The client must have at least one ID
// (IP, subnet, MAC, or ClientID).
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
ClientIDs []string
// UID is the unique identifier of the persistent client.
UID UID
// UpstreamsCacheSize is the cache size for custom upstreams.
UpstreamsCacheSize uint32
// UpstreamsCacheEnabled specifies whether custom upstreams are used.
Pull request: custom upstreams cache Merge in DNS/adguard-home from custom-ups-cache to master Squashed commit of the following: commit 98428a87520f70cb522701d8eccfe4c529be1e40 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 10:53:32 2023 +0200 all: upd dep commit 775a639af4a2a45220b17e8b0037edc126ff62e4 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:52:31 2023 +0200 dnsforward: imp test commit e9e2a58b48e8588dfcb28df319d4651e1fe77af5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:44:46 2023 +0200 docs: changelog commit a6d67218f037c8fec29e5fa2967476d63c3cfc32 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 17 09:37:17 2023 +0200 all: upd dep commit b101ff6e0cf393dacdee6fb68d33ba8f11c36280 Merge: d61f4eb88 8bb1aad73 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Nov 16 15:54:05 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit d61f4eb8871f8ae8504259998bf9015b29001cfb Merge: 567a8a4af fdf60eeed Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Nov 13 10:32:22 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit 567a8a4af34ad001d0e6d7d2efdc123205569e8c Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Mon Nov 13 10:30:24 2023 +0200 home: imp code commit a3c16facbebc166e5c0c731c1e892b61c0950d9e Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:34:04 2023 +0200 all: imp code commit 84160eafee1d0f2d0cd3f025f2d5070e4f597ad6 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:31:26 2023 +0200 all: conf custom ups cache commit b7f6581901ebad96c87e765a305a1fa5b336efbb Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 14:29:47 2023 +0200 all: conf custom ups cache commit d07df945d4e7614a679ef5dc77756096abf1e66c Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:26:29 2023 +0200 all: docs commit 998124bac08889c7d354dd1a099929726725bccc Merge: f665e2f85 53170d871 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:24:28 2023 +0200 Merge remote-tracking branch 'origin/master' into custom-ups-cache commit f665e2f85bce12d95f80aba6614b6bfd4874b122 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Nov 10 09:22:46 2023 +0200 all: conf custom ups cache commit a4b26973bef4f3b339198ffbe52a50baca303daf Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Nov 9 12:46:39 2023 +0200 all: conf custom ups cache
2023-11-17 15:51:51 +03:00
UpstreamsCacheEnabled bool
// UseOwnSettings specifies whether custom filtering settings are used.
UseOwnSettings bool
// FilteringEnabled specifies whether filtering is enabled.
FilteringEnabled bool
// SafeBrowsingEnabled specifies whether safe browsing is enabled.
SafeBrowsingEnabled bool
// ParentalEnabled specifies whether parental control is enabled.
ParentalEnabled bool
// UseOwnBlockedServices specifies whether custom services are blocked.
UseOwnBlockedServices bool
Pull request: AG-31778-fix-safesearch-https Squashed commit of the following: commit 85ea3d985e83209e3b49119959aedd330df24d23 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 18 15:19:38 2024 +0200 all: imp docs commit b0695daddbcf191454c5e829ca4d19def8ddacbf Merge: a79f98f2f 48c6242a7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:06:49 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit a79f98f2f215a4a79ca4d186c0da33db936429dc Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:05:34 2024 +0200 dnsforward: imp code commit b901a1169cc78313298d70cce770cd1523ccbf9f Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 11:03:52 2024 +0200 dnsforward: imp code commit fb6e66971b1b984147ec400ceaff856e7b5710c7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 10:08:51 2024 +0200 all: safesearch rewrites commit 88add21831fff7e04539f5dd299832883a6f3995 Merge: b78ad8f74 201ac73cf Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 09:43:20 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit b78ad8f748c7fa52533e0541cae16bd51c201370 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Apr 12 13:34:39 2024 +0200 all: safesearch rewrites commit fb3efbb053242c537ca872542006917b8e8ac1ff Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:15:37 2024 +0200 safesearch: imp code commit 1193c704f4d30be4a2cc66e84a31c9a6020ab269 Merge: 14e823d7c ff7c715c5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:13:44 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit 14e823d7cc13c275c2ed04704883a94b95e29963 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:11:43 2024 +0200 all: safesearch https commit cd403a2897ae56a9059a78f24b104af5805d84ab Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 12:09:27 2024 +0200 Revert "all: safesearch https" This reverts commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1. commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 12:41:47 2024 +0200 all: safesearch https commit 5f42688fbab566973acc8dc414a992819492a9ac Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:22:30 2024 +0200 filtering: imp code commit eb9bd9f47cd71cafe8eee4698a8a0d5d25dea3d3 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:19:22 2024 +0200 all: changelog commit 0c77c705a942fe83d3809a7efbc8a6baf5886762 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 08:55:22 2024 +0200 safesearch: imp tests commit 492a93fbb5ff54678e22a15577f509b2327c2ebe Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:45:16 2024 +0200 all: changelog commit a665e7246d11503c47d48ccc714e6862f764e930 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:41:24 2024 +0200 safesearch: https req
2024-04-22 10:48:26 +03:00
// IgnoreQueryLog specifies whether the client requests are logged.
IgnoreQueryLog bool
// IgnoreStatistics specifies whether the client requests are counted.
IgnoreStatistics bool
// SafeSearchConf is the safe search filtering configuration.
//
Pull request: AG-31778-fix-safesearch-https Squashed commit of the following: commit 85ea3d985e83209e3b49119959aedd330df24d23 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 18 15:19:38 2024 +0200 all: imp docs commit b0695daddbcf191454c5e829ca4d19def8ddacbf Merge: a79f98f2f 48c6242a7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:06:49 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit a79f98f2f215a4a79ca4d186c0da33db936429dc Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 17 11:05:34 2024 +0200 dnsforward: imp code commit b901a1169cc78313298d70cce770cd1523ccbf9f Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 11:03:52 2024 +0200 dnsforward: imp code commit fb6e66971b1b984147ec400ceaff856e7b5710c7 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 10:08:51 2024 +0200 all: safesearch rewrites commit 88add21831fff7e04539f5dd299832883a6f3995 Merge: b78ad8f74 201ac73cf Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 16 09:43:20 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit b78ad8f748c7fa52533e0541cae16bd51c201370 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Fri Apr 12 13:34:39 2024 +0200 all: safesearch rewrites commit fb3efbb053242c537ca872542006917b8e8ac1ff Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:15:37 2024 +0200 safesearch: imp code commit 1193c704f4d30be4a2cc66e84a31c9a6020ab269 Merge: 14e823d7c ff7c715c5 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:13:44 2024 +0200 Merge remote-tracking branch 'origin/master' into AG-31778-fix-safesearch-https # Conflicts: # CHANGELOG.md commit 14e823d7cc13c275c2ed04704883a94b95e29963 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 13:11:43 2024 +0200 all: safesearch https commit cd403a2897ae56a9059a78f24b104af5805d84ab Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Thu Apr 11 12:09:27 2024 +0200 Revert "all: safesearch https" This reverts commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1. commit 1c9564b9b4db70f85b2f827cc06b65d2b67b08b1 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 12:41:47 2024 +0200 all: safesearch https commit 5f42688fbab566973acc8dc414a992819492a9ac Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:22:30 2024 +0200 filtering: imp code commit eb9bd9f47cd71cafe8eee4698a8a0d5d25dea3d3 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 09:19:22 2024 +0200 all: changelog commit 0c77c705a942fe83d3809a7efbc8a6baf5886762 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Wed Apr 10 08:55:22 2024 +0200 safesearch: imp tests commit 492a93fbb5ff54678e22a15577f509b2327c2ebe Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:45:16 2024 +0200 all: changelog commit a665e7246d11503c47d48ccc714e6862f764e930 Author: Dimitry Kolyshev <dkolyshev@adguard.com> Date: Tue Apr 9 14:41:24 2024 +0200 safesearch: https req
2024-04-22 10:48:26 +03:00
// TODO(d.kolyshev): Make SafeSearchConf a pointer.
SafeSearchConf filtering.SafeSearchConfig
}
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
// validate returns an error if persistent client information contains errors.
Pull request 2273: AG-27492-client-storage-runtime-sources Squashed commit of the following: commit 3191224d6de3d679ed7c3a35a383ebed27d3c181 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 18:20:04 2024 +0300 client: imp tests commit 6cc4ed53a206657c5626a5894190a6851ebb3b01 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 18:04:36 2024 +0300 client: imp code commit 79272b299ad16534ba4919e1f0616a875d7a15cb Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 16:10:06 2024 +0300 all: imp code commit 0a001fffbe4dece198f9343b998d606e85f94703 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 20:05:47 2024 +0300 all: imp tests commit 80f7e98d302f78332a4e297f243ad1c4a958cadd Merge: df7492e9d e338214ad Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 19:10:13 2024 +0300 Merge branch 'master' into AG-27492-client-storage-runtime-sources commit df7492e9de063e3c1b582e9f014554bc6cba7e90 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 19:06:37 2024 +0300 all: imp code commit 23896ae5a6ee3f2d3a54dc15536d1c9349ba46b5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 19 21:04:34 2024 +0300 client: fix typo commit ba0ba2478ccd50d764d1a6a2d5c4b4b35b9b2a1c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 19 21:02:13 2024 +0300 all: imp code commit f7315be742422dda8d0adede6666b119761e67f4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 12 14:35:38 2024 +0300 home: imp code commit f63d0e80fb34f0d2799be7d51138ad1200449fc5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 12 14:15:49 2024 +0300 all: imp code commit 9feda414b6e469d911c9428d9ce1c5043d27cc93 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 10 17:53:42 2024 +0300 all: imp code commit fafd7cbb52d36bea260c9d922b7c4204f73e7a66 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Sep 9 21:13:05 2024 +0300 all: imp code commit 2d2b8e02163e1bd03bf46d46ef7dbb6a50c4e844 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 5 20:55:10 2024 +0300 client: add tests commit 4d394e6f2162f797c409073cb52e1e0de93a9d5e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Aug 29 20:40:38 2024 +0300 all: client storage runtime sources
2024-09-30 14:17:42 +03:00
// allTags must be sorted.
func (c *Persistent) validate(ctx context.Context, l *slog.Logger, allTags []string) (err error) {
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
switch {
case c.Name == "":
return errors.Error("empty name")
case c.IDsLen() == 0:
return errors.Error("id required")
case c.UID == UID{}:
return errors.Error("uid required")
}
conf, err := proxy.ParseUpstreamsConfig(c.Upstreams, &upstream.Options{})
if err != nil {
return fmt.Errorf("invalid upstream servers: %w", err)
}
err = conf.Close()
if err != nil {
l.ErrorContext(ctx, "client: closing upstream config", slogutil.KeyError, err)
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
}
for _, t := range c.Tags {
Pull request 2273: AG-27492-client-storage-runtime-sources Squashed commit of the following: commit 3191224d6de3d679ed7c3a35a383ebed27d3c181 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 18:20:04 2024 +0300 client: imp tests commit 6cc4ed53a206657c5626a5894190a6851ebb3b01 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 18:04:36 2024 +0300 client: imp code commit 79272b299ad16534ba4919e1f0616a875d7a15cb Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 26 16:10:06 2024 +0300 all: imp code commit 0a001fffbe4dece198f9343b998d606e85f94703 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 20:05:47 2024 +0300 all: imp tests commit 80f7e98d302f78332a4e297f243ad1c4a958cadd Merge: df7492e9d e338214ad Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 19:10:13 2024 +0300 Merge branch 'master' into AG-27492-client-storage-runtime-sources commit df7492e9de063e3c1b582e9f014554bc6cba7e90 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 24 19:06:37 2024 +0300 all: imp code commit 23896ae5a6ee3f2d3a54dc15536d1c9349ba46b5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 19 21:04:34 2024 +0300 client: fix typo commit ba0ba2478ccd50d764d1a6a2d5c4b4b35b9b2a1c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 19 21:02:13 2024 +0300 all: imp code commit f7315be742422dda8d0adede6666b119761e67f4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 12 14:35:38 2024 +0300 home: imp code commit f63d0e80fb34f0d2799be7d51138ad1200449fc5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 12 14:15:49 2024 +0300 all: imp code commit 9feda414b6e469d911c9428d9ce1c5043d27cc93 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Sep 10 17:53:42 2024 +0300 all: imp code commit fafd7cbb52d36bea260c9d922b7c4204f73e7a66 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Sep 9 21:13:05 2024 +0300 all: imp code commit 2d2b8e02163e1bd03bf46d46ef7dbb6a50c4e844 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Sep 5 20:55:10 2024 +0300 client: add tests commit 4d394e6f2162f797c409073cb52e1e0de93a9d5e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Aug 29 20:40:38 2024 +0300 all: client storage runtime sources
2024-09-30 14:17:42 +03:00
_, ok := slices.BinarySearch(allTags, t)
if !ok {
Pull request 2221: AG-27492-client-persistent-runtime-storage Squashed commit of the following: commit a2b1e829f57fa7411354d882ec67d0c8736efbac Merge: 5fde76bb2 65b7d232a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 25 16:12:17 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 5fde76bb20f818f052fe89dc90c2b3ea790da4d2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 21 16:58:17 2024 +0300 all: imp code commit eae49f91bc1b5eedae3d03b0b6c782afa11896d8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 19 20:10:55 2024 +0300 all: use storage commit 2c7efa46099d9b8ffe297ce247aff0aa8f45dff7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 20:14:34 2024 +0300 client: add tests commit d59bd7a24e273e58737c3efa832adabc57495bed Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 18:31:23 2024 +0300 client: add tests commit 045b83882380a8e181f6892cc3245944e4c9fd52 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 18 15:18:08 2024 +0300 client: add tests commit 702467f7cadf3574c4a1b7b441ac02e26581bfcf Merge: 4abc23bf8 1c82be295 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 17 18:40:43 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit 4abc23bf84dd8de02a1b805afba4d5a724b39d0c Merge: e268abf92 bed86d57f Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:47 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-runtime-storage commit e268abf9268aef7a5386b5e126b01b249c590f49 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 13 15:19:36 2024 +0300 client: add tests commit 5601cfce39599337aaf04688ffe2b14b49f856e5 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 27 14:27:53 2024 +0300 client: runtime index commit bde3baa5da85dd5404f78bd79a6a3e85c55cf7fc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon May 20 14:39:35 2024 +0300 all: persistent client storage
2024-06-26 14:30:02 +03:00
return fmt.Errorf("invalid tag: %q", t)
}
}
// TODO(s.chzhen): Move to the constructor.
slices.Sort(c.Tags)
return nil
}
// SetIDs parses a list of strings into typed fields and returns an error if
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
// there is one.
func (c *Persistent) SetIDs(ids []string) (err error) {
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
for _, id := range ids {
err = c.setID(id)
if err != nil {
return err
}
}
slices.SortFunc(c.IPs, netip.Addr.Compare)
// TODO(s.chzhen): Use netip.PrefixCompare in Go 1.23.
slices.SortFunc(c.Subnets, subnetCompare)
slices.SortFunc(c.MACs, slices.Compare[net.HardwareAddr])
slices.Sort(c.ClientIDs)
return nil
}
// subnetCompare is a comparison function for the two subnets. It returns -1 if
// x sorts before y, 1 if x sorts after y, and 0 if their relative sorting
// position is the same.
func subnetCompare(x, y netip.Prefix) (cmp int) {
if x == y {
return 0
}
xAddr, xBits := x.Addr(), x.Bits()
yAddr, yBits := y.Addr(), y.Bits()
if xBits == yBits {
return xAddr.Compare(yAddr)
}
if xBits > yBits {
return -1
} else {
return 1
}
}
// setID parses id into typed field if there is no error.
func (c *Persistent) setID(id string) (err error) {
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
if id == "" {
return errors.Error("clientid is empty")
}
var ip netip.Addr
if ip, err = netip.ParseAddr(id); err == nil {
c.IPs = append(c.IPs, ip)
return nil
}
var subnet netip.Prefix
if subnet, err = netip.ParsePrefix(id); err == nil {
c.Subnets = append(c.Subnets, subnet)
return nil
}
var mac net.HardwareAddr
if mac, err = net.ParseMAC(id); err == nil {
c.MACs = append(c.MACs, mac)
return nil
}
err = ValidateClientID(id)
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
if err != nil {
// Don't wrap the error, because it's informative enough as is.
return err
}
c.ClientIDs = append(c.ClientIDs, strings.ToLower(id))
return nil
}
// ValidateClientID returns an error if id is not a valid ClientID.
//
// TODO(s.chzhen): It's an exact copy of the [dnsforward.ValidateClientID] to
// avoid the import cycle. Remove it.
func ValidateClientID(id string) (err error) {
err = netutil.ValidateHostnameLabel(id)
if err != nil {
// Replace the domain name label wrapper with our own.
return fmt.Errorf("invalid clientid %q: %w", id, errors.Unwrap(err))
}
return nil
}
// IDs returns a list of client IDs containing at least one element.
func (c *Persistent) IDs() (ids []string) {
ids = make([]string, 0, c.IDsLen())
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
for _, ip := range c.IPs {
ids = append(ids, ip.String())
}
for _, subnet := range c.Subnets {
ids = append(ids, subnet.String())
}
for _, mac := range c.MACs {
ids = append(ids, mac.String())
}
return append(ids, c.ClientIDs...)
}
// IDsLen returns a length of client ids.
func (c *Persistent) IDsLen() (n int) {
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
return len(c.IPs) + len(c.Subnets) + len(c.MACs) + len(c.ClientIDs)
}
// EqualIDs returns true if the ids of the current and previous clients are the
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
// same.
func (c *Persistent) EqualIDs(prev *Persistent) (equal bool) {
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
return slices.Equal(c.IPs, prev.IPs) &&
slices.Equal(c.Subnets, prev.Subnets) &&
slices.EqualFunc(c.MACs, prev.MACs, slices.Equal[net.HardwareAddr]) &&
slices.Equal(c.ClientIDs, prev.ClientIDs)
}
// ShallowClone returns a deep copy of the client, except upstreamConfig,
// safeSearchConf, SafeSearch fields, because it's difficult to copy them.
func (c *Persistent) ShallowClone() (clone *Persistent) {
clone = &Persistent{}
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
*clone = *c
Pull request 1883: 951-blocked-services-client-schedule Updates #951. Squashed commit of the following: commit 94e4766932940a99c5265489bccb46d0ed6cec25 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 17:21:41 2023 +0300 chlog: upd docs commit b4022c33860c258bf29650413f0c972b849a1758 Merge: cfa24ff01 e7e638443 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 16:33:20 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit cfa24ff0190b2bc12736700eeff815525fbaf5fe Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 27 15:04:10 2023 +0300 chlog: imp docs commit dad27590d5eefde82758d58fc06a20c139492db8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 17:38:08 2023 +0300 home: imp err msg commit 7d9ba98c4477000fc2e0f06c3462fe9cd0c65293 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jun 26 16:58:00 2023 +0300 all: add tests commit 8e952fc4e3b3d433b29efe47c88d6b7806e99ff8 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 16:36:10 2023 +0300 schedule: add todo commit 723573a98d5b930334a5fa125eb12593f4a2430d Merge: 2151ab2a6 e54fc9b1e Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:40:03 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 2151ab2a627b9833ba6cce9621f72b29d326da75 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Jun 23 11:37:49 2023 +0300 all: add tests commit 81ab341db3e4053f09b181d8111c0da197bdac05 Merge: aa7ae41a8 66345e855 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jun 22 17:59:01 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit aa7ae41a868045fe24e390b25f15551fd8821529 Merge: 304389a48 06d465b0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:10:11 2023 +0300 Merge branch 'master' into 951-blocked-services-client-schedule commit 304389a487f728e8ced293ea811a4e0026a37f0d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jun 21 17:05:31 2023 +0300 home: imp err msg commit 29cfc7ae2a0bbd5ec3205eae3f6f810519787f26 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 20:42:59 2023 +0300 all: imp err handling commit 8543868eef6442fd30131d9567b66222999101e9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 18:21:50 2023 +0300 all: upd chlog commit c5b614d45e5cf25c30c52343f48139fb34c77539 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Tue Jun 20 14:37:47 2023 +0300 all: add blocked services schedule
2023-06-27 18:03:07 +03:00
clone.BlockedServices = c.BlockedServices.Clone()
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
clone.Tags = slices.Clone(c.Tags)
clone.Upstreams = slices.Clone(c.Upstreams)
clone.IPs = slices.Clone(c.IPs)
clone.Subnets = slices.Clone(c.Subnets)
clone.MACs = slices.Clone(c.MACs)
clone.ClientIDs = slices.Clone(c.ClientIDs)
Pull request 2122: AG-27492-client-persistent-ids Squashed commit of the following: commit a0527b86f10596a86357630117607a3c507e4ac2 Merge: 512edaf2d 9694f19ef Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 17 13:15:18 2024 +0300 Merge branch 'master' into AG-27492-client-persistent-ids commit 512edaf2dc29f19c4fb7860b0c350a5e4180cda4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 15:50:28 2024 +0300 home: imp docs commit 4d4b3599918aab8ee6315c7f2f35f70db89e4d02 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 20:20:42 2024 +0300 home: imp code commit 8031347b8613cc49a80968e162dd198851eafe7c Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 18:46:20 2024 +0300 home: fix typo commit 5932b181fe6a0c0bc605070fd9ddcc6617703ab7 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 16:52:49 2024 +0300 home: imp code more commit 9412f5846795acfb68b009491b1045d1e27d8ddc Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 11 15:41:23 2024 +0300 home: imp code commit 855d3201ab1b176ed5fdd32bce933a7795601a6d Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 10 20:24:49 2024 +0300 home: add tests commit 112f1bd13acf992b0ba9562c29365b22d5374ec2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 18:29:11 2023 +0300 home: imp code commit 8b295bfa8968c3767bcfaf05c7f109d75af8c961 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 29 14:58:17 2023 +0300 home: persistent client ids
2024-01-17 13:24:21 +03:00
return clone
}
// CloseUpstreams closes the client-specific upstream config of c if any.
func (c *Persistent) CloseUpstreams() (err error) {
if c.UpstreamConfig != nil {
if err = c.UpstreamConfig.Close(); err != nil {
return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err)
}
}
return nil
}