code_before
stringlengths
16
1.81M
edits
stringlengths
4
328k
next_edit
stringlengths
0
76.5k
code_after
stringlengths
3
49.9M
label_window
sequencelengths
4
1.81k
instruction
stringlengths
20
51.9k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
"dns_settings": "DNS settings", "encryption_settings": "Encryption settings", "dhcp_settings": "DHCP settings", "upstream_dns": "Upstream DNS servers", "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.", "test_upstream_btn": "Test upstreams", "apply_btn": "Apply", "disabled_filtering_toast": "Disabled filtering", "enabled_filtering_toast": "Enabled filtering", "disabled_safe_browsing_toast": "Disabled safebrowsing",
</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.",
"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.",
"dns_settings": "DNS settings", "encryption_settings": "Encryption settings", "dhcp_settings": "DHCP settings", "upstream_dns": "Upstream DNS servers", "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.", "test_upstream_btn": "Test upstreams", "apply_btn": "Apply", "disabled_filtering_toast": "Disabled filtering", "enabled_filtering_toast": "Enabled filtering", "disabled_safe_browsing_toast": "Disabled safebrowsing",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"example_comment_meaning": "just a comment", "example_comment_hash": "# Also a comment", "example_regex_meaning": "block access to the domains matching the <0>specified regular expression</0>", "example_upstream_regular": "regular DNS (over UDP)", "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", "example_upstream_tcp": "regular DNS (over TCP)", "all_filters_up_to_date_toast": "All filters are already up-to-date", "updated_upstream_dns_toast": "Updated the upstream DNS servers", "dns_test_ok_toast": "Specified DNS servers are working correctly", "dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly",
</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.",
"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",
"example_comment_meaning": "just a comment", "example_comment_hash": "# Also a comment", "example_regex_meaning": "block access to the domains matching the <0>specified regular expression</0>", "example_upstream_regular": "regular DNS (over UDP)", "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", "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", "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", "example_upstream_tcp": "regular DNS (over TCP)", "all_filters_up_to_date_toast": "All filters are already up-to-date", "updated_upstream_dns_toast": "Updated the upstream DNS servers", "dns_test_ok_toast": "Specified DNS servers are working correctly", "dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly",
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"install_submit_desc": "The setup procedure is finished and you are ready to start using AdGuard Home.", "install_devices_router": "Router", "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.", "install_devices_address": "AdGuard Home DNS server is listening on the following addresses", "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.", "install_devices_router_list_3": "Enter your AdGuard Home server addresses there.", "install_devices_windows_list_1": "Open Control Panel through Start menu or Windows search.", "install_devices_windows_list_2": "Go to Network and Internet category and then to Network and Sharing Center.", "install_devices_windows_list_3": "On the left side of the screen find Change adapter settings and click on it.", "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.",
</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",
"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.",
"install_submit_desc": "The setup procedure is finished and you are ready to start using AdGuard Home.", "install_devices_router": "Router", "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.", "install_devices_address": "AdGuard Home DNS server is listening on the following addresses", "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.", "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.", "install_devices_router_list_3": "Enter your AdGuard Home server addresses there.", "install_devices_windows_list_1": "Open Control Panel through Start menu or Windows search.", "install_devices_windows_list_2": "Go to Network and Internet category and then to Network and Sharing Center.", "install_devices_windows_list_3": "On the left side of the screen find Change adapter settings and click on it.", "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.",
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"install_devices_windows_list_1": "Open Control Panel through Start menu or Windows search.", "install_devices_windows_list_2": "Go to Network and Internet category and then to Network and Sharing Center.", "install_devices_windows_list_3": "On the left side of the screen find Change adapter settings and click on it.", "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.", "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP\/IP) in the list, select it and then click on Properties again.", "install_devices_windows_list_6": "Choose Use the following DNS server addresses and enter your AdGuard Home server addresses.", "install_devices_macos_list_1": "Click on Apple icon and go to System Preferences.", "install_devices_macos_list_2": "Click on Network.", "install_devices_macos_list_3": "Select the first connection in your list and click Advanced.", "install_devices_macos_list_4": "Select the DNS tab and enter your AdGuard Home server addresses.",
</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.",
"install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.",
"install_devices_windows_list_1": "Open Control Panel through Start menu or Windows search.", "install_devices_windows_list_2": "Go to Network and Internet category and then to Network and Sharing Center.", "install_devices_windows_list_3": "On the left side of the screen find Change adapter settings and click on it.", "install_devices_windows_list_4": "Select your active connection, right-click on it and choose Properties.", "install_devices_windows_list_5": "Find Internet Protocol Version 4 (TCP/IP) in the list, select it and then click on Properties again.", "install_devices_windows_list_6": "Choose Use the following DNS server addresses and enter your AdGuard Home server addresses.", "install_devices_macos_list_1": "Click on Apple icon and go to System Preferences.", "install_devices_macos_list_2": "Click on Network.", "install_devices_macos_list_3": "Select the first connection in your list and click Advanced.", "install_devices_macos_list_4": "Select the DNS tab and enter your AdGuard Home server addresses.",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"next": "Next", "open_dashboard": "Open Dashboard", "install_saved": "Saved successfully", "encryption_title": "Encryption", "encryption_desc": "Encryption (HTTPS\/TLS) support for both DNS and admin web interface", "encryption_config_saved": "Encryption config saved", "encryption_server": "Server name", "encryption_server_enter": "Enter your domain name", "encryption_server_desc": "In order to use HTTPS, you need to enter the server name that matches your SSL certificate.", "encryption_redirect": "Redirect to HTTPS automatically",
</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.",
"encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface",
"next": "Next", "open_dashboard": "Open Dashboard", "install_saved": "Saved successfully", "encryption_title": "Encryption", "encryption_desc": "Encryption (HTTPS/TLS) support for both DNS and admin web interface", "encryption_config_saved": "Encryption config saved", "encryption_server": "Server name", "encryption_server_enter": "Enter your domain name", "encryption_server_desc": "In order to use HTTPS, you need to enter the server name that matches your SSL certificate.", "encryption_redirect": "Redirect to HTTPS automatically",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_server_desc": "In order to use HTTPS, you need to enter the server name that matches your SSL certificate.", "encryption_redirect": "Redirect to HTTPS automatically", "encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS addresses.", "encryption_https": "HTTPS port", "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.", "encryption_dot": "DNS-over-TLS port", "encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.", "encryption_certificates": "Certificates", "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_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.",
"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.",
"encryption_server_desc": "In order to use HTTPS, you need to enter the server name that matches your SSL certificate.", "encryption_redirect": "Redirect to HTTPS automatically", "encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS addresses.", "encryption_https": "HTTPS port", "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.", "encryption_dot": "DNS-over-TLS port", "encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.", "encryption_certificates": "Certificates", "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" ]
+ translations: add twosky integration
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.", "encryption_dot": "DNS-over-TLS port", "encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.", "encryption_certificates": "Certificates", "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.", "encryption_status": "Status", "encryption_expire": "Expires", "encryption_key": "Private key", "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.", "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
</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.",
"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.",
"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.", "encryption_dot": "DNS-over-TLS port", "encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.", "encryption_certificates": "Certificates", "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.", "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.", "encryption_status": "Status", "encryption_expire": "Expires", "encryption_key": "Private key", "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.", "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_certificates_input": "Copy\/paste your PEM-encoded certificates here.", "encryption_status": "Status", "encryption_expire": "Expires", "encryption_key": "Private key", "encryption_key_input": "Copy\/paste your PEM-encoded private key for your certificate here.", "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)", "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.", "encryption_chain_valid": "Certificate chain is valid", "encryption_chain_invalid": "Certificate chain is invalid", "encryption_key_valid": "This is a valid {{type}} private key",
</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",
"encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.",
"encryption_certificates_input": "Copy\/paste your PEM-encoded certificates here.", "encryption_status": "Status", "encryption_expire": "Expires", "encryption_key": "Private key", "encryption_key_input": "Copy/paste your PEM-encoded private key for your certificate here.", "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)", "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.", "encryption_chain_valid": "Certificate chain is valid", "encryption_chain_invalid": "Certificate chain is invalid", "encryption_key_valid": "This is a valid {{type}} private key",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"encryption_subject": "Subject", "encryption_issuer": "Issuer", "encryption_hostnames": "Hostnames", "encryption_reset": "Are you sure you want to reset encryption settings?", "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>.", "form_error_port_range": "Enter port value in the range of 80-65535", "form_error_port_unsafe": "This is an unsafe port", "form_error_equal": "Shouldn't be equal", "form_error_password": "Password mismatched", "reset_settings": "Reset settings",
</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.",
"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>.",
"encryption_subject": "Subject", "encryption_issuer": "Issuer", "encryption_hostnames": "Hostnames", "encryption_reset": "Are you sure you want to reset encryption settings?", "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>.", "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>.", "form_error_port_range": "Enter port value in the range of 80-65535", "form_error_port_unsafe": "This is an unsafe port", "form_error_equal": "Shouldn't be equal", "form_error_password": "Password mismatched", "reset_settings": "Reset settings",
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"form_error_port_unsafe": "This is an unsafe port", "form_error_equal": "Shouldn't be equal", "form_error_password": "Password mismatched", "reset_settings": "Reset settings", "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here<\/0> for more info.", "setup_guide": "Setup guide", "dns_addresses": "DNS addresses", "down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.",
</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.",
"update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.",
"form_error_port_unsafe": "This is an unsafe port", "form_error_equal": "Shouldn't be equal", "form_error_password": "Password mismatched", "reset_settings": "Reset settings", "update_announcement": "AdGuard Home {{version}} is now available! <0>Click here</0> for more info.", "setup_guide": "Setup guide", "dns_addresses": "DNS addresses", "down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"setup_guide": "Setup guide", "dns_addresses": "DNS addresses", "down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.", "update_now": "Update now", "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.", "processing_update": "Please wait, AdGuard Home is being updated", "clients_title": "Clients", "clients_desc": "Configure devices connected to AdGuard Home",
</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.",
"dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.",
"setup_guide": "Setup guide", "dns_addresses": "DNS addresses", "down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.", "update_now": "Update now", "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.", "processing_update": "Please wait, AdGuard Home is being updated", "clients_title": "Clients", "clients_desc": "Configure devices connected to AdGuard Home",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.", "update_now": "Update now", "update_failed": "Auto-update failed. Please <a href='https:\/\/github.com\/AdguardTeam\/AdGuardHome\/wiki\/Getting-Started#update'>follow the steps<\/a> to update manually.", "processing_update": "Please wait, AdGuard Home is being updated", "clients_title": "Clients", "clients_desc": "Configure devices connected to AdGuard Home", "settings_global": "Global", "settings_custom": "Custom",
</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.",
"update_failed": "Auto-update failed. Please <a href='https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#update'>follow the steps</a> to update manually.",
"down": "Down", "fix": "Fix", "dns_providers": "Here is a <0>list of known DNS providers<\/0> to choose from.", "update_now": "Update now", "update_failed": "Auto-update failed. Please <a href='https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#update'>follow the steps</a> to update manually.", "processing_update": "Please wait, AdGuard Home is being updated", "clients_title": "Clients", "clients_desc": "Configure devices connected to AdGuard Home", "settings_global": "Global", "settings_custom": "Custom",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"client_new": "New Client", "client_edit": "Edit Client", "client_identifier": "Identifier", "ip_address": "IP address", "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>", "form_enter_ip": "Enter IP", "form_enter_mac": "Enter MAC", "form_client_name": "Enter client name", "client_global_settings": "Use global settings", "client_deleted": "Client \"{{key}}\" successfully deleted",
</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.",
"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>",
"client_new": "New Client", "client_edit": "Edit Client", "client_identifier": "Identifier", "ip_address": "IP address", "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>", "form_enter_ip": "Enter IP", "form_enter_mac": "Enter MAC", "form_client_name": "Enter client name", "client_global_settings": "Use global settings", "client_deleted": "Client \"{{key}}\" successfully deleted",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/en.json
"disabled_protection": "Protecci\u00f3n deshabilitada", "refresh_statics": "Restablecer estad\u00edsticas", "dns_query": "Consultas DNS", "blocked_by": "Bloqueado por filtros", "stats_malware_phishing": "Malware\/phishing bloqueado", "stats_adult": "Sitios web para adultos bloqueado", "stats_query_domain": "Dominios m\u00e1s consultados", "for_last_24_hours": "en las \u00faltimas 24 horas", "no_domains_found": "No se han encontrado dominios", "requests_count": "N\u00famero de peticiones",
</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.",
"stats_malware_phishing": "Malware/phishing bloqueado",
"disabled_protection": "Protecci\u00f3n deshabilitada", "refresh_statics": "Restablecer estad\u00edsticas", "dns_query": "Consultas DNS", "blocked_by": "Bloqueado por filtros", "stats_malware_phishing": "Malware/phishing bloqueado", "stats_adult": "Sitios web para adultos bloqueado", "stats_query_domain": "Dominios m\u00e1s consultados", "for_last_24_hours": "en las \u00faltimas 24 horas", "no_domains_found": "No se han encontrado dominios", "requests_count": "N\u00famero de peticiones",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/es.json
"example_comment_meaning": "solo un comentario", "example_comment_hash": "# Tambi\u00e9n un comentario", "example_regex_meaning": "bloquear el acceso a los dominios que coincidan con la expresi\u00f3n regular especificada", "example_upstream_regular": "DNS regular (mediante UDP)", "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>", "example_upstream_tcp": "DNS regular (mediante TCP)", "all_filters_up_to_date_toast": "Todos los filtros ya est\u00e1n actualizados", "updated_upstream_dns_toast": "Servidores DNS de subida actualizados", "dns_test_ok_toast": "Los servidores DNS especificados funcionan correctamente", "dns_test_not_ok_toast": "Servidor \"{{key}}\": no se puede utilizar, por favor revise si lo ha escrito correctamente",
</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.",
"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>",
"example_comment_meaning": "solo un comentario", "example_comment_hash": "# Tambi\u00e9n un comentario", "example_regex_meaning": "bloquear el acceso a los dominios que coincidan con la expresi\u00f3n regular especificada", "example_upstream_regular": "DNS regular (mediante UDP)", "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>", "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>", "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>", "example_upstream_tcp": "DNS regular (mediante TCP)", "all_filters_up_to_date_toast": "Todos los filtros ya est\u00e1n actualizados", "updated_upstream_dns_toast": "Servidores DNS de subida actualizados", "dns_test_ok_toast": "Los servidores DNS especificados funcionan correctamente", "dns_test_not_ok_toast": "Servidor \"{{key}}\": no se puede utilizar, por favor revise si lo ha escrito correctamente",
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/es.json
"last_dns_queries": "5000 derni\u00e8res requ\u00eates DNS", "previous_btn": "Pr\u00e9c\u00e9dent", "next_btn": "Suivant", "loading_table_status": "Chargement en cours ...", "page_table_footer_text": "Page", "of_table_footer_text": "de", "rows_table_footer_text": "lignes", "updated_custom_filtering_toast": "R\u00e8gles de filtrage d'utilisateur mises \u00e0 jour", "rule_removed_from_custom_filtering_toast": "R\u00e8gle retir\u00e9e des r\u00e8gles d'utilisateur", "rule_added_to_custom_filtering_toast": "R\u00e8gle ajout\u00e9e aux r\u00e8gles d'utilisateur",
</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>",
"last_dns_queries": "5000 derni\u00e8res requ\u00eates DNS", "previous_btn": "Pr\u00e9c\u00e9dent", "next_btn": "Suivant", "loading_table_status": "Chargement en cours ...", "of_table_footer_text": "de", "rows_table_footer_text": "lignes", "updated_custom_filtering_toast": "R\u00e8gles de filtrage d'utilisateur mises \u00e0 jour", "rule_removed_from_custom_filtering_toast": "R\u00e8gle retir\u00e9e des r\u00e8gles d'utilisateur", "rule_added_to_custom_filtering_toast": "R\u00e8gle ajout\u00e9e aux r\u00e8gles d'utilisateur",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/fr.json
"disabled_protection": "Prote\u00e7\u00e3o desativada", "refresh_statics": "Atualizar estat\u00edsticas", "dns_query": "Consultas de DNS", "blocked_by": "Bloqueador por filtros", "stats_malware_phishing": "Bloqueado malware\/phishing", "stats_adult": "Bloqueado sites adultos", "stats_query_domain": "Principais dom\u00ednios consultados", "for_last_24_hours": "nas \u00faltimas 24 horas", "no_domains_found": "Nenhum dom\u00ednio encontrado", "requests_count": "Contagem de solicita\u00e7\u00f5es",
</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.",
"stats_malware_phishing": "Bloqueado malware/phishing",
"disabled_protection": "Prote\u00e7\u00e3o desativada", "refresh_statics": "Atualizar estat\u00edsticas", "dns_query": "Consultas de DNS", "blocked_by": "Bloqueador por filtros", "stats_malware_phishing": "Bloqueado malware/phishing", "stats_adult": "Bloqueado sites adultos", "stats_query_domain": "Principais dom\u00ednios consultados", "for_last_24_hours": "nas \u00faltimas 24 horas", "no_domains_found": "Nenhum dom\u00ednio encontrado", "requests_count": "Contagem de solicita\u00e7\u00f5es",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/pt-br.json
"encryption_certificates_input": "Copie\/cole aqui seu certificado codificado em PEM.", "encryption_status": "Status", "encryption_expire": "Expira", "encryption_key": "Chave privada", "encryption_key_input": "Copie\/cole aqui a chave privada codificada em PEM para seu certificado.", "encryption_enable": "Ativar criptografia (HTTPS, DNS-sobre-HTTPS e DNS-sobre-TLS)", "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.", "encryption_chain_valid": "Cadeia de chave v\u00e1lida.", "encryption_chain_invalid": "A cadeia de certificado \u00e9 inv\u00e1lida", "encryption_key_valid": "Esta \u00e9 uma chave privada {{type}} v\u00e1lida",
</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",
"encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.",
"encryption_certificates_input": "Copie\/cole aqui seu certificado codificado em PEM.", "encryption_status": "Status", "encryption_expire": "Expira", "encryption_key": "Chave privada", "encryption_key_input": "Copie/cole aqui a chave privada codificada em PEM para seu certificado.", "encryption_enable": "Ativar criptografia (HTTPS, DNS-sobre-HTTPS e DNS-sobre-TLS)", "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.", "encryption_chain_valid": "Cadeia de chave v\u00e1lida.", "encryption_chain_invalid": "A cadeia de certificado \u00e9 inv\u00e1lida", "encryption_key_valid": "Esta \u00e9 uma chave privada {{type}} v\u00e1lida",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/pt-br.json
"version": "version", "address": "adress", "on": "P\u00c5", "off": "AV", "copyright": "Copyright", "homepage": "Hemsida", "report_an_issue": "Rapportera ett problem", "enable_protection": "Koppla p\u00e5 skydd", "enabled_protection": "Kopplade p\u00e5 skydd", "disable_protection": "Koppla bort skydd",
</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>",
"version": "version", "address": "adress", "on": "P\u00c5", "off": "AV", "homepage": "Hemsida", "report_an_issue": "Rapportera ett problem", "enable_protection": "Koppla p\u00e5 skydd", "enabled_protection": "Kopplade p\u00e5 skydd", "disable_protection": "Koppla bort skydd",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/sv.json
"disabled_protection": "Kopplade bort skydd", "refresh_statics": "Uppdatera statistik", "dns_query": "DNS-f\u00f6rfr\u00e5gningar", "blocked_by": "Blockerat av filter", "stats_malware_phishing": "Blockerad skadekod\/phising", "stats_adult": "Blockerade vuxensajter", "stats_query_domain": "Mest efters\u00f6kta dom\u00e4ner", "for_last_24_hours": "under de senaste 24 timamrna", "no_domains_found": "Inga dom\u00e4ner hittade", "requests_count": "F\u00f6rfr\u00e5gningsantal",
</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.",
"stats_malware_phishing": "Blockerad skadekod/phising",
"disabled_protection": "Kopplade bort skydd", "refresh_statics": "Uppdatera statistik", "dns_query": "DNS-f\u00f6rfr\u00e5gningar", "blocked_by": "Blockerat av filter", "stats_malware_phishing": "Blockerad skadekod/phising", "stats_adult": "Blockerade vuxensajter", "stats_query_domain": "Mest efters\u00f6kta dom\u00e4ner", "for_last_24_hours": "under de senaste 24 timamrna", "no_domains_found": "Inga dom\u00e4ner hittade", "requests_count": "F\u00f6rfr\u00e5gningsantal",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/__locales/sv.json
fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content interpolation: { escapeValue: false, // not needed for react!! }, react: {
</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
returnEmptyString: false, // count empty value as invalid
fallbackLng: 'en', keySeparator: false, // we use content as keys nsSeparator: false, // Fix character in content returnEmptyString: false, // count empty value as invalid interpolation: { escapeValue: false, // not needed for react!! }, react: {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
client/src/i18n.js
const fs = require('fs'); const path = require('path'); const crypto = require('crypto'); const requestPromise = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; const LOCALES_LIST = [ 'en',
</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;
const fs = require('fs'); const path = require('path'); const requestPromise = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; const LOCALES_LIST = [ 'en',
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
'zh-tw', 'bg', 'zh-cn', ]; /** * Prepare params to get translations from twosky * @param {string} locale language shortcut * @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 * @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(`&timestamp=${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';
const BASE_FILE = 'en.json'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home';
'zh-tw', 'bg', 'zh-cn', ]; const BASE_FILE = 'en.json'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; /** * Prepare params to get translations from twosky * @param {string} locale language shortcut * @param {object} twosky config twosky */
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
'zh-cn', ]; /** * Hash content * @param {string} content */ const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex'); /** * Prepare params to get translations from oneskyapp * @param {string} locale language shortcut * @param {object} oneskyapp config oneskyapp */ const prepare = (locale, oneskyapp) => { const timestamp = Math.round(new Date().getTime() / 1000);
</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(`&timestamp=${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) => {
* Prepare params to get translations from twosky
'zh-cn', ]; /** * Prepare params to get translations from twosky * Prepare params to get translations from twosky * Prepare params to get translations from twosky * Prepare params to get translations from twosky * Prepare params to get translations from twosky * Prepare params to get translations from twosky * Prepare params to get translations from twosky * @param {string} locale language shortcut * @param {object} oneskyapp config oneskyapp */ const prepare = (locale, oneskyapp) => { const timestamp = Math.round(new Date().getTime() / 1000);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
/** * Prepare params to get translations from oneskyapp * @param {string} locale language shortcut * @param {object} oneskyapp config oneskyapp */ const prepare = (locale, oneskyapp) => { const timestamp = Math.round(new Date().getTime() / 1000); let url = [];
</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(`&timestamp=${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
* @param {object} twosky config twosky
/** * Prepare params to get translations from oneskyapp * @param {string} locale language shortcut * @param {object} twosky config twosky */ const prepare = (locale, oneskyapp) => { const timestamp = Math.round(new Date().getTime() / 1000); let url = [];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* Prepare params to get translations from oneskyapp * @param {string} locale language shortcut * @param {object} oneskyapp config oneskyapp */ 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(`&timestamp=${timestamp}`); url.push(`&dev_hash=${hashString(timestamp + oneskyapp.secretKey)}`); url = url.join(''); return url; }; /** * Promise wrapper for writing in file * @param {string} filename
</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
const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`;
* Prepare params to get translations from oneskyapp * @param {string} locale language shortcut * @param {object} oneskyapp config oneskyapp */ const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; const getRequestUrl = (locale, url, projectId) => { return `${url}/download?format=json&language=${locale}&filename=${BASE_FILE}&project=${projectId}`; }; /** * Promise wrapper for writing in file * @param {string} filename
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* @param {any} body */ function writeInFile(filename, body) { return new Promise((resolve, reject) => { if (typeof normalizedBody !== 'string') { try { normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line } catch (err) { reject(err);
</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) => {
let normalizedBody = removeEmpty(JSON.parse(body));
* @param {any} body */ function writeInFile(filename, body) { let normalizedBody = removeEmpty(JSON.parse(body)); return new Promise((resolve, reject) => { if (typeof normalizedBody !== 'string') { try { normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line } catch (err) { reject(err);
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* @param {any} body */ function writeInFile(filename, body) { return new Promise((resolve, reject) => { if (typeof body !== 'string') { try { body = JSON.stringify(body, null, 4); // eslint-disable-line } catch (err) { reject(err); }
</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) => {
if (typeof normalizedBody !== 'string') {
* @param {any} body */ function writeInFile(filename, body) { return new Promise((resolve, reject) => { if (typeof normalizedBody !== 'string') { try { body = JSON.stringify(body, null, 4); // eslint-disable-line } catch (err) { reject(err); }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
function writeInFile(filename, body) { return new Promise((resolve, reject) => { if (typeof body !== 'string') { try { body = JSON.stringify(body, null, 4); // eslint-disable-line } catch (err) { reject(err); } }
</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) => {
normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line
function writeInFile(filename, body) { return new Promise((resolve, reject) => { if (typeof body !== 'string') { try { normalizedBody = JSON.stringify(normalizedBody, null, 4); // eslint-disable-line } catch (err) { reject(err); } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
reject(err); } } fs.writeFile(filename, body, (err) => { if (err) reject(err); resolve('Ok'); }); }); }
</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);
fs.writeFile(filename, normalizedBody, (err) => {
reject(err); } } fs.writeFile(filename, normalizedBody, (err) => { if (err) reject(err); resolve('Ok'); }); }); }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
}); } /** * Request to server onesky * @param {string} url * @param {string} locale */ const request = (url, locale) => ( requestPromise.get(url)
</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(`&timestamp=${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';
* 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
}); } /** * 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 * @param {string} url * @param {string} locale */ const request = (url, locale) => ( requestPromise.get(url)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
* Download locales */ const download = () => { const locales = LOCALES_LIST; let oneskyapp; try { oneskyapp = JSON.parse(fs.readFileSync('./oneskyapp.json')); } catch (err) { throw new Error(err); } const requests = locales.map((locale) => { const url = prepare(locale, oneskyapp); return request(url, locale);
</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(`&timestamp=${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}`;
if (!TWOSKY_URI) { console.error('No credentials'); return;
* Download locales */ const download = () => { const locales = LOCALES_LIST; if (!TWOSKY_URI) { console.error('No credentials'); return; if (!TWOSKY_URI) { console.error('No credentials'); return; if (!TWOSKY_URI) { console.error('No credentials'); return; if (!TWOSKY_URI) { console.error('No credentials'); return; if (!TWOSKY_URI) { console.error('No credentials'); return; } const requests = locales.map((locale) => { const url = prepare(locale, oneskyapp); return request(url, locale);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
throw new Error(err); } const requests = locales.map((locale) => { const url = prepare(locale, oneskyapp); return request(url, locale); }); Promise .all(requests)
</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(`&timestamp=${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
const url = getRequestUrl(locale, TWOSKY_URI, TWOSKY_PROJECT_ID);
throw new Error(err); } const requests = locales.map((locale) => { const url = getRequestUrl(locale, TWOSKY_URI, TWOSKY_PROJECT_ID); return request(url, locale); }); Promise .all(requests)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/download.js
const path = require('path'); const fs = require('fs'); const crypto = require('crypto'); const request = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; /**
</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) => {
const path = require('path'); const fs = require('fs'); const request = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; /**
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
const crypto = require('crypto'); const request = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; /** * Hash content * * @param {string} content */ const hashString = content => crypto.createHash('md5').update(content, 'utf8').digest('hex'); /** * Prepare post params */ const prepare = () => {
</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(`&timestamp=${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}`;
const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home';
const crypto = require('crypto'); const request = require('request-promise'); const LOCALES_DIR = '../../client/src/__locales'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; const BASE_FILE = 'en.json'; const LANGUAGE = 'en'; const TWOSKY_URI = process.env.TWOSKY_URI; const TWOSKY_PROJECT_ID = 'home'; /** * Prepare post params */ const prepare = () => {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
/** * Prepare post params */ 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); const formData = { timestamp, file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')), file_format: 'HIERARCHICAL_JSON', locale: 'en',
</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(`&timestamp=${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
const getRequestData = (url, projectId) => {
/** * Prepare post params */ const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const getRequestData = (url, projectId) => { const formData = { timestamp, file: fs.createReadStream(path.resolve(LOCALES_DIR, 'en.json')), file_format: 'HIERARCHICAL_JSON', locale: 'en',
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`; const timestamp = Math.round(new Date().getTime() / 1000); const formData = { 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), }; return { url, 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 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(`&timestamp=${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);
format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)),
const url = `${oneskyapp.url}${oneskyapp.projectId}/files`; const timestamp = Math.round(new Date().getTime() / 1000); const formData = { format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), format: 'json', language: LANGUAGE, filename: BASE_FILE, project: projectId, file: fs.createReadStream(path.resolve(LOCALES_DIR, `${LANGUAGE}.json`)), }; return { url, formData }; };
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
api_key: oneskyapp.apiKey, dev_hash: hashString(timestamp + oneskyapp.secretKey), }; return { url, formData }; }; /** * Make request to onesky to upload new json */
</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(`&timestamp=${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
return { url: `${url}/upload`, formData };
api_key: oneskyapp.apiKey, dev_hash: hashString(timestamp + oneskyapp.secretKey), }; return { url: `${url}/upload`, formData }; }; /** * Make request to onesky to upload new json */
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
return { url, formData }; }; /** * Make request to onesky to upload new json */ const upload = () => { const { url, formData } = prepare(); request .post({ url, formData })
</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(`&timestamp=${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}`;
* Make request to twosky to upload new json
return { url, formData }; }; /** * Make request to twosky to upload new json */ const upload = () => { const { url, formData } = prepare(); request .post({ url, formData })
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
/** * Make request to onesky to upload new json */ const upload = () => { const { url, formData } = prepare(); request .post({ url, formData }) .catch(err => console.log(err)); };
</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
if (!TWOSKY_URI) { console.error('No credentials'); return; } const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID);
/** * Make request to onesky to upload new json */ const upload = () => { if (!TWOSKY_URI) { console.error('No credentials'); return; } const { url, formData } = getRequestData(TWOSKY_URI, TWOSKY_PROJECT_ID); request .post({ url, formData }) .catch(err => console.log(err)); };
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
+ translations: add twosky integration
https://github.com/AdguardTeam/AdGuardHome/commit/3b0f2e5563bfa3411b258b1b9c0b9d74f5598514
scripts/translations/upload.js
d.ParentalBlockHost = c.Val() } case "querylog": d.QueryLogEnabled = true once.Do(func() { go startQueryLogServer() // TODO: how to handle errors? }) } } }
</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() {
onceQueryLog.Do(func() {
d.ParentalBlockHost = c.Val() } case "querylog": d.QueryLogEnabled = true onceQueryLog.Do(func() { go startQueryLogServer() // TODO: how to handle errors? }) } } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix registration of metrics if querylog is enabled
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
return d }) c.OnStartup(func() error { once.Do(func() { m := dnsserver.GetConfig(c).Handler("prometheus") if m == nil { return } if x, ok := m.(*metrics.Metrics); ok {
</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() {
onceMetrics.Do(func() {
return d }) c.OnStartup(func() error { onceMetrics.Do(func() { m := dnsserver.GetConfig(c).Handler("prometheus") if m == nil { return } if x, ok := m.(*metrics.Metrics); ok {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix registration of metrics if querylog is enabled
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
} // log if d.QueryLogEnabled { logRequest(rrw.Msg, result, time.Since(start), ip) } return rcode, err } func (d *Plugin) Name() string { return "dnsfilter" }
</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() {
logRequest(r, rrw.Msg, result, time.Since(start), ip)
} // log if d.QueryLogEnabled { logRequest(r, rrw.Msg, result, time.Since(start), ip) } return rcode, err } func (d *Plugin) Name() string { return "dnsfilter" }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix registration of metrics if querylog is enabled
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
} func (d *Plugin) Name() string { return "dnsfilter" } var once sync.Once
</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() {
var onceMetrics, onceQueryLog sync.Once
} func (d *Plugin) Name() string { return "dnsfilter" } var onceMetrics, onceQueryLog sync.Once
[ "keep", "keep", "keep", "keep", "replace" ]
Fix registration of metrics if querylog is enabled
https://github.com/AdguardTeam/AdGuardHome/commit/3b11648e14f44fed72da027bb51e7151216a3c5c
coredns_plugin/coredns_plugin.go
}) } type plug struct { d *dnsfilter.Dnsfilter Next plugin.Handler upstream upstream.Upstream
</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 {
type plugSettings struct { SafeBrowsingBlockHost string ParentalBlockHost string QueryLogEnabled bool BlockedTTL uint32 // in seconds, default 3600 }
}) } type plugSettings struct { SafeBrowsingBlockHost string ParentalBlockHost string QueryLogEnabled bool BlockedTTL uint32 // in seconds, default 3600 } type plug struct { d *dnsfilter.Dnsfilter Next plugin.Handler upstream upstream.Upstream
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
d *dnsfilter.Dnsfilter Next plugin.Handler upstream upstream.Upstream hosts map[string]net.IP SafeBrowsingBlockHost string ParentalBlockHost string QueryLogEnabled bool BlockedTTL uint32 // in seconds, default 3600 sync.RWMutex } var defaultPlugin = plug{
</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 {
settings plugSettings
d *dnsfilter.Dnsfilter Next plugin.Handler upstream upstream.Upstream hosts map[string]net.IP settings plugSettings settings plugSettings settings plugSettings settings plugSettings settings plugSettings sync.RWMutex } var defaultPlugin = plug{
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
sync.RWMutex } var defaultPlugin = plug{ SafeBrowsingBlockHost: "safebrowsing.block.dns.adguard.com", ParentalBlockHost: "family.block.dns.adguard.com", BlockedTTL: 3600, // in seconds }
</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 {
var defaultPluginSettings = plugSettings{
sync.RWMutex } var defaultPluginSettings = plugSettings{ SafeBrowsingBlockHost: "safebrowsing.block.dns.adguard.com", ParentalBlockHost: "family.block.dns.adguard.com", BlockedTTL: 3600, // in seconds }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
// coredns handling functions // func setupPlugin(c *caddy.Controller) (*plug, error) { // create new Plugin and copy default values var p = new(plug) *p = defaultPlugin p.d = dnsfilter.New() p.hosts = make(map[string]net.IP) filterFileNames := []string{} for c.Next() { args := c.RemainingArgs() if len(args) > 0 {
</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 {
p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), }
// coredns handling functions // func setupPlugin(c *caddy.Controller) (*plug, error) { // create new Plugin and copy default values p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), } p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), } p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), } p := &plug{ settings: defaultPluginSettings, d: dnsfilter.New(), hosts: make(map[string]net.IP), } filterFileNames := []string{} for c.Next() { args := c.RemainingArgs() if len(args) > 0 {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
if c.NextArg() { if len(c.Val()) == 0 { return nil, c.ArgErr() } p.ParentalBlockHost = c.Val() } case "blocked_ttl": if !c.NextArg() { return nil, c.ArgErr() }
</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
p.settings.ParentalBlockHost = c.Val()
if c.NextArg() { if len(c.Val()) == 0 { return nil, c.ArgErr() } p.settings.ParentalBlockHost = c.Val() } case "blocked_ttl": if !c.NextArg() { return nil, c.ArgErr() }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
blockttl, err := strconv.ParseUint(c.Val(), 10, 32) if err != nil { return nil, c.ArgErr() } p.BlockedTTL = uint32(blockttl) case "querylog": p.QueryLogEnabled = true onceQueryLog.Do(func() { go startQueryLogServer() // TODO: how to handle errors? })
</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
p.settings.BlockedTTL = uint32(blockttl)
blockttl, err := strconv.ParseUint(c.Val(), 10, 32) if err != nil { return nil, c.ArgErr() } p.settings.BlockedTTL = uint32(blockttl) case "querylog": p.QueryLogEnabled = true onceQueryLog.Do(func() { go startQueryLogServer() // TODO: how to handle errors? })
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
return nil, c.ArgErr() } p.BlockedTTL = uint32(blockttl) case "querylog": p.QueryLogEnabled = true onceQueryLog.Do(func() { go startQueryLogServer() // TODO: how to handle errors? }) } }
</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{
p.settings.QueryLogEnabled = true
return nil, c.ArgErr() } p.BlockedTTL = uint32(blockttl) case "querylog": p.settings.QueryLogEnabled = true onceQueryLog.Do(func() { go startQueryLogServer() // TODO: how to handle errors? }) } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
var records []dns.RR log.Println("Will give", val, "instead of", host) if addr != nil { // this is an IP address, return it result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.BlockedTTL, val)) if err != nil { log.Printf("Got error %s\n", err) return dns.RcodeServerFailure, fmt.Errorf("plugin/dnsfilter: %s", err) } records = append(records, result)
</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}
result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val))
var records []dns.RR log.Println("Will give", val, "instead of", host) if addr != nil { // this is an IP address, return it result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) if err != nil { log.Printf("Got error %s\n", err) return dns.RcodeServerFailure, fmt.Errorf("plugin/dnsfilter: %s", err) } records = append(records, result)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
// generate SOA record that makes DNS clients cache NXdomain results // the only value that is important is TTL in header, other values like refresh, retry, expire and minttl are irrelevant func (p *plug) genSOA(r *dns.Msg) []dns.RR { zone := r.Question[0].Name header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.BlockedTTL, Class: dns.ClassINET} Mbox := "hostmaster." if zone[0] != '.' { Mbox += zone }
</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
header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET}
// generate SOA record that makes DNS clients cache NXdomain results // the only value that is important is TTL in header, other values like refresh, retry, expire and minttl are irrelevant func (p *plug) genSOA(r *dns.Msg) []dns.RR { zone := r.Question[0].Name header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: p.settings.BlockedTTL, Class: dns.ClassINET} Mbox := "hostmaster." if zone[0] != '.' { Mbox += zone }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
if result.IsFiltered { switch result.Reason { case dnsfilter.FilteredSafeBrowsing: // return cname safebrowsing.block.dns.adguard.com val := p.SafeBrowsingBlockHost rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) if err != nil { return rcode, dnsfilter.Result{}, err } return rcode, result, err
</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, "", " ")
val := p.settings.SafeBrowsingBlockHost
if result.IsFiltered { switch result.Reason { case dnsfilter.FilteredSafeBrowsing: // return cname safebrowsing.block.dns.adguard.com val := p.settings.SafeBrowsingBlockHost rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) if err != nil { return rcode, dnsfilter.Result{}, err } return rcode, result, err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
} return rcode, result, err case dnsfilter.FilteredParental: // return cname family.block.dns.adguard.com val := p.ParentalBlockHost rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) if err != nil { return rcode, dnsfilter.Result{}, err } return rcode, result, err
</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)
val := p.settings.ParentalBlockHost
} return rcode, result, err case dnsfilter.FilteredParental: // return cname family.block.dns.adguard.com val := p.settings.ParentalBlockHost rcode, err := p.replaceHostWithValAndReply(ctx, w, r, host, val, question) if err != nil { return rcode, dnsfilter.Result{}, err } return rcode, result, err
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
rcode = dns.RcodeServerFailure } // log if p.QueryLogEnabled { logRequest(r, rrw.Msg, result, time.Since(start), ip) } return rcode, err }
</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()
if p.settings.QueryLogEnabled {
rcode = dns.RcodeServerFailure } // log if p.settings.QueryLogEnabled { logRequest(r, rrw.Msg, result, time.Since(start), ip) } return rcode, err }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
coredns_plugin/coredns_plugin.go
func writeStats() error { statsFile := filepath.Join(config.ourBinaryDir, "stats.json") log.Printf("Writing JSON file: %s", statsFile) statistics.RLock() json, err := json.MarshalIndent(statistics, "", " ") statistics.RUnlock() if err != nil { log.Printf("Couldn't generate JSON: %s", err) return err }
</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)
json, err := json.MarshalIndent(&statistics, "", " ")
func writeStats() error { statsFile := filepath.Join(config.ourBinaryDir, "stats.json") log.Printf("Writing JSON file: %s", statsFile) statistics.RLock() json, err := json.MarshalIndent(&statistics, "", " ") statistics.RUnlock() if err != nil { log.Printf("Couldn't generate JSON: %s", err) return err }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Fix more race conditions found by race detector
https://github.com/AdguardTeam/AdGuardHome/commit/3b1faa1365dc72c01728263b4dfd61c5274dbf6d
stats.go
github.com/rogpeppe/go-internal v1.7.0 // indirect github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/cobra v1.1.3 // indirect github.com/stretchr/testify v1.6.1 github.com/ti-mo/netfilter v0.4.0 github.com/u-root/u-root v7.0.0+incompatible go.etcd.io/bbolt v1.3.5 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
</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" )
github.com/stretchr/testify v1.7.0
github.com/rogpeppe/go-internal v1.7.0 // indirect github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/cobra v1.1.3 // indirect github.com/stretchr/testify v1.7.0 github.com/ti-mo/netfilter v0.4.0 github.com/u-root/u-root v7.0.0+incompatible go.etcd.io/bbolt v1.3.5 golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
go.mod
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU= github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg= github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
</s> remove github.com/stretchr/testify v1.6.1 </s> add github.com/stretchr/testify v1.7.0 </s> remove "os/exec" </s> add
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU= github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg= github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
go.sum
import ( "fmt" "strings" ) // Error is the constant error type. type Error string // Error implements the error interface for Error.
</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)
"github.com/AdguardTeam/golibs/log"
import ( "fmt" "strings" "github.com/AdguardTeam/golibs/log" ) // Error is the constant error type. type Error string // Error implements the error interface for Error.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr.go
// // msg must contain the final ": %w" verb. func Annotate(msg string, errPtr *error, args ...interface{}) { if errPtr == nil { return } err := *errPtr
</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")
// // TODO(a.garipov): Clearify the function usage.
// // msg must contain the final ": %w" verb. // // TODO(a.garipov): Clearify the function usage. func Annotate(msg string, errPtr *error, args ...interface{}) { if errPtr == nil { return } err := *errPtr
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr.go
package agherr import ( "errors" "fmt" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> remove "errors" </s> add </s> remove "errors" </s> add </s> remove "fmt" </s> add
"bytes"
package agherr import ( "bytes" "errors" "fmt" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr_test.go
"errors" "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestError_Error(t *testing.T) { testCases := []struct {
</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
"github.com/AdguardTeam/AdGuardHome/internal/aghtest"
"errors" "fmt" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestError_Error(t *testing.T) { testCases := []struct {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/agherr/agherr_test.go
"io/ioutil" "regexp" "strings" "github.com/AdguardTeam/AdGuardHome/internal/util" ) // hardwarePortInfo - information obtained using MacOS networksetup // about the current state of the internet connection type hardwarePortInfo struct {
</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" )
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
"io/ioutil" "regexp" "strings" "github.com/AdguardTeam/AdGuardHome/internal/aghos" ) // hardwarePortInfo - information obtained using MacOS networksetup // about the current state of the internet connection type hardwarePortInfo struct {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
// getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output func getNetworkSetupHardwareReports() map[string]string { _, out, err := util.RunCommand("networksetup", "-listallhardwareports") if err != nil { return nil } re, err := regexp.Compile("Hardware Port: (.*?)\nDevice: (.*?)\n")
</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
_, out, err := aghos.RunCommand("networksetup", "-listallhardwareports")
// getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command // it returns a map where the key is the interface name, and the value is the "hardware port" // returns nil if it fails to parse the output func getNetworkSetupHardwareReports() map[string]string { _, out, err := aghos.RunCommand("networksetup", "-listallhardwareports") if err != nil { return nil } re, err := regexp.Compile("Hardware Port: (.*?)\nDevice: (.*?)\n")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) { h := hardwarePortInfo{} _, out, err := util.RunCommand("networksetup", "-getinfo", hardwarePort) if err != nil { return h, err } re := regexp.MustCompile("IP address: (.*?)\nSubnet mask: (.*?)\nRouter: (.*?)\n")
</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
_, out, err := aghos.RunCommand("networksetup", "-getinfo", hardwarePort)
func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) { h := hardwarePortInfo{} _, out, err := aghos.RunCommand("networksetup", "-getinfo", hardwarePort) if err != nil { return h, err } re := regexp.MustCompile("IP address: (.*?)\nSubnet mask: (.*?)\nRouter: (.*?)\n")
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
args = append(args, "-setdnsservers", portInfo.name) args = append(args, dnsAddrs...) // Setting DNS servers is necessary when configuring a static IP code, _, err := util.RunCommand("networksetup", args...) if err != nil { return err } if code != 0 { return fmt.Errorf("failed to set DNS servers, code=%d", code)
</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)
code, _, err := aghos.RunCommand("networksetup", args...)
args = append(args, "-setdnsservers", portInfo.name) args = append(args, dnsAddrs...) // Setting DNS servers is necessary when configuring a static IP code, _, err := aghos.RunCommand("networksetup", args...) if err != nil { return err } if code != 0 { return fmt.Errorf("failed to set DNS servers, code=%d", code)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
return fmt.Errorf("failed to set DNS servers, code=%d", code) } // Actually configures hardware port to have static IP code, _, err = util.RunCommand("networksetup", "-setmanual", portInfo.name, portInfo.ip, portInfo.subnet, portInfo.gatewayIP) if err != nil { return err } if code != 0 {
</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)
code, _, err = aghos.RunCommand("networksetup", "-setmanual",
return fmt.Errorf("failed to set DNS servers, code=%d", code) } // Actually configures hardware port to have static IP code, _, err = aghos.RunCommand("networksetup", "-setmanual", portInfo.name, portInfo.ip, portInfo.subnet, portInfo.gatewayIP) if err != nil { return err } if code != 0 {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghnet/net_darwin.go
// Package aghos contains utilities for functions requiring system calls. package aghos import "syscall" // CanBindPrivilegedPorts checks if current process can bind to privileged // ports. func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts()
</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
import ( "fmt" "os/exec" "syscall" )
// Package aghos contains utilities for functions requiring system calls. package aghos import ( "fmt" "os/exec" "syscall" ) // CanBindPrivilegedPorts checks if current process can bind to privileged // ports. func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts()
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghos/os.go
import ( "crypto/sha256" "encoding/hex" "fmt" "net" "strings" "sync"
</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
"errors"
import ( "crypto/sha256" "encoding/hex" "errors" "fmt" "net" "strings" "sync"
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
"net" "strings" "sync" "github.com/AdguardTeam/AdGuardHome/internal/agherr" "github.com/miekg/dns" ) // TestUpstream is a mock of real upstream. type TestUpstream struct {
</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")
"net" "strings" "sync" "github.com/miekg/dns" ) // TestUpstream is a mock of real upstream. type TestUpstream struct {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
type TestErrUpstream struct{} // Exchange always returns nil Msg and non-nil error. func (u *TestErrUpstream) Exchange(*dns.Msg) (*dns.Msg, error) { return nil, agherr.Error("bad") } // Address always returns an empty string. func (u *TestErrUpstream) Address() string { return ""
</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)
// 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")
type TestErrUpstream struct{} // Exchange always returns nil Msg and non-nil error. func (u *TestErrUpstream) Exchange(*dns.Msg) (*dns.Msg, error) { // 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") } // Address always returns an empty string. func (u *TestErrUpstream) Address() string { return ""
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/aghtest/upstream.go
package home import ( "encoding/json" "errors" "fmt" "net" "net/http" "net/url" "runtime"
</s> remove "fmt" </s> add </s> remove "errors" </s> add </s> remove "os/exec" </s> add
package home import ( "encoding/json" "fmt" "net" "net/http" "net/url" "runtime"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
"strconv" "strings" "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs/log" "github.com/NYTimes/gziphandler" )
</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"
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
"strconv" "strings" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs/log" "github.com/NYTimes/gziphandler" )
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
if web.httpsServer.server == nil { return true } host, _, err := net.SplitHostPort(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort.
</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)
host, err := aghnet.SplitHost(r.Host)
if web.httpsServer.server == nil { return true } host, err := aghnet.SplitHost(r.Host) if err != nil { // Check for the missing port error. If it is that error, just // use the host as is. // // See the source code for net.SplitHostPort.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
} host, _, err := net.SplitHostPort(r.Host) if err != nil { // 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" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { 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 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)
httpError(w, http.StatusBadRequest, "bad host: %s", err)
} host, _, err := net.SplitHostPort(r.Host) if err != nil { httpError(w, http.StatusBadRequest, "bad host: %s", err) httpError(w, http.StatusBadRequest, "bad host: %s", err) httpError(w, http.StatusBadRequest, "bad host: %s", err) httpError(w, http.StatusBadRequest, "bad host: %s", err) httpError(w, http.StatusBadRequest, "bad host: %s", err) addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
// // See the source code for net.SplitHostPort. const missingPort = "missing port in address" addrErr := &net.AddrError{} if !errors.As(err, &addrErr) || addrErr.Err != missingPort { httpError(w, http.StatusBadRequest, "bad host: %s", err) return false } host = r.Host } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort {
</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=")
return false
// // See the source code for net.SplitHostPort. const missingPort = "missing port in address" return false return false return false return false return false return false return false return false } if r.TLS == nil && web.forceHTTPS { hostPort := host if port := web.conf.PortHTTPS; port != defaultHTTPSPort {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/control.go
"time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/golibs/log" )
</s> remove "errors" </s> add </s> remove "os/exec" </s> add
"github.com/AdguardTeam/AdGuardHome/internal/agherr"
"time" "github.com/AdguardTeam/AdGuardHome/internal/agherr" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/golibs/log" )
[ "keep", "add", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
// shutdownTimeout is the timeout for shutting HTTP server down operation. const shutdownTimeout = 5 * time.Second func logPanic() { if v := recover(); v != nil { log.Error("recovered from panic: %v", v) } } func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) { defer logPanic() if srv == nil { return
</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)
// shutdownTimeout is the timeout for shutting HTTP server down operation. const shutdownTimeout = 5 * time.Second func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) { defer logPanic() if srv == nil { return
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
} } func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) { defer logPanic() if srv == nil { return }
</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)
defer agherr.LogPanic("")
} } func shutdownSrv(ctx context.Context, cancel context.CancelFunc, srv *http.Server) { defer agherr.LogPanic("") if srv == nil { return }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/controlinstall.go
data, err := ioutil.ReadFile(pidfile) if os.IsNotExist(err) { var code int var psdata string code, psdata, err = util.RunCommand("ps", "-C", serviceName, "-o", "pid=") if err != nil || code != 0 { log.Error("Can't find AdGuardHome process: %s code:%d", err, code) return } data = []byte(psdata)
</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)
code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=")
data, err := ioutil.ReadFile(pidfile) if os.IsNotExist(err) { var code int var psdata string code, psdata, err = aghos.RunCommand("ps", "-C", serviceName, "-o", "pid=") if err != nil || code != 0 { log.Error("Can't find AdGuardHome process: %s code:%d", err, code) return } data = []byte(psdata)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/service.go
// runInitdCommand runs init.d service command // returns command code or error if any func runInitdCommand(action string) (int, error) { confPath := "/etc/init.d/" + serviceName code, _, err := util.RunCommand("sh", "-c", confPath+" "+action) return code, err } // Basically the same template as the one defined in github.com/kardianos/service // but with two additional keys - StandardOutPath and StandardErrorPath
</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)
code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action)
// runInitdCommand runs init.d service command // returns command code or error if any func runInitdCommand(action string) (int, error) { confPath := "/etc/init.d/" + serviceName code, _, err := aghos.RunCommand("sh", "-c", confPath+" "+action) return code, err } // Basically the same template as the one defined in github.com/kardianos/service // but with two additional keys - StandardOutPath and StandardErrorPath
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/home/service.go
package querylog import ( "errors" "io" "testing" "time" "github.com/stretchr/testify/assert"
</s> remove "errors" </s> add </s> remove "fmt" </s> add
package querylog import ( "io" "testing" "time" "github.com/stretchr/testify/assert"
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/querylog/qlogreader_test.go
ts, err := time.Parse(time.RFC3339Nano, tc.time) require.Nil(t, err) err = r.SeekTS(ts.UnixNano()) assert.True(t, errors.Is(err, tc.want), err) }) } } func TestQLogReader_ReadNext(t *testing.T) {
</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...)
assert.ErrorIs(t, err, tc.want)
ts, err := time.Parse(time.RFC3339Nano, tc.time) require.Nil(t, err) err = r.SeekTS(ts.UnixNano()) assert.ErrorIs(t, err, tc.want) }) } } func TestQLogReader_ReadNext(t *testing.T) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/querylog/qlogreader_test.go
package util import ( "bytes" "fmt" "io/ioutil" "os/exec" "path/filepath" "runtime" "strings"
</s> remove "os/exec" </s> add </s> remove "errors" </s> add </s> remove import "syscall" </s> add import ( "fmt" "os/exec" "syscall" )
package util import ( "bytes" "io/ioutil" "os/exec" "path/filepath" "runtime" "strings"
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
import ( "bytes" "fmt" "io/ioutil" "os/exec" "path/filepath" "runtime" "strings" )
</s> remove "fmt" </s> add </s> remove "errors" </s> add </s> remove import "syscall" </s> add import ( "fmt" "os/exec" "syscall" )
import ( "bytes" "fmt" "io/ioutil" "path/filepath" "runtime" "strings" )
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
"runtime" "strings" ) // 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 } // SplitNext - split string by a byte and return the first chunk // Skip empty chunks // Whitespace is trimmed func SplitNext(str *string, splitBy byte) string { i := strings.IndexByte(*str, splitBy)
</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)
"runtime" "strings" ) // SplitNext - split string by a byte and return the first chunk // Skip empty chunks // Whitespace is trimmed func SplitNext(str *string, splitBy byte) string { i := strings.IndexByte(*str, splitBy)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b2f5d7842a290a124a04489b3cca20f02a180d4
internal/util/helpers.go
env GOOS='darwin' "$(GO.MACRO)" vet ./internal/... env GOOS='freebsd' "$(GO.MACRO)" vet ./internal/... env GOOS='linux' "$(GO.MACRO)" vet ./internal/... env GOOS='windows' "$(GO.MACRO)" vet ./internal/... openapi-lint: ; cd ./openapi/ && $(YARN) test
</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)
env GOOS='openbsd' "$(GO.MACRO)" vet ./internal/...
env GOOS='darwin' "$(GO.MACRO)" vet ./internal/... env GOOS='freebsd' "$(GO.MACRO)" vet ./internal/... env GOOS='openbsd' "$(GO.MACRO)" vet ./internal/... env GOOS='linux' "$(GO.MACRO)" vet ./internal/... env GOOS='windows' "$(GO.MACRO)" vet ./internal/... openapi-lint: ; cd ./openapi/ && $(YARN) test
[ "keep", "add", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
Makefile
"os/exec" "syscall" ) // ErrUnsupported is returned when the functionality is unsupported on the // current operating system.
</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
"github.com/AdguardTeam/golibs/errors"
"os/exec" "syscall" "github.com/AdguardTeam/golibs/errors" ) // ErrUnsupported is returned when the functionality is unsupported on the // current operating system.
[ "keep", "add", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
) // CanBindPrivilegedPorts checks if current process can bind to privileged // ports. func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts() }
</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) {
// 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"
) // 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" // CanBindPrivilegedPorts checks if current process can bind to privileged // ports. func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts() }
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts() } // 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) } // HaveAdminRights checks if the current user has root (administrator) rights. func HaveAdminRights() (bool, error) { return haveAdminRights()
</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
// 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)
func CanBindPrivilegedPorts() (can bool, err error) { return canBindPrivilegedPorts() } // 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) // 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) // 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) // 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) } // HaveAdminRights checks if the current user has root (administrator) rights. func HaveAdminRights() (bool, error) { return haveAdminRights()
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os.go
import ( "os" "syscall" "github.com/AdguardTeam/golibs/log" ) func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() }
</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) {
import ( "os" "syscall" ) func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() } func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
</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)
func setRlimit(val uint64) (err error) {
func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() } func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
} func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil { log.Error("Setrlimit() failed: %v", err) } } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil }
</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) {
rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
} func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_bsd.go
import ( "os" "syscall" "github.com/AdguardTeam/golibs/log" ) func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() }
</s>
import ( "os" "syscall" ) func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() } func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = int64(val) rlim.Cur = int64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
</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)
func setRlimit(val uint64) (err error) {
func canBindPrivilegedPorts() (can bool, err error) { return HaveAdminRights() } func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = int64(val) rlim.Cur = int64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = int64(val) rlim.Cur = int64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil { log.Error("Setrlimit() failed: %v", err) } } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil }
</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) {
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = int64(val) rlim.Cur = int64(val) return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_freebsd.go
"path/filepath" "strings" "syscall" "github.com/AdguardTeam/golibs/log" "golang.org/x/sys/unix" ) func canBindPrivilegedPorts() (can bool, err error) { cnbs, err := unix.PrctlRetInt(unix.PR_CAP_AMBIENT, unix.PR_CAP_AMBIENT_IS_SET, unix.CAP_NET_BIND_SERVICE, 0, 0)
</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
"path/filepath" "strings" "syscall" "golang.org/x/sys/unix" ) func canBindPrivilegedPorts() (can bool, err error) { cnbs, err := unix.PrctlRetInt(unix.PR_CAP_AMBIENT, unix.PR_CAP_AMBIENT_IS_SET, unix.CAP_NET_BIND_SERVICE, 0, 0)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go
return cnbs == 1 || adm, err } func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
</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) {
func setRlimit(val uint64) (err error) {
return cnbs == 1 || adm, err } func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go
} func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = uint64(val) rlim.Cur = uint64(val) err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) if err != nil { log.Error("Setrlimit() failed: %v", err) } } func haveAdminRights() (bool, error) { // The error is nil because the platform-independent function signature // requires returning an 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) { </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) {
rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim)
} func setRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } func haveAdminRights() (bool, error) { // The error is nil because the platform-independent function signature // requires returning an error.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
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
https://github.com/AdguardTeam/AdGuardHome/commit/3b87478470ff49fbfe850c8f12492265a3c9491b
internal/aghos/os_linux.go