Remove existing URL ACLs to avoid conflicts

New: Choose IP address to listen on (advanced)
Fixed: Check if URL has been registered with Windows before trying to register it
This commit is contained in:
Mark McDowall
2014-11-23 23:46:22 -08:00
parent 5a8ce04bd5
commit d77c685d14
9 changed files with 194 additions and 61 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using System.Reflection;
using FluentValidation;
using NzbDrone.Common.EnvironmentInfo;
@@ -24,10 +23,8 @@ namespace NzbDrone.Api.Config
GetResourceById = GetHostConfig;
UpdateResource = SaveHostConfig;
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
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);
@@ -36,6 +33,11 @@ namespace NzbDrone.Api.Config
SharedValidator.RuleFor(c => c.SslCertHash).NotEmpty().When(c => c.EnableSsl && OsInfo.IsWindows);
SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script);
SharedValidator.RuleFor(c => c.BindAddress)
.ValidIp4Address()
.NotListenAllIp4Address()
.When(c => c.BindAddress != "*");
}
private HostConfigResource GetHostConfig()
@@ -61,4 +63,4 @@ namespace NzbDrone.Api.Config
_configFileProvider.SaveConfigDictionary(dictionary);
}
}
}
}