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
|
---|---|---|---|---|
"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\/' target='_blank'>Cloudflare DNS<\/a> as an upstream.",
<mask> "test_upstream_btn": "Test upstreams",
<mask> "apply_btn": "Apply",
<mask> "disabled_filtering_toast": "Disabled filtering",
<mask> "enabled_filtering_toast": "Enabled filtering",
<mask> "disabled_safe_browsing_toast": "Disabled safebrowsing",
</s> + translations: add twosky integration </s> remove "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH\/DoT resolvers you specify as upstreams.",
</s> add "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams.", </s> remove "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.",
</s> add "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.", </s> remove "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)<\/0>",
</s> add "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)</0>", </s> remove "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.",
</s> add "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", | [
"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_upstream_dot": "encrypted <0>DNS-over-TLS<\/0>",
<mask> "example_upstream_doh": "encrypted <0>DNS-over-HTTPS<\/0>",
<mask> "example_upstream_sdns": "you can use <0>DNS Stamps<\/0> for <1>DNSCrypt<\/1> or <2>DNS-over-HTTPS<\/2> resolvers",
<mask> "example_upstream_tcp": "regular DNS (over TCP)",
<mask> "all_filters_up_to_date_toast": "All filters are already up-to-date",
<mask> "updated_upstream_dns_toast": "Updated the upstream DNS servers",
<mask> "dns_test_ok_toast": "Specified DNS servers are working correctly",
<mask> "dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly",
</s> + translations: add twosky integration </s> remove "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>",
</s> add "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>", </s> remove "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)<\/0>",
</s> add "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)</0>", </s> remove "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH\/DoT resolvers you specify as upstreams.",
</s> add "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters<\/a> settings.",
</s> add "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters</a> settings.", | [
"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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", | <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 configure each of them manually.",
<mask> "install_devices_address": "AdGuard Home DNS server is listening on the following addresses",
<mask> "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
<mask> "install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
<mask> "install_devices_router_list_3": "Enter your AdGuard Home server addresses there.",
<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 adapter settings and click on it.",
<mask> "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.",
</s> + translations: add twosky integration </s> remove "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP\/IP) in the list, select it and then click on Properties again.",
</s> add "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "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.",
</s> add "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.", </s> remove "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters<\/a> settings.",
</s> add "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters</a> settings.", </s> remove "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface",
</s> add "encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface", | [
"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 adapter settings and click on it.",
<mask> "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.",
<mask> "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_6": "Choose Use the following DNS server addresses and enter your AdGuard Home server addresses.",
<mask> "install_devices_macos_list_1": "Click on Apple icon and go to System Preferences.",
<mask> "install_devices_macos_list_2": "Click on Network.",
<mask> "install_devices_macos_list_3": "Select the first connection in your list and click Advanced.",
<mask> "install_devices_macos_list_4": "Select the DNS tab and enter your AdGuard Home server addresses.",
</s> + translations: add twosky integration </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "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.",
</s> add "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.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface",
</s> add "encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface", </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", | [
"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": "Encryption config saved",
<mask> "encryption_server": "Server name",
<mask> "encryption_server_enter": "Enter your domain name",
<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",
</s> + translations: add twosky integration </s> remove "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.",
</s> add "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.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", </s> remove "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP\/IP) in the list, select it and then click on Properties again.",
</s> add "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.", | [
"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 addresses.",
<mask> "encryption_https": "HTTPS port",
<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 Home will run a DNS-over-TLS server on this port.",
<mask> "encryption_certificates": "Certificates",
<mask> "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.",
<mask> "encryption_certificates_input": "Copy\/paste your PEM-encoded certificates here.",
</s> + translations: add twosky integration </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface",
</s> add "encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface", </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}<\/0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}<\/0>. We will automatically set this IP address as static if you press Enable DHCP button.",
</s> add "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}</0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}</0>. We will automatically set this IP address as static if you press Enable DHCP button.", | [
"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 certificates here.", | <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 Home will run a DNS-over-TLS server on this port.",
<mask> "encryption_certificates": "Certificates",
<mask> "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.",
<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 certificate here.",
<mask> "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
</s> + translations: add twosky integration </s> remove "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.",
</s> add "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.", </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}<\/0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}<\/0>. We will automatically set this IP address as static if you press Enable DHCP button.",
</s> add "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}</0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}</0>. We will automatically set this IP address as static if you press Enable DHCP button.", </s> remove "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP\/IP) in the list, select it and then click on Properties again.",
</s> add "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.", | [
"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 certificate here.",
<mask> "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
<mask> "encryption_enable_desc": "If encryption is enabled, AdGuard Home admin interface will work over HTTPS, and the DNS server will listen for requests over DNS-over-HTTPS and DNS-over-TLS.",
<mask> "encryption_chain_valid": "Certificate chain is valid",
<mask> "encryption_chain_invalid": "Certificate chain is invalid",
<mask> "encryption_key_valid": "This is a valid {{type}} private key",
</s> + translations: add twosky integration </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "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.",
</s> add "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.", </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface",
</s> add "encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface", | [
"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>Encryption settings<\/0>.",
<mask> "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings<\/0>.",
<mask> "form_error_port_range": "Enter port value in the range of 80-65535",
<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",
</s> + translations: add twosky integration </s> remove "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.",
</s> add "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "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.",
</s> add "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.", </s> remove "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}<\/0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}<\/0>. We will automatically set this IP address as static if you press Enable DHCP button.",
</s> add "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}</0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}</0>. We will automatically set this IP address as static if you press Enable DHCP button.", </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", | [
"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> for more info.",
<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.",
</s> + translations: add twosky integration </s> remove "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.",
</s> add "dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.", </s> remove "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>.",
</s> add "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>.", </s> remove "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.",
</s> add "update_failed": "Auto-update failed. Please <a href='https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#update'>follow the steps</a> to update manually.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "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.",
</s> add "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.", | [
"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 failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.",
<mask> "processing_update": "Please wait, AdGuard Home is being updated",
<mask> "clients_title": "Clients",
<mask> "clients_desc": "Configure devices connected to AdGuard Home",
</s> + translations: add twosky integration </s> remove "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.",
</s> add "update_failed": "Auto-update failed. Please <a href='https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#update'>follow the steps</a> to update manually.", </s> remove "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.",
</s> add "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "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>",
</s> add "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>", </s> remove "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters<\/a> settings.",
</s> add "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters</a> settings.", | [
"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-Started#update'>follow the steps<\/a> to update manually.",
<mask> "processing_update": "Please wait, AdGuard Home is being updated",
<mask> "clients_title": "Clients",
<mask> "clients_desc": "Configure devices connected to AdGuard Home",
<mask> "settings_global": "Global",
<mask> "settings_custom": "Custom",
</s> + translations: add twosky integration </s> remove "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.",
</s> add "dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.", </s> remove "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.",
</s> add "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", </s> remove "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>",
</s> add "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>", </s> remove "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters<\/a> settings.",
</s> add "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters</a> settings.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", | [
"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 possible only if AdGuard Home is also a <0>DHCP server<\/0>",
<mask> "form_enter_ip": "Enter IP",
<mask> "form_enter_mac": "Enter MAC",
<mask> "form_client_name": "Enter client name",
<mask> "client_global_settings": "Use global settings",
<mask> "client_deleted": "Client \"{{key}}\" successfully deleted",
</s> + translations: add twosky integration </s> remove "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}<\/0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}<\/0>. We will automatically set this IP address as static if you press Enable DHCP button.",
</s> add "dhcp_dynamic_ip_found": "Your system uses dynamic IP address configuration for interface <0>{{interfaceName}}</0>. In order to use DHCP server a static IP address must be set. Your current IP address is <0>{{ipAddress}}</0>. We will automatically set this IP address as static if you press Enable DHCP button.", </s> remove "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters<\/a> settings.",
</s> add "filters_block_toggle_hint": "You can setup blocking rules in the <a href='#filters'>Filters</a> settings.", </s> remove "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 itself. Some routers require a specific application, which in that case should be already installed on your computer\/phone.",
"install_devices_router_list_2": "Find the DHCP\/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.",
</s> add "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 itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.",
"install_devices_router_list_2": "Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.", </s> remove "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)<\/0>",
</s> add "example_upstream_reserved": "you can specify DNS upstream <0>for a specific domain(s)</0>", </s> remove "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.",
</s> add "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.", | [
"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": "Sitios web para adultos bloqueado",
<mask> "stats_query_domain": "Dominios m\u00e1s consultados",
<mask> "for_last_24_hours": "en las \u00faltimas 24 horas",
<mask> "no_domains_found": "No se han encontrado dominios",
<mask> "requests_count": "N\u00famero de peticiones",
</s> + translations: add twosky integration </s> remove "stats_malware_phishing": "Bloqueado malware\/phishing",
</s> add "stats_malware_phishing": "Bloqueado malware/phishing", </s> remove "stats_malware_phishing": "Blocked malware\/phishing",
</s> add "stats_malware_phishing": "Blocked malware/phishing", </s> remove "stats_malware_phishing": "Blockerad skadekod\/phising",
</s> add "stats_malware_phishing": "Blockerad skadekod/phising", </s> remove "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>",
</s> add "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>", </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", | [
"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 (mediante UDP)",
<mask> "example_upstream_dot": "cifrado <0>DNS mediante TLS<\/0>",
<mask> "example_upstream_doh": "cifrado <0>DNS mediante HTTPS<\/0>",
<mask> "example_upstream_sdns": "puedes usar <0>DNS Stamps<\/0> para <1>DNSCrypt<\/1> o resolutores <2>DNS mediante HTTPS<\/2>",
<mask> "example_upstream_tcp": "DNS regular (mediante TCP)",
<mask> "all_filters_up_to_date_toast": "Todos los filtros ya est\u00e1n actualizados",
<mask> "updated_upstream_dns_toast": "Servidores DNS de subida actualizados",
<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 revise si lo ha escrito correctamente",
</s> + translations: add twosky integration </s> remove "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",
</s> add "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", </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", </s> remove "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.",
</s> add "dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.", </s> remove "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.",
</s> add "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", | [
"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> "rows_table_footer_text": "lignes",
<mask> "updated_custom_filtering_toast": "R\u00e8gles de filtrage d'utilisateur mises \u00e0 jour",
<mask> "rule_removed_from_custom_filtering_toast": "R\u00e8gle retir\u00e9e des r\u00e8gles d'utilisateur",
<mask> "rule_added_to_custom_filtering_toast": "R\u00e8gle ajout\u00e9e aux r\u00e8gles d'utilisateur",
</s> + translations: add twosky integration </s> remove "stats_malware_phishing": "Bloqueado malware\/phishing",
</s> add "stats_malware_phishing": "Bloqueado malware/phishing", </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", </s> remove "stats_malware_phishing": "Blockerad skadekod\/phising",
</s> add "stats_malware_phishing": "Blockerad skadekod/phising", </s> remove "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>",
</s> add "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>", | [
"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": "Bloqueado sites adultos",
<mask> "stats_query_domain": "Principais dom\u00ednios consultados",
<mask> "for_last_24_hours": "nas \u00faltimas 24 horas",
<mask> "no_domains_found": "Nenhum dom\u00ednio encontrado",
<mask> "requests_count": "Contagem de solicita\u00e7\u00f5es",
</s> + translations: add twosky integration </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", </s> remove "stats_malware_phishing": "Blockerad skadekod\/phising",
</s> add "stats_malware_phishing": "Blockerad skadekod/phising", </s> remove "stats_malware_phishing": "Blocked malware\/phishing",
</s> add "stats_malware_phishing": "Blocked malware/phishing", </s> remove "page_table_footer_text": "Page",
</s> add </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", | [
"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 para seu certificado.",
<mask> "encryption_enable": "Ativar criptografia (HTTPS, DNS-sobre-HTTPS e DNS-sobre-TLS)",
<mask> "encryption_enable_desc": "Se a criptografia estiver ativada, a interface administrativa do AdGuard Home funcionar\u00e1 em HTTPS, o servidor DNS ir\u00e1 capturar as solicita\u00e7\u00f5es por meio do DNS-sobre-HTTPS e DNS-sobre-TLS.",
<mask> "encryption_chain_valid": "Cadeia de chave v\u00e1lida.",
<mask> "encryption_chain_invalid": "A cadeia de certificado \u00e9 inv\u00e1lida",
<mask> "encryption_key_valid": "Esta \u00e9 uma chave privada {{type}} v\u00e1lida",
</s> + translations: add twosky integration </s> remove "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.",
</s> add "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", </s> remove "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 certificates here.",
</s> add "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 certificates here.", </s> remove "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>",
</s> add "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>", </s> remove "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.",
</s> add "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.", </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", | [
"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> "enabled_protection": "Kopplade p\u00e5 skydd",
<mask> "disable_protection": "Koppla bort skydd",
</s> + translations: add twosky integration </s> remove "stats_malware_phishing": "Blockerad skadekod\/phising",
</s> add "stats_malware_phishing": "Blockerad skadekod/phising", </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove "page_table_footer_text": "Page",
</s> add </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", </s> remove "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>",
</s> add "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>", | [
"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": "Blockerade vuxensajter",
<mask> "stats_query_domain": "Mest efters\u00f6kta dom\u00e4ner",
<mask> "for_last_24_hours": "under de senaste 24 timamrna",
<mask> "no_domains_found": "Inga dom\u00e4ner hittade",
<mask> "requests_count": "F\u00f6rfr\u00e5gningsantal",
</s> + translations: add twosky integration </s> remove "stats_malware_phishing": "Bloqueado malware\/phishing",
</s> add "stats_malware_phishing": "Bloqueado malware/phishing", </s> remove "stats_malware_phishing": "Malware\/phishing bloqueado",
</s> add "stats_malware_phishing": "Malware/phishing bloqueado", </s> remove "stats_malware_phishing": "Blocked malware\/phishing",
</s> add "stats_malware_phishing": "Blocked malware/phishing", </s> remove "copyright": "Copyright",
</s> add </s> remove "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.",
</s> add "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", | [
"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> + translations: add twosky integration </s> remove body = JSON.stringify(body, null, 4); // eslint-disable-line
</s> add normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line </s> remove if (typeof body !== 'string') {
</s> add if (typeof normalizedBody !== 'string') { </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky | [
"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 twosky integration </s> remove const crypto = require('crypto');
</s> add </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove timestamp,
file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')),
file_format: 'HIERARCHICAL_JSON',
locale: 'en',
is_keeping_all_strings: 'false',
api_key: oneskyapp.apiKey,
dev_hash: hashString(timestamp + oneskyapp.secretKey),
</s> add format: 'json',
language: LANGUAGE,
filename: BASE_FILE,
project: projectId,
file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; | [
"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 * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky </s> remove * @param {object} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; | [
"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> * @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);
</s> + translations: add twosky integration </s> remove * @param {object} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { | [
"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);
<mask>
<mask> let url = [];
</s> + translations: add twosky integration </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky | [
"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> let url = [];
<mask> url.push(oneskyapp.url + oneskyapp.projectId);
<mask> url.push(`/translations?locale=${locale}`);
<mask> url.push('&source_file_name=en.json');
<mask> url.push(`&export_file_name=${locale}.json`);
<mask> url.push(`&api_key=${oneskyapp.apiKey}`);
<mask> url.push(`×tamp=${timestamp}`);
<mask> url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
<mask> url = url.join('');
<mask>
<mask> return url;
<mask> };
<mask>
<mask> /**
<mask> * Promise wrapper for writing in file
<mask> * @param {string} filename
</s> + translations: add twosky integration </s> remove * @param {object} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky | [
"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-disable-line
<mask> } catch (err) {
<mask> reject(err);
</s> + translations: add twosky integration </s> remove if (typeof body !== 'string') {
</s> add if (typeof normalizedBody !== 'string') { </s> remove body = JSON.stringify(body, null, 4); // eslint-disable-line
</s> add normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { | [
"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> } catch (err) {
<mask> reject(err);
<mask> }
</s> + translations: add twosky integration </s> remove body = JSON.stringify(body, null, 4); // eslint-disable-line
</s> add normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { | [
"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> reject(err);
<mask> }
<mask> }
<mask>
</s> + translations: add twosky integration </s> remove if (typeof body !== 'string') {
</s> add if (typeof normalizedBody !== 'string') { </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; </s> remove fs.writeFile(filename, body, (err) => {
</s> add fs.writeFile(filename, normalizedBody, (err) => { </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { | [
"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> remove body = JSON.stringify(body, null, 4); // eslint-disable-line
</s> add normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line </s> remove if (typeof body !== 'string') {
</s> add if (typeof normalizedBody !== 'string') { </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky </s> remove const url = prepare(locale, oneskyapp);
</s> add const url = getRequestUrl(locale, TWOSKY_URI, TWOSKY_PROJECT_ID); | [
"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 processedObject;
}
/**
* Request twosky | <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} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; | [
"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> }
<mask>
<mask> const requests = locales.map((locale) => {
<mask> const url = prepare(locale, oneskyapp);
<mask> return request(url, locale);
</s> + translations: add twosky integration </s> remove const url = prepare(locale, oneskyapp);
</s> add const url = getRequestUrl(locale, TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; | [
"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 twosky integration </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove * Make request to onesky to upload new json
</s> add * Make request to twosky to upload new json | [
"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 crypto = require('crypto');
</s> add </s> remove
/**
* Hash content
*
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
</s> add const BASE_FILE = 'en.json';
const LANGUAGE = 'en';
const TWOSKY_URI = process.env.TWOSKY_URI;
const TWOSKY_PROJECT_ID = 'home'; </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove * Make request to onesky to upload new json
</s> add * Make request to twosky to upload new json </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { | [
"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('md5').update(content, 'utf8').digest('hex');
<mask>
<mask> /**
<mask> * Prepare post params
<mask> */
<mask> const prepare = () => {
</s> + translations: add twosky integration </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky </s> remove const crypto = require('crypto');
</s> add </s> remove * @param {object} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; | [
"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> 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: 'HIERARCHICAL_JSON',
<mask> locale: 'en',
</s> + translations: add twosky integration </s> remove timestamp,
file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')),
file_format: 'HIERARCHICAL_JSON',
locale: 'en',
is_keeping_all_strings: 'false',
api_key: oneskyapp.apiKey,
dev_hash: hashString(timestamp + oneskyapp.secretKey),
</s> add format: 'json',
language: LANGUAGE,
filename: BASE_FILE,
project: projectId,
file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), </s> remove let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return; </s> remove * @param {object} oneskyapp config oneskyapp
</s> add * @param {object} twosky config twosky </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove * Hash content
* @param {string} content
*/
const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex');
/**
* Prepare params to get translations from oneskyapp
</s> add * Prepare params to get translations from twosky | [
"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: 'HIERARCHICAL_JSON',
<mask> locale: 'en',
<mask> is_keeping_all_strings: 'false',
<mask> api_key: oneskyapp.apiKey,
<mask> dev_hash: hashString(timestamp + oneskyapp.secretKey),
<mask> };
<mask>
<mask> return { url, formData };
<mask> };
<mask>
</s> + translations: add twosky integration </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove return { url, formData };
</s> add return {
url: `${url}/upload`,
formData
}; </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove * Make request to onesky to upload new json
</s> add * Make request to twosky to upload new json </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); | [
"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 </s> remove * Make request to onesky to upload new json
</s> add * Make request to twosky to upload new json </s> remove timestamp,
file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')),
file_format: 'HIERARCHICAL_JSON',
locale: 'en',
is_keeping_all_strings: 'false',
api_key: oneskyapp.apiKey,
dev_hash: hashString(timestamp + oneskyapp.secretKey),
</s> add format: 'json',
language: LANGUAGE,
filename: BASE_FILE,
project: projectId,
file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request twosky | [
"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 </s> remove const { url, formData } = prepare();
</s> add if (!TWOSKY_URI) {
console.error('No credentials');
return;
}
const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); </s> remove return { url, formData };
</s> add return {
url: `${url}/upload`,
formData
}; </s> remove timestamp,
file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')),
file_format: 'HIERARCHICAL_JSON',
locale: 'en',
is_keeping_all_strings: 'false',
api_key: oneskyapp.apiKey,
dev_hash: hashString(timestamp + oneskyapp.secretKey),
</s> add format: 'json',
language: LANGUAGE,
filename: BASE_FILE,
project: projectId,
file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove const prepare = (locale, oneskyapp) => {
const timestamp = Math.round(new Date().getTime() / 1000);
let url = [];
url.push(oneskyapp.url + oneskyapp.projectId);
url.push(`/translations?locale=${locale}`);
url.push('&source_file_name=en.json');
url.push(`&export_file_name=${locale}.json`);
url.push(`&api_key=${oneskyapp.apiKey}`);
url.push(`×tamp=${timestamp}`);
url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`);
url = url.join('');
return url;
</s> add const getRequestUrl = (locale, url, projectId) => {
return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; | [
"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 integration </s> remove * Make request to onesky to upload new json
</s> add * Make request to twosky to upload new json </s> remove return { url, formData };
</s> add return {
url: `${url}/upload`,
formData
}; </s> remove const prepare = () => {
let oneskyapp;
try {
oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json'));
} catch (err) {
throw new Error(err);
}
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`;
const timestamp = Math.round(new Date().getTime() / 1000);
</s> add const getRequestData = (url, projectId) => { </s> remove timestamp,
file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')),
file_format: 'HIERARCHICAL_JSON',
locale: 'en',
is_keeping_all_strings: 'false',
api_key: oneskyapp.apiKey,
dev_hash: hashString(timestamp + oneskyapp.secretKey),
</s> add format: 'json',
language: LANGUAGE,
filename: BASE_FILE,
project: projectId,
file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), </s> remove * Request to server onesky
</s> add * 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 processedObject;
}
/**
* Request 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 enabled </s> remove logRequest(rrw.Msg, result, time.Since(start), ip)
</s> add logRequest(r, rrw.Msg, result, time.Since(start), ip) </s> remove var once sync.Once
</s> add var onceMetrics, onceQueryLog sync.Once </s> remove once.Do(func() {
</s> add onceMetrics.Do(func() { | [
"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 enabled </s> remove logRequest(rrw.Msg, result, time.Since(start), ip)
</s> add logRequest(r, rrw.Msg, result, time.Since(start), ip) </s> remove var once sync.Once
</s> add var onceMetrics, onceQueryLog sync.Once </s> remove once.Do(func() {
</s> add onceQueryLog.Do(func() { | [
"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 once sync.Once
</s> add var onceMetrics, onceQueryLog sync.Once </s> remove once.Do(func() {
</s> add onceMetrics.Do(func() { </s> remove once.Do(func() {
</s> add onceQueryLog.Do(func() { | [
"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 once.Do(func() {
</s> add onceMetrics.Do(func() { </s> remove once.Do(func() {
</s> add onceQueryLog.Do(func() { | [
"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
BlockedTTL uint32 // in seconds, default 3600
</s> add settings plugSettings </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { | [
"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, default 3600
<mask>
<mask> sync.RWMutex
<mask> }
<mask>
<mask> var defaultPlugin = plug{
</s> Fix more race conditions found by race detector </s> remove var defaultPlugin = plug{
</s> add var defaultPluginSettings = plugSettings{ </s> remove var p = new(plug)
*p = defaultPlugin
p.d = dnsfilter.New()
p.hosts = make(map[string]net.IP)
</s> add p := &plug{
settings: defaultPluginSettings,
d: dnsfilter.New(),
hosts: make(map[string]net.IP),
} </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { | [
"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 found by race detector </s> remove
SafeBrowsingBlockHost string
ParentalBlockHost string
QueryLogEnabled bool
BlockedTTL uint32 // in seconds, default 3600
</s> add settings plugSettings </s> remove var p = new(plug)
*p = defaultPlugin
p.d = dnsfilter.New()
p.hosts = make(map[string]net.IP)
</s> add p := &plug{
settings: defaultPluginSettings,
d: dnsfilter.New(),
hosts: make(map[string]net.IP),
} </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { | [
"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> filterFileNames := []string{}
<mask> for c.Next() {
<mask> args := c.RemainingArgs()
<mask> if len(args) > 0 {
</s> Fix more race conditions found by race detector </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.BlockedTTL, Class: dns.ClassINET}
</s> add header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET} </s> remove var defaultPlugin = plug{
</s> add var defaultPluginSettings = plugSettings{ </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { | [
"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 found by race detector </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost | [
"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 startQueryLogServer() // TODO: how to handle errors?
<mask> })
</s> Fix more race conditions found by race detector </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost | [
"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 race conditions found by race detector </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove var defaultPlugin = plug{
</s> add var defaultPluginSettings = plugSettings{ | [
"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)
<mask> return dns.RcodeServerFailure, fmt.Errorf("plugin/dnsfilter: %s", err)
<mask> }
<mask> records = append(records, result)
</s> Fix more race conditions found by race detector </s> remove json, err := json.MarshalIndent(statistics, "", " ")
</s> add json, err := json.MarshalIndent(&statistics, "", " ") </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.BlockedTTL, Class: dns.ClassINET}
</s> add header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET} | [
"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_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.BlockedTTL, Class: dns.ClassINET}
<mask>
<mask> Mbox := "hostmaster."
<mask> if zone[0] != '.' {
<mask> Mbox += zone
<mask> }
</s> Fix more race conditions found by race detector </s> remove result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val))
</s> add result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) </s> remove var p = new(plug)
*p = defaultPlugin
p.d = dnsfilter.New()
p.hosts = make(map[string]net.IP)
</s> add p := &plug{
settings: defaultPluginSettings,
d: dnsfilter.New(),
hosts: make(map[string]net.IP),
} </s> remove json, err := json.MarshalIndent(statistics, "", " ")
</s> add json, err := json.MarshalIndent(&statistics, "", " ") </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost | [
"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> if err != nil {
<mask> return rcode, dnsfilter.Result{}, err
<mask> }
<mask> return rcode, result, err
</s> Fix more race conditions found by race detector </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val))
</s> add result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove json, err := json.MarshalIndent(statistics, "", " ")
</s> add json, err := json.MarshalIndent(&statistics, "", " ") | [
"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> return rcode, dnsfilter.Result{}, err
<mask> }
<mask> return rcode, result, err
</s> Fix more race conditions found by race detector </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove if p.QueryLogEnabled {
</s> add if p.settings.QueryLogEnabled { </s> remove result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val))
</s> add result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) | [
"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.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove p.QueryLogEnabled = true
</s> add p.settings.QueryLogEnabled = true </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) </s> remove p.ParentalBlockHost = c.Val()
</s> add p.settings.ParentalBlockHost = c.Val() | [
"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.Printf("Couldn't generate JSON: %s", err)
<mask> return err
<mask> }
</s> Fix more race conditions found by race detector </s> remove result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val))
</s> add result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) </s> remove val := p.SafeBrowsingBlockHost
</s> add val := p.settings.SafeBrowsingBlockHost </s> remove val := p.ParentalBlockHost
</s> add val := p.settings.ParentalBlockHost </s> remove header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.BlockedTTL, Class: dns.ClassINET}
</s> add header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET} </s> remove p.BlockedTTL = uint32(blockttl)
</s> add p.settings.BlockedTTL = uint32(blockttl) | [
"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-root/u-root v7.0.0+incompatible
<mask> go.etcd.io/bbolt v1.3.5
<mask> golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
<mask> golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove import "syscall"
</s> add import (
"fmt"
"os/exec"
"syscall"
) | [
"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/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
<mask> github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
<mask> github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
<mask> github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU=
<mask> github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg=
<mask> github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM=
<mask> github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove github.com/stretchr/testify v1.6.1
</s> add github.com/stretchr/testify v1.7.0 </s> remove "os/exec"
</s> add | [
"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 master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove import "syscall"
</s> add import (
"fmt"
"os/exec"
"syscall"
) </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) | [
"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-addresses-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove code, _, err := util.RunCommand("networksetup", args...)
</s> add code, _, err := aghos.RunCommand("networksetup", args...) </s> remove func logPanic() {
if v := recover(); v != nil {
log.Error("recovered from panic: %v", v)
}
}
</s> add </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") | [
"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.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "errors"
</s> add </s> remove "errors"
</s> add </s> remove "fmt"
</s> add | [
"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-home from 2704-local-addresses-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "errors"
</s> add </s> remove assert.True(t, errors.Is(err, tc.want), err)
</s> add assert.ErrorIs(t, err, tc.want) </s> remove "errors"
</s> add | [
"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 {
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove import "syscall"
</s> add import (
"fmt"
"os/exec"
"syscall"
) | [
"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[string]string {
<mask> _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
<mask> if err != nil {
<mask> return nil
<mask> }
<mask>
<mask> re, err := regexp.Compile("Hardware Port: (.*?)\nDevice: (.*?)\n")
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add | [
"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("IP address: (.*?)\nSubnet mask: (.*?)\nRouter: (.*?)\n")
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove code, _, err := util.RunCommand("networksetup", args...)
</s> add code, _, err := aghos.RunCommand("networksetup", args...) </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) </s> remove code, _, err = util.RunCommand("networksetup", "-setmanual",
</s> add code, _, err = aghos.RunCommand("networksetup", "-setmanual", </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add | [
"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> if code != 0 {
<mask> return fmt.Errorf("failed to set DNS servers, code=%d", code)
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove code, _, err = util.RunCommand("networksetup", "-setmanual",
</s> add code, _, err = aghos.RunCommand("networksetup", "-setmanual", </s> remove code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=")
</s> add code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) | [
"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 != nil {
<mask> return err
<mask> }
<mask> if code != 0 {
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove code, _, err := util.RunCommand("networksetup", args...)
</s> add code, _, err := aghos.RunCommand("networksetup", args...) </s> remove code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=")
</s> add code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) | [
"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> return canBindPrivilegedPorts()
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add | [
"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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "errors"
</s> add </s> remove "os/exec"
</s> add </s> remove "fmt"
</s> add | [
"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/adguard-home from 2704-local-addresses-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") | [
"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 *TestErrUpstream) Address() string {
<mask> return ""
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) | [
"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 #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "fmt"
</s> add </s> remove "errors"
</s> add </s> remove "os/exec"
</s> add | [
"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 resolvers vol.1
Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "os/exec"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/agherr"
</s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/util"
</s> add "github.com/AdguardTeam/AdGuardHome/internal/aghos" | [
"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 net.SplitHostPort.
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) | [
"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 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>
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove code, _, err = util.RunCommand("networksetup", "-setmanual",
</s> add code, _, err = aghos.RunCommand("networksetup", "-setmanual", </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) | [
"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>
<mask> return false
<mask> }
<mask>
<mask> host = r.Host
<mask> }
<mask>
<mask> if r.TLS == nil && web.forceHTTPS {
<mask> hostPort := host
<mask> if port := web.conf.PortHTTPS; port != defaultHTTPSPort {
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove code, _, err = util.RunCommand("networksetup", "-setmanual",
</s> add code, _, err = aghos.RunCommand("networksetup", "-setmanual", </s> remove func logPanic() {
if v := recover(); v != nil {
log.Error("recovered from panic: %v", v)
}
}
</s> add </s> remove code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=")
</s> add code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") | [
"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.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "errors"
</s> add </s> remove "os/exec"
</s> add | [
"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(ctx context.Context, cancel context.CancelFunc, srv *http.Server) {
<mask> defer logPanic()
<mask>
<mask> if srv == nil {
<mask> return
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove defer logPanic()
</s> add defer agherr.LogPanic("") </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) | [
"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-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove func logPanic() {
if v := recover(); v != nil {
log.Error("recovered from panic: %v", v)
}
}
</s> add </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) | [
"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", err, code)
<mask> return
<mask> }
<mask> data = []byte(psdata)
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove code, _, err = util.RunCommand("networksetup", "-setmanual",
</s> add code, _, err = aghos.RunCommand("networksetup", "-setmanual", </s> remove code, _, err := util.RunCommand("networksetup", args...)
</s> add code, _, err := aghos.RunCommand("networksetup", args...) </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove assert.True(t, errors.Is(err, tc.want), err)
</s> add assert.ErrorIs(t, err, tc.want) | [
"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> }
<mask>
<mask> // Basically the same template as the one defined in github.com/kardianos/service
<mask> // but with two additional keys - StandardOutPath and StandardErrorPath
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove // RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (int, string, error) {
cmd := exec.Command(command, arguments...)
out, err := cmd.Output()
if err != nil {
return 1, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
}
return cmd.ProcessState.ExitCode(), string(out), nil
}
</s> add </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove host, _, err := net.SplitHostPort(r.Host)
</s> add host, err := aghnet.SplitHost(r.Host) </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) | [
"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.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "errors"
</s> add </s> remove "fmt"
</s> add | [
"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 local resolvers vol.1
Merge in DNS/adguard-home from 2704-local-addresses-vol.1 to master
Updates #2704.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) </s> remove addrErr := &net.AddrError{}
if !errors.As(err, &addrErr) || addrErr.Err != missingPort {
httpError(w, http.StatusBadRequest, "bad host: %s", err)
return false
}
host = r.Host
</s> add return false </s> remove code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=")
</s> add code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") </s> remove code, _, err := util.RunCommand("networksetup", args...)
</s> add code, _, err := aghos.RunCommand("networksetup", args...) | [
"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.
Updates #2829.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "os/exec"
</s> add </s> remove "errors"
</s> add </s> remove import "syscall"
</s> add import (
"fmt"
"os/exec"
"syscall"
) | [
"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.
Updates #2846.
Squashed commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove "fmt"
</s> add </s> remove "errors"
</s> add </s> remove import "syscall"
</s> add import (
"fmt"
"os/exec"
"syscall"
) | [
"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, "", fmt.Errorf("exec.Command(%s) failed: %v: %s", command, err, string(out))
<mask> }
<mask>
<mask> return cmd.ProcessState.ExitCode(), string(out), nil
<mask> }
<mask>
<mask> // SplitNext - split string by a byte and return the first chunk
<mask> // Skip empty chunks
<mask> // Whitespace is trimmed
<mask> func SplitNext(str *string, splitBy byte) string {
<mask> i := strings.IndexByte(*str, splitBy)
</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 commit of the following:
commit 9a49b3d27edcb30da7f16a065226907833b1dc81
Author: Eugene Burkov <[email protected]>
Date: Mon Mar 22 15:39:17 2021 +0300
aghnet: imp docs and logging
commit 74f95a29c55b9e732276601b0ecc63fb7c3a9f9e
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:56:51 2021 +0300
all: fix friday evening mistakes
commit 0e2066bc5c16ed807fa601780b99e154502361a9
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:51:15 2021 +0300
all: upd testify, imp code quality
commit 8237c50b670c58361ccf7adec3ff2452b1196677
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 20:19:29 2021 +0300
aghnet: imp test naming
commit 14eb1e189339554c0a6d38e2ba7a93917774ebab
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 19:41:43 2021 +0300
aghnet: isolate windows-specific functionality
commit d461ac8b18c187999da3e3aba116571b7ebe6785
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 14:50:05 2021 +0300
aghnet: imp code quality
commit d0ee01cb1f8613de2085c0f2f2f396e46beb52a5
Author: Eugene Burkov <[email protected]>
Date: Fri Mar 19 11:59:10 2021 +0300
all: mv funcs to agherr, mk system resolvers getter </s> remove _, out, err := util.RunCommand("networksetup", "-listallhardwareports")
</s> add _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") </s> remove code, _, err := util.RunCommand("sh", "-c", confPath+" "+action)
</s> add code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) </s> remove return nil, agherr.Error("bad")
</s> add // 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") </s> remove // Check for the missing port error. If it is that error, just
// use the host as is.
//
// See the source code for net.SplitHostPort.
const missingPort = "missing port in address"
</s> add httpError(w, http.StatusBadRequest, "bad host: %s", err) | [
"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 request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove if (runtime.GOOS == "linux" || runtime.GOOS == "darwin") &&
config.RlimitNoFile != 0 {
aghos.SetRlimit(config.RlimitNoFile)
</s> add if config.RlimitNoFile != 0 {
err = aghos.SetRlimit(config.RlimitNoFile)
if err != nil && !errors.Is(err, aghos.ErrUnsupported) {
return fmt.Errorf("setting rlimit: %w", err)
} </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) {
return ErrUnsupported </s> remove // SetRlimit sets user-specified limit of how many fd's we can use
// https://github.com/AdguardTeam/AdGuardHome/internal/issues/659.
func SetRlimit(val uint) {
setRlimit(val)
</s> add // 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) | [
"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
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove RlimitNoFile uint `yaml:"rlimit_nofile"` // Maximum number of opened fd's per process (0: default)
</s> add RlimitNoFile uint64 `yaml:"rlimit_nofile"` // Maximum number of opened fd's per process (0: default) </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add | [
"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 following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove // SetRlimit sets user-specified limit of how many fd's we can use
// https://github.com/AdguardTeam/AdGuardHome/internal/issues/659.
func SetRlimit(val uint) {
setRlimit(val)
</s> add // 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) </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) {
return ErrUnsupported </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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> setRlimit(val)
<mask> }
<mask>
<mask> // HaveAdminRights checks if the current user has root (administrator) rights.
<mask> func HaveAdminRights() (bool, error) {
<mask> return haveAdminRights()
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) {
return ErrUnsupported </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add | [
"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 following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove "github.com/AdguardTeam/golibs/log"
</s> add </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) {
return ErrUnsupported </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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> if err != nil {
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) | [
"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>
<mask> func haveAdminRights() (bool, error) {
<mask> return os.Getuid() == 0, nil
<mask> }
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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 following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support | [
"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 err != nil {
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) | [
"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 haveAdminRights() (bool, error) {
<mask> return os.Getuid() == 0, nil
<mask> }
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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, unix.CAP_NET_BIND_SERVICE, 0, 0)
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove
"github.com/AdguardTeam/golibs/log"
</s> add </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) {
return ErrUnsupported | [
"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 support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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>
<mask> func haveAdminRights() (bool, error) {
<mask> // The error is nil because the platform-independent function signature
<mask> // requires returning an error.
</s> Pull request: all: openbsd support
Updates #2439.
Squashed commit of the following:
commit 3ff109e43751132d77500256c8869938680ac281
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:46:17 2021 +0300
all: imp code, docs
commit 512ee6d78cfee511f429d09c8366bb7dd8019aa8
Author: Ainar Garipov <[email protected]>
Date: Thu Jun 3 20:06:41 2021 +0300
all: openbsd support </s> remove rlim.Max = uint64(val)
rlim.Cur = uint64(val)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add rlim.Max = val
rlim.Cur = val
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
if err != nil {
log.Error("Setrlimit() failed: %v", err)
}
</s> add return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { </s> remove func setRlimit(val uint) {
</s> add func setRlimit(val uint64) (err error) { | [
"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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.