+ client: 1889 Show a link to the FAQ article about Ubuntu when port 53 is in use

Close #1889

Squashed commit of the following:

commit 4fa57f692d0a66d20e9ba9d235ec423e5118db20
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 17:28:38 2020 +0300

    Revert "Update locales"

    This reverts commit dd88f8047e612022678dfabe8dda446c4b8f201b.

commit dd88f8047e612022678dfabe8dda446c4b8f201b
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 17:26:00 2020 +0300

    Update locales

commit 954ae2e97e988b53856766100c873e6d40b75123
Merge: 28f205a8 c1e56c83
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 17:23:50 2020 +0300

    Merge branch 'master' into feature/1889

commit 28f205a858281811af7d708356e10108983c7292
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 15:39:57 2020 +0300

    Rename systemdns-resolved ---> systemd-resolved

commit 3d62e26984f73285a7b788b6f42efcb3376ae562
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 15:15:10 2020 +0300

    Add commas to port 53 locale

commit 457563085186244dca36a80a959e5a9486558299
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 13:34:13 2020 +0300

    minor

commit 7aacf879951f8ab619824730cb28ea5cd2518812
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Fri Jul 17 13:27:55 2020 +0300

    + client: Show a link to the FAQ article about Ubuntu when port 53 is in use
This commit is contained in:
Artem Baskal 2020-07-17 17:59:34 +03:00
parent c1e56c837b
commit 4175d82279
3 changed files with 71 additions and 44 deletions

View File

@ -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</0> on how to resolve this."
}

View File

@ -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;

View File

@ -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,7 +22,8 @@ const STATIC_STATUS = {
};
const renderInterfaces = ((interfaces) => (
Object.keys(interfaces).map((item) => {
Object.keys(interfaces)
.map((item) => {
const option = interfaces[item];
const {
name,
@ -35,9 +38,9 @@ const renderInterfaces = ((interfaces) => (
if (isDown) {
return (
<option value={ip} key={name} disabled>
<Fragment>
<>
{name} - {ip} (<Trans>down</Trans>)
</Fragment>
</>
</option>
);
}
@ -79,9 +82,9 @@ class Settings extends Component {
}
return (
<Fragment>
<>
{status === STATIC_STATUS.DISABLED && (
<Fragment>
<>
<div className="mb-2">
<Trans values={{ ip }} components={[<strong key="0">text</strong>]}>
install_static_configure
@ -94,7 +97,7 @@ class Settings extends Component {
>
<Trans>set_static_ip</Trans>
</button>
</Fragment>
</>
)}
{status === STATIC_STATUS.ERROR && (
<div className="text-danger">
@ -108,7 +111,7 @@ class Settings extends Component {
</Trans>
</div>
)}
</Fragment>
</>
);
};
@ -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,12 +247,10 @@ class Settings extends Component {
onClick={() => this.handleAutofix('web')}
>
<Trans>fix</Trans>
</button>
}
</button>}
</div>}
<hr className="divider--small" />
</div>
}
</div>
</div>
<div className="setup__desc">
<Trans>install_settings_interface_link</Trans>
@ -289,7 +306,7 @@ class Settings extends Component {
</div>
<div className="col-12">
{dnsStatus
&& <Fragment>
&& <>
<div className="setup__error text-danger">
{dnsStatus}
{isDnsFixAvailable
@ -314,9 +331,14 @@ class Settings extends Component {
<Trans>autofix_warning_result</Trans>
</p>
</div>}
</>}
{dnsPort === UBUNTU_SYSTEM_PORT && !isDnsFixAvailable
&& dnsStatus.includes(ADDRESS_IN_USE_TEXT)
&& <Trans
components={[<a href={PORT_53_FAQ_LINK} key="0">link</a>]}>
port_53_faq_link
</Trans>}
<hr className="divider--small" />
</Fragment>
}
</div>
</div>
<div className="setup__desc">