RTorrentConnectionSettingsForm: discourage TCP connection type

This commit is contained in:
Jesse Chan
2020-10-31 23:41:32 +08:00
parent a293495264
commit ddc7dafd7f
3 changed files with 35 additions and 19 deletions
@@ -7,7 +7,7 @@ import type {
RTorrentTCPConnectionSettings,
} from '@shared/schema/ClientConnectionSettings';
import {FormGroup, FormRow, Radio, Textbox} from '../../../ui';
import {FormError, FormGroup, FormRow, FormRowGroup, Radio, Textbox} from '../../../ui';
export interface RTorrentConnectionSettingsProps {
intl: IntlShape;
@@ -94,24 +94,33 @@ class RTorrentConnectionSettingsForm extends React.Component<
if (type === 'tcp') {
return (
<FormRow>
<Textbox
onChange={(e) => this.handleFormChange(e, 'host')}
id="host"
label={<FormattedMessage id="connection.settings.rtorrent.host" />}
placeholder={intl.formatMessage({
id: 'connection.settings.rtorrent.host.input.placeholder',
})}
/>
<Textbox
onChange={(e) => this.handleFormChange(e, 'port')}
id="port"
label={<FormattedMessage id="connection.settings.rtorrent.port" />}
placeholder={intl.formatMessage({
id: 'connection.settings.rtorrent.port.input.placeholder',
})}
/>
</FormRow>
<FormRowGroup>
<FormRow>
<FormError>
{intl.formatMessage({
id: 'connection.settings.rtorrent.type.tcp.warning',
})}
</FormError>
</FormRow>
<FormRow>
<Textbox
onChange={(e) => this.handleFormChange(e, 'host')}
id="host"
label={<FormattedMessage id="connection.settings.rtorrent.host" />}
placeholder={intl.formatMessage({
id: 'connection.settings.rtorrent.host.input.placeholder',
})}
/>
<Textbox
onChange={(e) => this.handleFormChange(e, 'port')}
id="port"
label={<FormattedMessage id="connection.settings.rtorrent.port" />}
placeholder={intl.formatMessage({
id: 'connection.settings.rtorrent.port.input.placeholder',
})}
/>
</FormRow>
</FormRowGroup>
);
}
@@ -575,6 +575,12 @@
"value": "TCP"
}
],
"connection.settings.rtorrent.type.tcp.warning": [
{
"type": 0,
"value": "Exposing rTorrent via TCP may allow privilege escalation."
}
],
"connectivity.modal.content": [
{
"type": 0,
+1
View File
@@ -41,6 +41,7 @@
"connection.settings.rtorrent": "rTorrent",
"connection.settings.rtorrent.type": "Connection Type",
"connection.settings.rtorrent.type.tcp": "TCP",
"connection.settings.rtorrent.type.tcp.warning": "Exposing rTorrent via TCP may allow privilege escalation.",
"connection.settings.rtorrent.type.socket": "Socket",
"connection.settings.rtorrent.host": "Host",
"connection.settings.rtorrent.host.input.placeholder": "Hostname or IP",