diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 419ee4c2..5160c32e 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -563,5 +563,6 @@ "filter_category_regional_desc": "Lists that focus on regional ads and tracking servers", "filter_category_other_desc": "Other blocklists", "original_response": "Original response", - "click_to_view_queries": "Click to view queries" + "click_to_view_queries": "Click to view queries", + "port_53_faq_link": "Port 53 is often occupied by \"DNSStubListener\" or \"systemd-resolved\" services. Please read <0>this instruction on how to resolve this." } diff --git a/client/src/helpers/constants.js b/client/src/helpers/constants.js index 89f3d35e..aa8d3291 100644 --- a/client/src/helpers/constants.js +++ b/client/src/helpers/constants.js @@ -35,6 +35,10 @@ export const REPOSITORY = { }; export const PRIVACY_POLICY_LINK = 'https://adguard.com/privacy/home.html'; +export const PORT_53_FAQ_LINK = 'https://github.com/AdguardTeam/AdGuardHome/wiki/FAQ#bindinuse'; + +export const ADDRESS_IN_USE_TEXT = 'address already in use'; +export const UBUNTU_SYSTEM_PORT = 53; export const INSTALL_FIRST_STEP = 1; export const INSTALL_TOTAL_STEPS = 5; diff --git a/client/src/install/Setup/Settings.js b/client/src/install/Setup/Settings.js index a939af41..443b8036 100644 --- a/client/src/install/Setup/Settings.js +++ b/client/src/install/Setup/Settings.js @@ -1,4 +1,4 @@ -import React, { Component, Fragment } from 'react'; +import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { Field, reduxForm, formValueSelector } from 'redux-form'; @@ -9,7 +9,9 @@ import Controls from './Controls'; import AddressList from './AddressList'; import { getInterfaceIp } from '../../helpers/helpers'; -import { ALL_INTERFACES_IP, FORM_NAME } from '../../helpers/constants'; +import { + ALL_INTERFACES_IP, FORM_NAME, ADDRESS_IN_USE_TEXT, PORT_53_FAQ_LINK, UBUNTU_SYSTEM_PORT, +} from '../../helpers/constants'; import { renderInputField, toNumber } from '../../helpers/form'; import { validateRequiredValue, validateInstallPort } from '../../helpers/validators'; @@ -20,37 +22,38 @@ const STATIC_STATUS = { }; const renderInterfaces = ((interfaces) => ( - Object.keys(interfaces).map((item) => { - const option = interfaces[item]; - const { - name, - ip_addresses, - flags, - } = option; + Object.keys(interfaces) + .map((item) => { + const option = interfaces[item]; + const { + name, + ip_addresses, + flags, + } = option; - if (option && ip_addresses?.length > 0) { - const ip = getInterfaceIp(option); - const isDown = flags?.includes('down'); + if (option && ip_addresses?.length > 0) { + const ip = getInterfaceIp(option); + const isDown = flags?.includes('down'); + + if (isDown) { + return ( + + ); + } - if (isDown) { return ( - ); } - return ( - - ); - } - - return false; - }) + return false; + }) )); class Settings extends Component { @@ -79,9 +82,9 @@ class Settings extends Component { } return ( - + <> {status === STATIC_STATUS.DISABLED && ( - + <>
text]}> install_static_configure @@ -94,7 +97,7 @@ class Settings extends Component { > set_static_ip - + )} {status === STATIC_STATUS.ERROR && (
@@ -108,7 +111,7 @@ class Settings extends Component {
)} - + ); }; @@ -121,8 +124,16 @@ class Settings extends Component { handleFix, } = this.props; - const web = { ip: webIp, port: webPort, autofix: false }; - const dns = { ip: dnsIp, port: dnsPort, autofix: false }; + const web = { + ip: webIp, + port: webPort, + autofix: false, + }; + const dns = { + ip: dnsIp, + port: dnsPort, + autofix: false, + }; const set_static_ip = false; if (type === 'web') { @@ -143,8 +154,16 @@ class Settings extends Component { handleFix, } = this.props; - const web = { ip: webIp, port: webPort, autofix: false }; - const dns = { ip: dnsIp, port: dnsPort, autofix: false }; + const web = { + ip: webIp, + port: webPort, + autofix: false, + }; + const dns = { + ip: dnsIp, + port: dnsPort, + autofix: false, + }; const set_static_ip = true; if (window.confirm(this.props.t('confirm_static_ip', { ip }))) { @@ -228,11 +247,9 @@ class Settings extends Component { onClick={() => this.handleAutofix('web')} > fix - - } -
-
- } + } + } +
@@ -289,7 +306,7 @@ class Settings extends Component {
{dnsStatus - && + && <>
{dnsStatus} {isDnsFixAvailable @@ -314,9 +331,14 @@ class Settings extends Component { autofix_warning_result

} -
-
- } + } + {dnsPort === UBUNTU_SYSTEM_PORT && !isDnsFixAvailable + && dnsStatus.includes(ADDRESS_IN_USE_TEXT) + && link]}> + port_53_faq_link + } +