parent
e3b3e65409
commit
5666369cc4
@ -1,7 +1,7 @@
|
|||||||
REM SET BUILD_NUMBER=1
|
REM SET BUILD_NUMBER=1
|
||||||
REM SET BRANCH=develop
|
REM SET BRANCH=develop
|
||||||
echo ##teamcity[progressStart 'Building setup file']
|
echo ##teamcity[progressStart 'Building setup file']
|
||||||
inno\ISCC.exe nzbdrone.iss
|
inno\ISCC.exe sonarr.iss
|
||||||
echo ##teamcity[progressFinish 'Building setup file']
|
echo ##teamcity[progressFinish 'Building setup file']
|
||||||
|
|
||||||
echo ##teamcity[publishArtifacts 'setup\output\*.exe']
|
echo ##teamcity[publishArtifacts 'setup\output\*.exe']
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
|
||||||
|
namespace NzbDrone.Host.AccessControl
|
||||||
|
{
|
||||||
|
public interface IRemoteAccessAdapter
|
||||||
|
{
|
||||||
|
void MakeAccessible(bool passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RemoteAccessAdapter : IRemoteAccessAdapter
|
||||||
|
{
|
||||||
|
private readonly IRuntimeInfo _runtimeInfo;
|
||||||
|
private readonly IUrlAclAdapter _urlAclAdapter;
|
||||||
|
private readonly IFirewallAdapter _firewallAdapter;
|
||||||
|
private readonly ISslAdapter _sslAdapter;
|
||||||
|
|
||||||
|
public RemoteAccessAdapter(IRuntimeInfo runtimeInfo,
|
||||||
|
IUrlAclAdapter urlAclAdapter,
|
||||||
|
IFirewallAdapter firewallAdapter,
|
||||||
|
ISslAdapter sslAdapter)
|
||||||
|
{
|
||||||
|
_runtimeInfo = runtimeInfo;
|
||||||
|
_urlAclAdapter = urlAclAdapter;
|
||||||
|
_firewallAdapter = firewallAdapter;
|
||||||
|
_sslAdapter = sslAdapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MakeAccessible(bool passive)
|
||||||
|
{
|
||||||
|
if (OsInfo.IsWindows)
|
||||||
|
{
|
||||||
|
if (_runtimeInfo.IsAdmin)
|
||||||
|
{
|
||||||
|
_firewallAdapter.MakeAccessible();
|
||||||
|
_sslAdapter.Register();
|
||||||
|
}
|
||||||
|
else if (!passive)
|
||||||
|
{
|
||||||
|
throw new RemoteAccessException("Failed to register URLs for Sonarr. Sonarr will not be accessible remotely");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_urlAclAdapter.ConfigureUrls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using NzbDrone.Common.Exceptions;
|
||||||
|
|
||||||
|
namespace NzbDrone.Host.AccessControl
|
||||||
|
{
|
||||||
|
public class RemoteAccessException : NzbDroneException
|
||||||
|
{
|
||||||
|
public RemoteAccessException(string message, params object[] args) : base(message, args)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RemoteAccessException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RemoteAccessException(string message, Exception innerException, params object[] args) : base(message, innerException, args)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RemoteAccessException(string message, Exception innerException) : base(message, innerException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue