Allow binding to specific interface addresses

https://trello.com/c/aWazKGQc/404-allow-binding-to-specified-ip-address
This commit is contained in:
Mike
2014-10-01 14:34:10 -04:00
committed by Mark McDowall
parent 65c1e8852a
commit 5a8ce04bd5
6 changed files with 63 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using System.Reflection;
using FluentValidation;
using NzbDrone.Common.EnvironmentInfo;
@@ -25,7 +26,9 @@ namespace NzbDrone.Api.Config
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
SharedValidator.RuleFor(c => c.Port).ValidPort();
SharedValidator.RuleFor(c => c.BindAddress).ValidIp4Address().When(c => c.BindAddress != "*");
SharedValidator.RuleFor(c => c.Port).InclusiveBetween(1, 65535);
SharedValidator.RuleFor(c => c.Username).NotEmpty().When(c => c.AuthenticationEnabled);
SharedValidator.RuleFor(c => c.Password).NotEmpty().When(c => c.AuthenticationEnabled);