docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
errortext := fmt.Errorf("Unable to write coredns config: %s", err) | <mask> return
<mask> }
<mask> err := writeCoreDNSConfig()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> err = writeFilterFile()
</s> Move starting of coredns server into separate function </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400)
return
</s> add return fmt.Errorf("Unable to start coreDNS: Already running") </s> remove errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
</s> add errortext := fmt.Errorf("Couldn't write filter file: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
return errortext | <mask> err := writeCoreDNSConfig()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> err = writeFilterFile()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
<mask> log.Println(errortext)
</s> Move starting of coredns server into separate function </s> remove errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
</s> add errortext := fmt.Errorf("Couldn't write filter file: %s", err) </s> remove errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
</s> add errortext := fmt.Errorf("Unable to write coredns config: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400)
return
</s> add return fmt.Errorf("Unable to start coreDNS: Already running") </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
errortext := fmt.Errorf("Couldn't write filter file: %s", err) | <mask> return
<mask> }
<mask> err = writeFilterFile()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> binarypath := filepath.Join(config.ourBinaryDir, config.CoreDNS.binaryFile)
</s> Move starting of coredns server into separate function </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
</s> add errortext := fmt.Errorf("Unable to write coredns config: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
return errortext | <mask> err = writeFilterFile()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> binarypath := filepath.Join(config.ourBinaryDir, config.CoreDNS.binaryFile)
<mask> configpath := filepath.Join(config.ourBinaryDir, config.CoreDNS.coreFile)
<mask> coreDNSCommand = exec.Command(binarypath, "-conf", configpath, "-dns.port", fmt.Sprintf("%d", config.CoreDNS.Port))
<mask> coreDNSCommand.Stdout = os.Stdout
</s> Move starting of coredns server into separate function </s> remove errortext := fmt.Sprintf("Couldn't write filter file: %s", err)
</s> add errortext := fmt.Errorf("Couldn't write filter file: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) </s> remove errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
</s> add errortext := fmt.Errorf("Unable to write coredns config: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
errortext := fmt.Errorf("Unable to start coreDNS: %s", err) | <mask> coreDNSCommand.Stdout = os.Stdout
<mask> coreDNSCommand.Stderr = os.Stderr
<mask> err = coreDNSCommand.Start()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> log.Printf("coredns PID: %v\n", coreDNSCommand.Process.Pid)
</s> Move starting of coredns server into separate function </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid)
</s> add </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
return errortext | <mask> err = coreDNSCommand.Start()
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> log.Printf("coredns PID: %v\n", coreDNSCommand.Process.Pid)
<mask> fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid)
<mask> go childwaiter()
<mask> }
</s> Move starting of coredns server into separate function </s> remove fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid)
</s> add </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to write coredns config: %s", err)
</s> add errortext := fmt.Errorf("Unable to write coredns config: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
<mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> return
<mask> }
<mask> log.Printf("coredns PID: %v\n", coreDNSCommand.Process.Pid)
<mask> fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid)
<mask> go childwaiter()
<mask> }
<mask>
<mask> func childwaiter() {
<mask> err := coreDNSCommand.Wait()
</s> Move starting of coredns server into separate function </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) </s> remove func handleStart(w http.ResponseWriter, r *http.Request) {
</s> add func startDNSServer() error { </s> remove http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400)
return
</s> add return fmt.Errorf("Unable to start coreDNS: Already running") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
|
return nil
}
func handleStart(w http.ResponseWriter, r *http.Request) {
if isRunning() {
http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400)
return
}
err := startDNSServer()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid) | <mask> }
<mask> log.Printf("coredns PID: %v\n", coreDNSCommand.Process.Pid)
<mask> go childwaiter()
<mask> }
<mask>
<mask> func childwaiter() {
<mask> err := coreDNSCommand.Wait()
<mask> log.Printf("coredns terminated: %s\n", err)
<mask> err = coreDNSCommand.Process.Release()
</s> Move starting of coredns server into separate function </s> remove fmt.Fprintf(w, "OK, PID %d\n", coreDNSCommand.Process.Pid)
</s> add </s> remove http.Error(w, errortext, http.StatusInternalServerError)
return
</s> add return errortext </s> remove errortext := fmt.Sprintf("Unable to start coreDNS: %s", err)
</s> add errortext := fmt.Errorf("Unable to start coreDNS: %s", err) </s> remove func handleStart(w http.ResponseWriter, r *http.Request) {
</s> add func startDNSServer() error { </s> remove http.Error(w, fmt.Sprintf("Unable to start coreDNS: Already running"), 400)
return
</s> add return fmt.Errorf("Unable to start coreDNS: Already running") | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/33fbccf0badee8a4c5f790d850d85e161536779f | control.go |
"dns_test_warning_toast": "Upstream \"{{key}}\" no responde a las peticiones de prueba y es posible que no funcione correctamente", | <mask> "updated_upstream_dns_toast": "Servidores DNS de subida guardados correctamente",
<mask> "dns_test_ok_toast": "Los servidores DNS especificados funcionan correctamente",
<mask> "dns_test_not_ok_toast": "Servidor \"{{key}}\": no se puede utilizar, por favor revisa si lo has escrito correctamente",
<mask> "unblock": "Desbloquear",
<mask> "block": "Bloquear",
<mask> "disallow_this_client": "No permitir a este cliente",
<mask> "allow_this_client": "Permitir a este cliente",
<mask> "block_for_this_client_only": "Bloquear solo para este cliente",
<mask> "unblock_for_this_client_only": "Desbloquear solo para este cliente",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
</s> add "encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", </s> remove "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
</s> add "encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/es.json |
"form_error_gateway_ip": "Sewa tidak dapat memiliki alamat IP gateway", | <mask> "form_error_server_name": "Nama server tidak valid",
<mask> "form_error_subnet": "Subnet \"{{cidr}}\" tidak berisi alamat IP \"{{ip}}\"",
<mask> "form_error_positive": "Harus lebih dari 0",
<mask> "out_of_range_error": "Harus di luar rentang \"{{start}}\"-\"{{end}}\"",
<mask> "lower_range_start_error": "Harus lebih rendah dari rentang awal",
<mask> "greater_range_start_error": "Harus lebih besar dari rentang awal",
<mask> "greater_range_end_error": "Harus lebih besar dari rentang akhir",
<mask> "subnet_error": "Alamat harus dalam satu subnet",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
</s> add "encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", </s> remove "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
</s> add "encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/id.json |
"dns_test_warning_toast": "Upstream \"{{key}}\" tidak menanggapi permintaan pengujian dan mungkin tidak berfungsi dengan baik", | <mask> "all_lists_up_to_date_toast": "Semua daftar sudah diperbarui",
<mask> "updated_upstream_dns_toast": "Server upstream berhasil disimpan",
<mask> "dns_test_ok_toast": "Server DNS yang ditentukan bekerja dengan benar",
<mask> "dns_test_not_ok_toast": "Server \"{{key}}\": tidak dapat digunakan, mohon cek bahwa Anda telah menulisnya dengan benar",
<mask> "unblock": "Buka Blokir",
<mask> "block": "Blok",
<mask> "disallow_this_client": "Cabut ijin untuk klien ini",
<mask> "allow_this_client": "Ijinkan klien ini",
<mask> "block_for_this_client_only": "Blok hanya untuk klien ini",
<mask> "unblock_for_this_client_only": "Jangan diblok hanya untuk klien ini",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
</s> add "encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", </s> remove "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
</s> add "encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/id.json |
"encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", | <mask> "encryption_desc": "Enkripsi (HTTPS/QUIC/TLS) untuk DNS dan antarmuka admin",
<mask> "encryption_config_saved": "Pengaturan enkripsi telah tersimpan",
<mask> "encryption_server": "Nama server",
<mask> "encryption_server_enter": "Masukkan nama domain anda",
<mask> "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
<mask> "encryption_redirect": "Alihkan ke HTTPS secara otomatis",
<mask> "encryption_redirect_desc": "Jika dicentang, AdGuard Home akan secara otomatis mengarahkan anda dari HTTP ke alamat HTTPS.",
<mask> "encryption_https": "Port HTTPS",
<mask> "encryption_https_desc": "Jika port HTTPS dikonfigurasi, antarmuka admin Home AdGuard akan dapat diakses melalui HTTPS, dan itu juga akan memberikan DNS-over-HTTPS di lokasi '/ dns-query'.",
<mask> "encryption_dot": "Port DNS-over-TLS",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
</s> add "encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/id.json |
"dns_test_warning_toast": "Upstream \"{{key}}\" reageert niet op testverzoeken en werkt mogelijk niet goed", | <mask> "updated_upstream_dns_toast": "Upstream-servers succesvol opgeslagen",
<mask> "dns_test_ok_toast": "Opgegeven DNS-servers werken correct",
<mask> "dns_test_not_ok_toast": "Server \"{{key}}\": kon niet worden gebruikt, controleer of je het correct hebt geschreven",
<mask> "unblock": "Deblokkeren",
<mask> "block": "Blokkeren",
<mask> "disallow_this_client": "Toepassing/systeem niet toelaten",
<mask> "allow_this_client": "Toepassing/systeem toelaten",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
</s> add "encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", </s> remove "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
</s> add "encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/nl.json |
"encryption_server_desc": "Indien ingesteld, detecteert AdGuard Home Client-ID's, reageert op DDR-zoekopdrachten en voert aanvullende verbindingsvalidaties uit. Indien niet ingesteld, zijn deze functies uitgeschakeld. Moet overeenkomen met een van de DNS-namen in het certificaat.", | <mask> "encryption_desc": "Encryptie (HTTPS/TLS) ondersteuning voor DNS en admin web interface",
<mask> "encryption_config_saved": "Versleuteling configuratie opgeslagen",
<mask> "encryption_server": "Server naam",
<mask> "encryption_server_enter": "Voer domein naam in",
<mask> "encryption_server_desc": "Om HTTPS te gebruiken, moet je de servernaam invoeren die overeenkomt met je SSL-certificaat of jokerteken-certificaat. Als het veld niet is ingesteld, accepteert het TLS-verbindingen voor elk domein.",
<mask> "encryption_redirect": "Herleid automatisch naar HTTPS",
<mask> "encryption_redirect_desc": "Indien ingeschakeld, zal AdGuard Home je automatisch herleiden van HTTP naar HTTPS.",
<mask> "encryption_https": "HTTPS poort",
<mask> "encryption_https_desc": "Als de HTTPS-poort is geconfigureerd, is de AdGuard Home beheerders interface toegankelijk via HTTPS en biedt deze ook DNS-via-HTTPS op de locatie '/ dns-query'.",
<mask> "encryption_dot": "DNS-via-TLS poort",
</s> Pull request: upd-i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 366600a32ecbb163ab43b43145898bbadcfbc2e9
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:09:16 2022 +0300
client: fix si-lk
commit 2a55ee3846251e53529f4ef6562e5f4939381eae
Author: Ainar Garipov <[email protected]>
Date: Wed Aug 3 15:03:45 2022 +0300
client: upd i18n </s> remove "encryption_server_desc": "Untuk menggunakan HTTPS, Anda harus memasukkan nama server yang cocok dengan sertifikat SSL Anda. Bila ruas tak ditata, akan menerima koneksi TLS bagi domain manapun.",
</s> add "encryption_server_desc": "Jika disetel, AdGuard Home mendeteksi ClientID, merespons kueri DDR, dan melakukan validasi koneksi tambahan. Jika tidak disetel, fitur-fitur ini dinonaktifkan. Harus cocok dengan salah satu Nama DNS dalam sertifikat.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3420becce38e72ef3870f086a86342788ba9a8f8 | client/src/__locales/nl.json |
# Using NVS for managing Node.js versions on Windows
NVS_HOME="C:\ProgramData"
git clone --single-branch https://github.com/jasongin/nvs $NVS_HOME
source $NVS_HOME/nvs.sh
nvs add latest
nvs use latest | <mask> npm install -g npm
<mask> curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.23.8
<mask> ;;
<mask> windows)
<mask> choco install nvm
<mask> nvm install node
<mask> npm install -g npm
<mask> ;;
<mask> esac
<mask>
<mask> install:
<mask> - |-
</s> *: travis - use nvs on Windows | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/344a0336b0f10451eb252c451a8c1e6baa836609 | .travis.yml |
node --version
npm --version | <mask> case $TRAVIS_OS_NAME in
<mask> linux | osx)
<mask> npm --prefix client ci
<mask> ;;
<mask> windows)
<mask> node --version
</s> *: travis - use nvs on Windows </s> remove choco install nvm
nvm install node
npm install -g npm
</s> add # Using NVS for managing Node.js versions on Windows
NVS_HOME="C:\ProgramData"
git clone --single-branch https://github.com/jasongin/nvs $NVS_HOME
source $NVS_HOME/nvs.sh
nvs add latest
nvs use latest | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/344a0336b0f10451eb252c451a8c1e6baa836609 | .travis.yml |
node --version
npm --version
nvs --version | <mask> ;;
<mask> windows)
<mask> npm --prefix client ci
<mask> ;;
<mask> esac
<mask>
</s> *: travis - use nvs on Windows </s> remove choco install nvm
nvm install node
npm install -g npm
</s> add # Using NVS for managing Node.js versions on Windows
NVS_HOME="C:\ProgramData"
git clone --single-branch https://github.com/jasongin/nvs $NVS_HOME
source $NVS_HOME/nvs.sh
nvs add latest
nvs use latest | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/344a0336b0f10451eb252c451a8c1e6baa836609 | .travis.yml |
"sort" | <mask> "errors"
<mask> "log"
<mask> "strconv"
<mask> "time"
<mask>
<mask> // ratelimiting and per-ip buckets
<mask> "github.com/beefsack/go-rate"
<mask> "github.com/patrickmn/go-cache"
</s> Added ratelimit whitelist and tests </s> remove ratelimit int // in requests per second per IP
</s> add ratelimit int // in requests per second per IP
whitelist []string // a list of whitelisted IP addresses
</s> remove func setup(c *caddy.Controller) error {
</s> add func setupPlugin(c *caddy.Controller) (*plug, error) {
</s> remove p.ratelimit = ratelimit
</s> add </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
<mask> "golang.org/x/net/context"
<mask> )
<mask>
<mask> const defaultRatelimit = 100
<mask> const defaultMaxRateLimitedIPs = 1024 * 1024
<mask>
<mask> var (
<mask> tokenBuckets = cache.New(time.Hour, time.Hour)
<mask> )
<mask>
</s> Added ratelimit whitelist and tests </s> remove p.ratelimit = ratelimit
</s> add </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
|
if len(p.whitelist) > 0 && sort.SearchStrings(p.whitelist, ip) >= 0 {
return true, nil
}
| <mask>
<mask> func (p *plug) allowRequest(ip string) (bool, error) {
<mask> if _, found := tokenBuckets.Get(ip); !found {
<mask> tokenBuckets.Set(ip, rate.New(p.ratelimit, time.Second), time.Hour)
<mask> }
<mask>
<mask> value, found := tokenBuckets.Get(ip)
<mask> if !found {
</s> Added ratelimit whitelist and tests </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove func setup(c *caddy.Controller) error {
</s> add func setupPlugin(c *caddy.Controller) (*plug, error) {
</s> remove config := dnsserver.GetConfig(c)
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
ratelimit int // in requests per second per IP
whitelist []string // a list of whitelisted IP addresses
| <mask> type plug struct {
<mask> Next plugin.Handler
<mask>
<mask> // configuration for creating above
<mask> ratelimit int // in requests per second per IP
<mask> }
<mask>
<mask> func setup(c *caddy.Controller) error {
<mask> p := &plug{ratelimit: defaultRatelimit}
<mask> config := dnsserver.GetConfig(c)
</s> Added ratelimit whitelist and tests </s> remove func setup(c *caddy.Controller) error {
</s> add func setupPlugin(c *caddy.Controller) (*plug, error) {
</s> remove config := dnsserver.GetConfig(c)
</s> add </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
func setupPlugin(c *caddy.Controller) (*plug, error) {
| <mask> // configuration for creating above
<mask> ratelimit int // in requests per second per IP
<mask> }
<mask>
<mask> func setup(c *caddy.Controller) error {
<mask> p := &plug{ratelimit: defaultRatelimit}
<mask> config := dnsserver.GetConfig(c)
<mask>
<mask> for c.Next() {
<mask> args := c.RemainingArgs()
</s> Added ratelimit whitelist and tests </s> remove ratelimit int // in requests per second per IP
</s> add ratelimit int // in requests per second per IP
whitelist []string // a list of whitelisted IP addresses
</s> remove config := dnsserver.GetConfig(c)
</s> add </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
<mask> }
<mask>
<mask> func setup(c *caddy.Controller) error {
<mask> p := &plug{ratelimit: defaultRatelimit}
<mask> config := dnsserver.GetConfig(c)
<mask>
<mask> for c.Next() {
<mask> args := c.RemainingArgs()
<mask> if len(args) <= 0 {
<mask> continue
</s> Added ratelimit whitelist and tests </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove func setup(c *caddy.Controller) error {
</s> add func setupPlugin(c *caddy.Controller) (*plug, error) {
</s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove ratelimit int // in requests per second per IP
</s> add ratelimit int // in requests per second per IP
whitelist []string // a list of whitelisted IP addresses
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
|
if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit | <mask> config := dnsserver.GetConfig(c)
<mask>
<mask> for c.Next() {
<mask> args := c.RemainingArgs()
<mask> if len(args) <= 0 {
<mask> continue
<mask> }
<mask> ratelimit, err := strconv.Atoi(args[0])
<mask> if err != nil {
<mask> return c.ArgErr()
<mask> }
</s> Added ratelimit whitelist and tests </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove config := dnsserver.GetConfig(c)
</s> add </s> remove p.ratelimit = ratelimit
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} | <mask> args := c.RemainingArgs()
<mask> if len(args) <= 0 {
<mask> continue
<mask> }
<mask> ratelimit, err := strconv.Atoi(args[0])
<mask> if err != nil {
<mask> return c.ArgErr()
<mask> }
<mask> p.ratelimit = ratelimit
<mask> }
<mask>
<mask> config.AddPlugin(func(next plugin.Handler) plugin.Handler {
</s> Added ratelimit whitelist and tests </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove p.ratelimit = ratelimit
</s> add </s> remove config := dnsserver.GetConfig(c)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
<mask> ratelimit, err := strconv.Atoi(args[0])
<mask> if err != nil {
<mask> return c.ArgErr()
<mask> }
<mask> p.ratelimit = ratelimit
<mask> }
<mask>
<mask> config.AddPlugin(func(next plugin.Handler) plugin.Handler {
<mask> p.Next = next
<mask> return p
</s> Added ratelimit whitelist and tests </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove config := dnsserver.GetConfig(c)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
|
return p, nil
}
func setup(c *caddy.Controller) error {
p, err := setupPlugin(c)
if err != nil {
return err
}
config := dnsserver.GetConfig(c) | <mask> }
<mask> }
<mask> }
<mask>
<mask> config.AddPlugin(func(next plugin.Handler) plugin.Handler {
<mask> p.Next = next
<mask> return p
<mask> })
</s> Added ratelimit whitelist and tests </s> remove p.ratelimit = ratelimit
</s> add </s> remove ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return c.ArgErr()
</s> add for c.NextBlock() {
switch c.Val() {
case "whitelist":
p.whitelist = c.RemainingArgs()
if len(p.whitelist) > 0 {
sort.Strings(p.whitelist)
}
} </s> remove if len(args) <= 0 {
continue
</s> add if len(args) > 0 {
ratelimit, err := strconv.Atoi(args[0])
if err != nil {
return nil, c.ArgErr()
}
p.ratelimit = ratelimit </s> remove config := dnsserver.GetConfig(c)
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/345e4dc89a18aa0dd0f63458755126cb3f2f4235 | coredns_plugin/ratelimit/ratelimit.go |
// Print the first message after logger is configured. | <mask>
<mask> // Go memory hacks
<mask> memoryUsage(args)
<mask>
<mask> // print the first message after logger is configured
<mask> log.Println(version.Full())
<mask> log.Debug("Current working directory is %s", Context.workDir)
<mask> if args.runningAsService {
<mask> log.Info("AdGuard Home is running as a service")
<mask> }
</s> Pull request: 4046 darwin service message
Merge in DNS/adguard-home from 4046-log-dir to master
Closes #4046.
Squashed commit of the following:
commit 05140550b14f477f52487c575f56428ce9e6fa10
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 5 17:54:11 2022 +0500
all: add macOS service msg </s> remove log.Debug("Current working directory is %s", Context.workDir)
</s> add log.Debug("current working directory is %s", Context.workDir) </s> remove // When running as a Windows service, use eventlog by default if nothing else is configured
// Otherwise, we'll simply loose the log output
</s> add // When running as a Windows service, use eventlog by default if nothing
// else is configured. Otherwise, we'll simply lose the log output. </s> remove // Make sure that we see the microseconds in logs, as networking stuff
// can happen pretty quickly.
</s> add // Make sure that we see the microseconds in logs, as networking stuff can
// happen pretty quickly. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34c95f99f86df9dd8c0dcead98424add0523383f | internal/home/home.go |
log.Debug("current working directory is %s", Context.workDir) | <mask> memoryUsage(args)
<mask>
<mask> // print the first message after logger is configured
<mask> log.Println(version.Full())
<mask> log.Debug("Current working directory is %s", Context.workDir)
<mask> if args.runningAsService {
<mask> log.Info("AdGuard Home is running as a service")
<mask> }
<mask>
<mask> setupContext(args)
</s> Pull request: 4046 darwin service message
Merge in DNS/adguard-home from 4046-log-dir to master
Closes #4046.
Squashed commit of the following:
commit 05140550b14f477f52487c575f56428ce9e6fa10
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 5 17:54:11 2022 +0500
all: add macOS service msg </s> remove // print the first message after logger is configured
</s> add // Print the first message after logger is configured. </s> remove // When running as a Windows service, use eventlog by default if nothing else is configured
// Otherwise, we'll simply loose the log output
</s> add // When running as a Windows service, use eventlog by default if nothing
// else is configured. Otherwise, we'll simply lose the log output. </s> remove // Make sure that we see the microseconds in logs, as networking stuff
// can happen pretty quickly.
</s> add // Make sure that we see the microseconds in logs, as networking stuff can
// happen pretty quickly. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34c95f99f86df9dd8c0dcead98424add0523383f | internal/home/home.go |
// Make sure that we see the microseconds in logs, as networking stuff can
// happen pretty quickly. | <mask> if ls.Verbose {
<mask> log.SetLevel(log.DEBUG)
<mask> }
<mask>
<mask> // Make sure that we see the microseconds in logs, as networking stuff
<mask> // can happen pretty quickly.
<mask> log.SetFlags(log.LstdFlags | log.Lmicroseconds)
<mask>
<mask> if args.runningAsService && ls.LogFile == "" && runtime.GOOS == "windows" {
<mask> // When running as a Windows service, use eventlog by default if nothing else is configured
<mask> // Otherwise, we'll simply loose the log output
</s> Pull request: 4046 darwin service message
Merge in DNS/adguard-home from 4046-log-dir to master
Closes #4046.
Squashed commit of the following:
commit 05140550b14f477f52487c575f56428ce9e6fa10
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 5 17:54:11 2022 +0500
all: add macOS service msg </s> remove // When running as a Windows service, use eventlog by default if nothing else is configured
// Otherwise, we'll simply loose the log output
</s> add // When running as a Windows service, use eventlog by default if nothing
// else is configured. Otherwise, we'll simply lose the log output. </s> remove // print the first message after logger is configured
</s> add // Print the first message after logger is configured. </s> remove log.Debug("Current working directory is %s", Context.workDir)
</s> add log.Debug("current working directory is %s", Context.workDir) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34c95f99f86df9dd8c0dcead98424add0523383f | internal/home/home.go |
// When running as a Windows service, use eventlog by default if nothing
// else is configured. Otherwise, we'll simply lose the log output. | <mask> // can happen pretty quickly.
<mask> log.SetFlags(log.LstdFlags | log.Lmicroseconds)
<mask>
<mask> if args.runningAsService && ls.LogFile == "" && runtime.GOOS == "windows" {
<mask> // When running as a Windows service, use eventlog by default if nothing else is configured
<mask> // Otherwise, we'll simply loose the log output
<mask> ls.LogFile = configSyslog
<mask> }
<mask>
<mask> // logs are written to stdout (default)
<mask> if ls.LogFile == "" {
</s> Pull request: 4046 darwin service message
Merge in DNS/adguard-home from 4046-log-dir to master
Closes #4046.
Squashed commit of the following:
commit 05140550b14f477f52487c575f56428ce9e6fa10
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 5 17:54:11 2022 +0500
all: add macOS service msg </s> remove // Make sure that we see the microseconds in logs, as networking stuff
// can happen pretty quickly.
</s> add // Make sure that we see the microseconds in logs, as networking stuff can
// happen pretty quickly. </s> remove // print the first message after logger is configured
</s> add // Print the first message after logger is configured. </s> remove log.Debug("Current working directory is %s", Context.workDir)
</s> add log.Debug("current working directory is %s", Context.workDir) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34c95f99f86df9dd8c0dcead98424add0523383f | internal/home/home.go |
if runtime.GOOS == "darwin" &&
action == "start" &&
!strings.HasPrefix(Context.workDir, "/Applications/") {
log.Info("warning: service must be started from within the /Applications directory")
}
| <mask> // On OpenWrt, the service utility may not exist. We use our service script
<mask> // directly in this case.
<mask> func svcAction(s service.Service, action string) (err error) {
<mask> err = service.Control(s, action)
<mask> if err != nil && service.Platform() == "unix-systemv" &&
<mask> (action == "start" || action == "stop" || action == "restart") {
<mask> _, err = runInitdCommand(action)
<mask>
</s> Pull request: 4046 darwin service message
Merge in DNS/adguard-home from 4046-log-dir to master
Closes #4046.
Squashed commit of the following:
commit 05140550b14f477f52487c575f56428ce9e6fa10
Author: Eugene Burkov <[email protected]>
Date: Wed Jan 5 17:54:11 2022 +0500
all: add macOS service msg </s> remove // When running as a Windows service, use eventlog by default if nothing else is configured
// Otherwise, we'll simply loose the log output
</s> add // When running as a Windows service, use eventlog by default if nothing
// else is configured. Otherwise, we'll simply lose the log output. </s> remove // Make sure that we see the microseconds in logs, as networking stuff
// can happen pretty quickly.
</s> add // Make sure that we see the microseconds in logs, as networking stuff can
// happen pretty quickly. </s> remove // print the first message after logger is configured
</s> add // Print the first message after logger is configured. </s> remove log.Debug("Current working directory is %s", Context.workDir)
</s> add log.Debug("current working directory is %s", Context.workDir) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34c95f99f86df9dd8c0dcead98424add0523383f | internal/home/service.go |
Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Interfaces map[string]interface{} `json:"interfaces"` | <mask> Port int `json:"port"`
<mask> }
<mask>
<mask> type firstRunData struct {
<mask> Web ipport `json:"web"`
<mask> DNS ipport `json:"dns"`
<mask> Username string `json:"username,omitempty"`
<mask> Password string `json:"password,omitempty"`
<mask> }
<mask>
<mask> func handleGetDefaultAddresses(w http.ResponseWriter, r *http.Request) {
<mask> data := firstRunData{}
<mask> ifaces, err := getValidNetInterfaces()
</s> /install/get_default_addresses -- now it gives out list of interfaces </s> remove // find an interface with an ipv4 address
addr := findIPv4IfaceAddr(ifaces)
if len(addr) == 0 {
httpError(w, http.StatusServiceUnavailable, "Couldn't find any interface with IPv4, plase try again later")
return
}
data.Web.IP = addr
data.DNS.IP = addr
</s> add // fill out the fields | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34e14930deec600a24db4fb8ceaa1daa63776c1c | control.go |
// fill out the fields | <mask> httpError(w, http.StatusServiceUnavailable, "Couldn't find any legible interface, plase try again later")
<mask> return
<mask> }
<mask>
<mask> // find an interface with an ipv4 address
<mask> addr := findIPv4IfaceAddr(ifaces)
<mask> if len(addr) == 0 {
<mask> httpError(w, http.StatusServiceUnavailable, "Couldn't find any interface with IPv4, plase try again later")
<mask> return
<mask> }
<mask> data.Web.IP = addr
<mask> data.DNS.IP = addr
<mask> data.Web.Port = 3000 // TODO: find out if port 80 is available -- if not, fall back to 3000
<mask> data.DNS.Port = 53 // TODO: find out if port 53 is available -- if not, show a big warning
<mask>
<mask> w.Header().Set("Content-Type", "application/json")
<mask> err = json.NewEncoder(w).Encode(data)
</s> /install/get_default_addresses -- now it gives out list of interfaces </s> remove Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
</s> add Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Interfaces map[string]interface{} `json:"interfaces"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34e14930deec600a24db4fb8ceaa1daa63776c1c | control.go |
data.Interfaces = make(map[string]interface{})
for _, iface := range ifaces {
data.Interfaces[iface.Name] = iface
} | <mask> // fill out the fields
<mask> data.Web.Port = 3000 // TODO: find out if port 80 is available -- if not, fall back to 3000
<mask> data.DNS.Port = 53 // TODO: find out if port 53 is available -- if not, show a big warning
<mask>
<mask> w.Header().Set("Content-Type", "application/json")
<mask> err = json.NewEncoder(w).Encode(data)
<mask> if err != nil {
<mask> httpError(w, http.StatusInternalServerError, "Unable to marshal default addresses to json: %s", err)
</s> /install/get_default_addresses -- now it gives out list of interfaces </s> remove // find an interface with an ipv4 address
addr := findIPv4IfaceAddr(ifaces)
if len(addr) == 0 {
httpError(w, http.StatusServiceUnavailable, "Couldn't find any interface with IPv4, plase try again later")
return
}
data.Web.IP = addr
data.DNS.IP = addr
</s> add // fill out the fields </s> remove Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
</s> add Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Interfaces map[string]interface{} `json:"interfaces"` | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34e14930deec600a24db4fb8ceaa1daa63776c1c | control.go |
// TODO: validate that hosts and ports are bindable | <mask>
<mask> spew.Dump(newSettings)
<mask> config.firstRun = false
<mask> config.BindHost = newSettings.Web.IP
<mask> config.BindPort = newSettings.Web.Port
<mask> config.DNS.BindHost = newSettings.DNS.IP
</s> /install/get_default_addresses -- now it gives out list of interfaces </s> remove // find an interface with an ipv4 address
addr := findIPv4IfaceAddr(ifaces)
if len(addr) == 0 {
httpError(w, http.StatusServiceUnavailable, "Couldn't find any interface with IPv4, plase try again later")
return
}
data.Web.IP = addr
data.DNS.IP = addr
</s> add // fill out the fields </s> remove Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
</s> add Web ipport `json:"web"`
DNS ipport `json:"dns"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Interfaces map[string]interface{} `json:"interfaces"` | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/34e14930deec600a24db4fb8ceaa1daa63776c1c | control.go |
// map's values are guaranteed to be of type of *HostsRecord. | <mask> return nil
<mask> }
<mask>
<mask> // Upd returns the channel into which the updates are sent. The receivable
<mask> // map's values are guaranteed to be of type of *stringutil.Set.
<mask> func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
<mask> return hc.updates
<mask> }
<mask>
<mask> // pathsToPatterns converts paths into patterns compatible with fs.Glob.
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
hp.addRecord(ip, hosts) | <mask> if ip == nil || len(hosts) == 0 {
<mask> continue
<mask> }
<mask>
<mask> hp.addPairs(ip, hosts)
<mask> }
<mask>
<mask> return nil, true, s.Err()
<mask> }
<mask>
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
for _, h := range hosts {
if set.Has(h) {
</s> add for _, host := range hosts {
if rec.Canonical == host || rec.Aliases.Has(host) { </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove hosts, ok := v.(*stringutil.Set)
</s> add rec, ok := v.(*aghnet.HostsRecord) </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
// HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil | <mask>
<mask> return ip, hosts
<mask> }
<mask>
<mask> // addPair puts the pair of ip and host to the rules builder if needed. For
<mask> // each ip the first member of hosts will become the main one.
<mask> func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
<mask> v, ok := hp.table.Get(ip)
<mask> if !ok {
<mask> // This ip is added at the first time.
<mask> v = stringutil.NewSet()
<mask> hp.table.Set(ip, v)
<mask> }
<mask>
<mask> var set *stringutil.Set
<mask> set, ok = v.(*stringutil.Set)
<mask> if !ok {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) | <mask> v = stringutil.NewSet()
<mask> hp.table.Set(ip, v)
<mask> }
<mask>
<mask> var set *stringutil.Set
<mask> set, ok = v.(*stringutil.Set)
<mask> if !ok {
<mask> log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
<mask>
<mask> return
<mask> }
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} </s> remove return
</s> add rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} | <mask>
<mask> var set *stringutil.Set
<mask> set, ok = v.(*stringutil.Set)
<mask> if !ok {
<mask> log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
<mask>
<mask> return
<mask> }
<mask>
<mask> processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove return
</s> add rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
for _, h := range hosts {
if set.Has(h) {
</s> add for _, host := range hosts {
if rec.Canonical == host || rec.Aliases.Has(host) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} | <mask> set, ok = v.(*stringutil.Set)
<mask> if !ok {
<mask> log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
<mask>
<mask> return
<mask> }
<mask>
<mask> processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
<mask> for _, h := range hosts {
<mask> if set.Has(h) {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} </s> remove processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
for _, h := range hosts {
if set.Has(h) {
</s> add for _, host := range hosts {
if rec.Canonical == host || rec.Aliases.Has(host) { </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove set.Add(h)
</s> add rec.Aliases.Add(host) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
for _, host := range hosts {
if rec.Canonical == host || rec.Aliases.Has(host) { | <mask>
<mask> return
<mask> }
<mask>
<mask> processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
<mask> for _, h := range hosts {
<mask> if set.Has(h) {
<mask> continue
<mask> }
<mask>
<mask> set.Add(h)
<mask>
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove return
</s> add rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} </s> remove set.Add(h)
</s> add rec.Aliases.Add(host) </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove rule, rulePtr := hp.writeRules(h, ip)
hp.translations[rule], hp.translations[rulePtr] = processed, processed
log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h)
</s> add hp.addRules(ip, host, line) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
rec.Aliases.Add(host) | <mask> if set.Has(h) {
<mask> continue
<mask> }
<mask>
<mask> set.Add(h)
<mask>
<mask> rule, rulePtr := hp.writeRules(h, ip)
<mask> hp.translations[rule], hp.translations[rulePtr] = processed, processed
<mask>
<mask> log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h)
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove rule, rulePtr := hp.writeRules(h, ip)
hp.translations[rule], hp.translations[rulePtr] = processed, processed
log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h)
</s> add hp.addRules(ip, host, line) </s> remove processed := strings.Join(append([]string{ip.String()}, hosts...), " ")
for _, h := range hosts {
if set.Has(h) {
</s> add for _, host := range hosts {
if rec.Canonical == host || rec.Aliases.Has(host) { </s> remove return
</s> add rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
hp.addRules(ip, host, line) | <mask> }
<mask>
<mask> set.Add(h)
<mask>
<mask> rule, rulePtr := hp.writeRules(h, ip)
<mask> hp.translations[rule], hp.translations[rulePtr] = processed, processed
<mask>
<mask> log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h)
<mask> }
<mask> }
<mask>
<mask> // writeRules writes the actual rule for the qtype and the PTR for the host-ip
<mask> // pair into internal builders.
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove set.Add(h)
</s> add rec.Aliases.Add(host) </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
// addRules adds rules and rule translations for the line.
func (hp *hostsParser) addRules(ip net.IP, host, line string) {
rule, rulePtr := hp.writeRules(host, ip)
hp.translations[rule], hp.translations[rulePtr] = line, line
log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, host)
}
| <mask> }
<mask>
<mask> // writeRules writes the actual rule for the qtype and the PTR for the host-ip
<mask> // pair into internal builders.
<mask> func (hp *hostsParser) writeRules(host string, ip net.IP) (rule, rulePtr string) {
<mask> arpa, err := netutil.IPToReversedAddr(ip)
<mask> if err != nil {
<mask> return "", ""
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove rule, rulePtr := hp.writeRules(h, ip)
hp.translations[rule], hp.translations[rulePtr] = processed, processed
log.Debug("%s: added ip-host pair %q-%q", hostsContainerPref, ip, h)
</s> add hp.addRules(ip, host, line) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove // defined by refreshIvl. It disables auto-resfreshing if refreshIvl is 0. If
</s> add // defined by refreshIvl. It disables auto-refreshing if refreshIvl is 0. If | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
// target's values must be of type *HostsRecord. | <mask> }
<mask>
<mask> // equalSet returns true if the internal hosts table just parsed equals target.
<mask> func (hp *hostsParser) equalSet(target *netutil.IPMap) (ok bool) {
<mask> if target == nil {
<mask> // hp.table shouldn't appear nil since it's initialized on each refresh.
<mask> return target == hp.table
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove hp.addPairs(ip, hosts)
</s> add hp.addRecord(ip, hosts) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false | <mask> if hp.table.Len() != target.Len() {
<mask> return false
<mask> }
<mask>
<mask> hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
<mask> // ok is set to true if the target doesn't contain ip or if the
<mask> // appropriate hosts set isn't equal to the checked one.
<mask> if a, hasIP := target.Get(ip); !hasIP {
<mask> ok = true
<mask> } else if hosts, aok := a.(*stringutil.Set); aok {
<mask> ok = !hosts.Equal(b.(*stringutil.Set))
<mask> }
<mask>
<mask> // Continue only if maps has no discrepancies.
<mask> return !ok
<mask> })
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove hosts, ok := v.(*stringutil.Set)
</s> add rec, ok := v.(*aghnet.HostsRecord) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok | <mask> } else if hosts, aok := a.(*stringutil.Set); aok {
<mask> ok = !hosts.Equal(b.(*stringutil.Set))
<mask> }
<mask>
<mask> // Continue only if maps has no discrepancies.
<mask> return !ok
<mask> })
<mask>
<mask> // Return true if every value from the IP map has no discrepancies with the
<mask> // appropriate one from the target.
<mask> return !ok
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
return ok | <mask> // Continue only if maps has no discrepancies.
<mask> return !ok
<mask> })
<mask>
<mask> // Return true if every value from the IP map has no discrepancies with the
<mask> // appropriate one from the target.
<mask> return !ok
<mask> }
<mask>
<mask> // sendUpd tries to send the parsed data to the ch.
<mask> func (hp *hostsParser) sendUpd(ch chan *netutil.IPMap) {
<mask> log.Debug("%s: sending upd", hostsContainerPref)
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer.go |
"github.com/AdguardTeam/golibs/netutil" | <mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/stringutil"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/AdguardTeam/urlfilter"
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
<mask> "github.com/stretchr/testify/assert"
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove hosts.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) {
n++
}
return true
})
</s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile)
n++ </s> remove }, {
</s> add name: "hello_alias", </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove name: "simple",
</s> add }, { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
checkRefresh := func(t *testing.T, want *HostsRecord) {
t.Helper()
var ok bool
var upd *netutil.IPMap
select {
case upd, ok = <-hc.Upd():
require.True(t, ok)
require.NotNil(t, upd)
case <-time.After(1 * time.Second):
t.Fatal("did not receive after 1s")
} | <mask> hc, err := NewHostsContainer(0, testFS, w, "dir")
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, hc.Close)
<mask>
<mask> checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) {
<mask> upd, ok := <-hc.Upd()
<mask> require.True(t, ok)
<mask> require.NotNil(t, upd)
<mask>
<mask> assert.Equal(t, 1, upd.Len())
<mask>
<mask> v, ok := upd.Get(ip)
<mask> require.True(t, ok)
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove assert.True(t, set.Equal(wantHosts))
</s> add rec, _ := v.(*HostsRecord)
require.NotNil(t, rec)
assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove hosts, ok := v.(*stringutil.Set)
</s> add rec, ok := v.(*aghnet.HostsRecord) </s> remove var rc *RuntimeClient
rc, ok = clients.findRuntimeClientLocked(ip)
</s> add rc, ok := clients.findRuntimeClientLocked(ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
require.IsType(t, (*HostsRecord)(nil), v) | <mask>
<mask> v, ok := upd.Get(ip)
<mask> require.True(t, ok)
<mask>
<mask> var set *stringutil.Set
<mask> set, ok = v.(*stringutil.Set)
<mask> require.True(t, ok)
<mask>
<mask> assert.True(t, set.Equal(wantHosts))
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove assert.True(t, set.Equal(wantHosts))
</s> add rec, _ := v.(*HostsRecord)
require.NotNil(t, rec)
assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) {
upd, ok := <-hc.Upd()
require.True(t, ok)
require.NotNil(t, upd)
</s> add checkRefresh := func(t *testing.T, want *HostsRecord) {
t.Helper()
var ok bool
var upd *netutil.IPMap
select {
case upd, ok = <-hc.Upd():
require.True(t, ok)
require.NotNil(t, upd)
case <-time.After(1 * time.Second):
t.Fatal("did not receive after 1s")
} </s> remove checkRefresh(t, stringutil.NewSet("hostname"))
</s> add checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet(),
Canonical: "hostname",
}) </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
rec, _ := v.(*HostsRecord)
require.NotNil(t, rec)
assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) | <mask> var set *stringutil.Set
<mask> set, ok = v.(*stringutil.Set)
<mask> require.True(t, ok)
<mask>
<mask> assert.True(t, set.Equal(wantHosts))
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
<mask> checkRefresh(t, stringutil.NewSet("hostname"))
<mask> })
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove checkRefresh(t, stringutil.NewSet("hostname"))
</s> add checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet(),
Canonical: "hostname",
}) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) {
upd, ok := <-hc.Upd()
require.True(t, ok)
require.NotNil(t, upd)
</s> add checkRefresh := func(t *testing.T, want *HostsRecord) {
t.Helper()
var ok bool
var upd *netutil.IPMap
select {
case upd, ok = <-hc.Upd():
require.True(t, ok)
require.NotNil(t, upd)
case <-time.After(1 * time.Second):
t.Fatal("did not receive after 1s")
} </s> remove checkRefresh(t, stringutil.NewSet("hostname", "alias"))
</s> add checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet("alias"),
Canonical: "hostname",
}) </s> remove log.Debug("%s: adding pairs: unexpected value type %T", hostsContainerPref, v)
</s> add rec = &HostsRecord{
Aliases: stringutil.NewSet(),
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet(),
Canonical: "hostname",
}) | <mask> assert.True(t, set.Equal(wantHosts))
<mask> }
<mask>
<mask> t.Run("initial_refresh", func(t *testing.T) {
<mask> checkRefresh(t, stringutil.NewSet("hostname"))
<mask> })
<mask>
<mask> t.Run("second_refresh", func(t *testing.T) {
<mask> testFS["dir/file2"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)}
<mask> eventsCh <- event{}
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove checkRefresh(t, stringutil.NewSet("hostname", "alias"))
</s> add checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet("alias"),
Canonical: "hostname",
}) </s> remove assert.True(t, set.Equal(wantHosts))
</s> add rec, _ := v.(*HostsRecord)
require.NotNil(t, rec)
assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) {
upd, ok := <-hc.Upd()
require.True(t, ok)
require.NotNil(t, upd)
</s> add checkRefresh := func(t *testing.T, want *HostsRecord) {
t.Helper()
var ok bool
var upd *netutil.IPMap
select {
case upd, ok = <-hc.Upd():
require.True(t, ok)
require.NotNil(t, upd)
case <-time.After(1 * time.Second):
t.Fatal("did not receive after 1s")
} </s> remove hosts.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) {
n++
}
return true
})
</s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile)
n++ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet("alias"),
Canonical: "hostname",
}) | <mask>
<mask> t.Run("second_refresh", func(t *testing.T) {
<mask> testFS["dir/file2"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)}
<mask> eventsCh <- event{}
<mask> checkRefresh(t, stringutil.NewSet("hostname", "alias"))
<mask> })
<mask>
<mask> t.Run("double_refresh", func(t *testing.T) {
<mask> // Make a change once.
<mask> testFS["dir/file1"] = &fstest.MapFile{Data: []byte(ipStr + ` alias` + nl)}
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove checkRefresh(t, stringutil.NewSet("hostname"))
</s> add checkRefresh(t, &HostsRecord{
Aliases: stringutil.NewSet(),
Canonical: "hostname",
}) </s> remove assert.True(t, set.Equal(wantHosts))
</s> add rec, _ := v.(*HostsRecord)
require.NotNil(t, rec)
assert.Truef(t, rec.Equal(want), "%+v != %+v", rec, want) </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
require.True(t, ok)
</s> add require.IsType(t, (*HostsRecord)(nil), v) </s> remove checkRefresh := func(t *testing.T, wantHosts *stringutil.Set) {
upd, ok := <-hc.Upd()
require.True(t, ok)
require.NotNil(t, upd)
</s> add checkRefresh := func(t *testing.T, want *HostsRecord) {
t.Helper()
var ok bool
var upd *netutil.IPMap
select {
case upd, ok = <-hc.Upd():
require.True(t, ok)
require.NotNil(t, upd)
case <-time.After(1 * time.Second):
t.Fatal("did not receive after 1s")
} </s> remove var rc *RuntimeClient
rc, ok = clients.findRuntimeClientLocked(ip)
</s> add rc, ok := clients.findRuntimeClientLocked(ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
<mask>
<mask> require.NoError(t, fstest.TestFS(testdata, "etc_hosts"))
<mask>
<mask> testCases := []struct {
<mask> want []*rules.DNSRewrite
<mask> name string
<mask> req *urlfilter.DNSRequest
<mask> }{{
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> Value: net.IPv4(1, 0, 0, 1),
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "other_line_alias", </s> remove }, {
</s> add name: "hello_alias", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
name string
want []*rules.DNSRewrite | <mask> require.NoError(t, fstest.TestFS(testdata, "etc_hosts"))
<mask>
<mask> testCases := []struct {
<mask> req *urlfilter.DNSRequest
<mask> }{{
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "simplehost",
<mask> DNSType: dns.TypeA,
<mask> },
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want []*rules.DNSRewrite
name string
</s> add </s> remove name: "simple",
</s> add }, { </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove }, {
</s> add name: "hello_alias", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
req: &urlfilter.DNSRequest{
Hostname: "simplehost",
DNSType: dns.TypeA,
},
name: "simple", | <mask> req *urlfilter.DNSRequest
<mask> name string
<mask> want []*rules.DNSRewrite
<mask> }{{
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> Value: net.IPv4(1, 0, 0, 1),
<mask> RRType: dns.TypeA,
<mask> }, {
<mask> RCode: dns.RcodeSuccess,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want []*rules.DNSRewrite
name string
</s> add </s> remove }, {
</s> add name: "other_line_alias", </s> remove }, {
</s> add name: "hello_alias", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> RCode: dns.RcodeSuccess,
<mask> Value: net.ParseIP("::1"),
<mask> RRType: dns.TypeAAAA,
<mask> }},
<mask> name: "simple",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "simplehost",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove name: "issue_4216_4_6",
</s> add }, { </s> remove name: "hello_alias",
</s> add }, { </s> remove name: "lots_of_aliases",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
Hostname: "hello.world", | <mask> RRType: dns.TypeAAAA,
<mask> }},
<mask> name: "simple",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "simplehost",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "simple",
</s> add }, { </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove }, {
</s> add name: "hello_alias", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "hello_alias", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "simplehost",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> Value: net.IPv4(1, 0, 0, 0),
<mask> RRType: dns.TypeA,
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "other_line_alias", </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove name: "simple",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> RCode: dns.RcodeSuccess,
<mask> Value: net.ParseIP("::"),
<mask> RRType: dns.TypeAAAA,
<mask> }},
<mask> name: "hello_alias",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "hello.world",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", </s> remove name: "other_line_alias",
req: &urlfilter.DNSRequest{
Hostname: "hello.world.again",
DNSType: dns.TypeA,
},
</s> add </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove name: "lots_of_aliases",
</s> add }, { </s> remove name: "issue_4216_4_6",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
Hostname: "hello.world.again", | <mask> RRType: dns.TypeAAAA,
<mask> }},
<mask> name: "hello_alias",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "hello.world",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "hello_alias",
</s> add }, { </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove }, {
</s> add name: "hello_alias", </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove }, {
</s> add name: "other_line_alias", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "other_line_alias", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "hello.world",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> Value: net.IPv4(1, 0, 0, 0),
<mask> RRType: dns.TypeA,
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "hello_alias", </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
<mask> RCode: dns.RcodeSuccess,
<mask> Value: net.ParseIP("::"),
<mask> RRType: dns.TypeAAAA,
<mask> }},
<mask> name: "other_line_alias",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "hello.world.again",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "hello_subdomain",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "say.hello",
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want: []*rules.DNSRewrite{},
name: "hello_subdomain",
</s> add </s> remove }, {
</s> add name: "hello_subdomain", </s> remove name: "hello_alias",
</s> add }, { </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
<mask> Hostname: "hello.world.again",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "hello_subdomain",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "say.hello",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "other_line_alias",
req: &urlfilter.DNSRequest{
Hostname: "hello.world.again",
DNSType: dns.TypeA,
},
</s> add </s> remove }, {
</s> add name: "hello_subdomain", </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add </s> remove name: "hello_alias_subdomain",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
name: "hello_subdomain", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "say.hello",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "hello_alias_subdomain",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "say.hello.world",
<mask> DNSType: dns.TypeA,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "hello_alias_subdomain",
</s> add }, { </s> remove want: []*rules.DNSRewrite{},
name: "hello_subdomain",
</s> add </s> remove name: "other_line_alias",
req: &urlfilter.DNSRequest{
Hostname: "hello.world.again",
DNSType: dns.TypeA,
},
</s> add </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "hello_alias_subdomain",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "say.hello.world",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "hello_subdomain", </s> remove want: []*rules.DNSRewrite{},
name: "hello_subdomain",
</s> add </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "hello_alias_subdomain",
want: []*rules.DNSRewrite{}, | <mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "for.testing",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> name: "lots_of_aliases",
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "lots_of_aliases",
</s> add }, { </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, </s> remove }, {
</s> add name: "reverse", | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
req: &urlfilter.DNSRequest{
Hostname: "for.testing",
DNSType: dns.TypeA,
},
name: "lots_of_aliases", | <mask> name: "hello_alias_subdomain",
<mask> want: []*rules.DNSRewrite{},
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeA,
<mask> Value: net.IPv4(1, 0, 0, 2),
<mask> }, {
<mask> RCode: dns.RcodeSuccess,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "other_line_alias", </s> remove }, {
</s> add name: "hello_alias", </s> remove want []*rules.DNSRewrite
name string
</s> add </s> remove name: "hello_alias_subdomain",
</s> add }, { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeAAAA,
<mask> Value: net.ParseIP("::2"),
<mask> }},
<mask> name: "lots_of_aliases",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "for.testing",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, </s> remove }, {
</s> add name: "reverse", </s> remove name: "hello_alias",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, | <mask> Value: net.ParseIP("::2"),
<mask> }},
<mask> name: "lots_of_aliases",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "for.testing",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypePTR,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "lots_of_aliases",
</s> add }, { </s> remove }, {
</s> add name: "reverse", </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "reverse", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "for.testing",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypePTR,
<mask> Value: "simplehost.",
<mask> }},
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add </s> remove name: "lots_of_aliases",
</s> add }, { </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypePTR,
<mask> Value: "simplehost.",
<mask> }},
<mask> name: "reverse",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "1.0.0.1.in-addr.arpa",
<mask> DNSType: dns.TypePTR,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "non-existing",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "nonexisting",
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add </s> remove }, {
</s> add name: "reverse", </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, </s> remove want: nil,
name: "bad_type",
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
<mask> Hostname: "1.0.0.1.in-addr.arpa",
<mask> DNSType: dns.TypePTR,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{},
<mask> name: "non-existing",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "nonexisting",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add </s> remove want: nil,
name: "bad_type",
</s> add </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
name: "non-existing",
want: []*rules.DNSRewrite{}, | <mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "1.0.0.1.in-addr.arpa",
<mask> DNSType: dns.TypeSRV,
<mask> },
<mask> name: "bad_type",
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want: nil,
name: "bad_type",
</s> add </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
<mask> Hostname: "nonexisting",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: nil,
<mask> name: "bad_type",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "1.0.0.1.in-addr.arpa",
<mask> DNSType: dns.TypeSRV,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add </s> remove name: "reverse",
req: &urlfilter.DNSRequest{
Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR,
},
</s> add </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
name: "bad_type",
want: nil, | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "1.0.0.1.in-addr.arpa",
<mask> DNSType: dns.TypeSRV,
<mask> },
<mask> }, {
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain",
<mask> DNSType: dns.TypeA,
<mask> },
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove want: nil,
name: "bad_type",
</s> add </s> remove want: []*rules.DNSRewrite{},
name: "non-existing",
</s> add </s> remove name: "issue_4216_4_6",
</s> add }, { </s> remove Hostname: "domain",
</s> add Hostname: "domain4", | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
req: &urlfilter.DNSRequest{
Hostname: "domain",
DNSType: dns.TypeA,
},
name: "issue_4216_4_6", | <mask> want: nil,
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeA,
<mask> Value: net.IPv4(4, 2, 1, 6),
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove }, {
</s> add name: "issue_4216_6", </s> remove }, {
</s> add name: "other_line_alias", </s> remove }, {
</s> add name: "hello_alias", </s> remove }, {
</s> add name: "issue_4216_4", | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeAAAA,
<mask> Value: net.ParseIP("::42"),
<mask> }},
<mask> name: "issue_4216_4_6",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain",
</s> add Hostname: "domain4", </s> remove name: "simple",
</s> add }, { </s> remove name: "lots_of_aliases",
</s> add }, { </s> remove name: "hello_alias",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
Hostname: "domain4", | <mask> Value: net.ParseIP("::42"),
<mask> }},
<mask> name: "issue_4216_4_6",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "issue_4216_4_6",
</s> add }, { </s> remove }, {
</s> add name: "issue_4216_4", </s> remove }, {
</s> add name: "reverse", </s> remove Hostname: "for.testing",
DNSType: dns.TypeA,
</s> add Hostname: "1.0.0.1.in-addr.arpa",
DNSType: dns.TypePTR, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "issue_4216_4", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeA,
<mask> Value: net.IPv4(7, 5, 3, 1),
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove name: "issue_4216_4",
</s> add }, { </s> remove Hostname: "domain",
</s> add Hostname: "domain4", </s> remove name: "issue_4216_4_6",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
}, { | <mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeA,
<mask> Value: net.IPv4(1, 3, 5, 7),
<mask> }},
<mask> name: "issue_4216_4",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain4",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove }, {
</s> add name: "issue_4216_4", </s> remove Hostname: "domain",
</s> add Hostname: "domain4", </s> remove }, {
</s> add name: "issue_4216_6", </s> remove }, {
</s> add name: "hello_alias", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
Hostname: "domain6",
DNSType: dns.TypeAAAA, | <mask> Value: net.IPv4(1, 3, 5, 7),
<mask> }},
<mask> name: "issue_4216_4",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain4",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeAAAA,
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove name: "issue_4216_4",
</s> add }, { </s> remove }, {
</s> add name: "issue_4216_4", </s> remove }, {
</s> add name: "issue_4216_6", </s> remove Hostname: "domain",
</s> add Hostname: "domain4", </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
name: "issue_4216_6", | <mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain4",
<mask> DNSType: dns.TypeA,
<mask> },
<mask> }, {
<mask> want: []*rules.DNSRewrite{{
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeAAAA,
<mask> Value: net.ParseIP("::13"),
<mask> }, {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove Hostname: "domain",
</s> add Hostname: "domain4", </s> remove name: "issue_4216_4",
</s> add }, { </s> remove Hostname: "hello.world",
</s> add Hostname: "hello.world.again", </s> remove Hostname: "simplehost",
</s> add Hostname: "hello.world", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
<mask> RCode: dns.RcodeSuccess,
<mask> RRType: dns.TypeAAAA,
<mask> Value: net.ParseIP("::31"),
<mask> }},
<mask> name: "issue_4216_6",
<mask> req: &urlfilter.DNSRequest{
<mask> Hostname: "domain6",
<mask> DNSType: dns.TypeAAAA,
<mask> },
<mask> }}
<mask>
<mask> stubWatcher := aghtest.FSWatcher{
<mask> OnEvents: func() (e <-chan struct{}) { return nil },
<mask> OnAdd: func(name string) (err error) { return nil },
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove Hostname: "domain4",
DNSType: dns.TypeA,
</s> add Hostname: "domain6",
DNSType: dns.TypeAAAA, </s> remove }, {
</s> add name: "issue_4216_6", </s> remove name: "simple",
</s> add }, { </s> remove name: "issue_4216_4_6",
</s> add }, { </s> remove name: "hello_alias",
</s> add }, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/hostscontainer_test.go |
|
// defined by refreshIvl. It disables auto-refreshing if refreshIvl is 0. If | <mask> refresh() (err error)
<mask> }
<mask>
<mask> // NewSystemResolvers returns a SystemResolvers with the cache refresh rate
<mask> // defined by refreshIvl. It disables auto-resfreshing if refreshIvl is 0. If
<mask> // nil is passed for hostGenFunc, the default generator will be used.
<mask> func NewSystemResolvers(
<mask> hostGenFunc HostGenFunc,
<mask> ) (sr SystemResolvers, err error) {
<mask> sr = newSystemResolvers(hostGenFunc)
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove // map's values are guaranteed to be of type of *stringutil.Set.
</s> add // map's values are guaranteed to be of type of *HostsRecord. </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/aghnet/systemresolvers.go |
rc, ok := clients.findRuntimeClientLocked(ip) | <mask> }
<mask>
<mask> // addHostLocked adds a new IP-hostname pairing. For internal use only.
<mask> func (clients *clientsContainer) addHostLocked(ip net.IP, host string, src clientSource) (ok bool) {
<mask> var rc *RuntimeClient
<mask> rc, ok = clients.findRuntimeClientLocked(ip)
<mask> if ok {
<mask> if rc.Source > src {
<mask> return false
<mask> }
<mask>
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/home/clients.go |
rec, ok := v.(*aghnet.HostsRecord) | <mask> clients.rmHostsBySrc(ClientSourceHostsFile)
<mask>
<mask> n := 0
<mask> hosts.Range(func(ip net.IP, v interface{}) (cont bool) {
<mask> hosts, ok := v.(*stringutil.Set)
<mask> if !ok {
<mask> log.Error("dns: bad type %T in ipToRC for %s", v, ip)
<mask>
<mask> return true
<mask> }
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil </s> remove return
</s> add rec.Canonical, hosts = hosts[0], hosts[1:]
hp.addRules(ip, rec.Canonical, line)
hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
} </s> remove var set *stringutil.Set
set, ok = v.(*stringutil.Set)
</s> add return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}, hosts...), " ")
var rec *HostsRecord
v, ok := hp.table.Get(ip) </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/home/clients.go |
clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile)
n++ | <mask>
<mask> return true
<mask> }
<mask>
<mask> hosts.Range(func(name string) (cont bool) {
<mask> if clients.addHostLocked(ip, name, ClientSourceHostsFile) {
<mask> n++
<mask> }
<mask>
<mask> return true
<mask> })
<mask>
<mask> return true
<mask> })
<mask>
<mask> log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove log.Debug("clients: added %d client aliases from system hosts-file", n)
</s> add log.Debug("clients: added %d client aliases from system hosts file", n) </s> remove hp.table.Range(func(ip net.IP, b interface{}) (cont bool) {
// ok is set to true if the target doesn't contain ip or if the
// appropriate hosts set isn't equal to the checked one.
if a, hasIP := target.Get(ip); !hasIP {
ok = true
} else if hosts, aok := a.(*stringutil.Set); aok {
ok = !hosts.Equal(b.(*stringutil.Set))
</s> add hp.table.Range(func(ip net.IP, recVal interface{}) (cont bool) {
var targetVal interface{}
targetVal, ok = target.Get(ip)
if !ok {
return false </s> remove hosts, ok := v.(*stringutil.Set)
</s> add rec, ok := v.(*aghnet.HostsRecord) </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/home/clients.go |
log.Debug("clients: added %d client aliases from system hosts file", n) | <mask>
<mask> return true
<mask> })
<mask>
<mask> log.Debug("clients: added %d client aliases from system hosts-file", n)
<mask> }
<mask>
<mask> // addFromSystemARP adds the IP-hostname pairings from the output of the arp -a
<mask> // command.
<mask> func (clients *clientsContainer) addFromSystemARP() {
</s> Pull request: all: use canonical names for hosts file runtime clients
Updates #4683.
Squashed commit of the following:
commit daa8fdaee574d4ac2171f6b13c5ce3f3fedd9801
Author: Ainar Garipov <[email protected]>
Date: Thu Jul 7 19:13:29 2022 +0300
all: use canonical names for hosts file runtime clients </s> remove hosts.Range(func(name string) (cont bool) {
if clients.addHostLocked(ip, name, ClientSourceHostsFile) {
n++
}
return true
})
</s> add clients.addHostLocked(ip, rec.Canonical, ClientSourceHostsFile)
n++ </s> remove // Return true if every value from the IP map has no discrepancies with the
// appropriate one from the target.
return !ok
</s> add return ok </s> remove // Continue only if maps has no discrepancies.
return !ok
</s> add var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok </s> remove var rc *RuntimeClient
rc, ok = clients.findRuntimeClientLocked(ip)
</s> add rc, ok := clients.findRuntimeClientLocked(ip) </s> remove // addPair puts the pair of ip and host to the rules builder if needed. For
// each ip the first member of hosts will become the main one.
func (hp *hostsParser) addPairs(ip net.IP, hosts []string) {
v, ok := hp.table.Get(ip)
if !ok {
// This ip is added at the first time.
v = stringutil.NewSet()
hp.table.Set(ip, v)
</s> add // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/3505ce87397372f79bc067f6afa8cead833426a9 | internal/home/clients.go |
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), | <mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Requests count',
<mask> accessor: 'domain',
<mask> Cell: ({ value }) => {
<mask> const {
</s> Fix footer links
Closes #360 | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3 | client/src/components/Dashboard/BlockedDomains.js |
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), | <mask> columns = [{
<mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Requests count',
<mask> accessor: 'count',
<mask> Cell: ({ value }) => {
<mask> const percent = getPercent(this.props.dnsQueries, value);
<mask> const percentColor = this.getPercentColor(percent);
</s> Fix footer links
Closes #360 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3 | client/src/components/Dashboard/Clients.js |
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>), | <mask> columns = [{
<mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Requests count',
<mask> accessor: 'count',
<mask> Cell: ({ value }) => {
<mask> const percent = getPercent(this.props.dnsQueries, value);
<mask> const percentColor = this.getPercentColor(percent);
</s> Fix footer links
Closes #360 | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/35368619b0d7ed0fb838d749cd7b2f63ae9c9aa3 | client/src/components/Dashboard/QueriedDomains.js |
"example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", | <mask> "example_upstream_regular": "DNS reguler (melalui UDP);",
<mask> "example_upstream_udp": "DNS biasa (lebih dari UDP, nama host);",
<mask> "example_upstream_dot": "terenkripsi <0>DNS-over-TLS</0>;",
<mask> "example_upstream_doh": "terenkripsi <0>DNS-over-HTTPS</0>;",
<mask> "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);",
<mask> "example_upstream_sdns": "<0>Stempel DNS</0> untuk <1>DNSCrypt</1> atau pengarah <2>DNS-over-HTTPS</2>;",
<mask> "example_upstream_tcp": "DNS reguler (melalui TCP);",
<mask> "example_upstream_tcp_hostname": "DNS biasa (lebih dari TCP, nama host);",
<mask> "all_lists_up_to_date_toast": "Semua daftar sudah diperbarui",
<mask> "updated_upstream_dns_toast": "Server upstream berhasil disimpan",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 3feadfe31609ef52726b582ad6ba18bfa435a081
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 3 16:34:36 2022 +0300
client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);",
</s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);",
</s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.",
</s> add "encryption_doq": "Port DNS-over-QUIC ",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a | client/src/__locales/id.json |
"encryption_doq": "Port DNS-over-QUIC ",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.", | <mask> "encryption_https": "Port HTTPS",
<mask> "encryption_https_desc": "Jika port HTTPS dikonfigurasi, antarmuka admin Home AdGuard akan dapat diakses melalui HTTPS, dan itu juga akan memberikan DNS-over-HTTPS di lokasi '/ dns-query'.",
<mask> "encryption_dot": "Port DNS-over-TLS",
<mask> "encryption_dot_desc": "Jika port ini terkonfigurasi, AdGuard Home akan menjalankan server DNS-over-TLS dalam port ini",
<mask> "encryption_doq": "Port DNS-over-QUIC (eksperimental)",
<mask> "encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.",
<mask> "encryption_certificates": "Sertifikat",
<mask> "encryption_certificates_desc": "Untuk menggunakan enkripsi, Anda perlu memberikan rantai sertifikat SSL yang valid untuk domain Anda. Anda bisa mendapatkan sertifikat gratis di <0>{{link}}</0> atau Anda dapat membelinya dari salah satu Otoritas Sertifikat tepercaya.",
<mask> "encryption_certificates_input": "Salin / rekatkan sertifikat PEM yang disandikan di sini.",
<mask> "encryption_status": "Status",
<mask> "encryption_expire": "Kedaluwarsa",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 3feadfe31609ef52726b582ad6ba18bfa435a081
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 3 16:34:36 2022 +0300
client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);",
</s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);",
</s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);",
</s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a | client/src/__locales/id.json |
"example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", | <mask> "example_upstream_regular": "DNS regolare (over UDP);",
<mask> "example_upstream_udp": "DNS regolare (over UDP, nome host);",
<mask> "example_upstream_dot": "<0>DNS su TLS</0> crittografato;",
<mask> "example_upstream_doh": "<0>DNS su HTTPS</0> crittografato;",
<mask> "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);",
<mask> "example_upstream_sdns": "<0>DNS Stamps</0> per <1>DNSCrypt</1> oppure i risolutori <2>DNS su HTTPS</2>;",
<mask> "example_upstream_tcp": "DNS regolare (over TCP);",
<mask> "example_upstream_tcp_hostname": "DNS regolare (over TCP, nome host);",
<mask> "all_lists_up_to_date_toast": "Tutti gli elenchi sono aggiornati",
<mask> "updated_upstream_dns_toast": "I server upstream sono stati salvati correttamente",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 3feadfe31609ef52726b582ad6ba18bfa435a081
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 3 16:34:36 2022 +0300
client: upd i18n </s> remove "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);",
</s> add "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);",
</s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.",
</s> add "encryption_doq": "Port DNS-over-QUIC ",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a | client/src/__locales/it.json |
"example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0>;", | <mask> "example_upstream_regular": "standaard DNS (over UDP);",
<mask> "example_upstream_udp": "standaard DNS (via UDP, hostnaam);",
<mask> "example_upstream_dot": "versleutelde <0>DNS-via-TLS</0>;",
<mask> "example_upstream_doh": "versleutelde <0>DNS-via-HTTPS</0>;",
<mask> "example_upstream_doq": "versleutelde <0>DNS-via-QUIC</0> (experimenteel);",
<mask> "example_upstream_sdns": "<0>DNS Stamps</0> voor <1>DNSCrypt</1> of <2>DNS-via-HTTPS</2> oplossingen;",
<mask> "example_upstream_tcp": "standaard DNS (over TCP);",
<mask> "example_upstream_tcp_hostname": "standaard DNS (via TCP, hostnaam);",
<mask> "all_lists_up_to_date_toast": "Alle lijsten zijn reeds actueel",
<mask> "updated_upstream_dns_toast": "Upstream-servers succesvol opgeslagen",
</s> Pull request: client: upd i18n
Merge in DNS/adguard-home from upd-i18n to master
Squashed commit of the following:
commit 3feadfe31609ef52726b582ad6ba18bfa435a081
Author: Ainar Garipov <[email protected]>
Date: Fri Jun 3 16:34:36 2022 +0300
client: upd i18n </s> remove "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0> (eksperimental);",
</s> add "example_upstream_doq": "terenkripsi <0>DNS-over-QUIC</0>;", </s> remove "example_upstream_doq": "<0>DNS su QUIC</0> crittografato (sperimentale);",
</s> add "example_upstream_doq": "<0>DNS su QUIC</0> crittografato;", </s> remove "encryption_doq": "Port DNS-over-QUIC (eksperimental)",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini. Ini adalah eksperimental dan mungkin tidak dapat diandalkan. Juga, tidak banyak klien yang mendukungnya saat ini.",
</s> add "encryption_doq": "Port DNS-over-QUIC ",
"encryption_doq_desc": "Jika port ini diatur secara sepesifik, AdGuard Home akan menjalankan server DNS-lewat-QUIC pada port ini.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/368a98fb296da349ed7fb99b03c4ed6b7d0dda3a | client/src/__locales/nl.json |
<mask> "strconv"
<mask> "syscall"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/log"
<mask> "github.com/gobuffalo/packr"
<mask> "golang.org/x/crypto/ssh/terminal"
<mask> )
<mask>
<mask> // VersionString will be set through ldflags, contains current version
</s> move log wrapper library outside into hmage/golibs/log </s> remove "github.com/AdguardTeam/AdGuardHome/log"
</s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log"
</s> add "github.com/hmage/golibs/log" </s> remove "github.com/AdguardTeam/AdGuardHome/log"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/log"
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/368e2d1ebd51bbb48a6df208299630666853f985 | app.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.