docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
"upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https://1.1.1.1/' target='_blank'>Cloudflare DNS</a> as an upstream.",
<mask> "dns_settings": "DNS settings", <mask> "encryption_settings": "Encryption settings", <mask> "dhcp_settings": "DHCP settings", <mask> "upstream_dns": "Upstream DNS servers", <mask> "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' targ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"example_upstream_dot": "encrypted <0>DNS-over-TLS</0>", "example_upstream_doh": "encrypted <0>DNS-over-HTTPS</0>", "example_upstream_sdns": "you can use <0>DNS Stamps</0> for <1>DNSCrypt</1> or <2>DNS-over-HTTPS</2> resolvers",
<mask> "example_comment_meaning": "just a comment", <mask> "example_comment_hash": "# Also a comment", <mask> "example_regex_meaning": "block access to the domains matching the <0>specified regular expression</0>", <mask> "example_upstream_regular": "regular DNS (over UDP)", <mask> "example_ups...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"install_devices_router_list_1": "Open the preferences for your router. Usually, you can access it from your browser via a URL (like http://192.168.0.1/ or http://192.168.1.1/). You may be asked to enter the password. If you don't remember it, you can often reset the password by pressing a button on the router itse...
<mask> "install_submit_desc": "The setup procedure is finished and you are ready to start using AdGuard Home.", <mask> "install_devices_router": "Router", <mask> "install_devices_router_desc": "This setup will automatically cover all the devices connected to your home router and you will not need to conf...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.",
<mask> "install_devices_windows_list_1": "Open Control Panel through Start menu or Windows search.", <mask> "install_devices_windows_list_2": "Go to Network and Internet category and then to Network and Sharing Center.", <mask> "install_devices_windows_list_3": "On the left side of the screen find Change...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface",
<mask> "next": "Next", <mask> "open_dashboard": "Open Dashboard", <mask> "install_saved": "Saved successfully", <mask> "encryption_title": "Encryption", <mask> "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface", <mask> "encryption_config_saved": "Encr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '/dns-query' location.",
<mask> "encryption_server_desc": "In order to use HTTPS, you need to enter the server name that matches your SSL certificate.", <mask> "encryption_redirect": "Redirect to HTTPS automatically", <mask> "encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_certificates_desc": "In order to use encryption, you need to provide a valid SSL certificates chain for your domain. You can get a free certificate on <0>{{link}}</0> or you can buy it from one of the trusted Certificate Authorities.", "encryption_certificates_input": "Copy/paste your PEM-encoded ce...
<mask> "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\/dns-query' location.", <mask> "encryption_dot": "DNS-over-TLS port", <mask> "encryption_dot_desc": "If this port is configured, AdGuard Ho...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.",
<mask> "encryption_certificates_input": "Copy\/paste your PEM-encoded certificates here.", <mask> "encryption_status": "Status", <mask> "encryption_expire": "Expires", <mask> "encryption_key": "Private key", <mask> "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certi...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.", "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.",
<mask> "encryption_subject": "Subject", <mask> "encryption_issuer": "Issuer", <mask> "encryption_hostnames": "Hostnames", <mask> "encryption_reset": "Are you sure you want to reset encryption settings?", <mask> "topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.",
<mask> "form_error_port_unsafe": "This is an unsafe port", <mask> "form_error_equal": "Shouldn't be equal", <mask> "form_error_password": "Password mismatched", <mask> "reset_settings": "Reset settings", <mask> "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.",
<mask> "setup_guide": "Setup guide", <mask> "dns_addresses": "DNS addresses", <mask> "down": "Down", <mask> "fix": "Fix", <mask> "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.", <mask> "update_now": "Update now", <mask> "update_failed": "Auto-update fa...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"update_failed": "Auto-update failed. Please <a href='https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#update'>follow the steps</a> to update manually.",
<mask> "down": "Down", <mask> "fix": "Fix", <mask> "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.", <mask> "update_now": "Update now", <mask> "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Star...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"client_identifier_desc": "Clients can be identified by the IP address or MAC address. Please note, that using MAC as identifier is possible only if AdGuard Home is also a <0>DHCP server</0>",
<mask> "client_new": "New Client", <mask> "client_edit": "Edit Client", <mask> "client_identifier": "Identifier", <mask> "ip_address": "IP address", <mask> "client_identifier_desc": "Clients can be identified by the IP address or MAC address. Please note, that using MAC as identifier is possibl...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"stats_malware_phishing": "Malware/phishing bloqueado",
<mask> "disabled_protection": "Protecci\u00f3n deshabilitada", <mask> "refresh_statics": "Restablecer estad\u00edsticas", <mask> "dns_query": "Consultas DNS", <mask> "blocked_by": "Bloqueado por filtros", <mask> "stats_malware_phishing": "Malware\/phishing bloqueado", <mask> "stats_adult":...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/es.json
"example_upstream_dot": "cifrado <0>DNS mediante TLS</0>", "example_upstream_doh": "cifrado <0>DNS mediante HTTPS</0>", "example_upstream_sdns": "puedes usar <0>DNS Stamps</0> para <1>DNSCrypt</1> o resolutores <2>DNS mediante HTTPS</2>",
<mask> "example_comment_meaning": "solo un comentario", <mask> "example_comment_hash": "# Tambi\u00e9n un comentario", <mask> "example_regex_meaning": "bloquear el acceso a los dominios que coincidan con la expresi\u00f3n regular especificada", <mask> "example_upstream_regular": "DNS regular (median...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/es.json
<mask> "last_dns_queries": "5000 derni\u00e8res requ\u00eates DNS", <mask> "previous_btn": "Pr\u00e9c\u00e9dent", <mask> "next_btn": "Suivant", <mask> "loading_table_status": "Chargement en cours ...", <mask> "page_table_footer_text": "Page", <mask> "of_table_footer_text": "de", <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/fr.json
"stats_malware_phishing": "Bloqueado malware/phishing",
<mask> "disabled_protection": "Prote\u00e7\u00e3o desativada", <mask> "refresh_statics": "Atualizar estat\u00edsticas", <mask> "dns_query": "Consultas de DNS", <mask> "blocked_by": "Bloqueador por filtros", <mask> "stats_malware_phishing": "Bloqueado malware\/phishing", <mask> "stats_adult...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/pt-br.json
"encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.",
<mask> "encryption_certificates_input": "Copie\/cole aqui seu certificado codificado em PEM.", <mask> "encryption_status": "Status", <mask> "encryption_expire": "Expira", <mask> "encryption_key": "Chave privada", <mask> "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/pt-br.json
<mask> "version": "version", <mask> "address": "adress", <mask> "on": "P\u00c5", <mask> "off": "AV", <mask> "copyright": "Copyright", <mask> "homepage": "Hemsida", <mask> "report_an_issue": "Rapportera ett problem", <mask> "enable_protection": "Koppla p\u00e5 skydd", <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/sv.json
"stats_malware_phishing": "Blockerad skadekod/phising",
<mask> "disabled_protection": "Kopplade bort skydd", <mask> "refresh_statics": "Uppdatera statistik", <mask> "dns_query": "DNS-f\u00f6rfr\u00e5gningar", <mask> "blocked_by": "Blockerat av filter", <mask> "stats_malware_phishing": "Blockerad skadekod\/phising", <mask> "stats_adult": "Blocke...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/sv.json
returnEmptyString: false, // count empty value as invalid
<mask> fallbackLng: 'en', <mask> keySeparator: false, // we use content as keys <mask> nsSeparator: false, // Fix character in content <mask> interpolation: { <mask> escapeValue: false, // not needed for react!! <mask> }, <mask> react: { </s> + transla...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/i18n.js
<mask> const fs = require('fs'); <mask> const path = require('path'); <mask> const crypto = require('crypto'); <mask> const requestPromise = require('request-promise'); <mask> <mask> const LOCALES_DIR = '../../client/src/__locales'; <mask> const LOCALES_LIST = [ <mask> 'en', </s> + translations: add twosk...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
const BASE_FILE = 'en.json'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home';
<mask> 'zh-tw', <mask> 'bg', <mask> 'zh-cn', <mask> ]; <mask> <mask> /** <mask> * Prepare params to get translations from twosky <mask> * @param {string} locale language shortcut <mask> * @param {object} twosky config twosky <mask> */ </s> + translations: add twosky integration </s> remove ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* Prepare params to get translations from twosky
<mask> 'zh-cn', <mask> ]; <mask> <mask> /** <mask> * Hash content <mask> * @param {string} content <mask> */ <mask> const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex'); <mask> <mask> /** <mask> * Prepare params to get translations from oneskyapp <mask> * @...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* @param {object} twosky config twosky
<mask> <mask> /** <mask> * Prepare params to get translations from oneskyapp <mask> * @param {string} locale language shortcut <mask> * @param {object} oneskyapp config oneskyapp <mask> */ <mask> const prepare = (locale, oneskyapp) => { <mask> const timestamp = Math.round(new Date().getTime() / 1000); ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`;
<mask> * Prepare params to get translations from oneskyapp <mask> * @param {string} locale language shortcut <mask> * @param {object} oneskyapp config oneskyapp <mask> */ <mask> const prepare = (locale, oneskyapp) => { <mask> const timestamp = Math.round(new Date().getTime() / 1000); <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
let normalizedBody = removeEmpty(JSON.parse(body));
<mask> * @param {any} body <mask> */ <mask> function writeInFile(filename, body) { <mask> return new Promise((resolve, reject) => { <mask> if (typeof normalizedBody !== 'string') { <mask> try { <mask> normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-di...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
if (typeof normalizedBody !== 'string') {
<mask> * @param {any} body <mask> */ <mask> function writeInFile(filename, body) { <mask> return new Promise((resolve, reject) => { <mask> if (typeof body !== 'string') { <mask> try { <mask> body = JSON.stringify(body, null, 4); // eslint-disable-line <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line
<mask> function writeInFile(filename, body) { <mask> return new Promise((resolve, reject) => { <mask> if (typeof body !== 'string') { <mask> try { <mask> body = JSON.stringify(body, null, 4); // eslint-disable-line <mask> } catch (err) { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
fs.writeFile(filename, normalizedBody, (err) => {
<mask> reject(err); <mask> } <mask> } <mask> <mask> fs.writeFile(filename, body, (err) => { <mask> if (err) reject(err); <mask> resolve('Ok'); <mask> }); <mask> }); <mask> } </s> + translations: add twosky integration </s> remov...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* Clear initial from empty value keys * @param {object} initialObject */ function removeEmpty(initialObject) { let processedObject = {}; Object.keys(initialObject).forEach(prop => { if (initialObject[prop]) { processedObject[prop] = initialObject[prop]; } }); return proces...
<mask> }); <mask> } <mask> <mask> /** <mask> * Request to server onesky <mask> * @param {string} url <mask> * @param {string} locale <mask> */ <mask> const request = (url, locale) => ( <mask> requestPromise.get(url) </s> + translations: add twosky integration </s> remove * @param {object} onesk...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
if (!TWOSKY_URI) { console.error('No credentials'); return;
<mask> * Download locales <mask> */ <mask> const download = () => { <mask> const locales = LOCALES_LIST; <mask> let oneskyapp; <mask> try { <mask> oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json')); <mask> } catch (err) { <mask> throw new Error(err); <mask> } <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
const url = getRequestUrl(locale, TWOSKY_URI, TWOSKY_PROJECT_ID);
<mask> throw new Error(err); <mask> } <mask> <mask> const requests = locales.map((locale) => { <mask> const url = prepare(locale, oneskyapp); <mask> return request(url, locale); <mask> }); <mask> <mask> Promise <mask> .all(requests) </s> + translations: add t...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
<mask> const path = require('path'); <mask> const fs = require('fs'); <mask> const crypto = require('crypto'); <mask> const request = require('request-promise'); <mask> <mask> const LOCALES_DIR = '../../client/src/__locales'; <mask> <mask> /** </s> + translations: add twosky integration </s> remove const cry...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home';
<mask> const crypto = require('crypto'); <mask> const request = require('request-promise'); <mask> <mask> const LOCALES_DIR = '../../client/src/__locales'; <mask> <mask> /** <mask> * Hash content <mask> * <mask> * @param {string} content <mask> */ <mask> const hashString = content => crypto.createHash(...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
const getRequestData = (url, projectId) => {
<mask> <mask> /** <mask> * Prepare post params <mask> */ <mask> const prepare = () => { <mask> let oneskyapp; <mask> try { <mask> oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json')); <mask> } catch (err) { <mask> throw new Error(err); <mask> } <mask> <mask> c...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)),
<mask> <mask> const url = `${oneskyapp.url}${oneskyapp.projectId}/files`; <mask> const timestamp = Math.round(new Date().getTime() / 1000); <mask> const formData = { <mask> timestamp, <mask> file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')), <mask> file_format: ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
return { url: `${url}/upload`, formData };
<mask> api_key: oneskyapp.apiKey, <mask> dev_hash: hashString(timestamp + oneskyapp.secretKey), <mask> }; <mask> <mask> return { url, formData }; <mask> }; <mask> <mask> /** <mask> * Make request to onesky to upload new json <mask> */ </s> + translations: add twosky integration </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
* Make request to twosky to upload new json
<mask> return { url, formData }; <mask> }; <mask> <mask> /** <mask> * Make request to onesky to upload new json <mask> */ <mask> const upload = () => { <mask> const { url, formData } = prepare(); <mask> request <mask> .post({ url, formData }) </s> + translations: add twosky integration...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
if (!TWOSKY_URI) { console.error('No credentials'); return; } const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID);
<mask> /** <mask> * Make request to onesky to upload new json <mask> */ <mask> const upload = () => { <mask> const { url, formData } = prepare(); <mask> request <mask> .post({ url, formData }) <mask> .catch(err => console.log(err)); <mask> }; <mask> </s> + translations: add twosky ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
onceQueryLog.Do(func() {
<mask> d.ParentalBlockHost = c.Val() <mask> } <mask> case "querylog": <mask> d.QueryLogEnabled = true <mask> once.Do(func() { <mask> go startQueryLogServer() // TODO: how to handle errors? <mask> }) <mask> } <mask> } <mask> } </s> Fix registration of metrics if querylog is ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
onceMetrics.Do(func() {
<mask> return d <mask> }) <mask> <mask> c.OnStartup(func() error { <mask> once.Do(func() { <mask> m := dnsserver.GetConfig(c).Handler("prometheus") <mask> if m == nil { <mask> return <mask> } <mask> if x, ok := m.(*metrics.Metrics); ok { </s> Fix registration of metrics if querylog is ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
logRequest(r, rrw.Msg, result, time.Since(start), ip)
<mask> } <mask> <mask> // log <mask> if d.QueryLogEnabled { <mask> logRequest(rrw.Msg, result, time.Since(start), ip) <mask> } <mask> return rcode, err <mask> } <mask> <mask> func (d *Plugin) Name() string { return "dnsfilter" } </s> Fix registration of metrics if querylog is enabled </s> remove var...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
var onceMetrics, onceQueryLog sync.Once
<mask> } <mask> <mask> func (d *Plugin) Name() string { return "dnsfilter" } <mask> <mask> var once sync.Once </s> Fix registration of metrics if querylog is enabled </s> remove logRequest(rrw.Msg, result, time.Since(start), ip) </s> add logRequest(r, rrw.Msg, result, time.Since(start), ip) </s> remove o...
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
type plugSettings struct { SafeBrowsingBlockHost string ParentalBlockHost string QueryLogEnabled bool BlockedTTL uint32 // in seconds, default 3600 }
<mask> }) <mask> } <mask> <mask> type plug struct { <mask> d *dnsfilter.Dnsfilter <mask> Next plugin.Handler <mask> upstream upstream.Upstream </s> Fix more race conditions found by race detector </s> remove SafeBrowsingBlockHost string ParentalBlockHost string QueryLogEnabled bool...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
settings plugSettings
<mask> d *dnsfilter.Dnsfilter <mask> Next plugin.Handler <mask> upstream upstream.Upstream <mask> hosts map[string]net.IP <mask> <mask> SafeBrowsingBlockHost string <mask> ParentalBlockHost string <mask> QueryLogEnabled bool <mask> BlockedTTL uint32 // in seconds, de...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
var defaultPluginSettings = plugSettings{
<mask> <mask> sync.RWMutex <mask> } <mask> <mask> var defaultPlugin = plug{ <mask> SafeBrowsingBlockHost: "safebrowsing.block.dns.adguard.com", <mask> ParentalBlockHost: "family.block.dns.adguard.com", <mask> BlockedTTL: 3600, // in seconds <mask> } <mask> </s> Fix more race conditions ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), }
<mask> // coredns handling functions <mask> // <mask> func setupPlugin(c *caddy.Controller) (*plug, error) { <mask> // create new Plugin and copy default values <mask> var p = new(plug) <mask> *p = defaultPlugin <mask> p.d = dnsfilter.New() <mask> p.hosts = make(map[string]net.IP) <mask> <mask> filterF...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
p.settings.ParentalBlockHost = c.Val()
<mask> if c.NextArg() { <mask> if len(c.Val()) == 0 { <mask> return nil, c.ArgErr() <mask> } <mask> p.ParentalBlockHost = c.Val() <mask> } <mask> case "blocked_ttl": <mask> if !c.NextArg() { <mask> return nil, c.ArgErr() <mask> } </s> Fix more race conditions foun...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
p.settings.BlockedTTL = uint32(blockttl)
<mask> blockttl, err := strconv.ParseUint(c.Val(), 10, 32) <mask> if err != nil { <mask> return nil, c.ArgErr() <mask> } <mask> p.BlockedTTL = uint32(blockttl) <mask> case "querylog": <mask> p.QueryLogEnabled = true <mask> onceQueryLog.Do(func() { <mask> go startQueryLogSer...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
p.settings.QueryLogEnabled = true
<mask> return nil, c.ArgErr() <mask> } <mask> p.BlockedTTL = uint32(blockttl) <mask> case "querylog": <mask> p.QueryLogEnabled = true <mask> onceQueryLog.Do(func() { <mask> go startQueryLogServer() // TODO: how to handle errors? <mask> }) <mask> } <mask> } </s> Fix more ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val))
<mask> var records []dns.RR <mask> log.Println("Will give", val, "instead of", host) <mask> if addr != nil { <mask> // this is an IP address, return it <mask> result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val)) <mask> if err != nil { <mask> log.Printf("Got error %s\n", err) ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET}
<mask> // generate SOA record that makes DNS clients cache NXdomain results <mask> // the only value that is important is TTL in header, other values like refresh, retry, expire and minttl are irrelevant <mask> func (p *plug) genSOA(r *dns.Msg) []dns.RR { <mask> zone := r.Question[0].Name <mask> header := dns.RR...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
val := p.settings.SafeBrowsingBlockHost
<mask> if result.IsFiltered { <mask> switch result.Reason { <mask> case dnsfilter.FilteredSafeBrowsing: <mask> // return cname safebrowsing.block.dns.adguard.com <mask> val := p.SafeBrowsingBlockHost <mask> rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
val := p.settings.ParentalBlockHost
<mask> } <mask> return rcode, result, err <mask> case dnsfilter.FilteredParental: <mask> // return cname family.block.dns.adguard.com <mask> val := p.ParentalBlockHost <mask> rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) <mask> if err != nil { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
if p.settings.QueryLogEnabled {
<mask> rcode = dns.RcodeServerFailure <mask> } <mask> <mask> // log <mask> if p.QueryLogEnabled { <mask> logRequest(r, rrw.Msg, result, time.Since(start), ip) <mask> } <mask> return rcode, err <mask> } <mask> </s> Fix more race conditions found by race detector </s> remove val := p.ParentalBlo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
json, err := json.MarshalIndent(&statistics, "", " ")
<mask> func writeStats() error { <mask> statsFile := filepath.Join(config.ourBinaryDir, "stats.json") <mask> log.Printf("Writing JSON file: %s", statsFile) <mask> statistics.RLock() <mask> json, err := json.MarshalIndent(statistics, "", " ") <mask> statistics.RUnlock() <mask> if err != nil { <mask> log...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
stats.go
github.com/stretchr/testify v1.7.0
<mask> github.com/rogpeppe/go-internal v1.7.0 // indirect <mask> github.com/satori/go.uuid v1.2.0 <mask> github.com/sirupsen/logrus v1.8.1 // indirect <mask> github.com/spf13/cobra v1.1.3 // indirect <mask> github.com/stretchr/testify v1.6.1 <mask> github.com/ti-mo/netfilter v0.4.0 <mask> github.com/u-roo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
go.mod
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
<mask> github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= <mask> github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= <mask> github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= <mask> github.com/stretchr/testi...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
go.sum
"github.com/AdguardTeam/golibs/log"
<mask> import ( <mask> "fmt" <mask> "strings" <mask> ) <mask> <mask> // Error is the constant error type. <mask> type Error string <mask> <mask> // Error implements the error interface for Error. </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to ma...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr.go
// // TODO(a.garipov): Clearify the function usage.
<mask> // <mask> // msg must contain the final ": %w" verb. <mask> func Annotate(msg string, errPtr *error, args ...interface{}) { <mask> if errPtr == nil { <mask> return <mask> } <mask> <mask> err := *errPtr </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-address...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr.go
"bytes"
<mask> package agherr <mask> <mask> import ( <mask> "errors" <mask> "fmt" <mask> "testing" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest" </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr_test.go
"github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "errors" <mask> "fmt" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestError_Error(t *testing.T) { <mask> testCases := []struct { </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr_test.go
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "io/ioutil" <mask> "regexp" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> ) <mask> <mask> // hardwarePortInfo - information obtained using MacOS networksetup <mask> // about the current state of the internet connection <mask> type hardwarePortInfo struct...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
_, out, err := aghos.RunCommand("networksetup", "-listallhardwareports")
<mask> // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command <mask> // it returns a map where the key is the interface name, and the value is the "hardware port" <mask> // returns nil if it fails to parse the output <mask> func getNetworkSetupHardwareReports() map[s...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
_, out, err := aghos.RunCommand("networksetup", "-getinfo", hardwarePort)
<mask> <mask> func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) { <mask> h := hardwarePortInfo{} <mask> <mask> _, out, err := util.RunCommand("networksetup", "-getinfo", hardwarePort) <mask> if err != nil { <mask> return h, err <mask> } <mask> <mask> re := regexp.MustCompile("I...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
code, _, err := aghos.RunCommand("networksetup", args...)
<mask> args = append(args, "-setdnsservers", portInfo.name) <mask> args = append(args, dnsAddrs...) <mask> <mask> // Setting DNS servers is necessary when configuring a static IP <mask> code, _, err := util.RunCommand("networksetup", args...) <mask> if err != nil { <mask> return err <mask> } <mask> i...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
code, _, err = aghos.RunCommand("networksetup", "-setmanual",
<mask> return fmt.Errorf("failed to set DNS servers, code=%d", code) <mask> } <mask> <mask> // Actually configures hardware port to have static IP <mask> code, _, err = util.RunCommand("networksetup", "-setmanual", <mask> portInfo.name, portInfo.ip, portInfo.subnet, portInfo.gatewayIP) <mask> if err != ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
import ( "fmt" "os/exec" "syscall" )
<mask> // Package aghos contains utilities for functions requiring system calls. <mask> package aghos <mask> <mask> import "syscall" <mask> <mask> // CanBindPrivilegedPorts checks if current process can bind to privileged <mask> // ports. <mask> func CanBindPrivilegedPorts() (can bool, err error) { <mask> r...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghos/os.go
"errors"
<mask> <mask> import ( <mask> "crypto/sha256" <mask> "encoding/hex" <mask> "fmt" <mask> "net" <mask> "strings" <mask> "sync" <mask> </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. Updates #2846. Squashed...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
<mask> "net" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> // TestUpstream is a mock of real upstream. <mask> type TestUpstream struct { </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
// We don't use an agherr.Error to avoid the import cycle since aghtests // used to provide the utilities for testing which agherr (and any other // testable package) should be able to use. return nil, errors.New("bad")
<mask> type TestErrUpstream struct{} <mask> <mask> // Exchange always returns nil Msg and non-nil error. <mask> func (u *TestErrUpstream) Exchange(*dns.Msg) (*dns.Msg, error) { <mask> return nil, agherr.Error("bad") <mask> } <mask> <mask> // Address always returns an empty string. <mask> func (u *TestErrUps...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
<mask> package home <mask> <mask> import ( <mask> "encoding/json" <mask> "errors" <mask> "fmt" <mask> "net" <mask> "net/http" <mask> "net/url" <mask> "runtime" </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "strconv" <mask> "strings" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/internal/version" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/NYTimes/gziphandler" <mask> ) <mask> </s> Pull request: 2704 local resolve...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
host, err := aghnet.SplitHost(r.Host)
<mask> if web.httpsServer.server == nil { <mask> return true <mask> } <mask> <mask> host, _, err := net.SplitHostPort(r.Host) <mask> if err != nil { <mask> // Check for the missing port error. If it is that error, just <mask> // use the host as is. <mask> // <mask> // See the source code for n...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
httpError(w, http.StatusBadRequest, "bad host: %s", err)
<mask> } <mask> <mask> host, _, err := net.SplitHostPort(r.Host) <mask> if err != nil { <mask> // Check for the missing port error. If it is that error, just <mask> // use the host as is. <mask> // <mask> // See the source code for net.SplitHostPort. <mask> const missingPort = "missing port in a...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
return false
<mask> // <mask> // See the source code for net.SplitHostPort. <mask> const missingPort = "missing port in address" <mask> <mask> addrErr := &net.AddrError{} <mask> if !errors.As(err, &addrErr) || addrErr.Err != missingPort { <mask> httpError(w, http.StatusBadRequest, "bad host: %s", err) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
"github.com/AdguardTeam/AdGuardHome/internal/agherr"
<mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. Updates #2846. Squash...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
<mask> <mask> // shutdownTimeout is the timeout for shutting HTTP server down operation. <mask> const shutdownTimeout = 5 * time.Second <mask> <mask> func logPanic() { <mask> if v := recover(); v != nil { <mask> log.Error("recovered from panic: %v", v) <mask> } <mask> } <mask> <mask> func shutdownSrv(...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
defer agherr.LogPanic("")
<mask> } <mask> } <mask> <mask> func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) { <mask> defer logPanic() <mask> <mask> if srv == nil { <mask> return <mask> } <mask> </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=")
<mask> data, err := ioutil.ReadFile(pidfile) <mask> if os.IsNotExist(err) { <mask> var code int <mask> var psdata string <mask> code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=") <mask> if err != nil || code != 0 { <mask> log.Error("Can't find AdGuardHome process: %s code:%d...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/service.go
code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action)
<mask> // runInitdCommand runs init.d service command <mask> // returns command code or error if any <mask> func runInitdCommand(action string) (int, error) { <mask> confPath := "/etc/init.d/" + serviceName <mask> code, _, err := util.RunCommand("sh", "-c", confPath+" "+action) <mask> return code, err <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/service.go
<mask> package querylog <mask> <mask> import ( <mask> "errors" <mask> "io" <mask> "testing" <mask> "time" <mask> <mask> "github.com/stretchr/testify/assert" </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. ...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/querylog/qlogreader_test.go
assert.ErrorIs(t, err, tc.want)
<mask> ts, err := time.Parse(time.RFC3339Nano, tc.time) <mask> require.Nil(t, err) <mask> <mask> err = r.SeekTS(ts.UnixNano()) <mask> assert.True(t, errors.Is(err, tc.want), err) <mask> }) <mask> } <mask> } <mask> <mask> func TestQLogReader_ReadNext(t *testing.T) { </s> Pull request: 2704 lo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/querylog/qlogreader_test.go
<mask> package util <mask> <mask> import ( <mask> "bytes" <mask> "fmt" <mask> "io/ioutil" <mask> "os/exec" <mask> "path/filepath" <mask> "runtime" <mask> "strings" </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Update...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
<mask> import ( <mask> "bytes" <mask> "fmt" <mask> "io/ioutil" <mask> "os/exec" <mask> "path/filepath" <mask> "runtime" <mask> "strings" <mask> ) <mask> </s> Pull request: 2704 local resolvers vol.1 Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master Updates #2704. Updates #2829. Up...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
<mask> "runtime" <mask> "strings" <mask> ) <mask> <mask> // RunCommand runs shell command. <mask> func RunCommand(command string, arguments ...string) (int, string, error) { <mask> cmd := exec.Command(command, arguments...) <mask> out, err := cmd.Output() <mask> if err != nil { <mask> return 1, "", fm...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
env GOOS='openbsd' "$(GO.MACRO)" vet ./internal/...
<mask> env GOOS='darwin' "$(GO.MACRO)" vet ./internal/... <mask> env GOOS='freebsd' "$(GO.MACRO)" vet ./internal/... <mask> env GOOS='linux' "$(GO.MACRO)" vet ./internal/... <mask> env GOOS='windows' "$(GO.MACRO)" vet ./internal/... <mask> <mask> openapi-lint: ; cd ./openapi/ && $(YARN) test </s> Pull re...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
Makefile
"github.com/AdguardTeam/golibs/errors"
<mask> "os/exec" <mask> "syscall" <mask> ) <mask> <mask> // ErrUnsupported is returned when the functionality is unsupported on the <mask> // current operating system. </s> Pull request: all: openbsd support Updates #2439. Squashed commit of the following: commit 3ff109e43751132d77500256c8869938680ac281 Au...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
// ErrUnsupported is returned when the functionality is unsupported on the // current operating system. // // TODO(a.garipov): Make a structured error and use it everywhere instead of // a bunch of fmt.Errorf and all that. const ErrUnsupported errors.Error = "unsupported"
<mask> ) <mask> <mask> // CanBindPrivilegedPorts checks if current process can bind to privileged <mask> // ports. <mask> func CanBindPrivilegedPorts() (can bool, err error) { <mask> return canBindPrivilegedPorts() <mask> } </s> Pull request: all: openbsd support Updates #2439. Squashed commit of the follow...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
// SetRlimit sets user-specified limit of how many fd's we can use. // // See https://github.com/AdguardTeam/AdGuardHome/internal/issues/659. func SetRlimit(val uint64) (err error) { return setRlimit(val)
<mask> func CanBindPrivilegedPorts() (can bool, err error) { <mask> return canBindPrivilegedPorts() <mask> } <mask> <mask> // SetRlimit sets user-specified limit of how many fd's we can use <mask> // https://github.com/AdguardTeam/AdGuardHome/internal/issues/659. <mask> func SetRlimit(val uint) { <mask> setR...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
<mask> <mask> import ( <mask> "os" <mask> "syscall" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> func canBindPrivilegedPorts() (can bool, err error) { <mask> return HaveAdminRights() <mask> } </s> Pull request: all: openbsd support Updates #2439. Squashed commit of the f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
func setRlimit(val uint64) (err error) {
<mask> func canBindPrivilegedPorts() (can bool, err error) { <mask> return HaveAdminRights() <mask> } <mask> <mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = uint64(val) <mask> rlim.Cur = uint64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
<mask> } <mask> <mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = uint64(val) <mask> rlim.Cur = uint64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> if err != nil { <mask> log.Error("Setrlimit() failed: %v", err) <mask> } <mask> } <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
<mask> <mask> import ( <mask> "os" <mask> "syscall" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> func canBindPrivilegedPorts() (can bool, err error) { <mask> return HaveAdminRights() <mask> } </s> Pull request: all: openbsd support Updates #2439. Squashed commit of the f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
func setRlimit(val uint64) (err error) {
<mask> func canBindPrivilegedPorts() (can bool, err error) { <mask> return HaveAdminRights() <mask> } <mask> <mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = int64(val) <mask> rlim.Cur = int64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> if...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
<mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = int64(val) <mask> rlim.Cur = int64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> if err != nil { <mask> log.Error("Setrlimit() failed: %v", err) <mask> } <mask> } <mask> <mask> func haveAdm...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
<mask> "path/filepath" <mask> "strings" <mask> "syscall" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "golang.org/x/sys/unix" <mask> ) <mask> <mask> func canBindPrivilegedPorts() (can bool, err error) { <mask> cnbs, err := unix.PrctlRetInt(unix.PR_CAP_AMBIENT, unix.PR_CAP_AMBIENT_IS_SET, u...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go
func setRlimit(val uint64) (err error) {
<mask> <mask> return cnbs == 1 || adm, err <mask> } <mask> <mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = uint64(val) <mask> rlim.Cur = uint64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> if err != nil { </s> Pull request: all: openbsd ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go
rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
<mask> } <mask> <mask> func setRlimit(val uint) { <mask> var rlim syscall.Rlimit <mask> rlim.Max = uint64(val) <mask> rlim.Cur = uint64(val) <mask> err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) <mask> if err != nil { <mask> log.Error("Setrlimit() failed: %v", err) <mask> } <mask> } <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go