From 661d72ef9b3ca9032035dad0a9876a53cfc4728b Mon Sep 17 00:00:00 2001 From: Stevie Robinson Date: Sun, 5 Jan 2025 02:58:24 +0100 Subject: [PATCH] Fixed: Listening on all IPv4 Addresses (cherry picked from commit 035c474f10c257331a5f47e863d24af82537e335) --- src/NzbDrone.Core/Validation/IpValidation.cs | 6 ------ src/Readarr.Api.V1/Config/HostConfigController.cs | 1 - 2 files changed, 7 deletions(-) diff --git a/src/NzbDrone.Core/Validation/IpValidation.cs b/src/NzbDrone.Core/Validation/IpValidation.cs index eb5863caa..f4afa1f66 100644 --- a/src/NzbDrone.Core/Validation/IpValidation.cs +++ b/src/NzbDrone.Core/Validation/IpValidation.cs @@ -1,5 +1,4 @@ using FluentValidation; -using FluentValidation.Validators; using NzbDrone.Common.Extensions; namespace NzbDrone.Core.Validation @@ -10,10 +9,5 @@ namespace NzbDrone.Core.Validation { return ruleBuilder.Must(x => x.IsValidIpAddress()).WithMessage("Must contain wildcard (*) or a valid IP Address"); } - - public static IRuleBuilderOptions NotListenAllIp4Address(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!0\.0\.0\.0)")).WithMessage("Use * instead of 0.0.0.0"); - } } } diff --git a/src/Readarr.Api.V1/Config/HostConfigController.cs b/src/Readarr.Api.V1/Config/HostConfigController.cs index 85792f8f3..172806c0e 100644 --- a/src/Readarr.Api.V1/Config/HostConfigController.cs +++ b/src/Readarr.Api.V1/Config/HostConfigController.cs @@ -34,7 +34,6 @@ namespace Readarr.Api.V1.Config SharedValidator.RuleFor(c => c.BindAddress) .ValidIpAddress() - .NotListenAllIp4Address() .When(c => c.BindAddress != "*" && c.BindAddress != "localhost"); SharedValidator.RuleFor(c => c.Port).ValidPort();