1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-02-23 14:41:27 +00:00

Fixed: Listening on all IPv4 Addresses

Closes #7526
This commit is contained in:
Stevie Robinson 2025-01-05 02:58:24 +01:00 committed by GitHub
parent 4dcc015fb1
commit 035c474f10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 7 deletions

View file

@ -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");
}
}
}

View file

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