mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-29 20:08:27 +01:00
Merge pull request #5495 from BaronGreenback/RemoteAccessFix
(cherry picked from commit a890a85092)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
e78fa8c3ef
commit
c3c98331d9
@@ -587,6 +587,29 @@ namespace Jellyfin.Networking.Manager
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool HasRemoteAccess(IPAddress remoteIp)
|
||||
{
|
||||
var config = _configurationManager.GetNetworkConfiguration();
|
||||
if (config.EnableRemoteAccess)
|
||||
{
|
||||
// Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely.
|
||||
// If left blank, all remote addresses will be allowed.
|
||||
if (RemoteAddressFilter.Count > 0 && !IsInLocalNetwork(remoteIp))
|
||||
{
|
||||
// remoteAddressFilter is a whitelist or blacklist.
|
||||
return RemoteAddressFilter.ContainsAddress(remoteIp) == !config.IsRemoteIPFilterBlacklist;
|
||||
}
|
||||
}
|
||||
else if (!IsInLocalNetwork(remoteIp))
|
||||
{
|
||||
// Remote not enabled. So everyone should be LAN.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reloads all settings and re-initialises the instance.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user