From 117617188ed988bd8a90e9fbe8bada08d5b14513 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sat, 22 Feb 2025 16:46:47 +0100 Subject: [PATCH] feat(settings): add a disclaimer for dns servers and ipv4 first settings (#1375) * feat(settings): add a disclaimer for dns servers and ipv4 first settings This PR adds a disclaimer to warn the user that he should use the network settings of his containers/system first instead of this one. * fix: add missing translations * feat: create a new Advanced Network Settings section * Update src/components/Settings/SettingsNetwork/index.tsx Co-authored-by: fallenbagel <98979876+fallenbagel@users.noreply.github.com> * Update src/i18n/locale/en.json Co-authored-by: fallenbagel <98979876+fallenbagel@users.noreply.github.com> * fix: rename to Force IPv4 Resolution First --------- Co-authored-by: fallenbagel <98979876+fallenbagel@users.noreply.github.com> --- .../Settings/SettingsNetwork/index.tsx | 137 ++++++++++-------- src/i18n/locale/en.json | 5 +- 2 files changed, 84 insertions(+), 58 deletions(-) diff --git a/src/components/Settings/SettingsNetwork/index.tsx b/src/components/Settings/SettingsNetwork/index.tsx index 82701cdac..befed1fba 100644 --- a/src/components/Settings/SettingsNetwork/index.tsx +++ b/src/components/Settings/SettingsNetwork/index.tsx @@ -27,12 +27,6 @@ const messages = defineMessages('components.Settings.SettingsNetwork', { trustProxy: 'Enable Proxy Support', trustProxyTip: 'Allow Jellyseerr to correctly register client IP addresses behind a proxy', - forceIpv4First: 'IPv4 Resolution First', - forceIpv4FirstTip: - 'Force Jellyseerr to resolve IPv4 addresses first instead of IPv6', - dnsServers: 'Custom DNS Servers', - dnsServersTip: - 'Comma-separated list of custom DNS servers, e.g. "1.1.1.1,[2606:4700:4700::1111]"', proxyEnabled: 'HTTP(S) Proxy', proxyHostname: 'Proxy Hostname', proxyPort: 'Proxy Port', @@ -44,9 +38,19 @@ const messages = defineMessages('components.Settings.SettingsNetwork', { "Use ',' as a separator, and '*.' as a wildcard for subdomains", proxyBypassLocalAddresses: 'Bypass Proxy for Local Addresses', validationProxyPort: 'You must provide a valid port', + advancedNetworkSettings: 'Advanced Network Settings', + networkDisclaimer: + 'Network parameters from your container/system should be used instead of these settings. See the {docs} for more information.', + docs: 'documentation', + forceIpv4First: 'Force IPv4 Resolution First', + forceIpv4FirstTip: + 'Force Jellyseerr to resolve IPv4 addresses first instead of IPv6', + dnsServers: 'Custom DNS Servers', + dnsServersTip: + 'Comma-separated list of custom DNS servers, e.g. "1.1.1.1,[2606:4700:4700::1111]"', }); -const SettingsMain = () => { +const SettingsNetwork = () => { const { addToast } = useToasts(); const intl = useIntl(); const { @@ -206,55 +210,6 @@ const SettingsMain = () => { -
- -
- { - setFieldValue('forceIpv4First', !values.forceIpv4First); - }} - /> -
-
-
- -
-
- -
- {errors.dnsServers && - touched.dnsServers && - typeof errors.dnsServers === 'string' && ( -
{errors.dnsServers}
- )} -
-
)} +

+ {intl.formatMessage(messages.advancedNetworkSettings)} +

+

+ {intl.formatMessage(messages.networkDisclaimer, { + docs: ( + + {intl.formatMessage(messages.docs)} + + ), + })} +

+
+ +
+ { + setFieldValue('forceIpv4First', !values.forceIpv4First); + }} + /> +
+
+
+ +
+
+ +
+ {errors.dnsServers && + touched.dnsServers && + typeof errors.dnsServers === 'string' && ( +
{errors.dnsServers}
+ )} +
+
@@ -458,4 +481,4 @@ const SettingsMain = () => { ); }; -export default SettingsMain; +export default SettingsNetwork; diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 1bd66d846..e38c70c64 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -935,14 +935,17 @@ "components.Settings.SettingsMain.validationApplicationTitle": "You must provide an application title", "components.Settings.SettingsMain.validationApplicationUrl": "You must provide a valid URL", "components.Settings.SettingsMain.validationApplicationUrlTrailingSlash": "URL must not end in a trailing slash", + "components.Settings.SettingsNetwork.advancedNetworkSettings": "Advanced Network Settings", "components.Settings.SettingsNetwork.csrfProtection": "Enable CSRF Protection", "components.Settings.SettingsNetwork.csrfProtectionHoverTip": "Do NOT enable this setting unless you understand what you are doing!", "components.Settings.SettingsNetwork.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", "components.Settings.SettingsNetwork.dnsServers": "Custom DNS Servers", "components.Settings.SettingsNetwork.dnsServersTip": "Comma-separated list of custom DNS servers, e.g. \"1.1.1.1,[2606:4700:4700::1111]\"", - "components.Settings.SettingsNetwork.forceIpv4First": "IPv4 Resolution First", + "components.Settings.SettingsNetwork.docs": "documentation", + "components.Settings.SettingsNetwork.forceIpv4First": "Force IPv4 Resolution First", "components.Settings.SettingsNetwork.forceIpv4FirstTip": "Force Jellyseerr to resolve IPv4 addresses first instead of IPv6", "components.Settings.SettingsNetwork.network": "Network", + "components.Settings.SettingsNetwork.networkDisclaimer": "Network parameters from your container/system should be used instead of these settings. See the {docs} for more information.", "components.Settings.SettingsNetwork.networksettings": "Network Settings", "components.Settings.SettingsNetwork.networksettingsDescription": "Configure network settings for your Jellyseerr instance.", "components.Settings.SettingsNetwork.proxyBypassFilter": "Proxy Ignored Addresses",