Fixed: Listening on all IPv4 Addresses

(cherry picked from commit 035c474f10c257331a5f47e863d24af82537e335)
master v1.29.2.4915
Stevie Robinson 3 weeks ago committed by Bogdan
parent 36f6896f30
commit 73494c462c

@ -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<T, string> NotListenAllIp4Address<T>(this IRuleBuilder<T, string> ruleBuilder)
{
return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!0\.0\.0\.0)")).WithMessage("Use * instead of 0.0.0.0");
}
}
}

@ -34,7 +34,6 @@ namespace Prowlarr.Api.V1.Config
SharedValidator.RuleFor(c => c.BindAddress)
.ValidIpAddress()
.NotListenAllIp4Address()
.When(c => c.BindAddress != "*" && c.BindAddress != "localhost");
SharedValidator.RuleFor(c => c.Port).ValidPort();

Loading…
Cancel
Save