1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

New: Switch to ASPNetCore Kestrel and SignalR

This commit is contained in:
ta264
2019-10-14 21:21:00 +01:00
committed by Qstick
parent fdbed91a4e
commit fb5b9c445b
58 changed files with 917 additions and 1298 deletions
@@ -0,0 +1,32 @@
using NzbDrone.Common.EnvironmentInfo;
namespace Radarr.Host.AccessControl
{
public class RemoteAccessAdapter : IRemoteAccessAdapter
{
private readonly IRuntimeInfo _runtimeInfo;
private readonly IFirewallAdapter _firewallAdapter;
public RemoteAccessAdapter(IRuntimeInfo runtimeInfo,
IFirewallAdapter firewallAdapter)
{
_runtimeInfo = runtimeInfo;
_firewallAdapter = firewallAdapter;
}
public void MakeAccessible(bool passive)
{
if (OsInfo.IsWindows)
{
if (_runtimeInfo.IsAdmin)
{
_firewallAdapter.MakeAccessible();
}
else if (!passive)
{
throw new RemoteAccessException("Failed to register URLs for Radarr. Radarr will not be accessible remotely");
}
}
}
}
}