From ada467ecf40c7c27d57ae69ad515bd245d7bb639 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sun, 2 Mar 2025 22:53:43 +0100 Subject: [PATCH] fix(settings): remove dns server option (#1416) * fix(settings): remove dns server option This PR removes the DNS Servers option added in #1266 because it doesn't seem to work reliably. * style: remove whitespace change --- cypress/config/settings.cypress.json | 1 - jellyseerr-api.yml | 3 -- server/index.ts | 6 ---- server/lib/settings/index.ts | 2 -- .../0005_migrate_network_settings.ts | 2 -- server/utils/restartFlag.ts | 3 +- .../Settings/SettingsNetwork/index.tsx | 33 ------------------- src/i18n/locale/en.json | 2 -- 8 files changed, 1 insertion(+), 51 deletions(-) diff --git a/cypress/config/settings.cypress.json b/cypress/config/settings.cypress.json index f376d8804..702ee1487 100644 --- a/cypress/config/settings.cypress.json +++ b/cypress/config/settings.cypress.json @@ -24,7 +24,6 @@ "partialRequestsEnabled": true, "enableSpecialEpisodes": false, "forceIpv4First": false, - "dnsServers": "", "locale": "en" }, "plex": { diff --git a/jellyseerr-api.yml b/jellyseerr-api.yml index ddd942027..0bbe7ffb7 100644 --- a/jellyseerr-api.yml +++ b/jellyseerr-api.yml @@ -194,9 +194,6 @@ components: forceIpv4First: type: boolean example: false - dnsServers: - type: string - example: '1.1.1.1' trustProxy: type: boolean example: true diff --git a/server/index.ts b/server/index.ts index 88baedb86..008764193 100644 --- a/server/index.ts +++ b/server/index.ts @@ -83,12 +83,6 @@ app net.setDefaultAutoSelectFamily(false); } - if (settings.network.dnsServers.trim() !== '') { - dns.setServers( - settings.network.dnsServers.split(',').map((server) => server.trim()) - ); - } - // Register HTTP proxy if (settings.network.proxy.enabled) { await createCustomProxyAgent(settings.network.proxy); diff --git a/server/lib/settings/index.ts b/server/lib/settings/index.ts index 7fc09fb3f..d85f71379 100644 --- a/server/lib/settings/index.ts +++ b/server/lib/settings/index.ts @@ -137,7 +137,6 @@ export interface MainSettings { export interface NetworkSettings { csrfProtection: boolean; forceIpv4First: boolean; - dnsServers: string; trustProxy: boolean; proxy: ProxySettings; } @@ -510,7 +509,6 @@ class Settings { csrfProtection: false, trustProxy: false, forceIpv4First: false, - dnsServers: '', proxy: { enabled: false, hostname: '', diff --git a/server/lib/settings/migrations/0005_migrate_network_settings.ts b/server/lib/settings/migrations/0005_migrate_network_settings.ts index a6ad48445..6d4a826f3 100644 --- a/server/lib/settings/migrations/0005_migrate_network_settings.ts +++ b/server/lib/settings/migrations/0005_migrate_network_settings.ts @@ -10,7 +10,6 @@ const migrateNetworkSettings = (settings: any): AllSettings => { csrfProtection: settings.main.csrfProtection ?? false, trustProxy: settings.main.trustProxy ?? false, forceIpv4First: settings.main.forceIpv4First ?? false, - dnsServers: settings.main.dnsServers ?? '', proxy: settings.main.proxy ?? { enabled: false, hostname: '', @@ -25,7 +24,6 @@ const migrateNetworkSettings = (settings: any): AllSettings => { delete settings.main.csrfProtection; delete settings.main.trustProxy; delete settings.main.forceIpv4First; - delete settings.main.dnsServers; delete settings.main.proxy; return newSettings; }; diff --git a/server/utils/restartFlag.ts b/server/utils/restartFlag.ts index 24282a091..ffd64df3f 100644 --- a/server/utils/restartFlag.ts +++ b/server/utils/restartFlag.ts @@ -18,8 +18,7 @@ class RestartFlag { this.networkSettings.csrfProtection !== networkSettings.csrfProtection || this.networkSettings.trustProxy !== networkSettings.trustProxy || this.networkSettings.proxy.enabled !== networkSettings.proxy.enabled || - this.networkSettings.forceIpv4First !== networkSettings.forceIpv4First || - this.networkSettings.dnsServers !== networkSettings.dnsServers + this.networkSettings.forceIpv4First !== networkSettings.forceIpv4First ); } } diff --git a/src/components/Settings/SettingsNetwork/index.tsx b/src/components/Settings/SettingsNetwork/index.tsx index befed1fba..e715267e9 100644 --- a/src/components/Settings/SettingsNetwork/index.tsx +++ b/src/components/Settings/SettingsNetwork/index.tsx @@ -45,9 +45,6 @@ const messages = defineMessages('components.Settings.SettingsNetwork', { 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 SettingsNetwork = () => { @@ -93,7 +90,6 @@ const SettingsNetwork = () => { initialValues={{ csrfProtection: data?.csrfProtection, forceIpv4First: data?.forceIpv4First, - dnsServers: data?.dnsServers, trustProxy: data?.trustProxy, proxyEnabled: data?.proxy?.enabled, proxyHostname: data?.proxy?.hostname, @@ -116,7 +112,6 @@ const SettingsNetwork = () => { body: JSON.stringify({ csrfProtection: values.csrfProtection, forceIpv4First: values.forceIpv4First, - dnsServers: values.dnsServers, trustProxy: values.trustProxy, proxy: { enabled: values.proxyEnabled, @@ -426,34 +421,6 @@ const SettingsNetwork = () => { /> -
- -
-
- -
- {errors.dnsServers && - touched.dnsServers && - typeof errors.dnsServers === 'string' && ( -
{errors.dnsServers}
- )} -
-
diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 73dfc7b8c..50df170b2 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -940,8 +940,6 @@ "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.docs": "documentation", "components.Settings.SettingsNetwork.forceIpv4First": "Force IPv4 Resolution First", "components.Settings.SettingsNetwork.forceIpv4FirstTip": "Force Jellyseerr to resolve IPv4 addresses first instead of IPv6",