|
|
@ -11,7 +11,6 @@ using MediaBrowser.Common.Configuration;
|
|
|
|
using MediaBrowser.Common.Net;
|
|
|
|
using MediaBrowser.Common.Net;
|
|
|
|
using MediaBrowser.Model.Net;
|
|
|
|
using MediaBrowser.Model.Net;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.HttpOverrides;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
|
|
|
|
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
|
|
|
@ -237,7 +236,7 @@ public class NetworkManager : INetworkManager, IDisposable
|
|
|
|
var mac = adapter.GetPhysicalAddress();
|
|
|
|
var mac = adapter.GetPhysicalAddress();
|
|
|
|
|
|
|
|
|
|
|
|
// Populate MAC list
|
|
|
|
// Populate MAC list
|
|
|
|
if (adapter.NetworkInterfaceType != NetworkInterfaceType.Loopback && PhysicalAddress.None.Equals(mac))
|
|
|
|
if (adapter.NetworkInterfaceType != NetworkInterfaceType.Loopback && !PhysicalAddress.None.Equals(mac))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
macAddresses.Add(mac);
|
|
|
|
macAddresses.Add(mac);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -739,7 +738,9 @@ public class NetworkManager : INetworkManager, IDisposable
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public IReadOnlyList<IPData> GetAllBindInterfaces(bool individualInterfaces = false)
|
|
|
|
public IReadOnlyList<IPData> GetAllBindInterfaces(bool individualInterfaces = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_interfaces.Count > 0 || individualInterfaces)
|
|
|
|
var config = _configurationManager.GetNetworkConfiguration();
|
|
|
|
|
|
|
|
var localNetworkAddresses = config.LocalNetworkAddresses;
|
|
|
|
|
|
|
|
if ((localNetworkAddresses.Length > 0 && !string.IsNullOrWhiteSpace(localNetworkAddresses[0]) && _interfaces.Count > 0) || individualInterfaces)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return _interfaces;
|
|
|
|
return _interfaces;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1116,12 +1117,13 @@ public class NetworkManager : INetworkManager, IDisposable
|
|
|
|
var logLevel = debug ? LogLevel.Debug : LogLevel.Information;
|
|
|
|
var logLevel = debug ? LogLevel.Debug : LogLevel.Information;
|
|
|
|
if (_logger.IsEnabled(logLevel))
|
|
|
|
if (_logger.IsEnabled(logLevel))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Log(logLevel, "Defined LAN addresses: {0}", _lanSubnets.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Defined LAN subnets: {Subnets}", _lanSubnets.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Defined LAN exclusions: {0}", _excludedSubnets.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Defined LAN exclusions: {Subnets}", _excludedSubnets.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Using LAN addresses: {0}", _lanSubnets.Where(s => !_excludedSubnets.Contains(s)).Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Used LAN subnets: {Subnets}", _lanSubnets.Where(s => !_excludedSubnets.Contains(s)).Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Using bind addresses: {0}", _interfaces.OrderByDescending(x => x.AddressFamily == AddressFamily.InterNetwork).Select(x => x.Address));
|
|
|
|
_logger.Log(logLevel, "Filtered interface addresses: {Addresses}", _interfaces.OrderByDescending(x => x.AddressFamily == AddressFamily.InterNetwork).Select(x => x.Address));
|
|
|
|
_logger.Log(logLevel, "Remote IP filter is {0}", config.IsRemoteIPFilterBlacklist ? "Blocklist" : "Allowlist");
|
|
|
|
_logger.Log(logLevel, "Bind Addresses {Addresses}", GetAllBindInterfaces(false).OrderByDescending(x => x.AddressFamily == AddressFamily.InterNetwork).Select(x => x.Address));
|
|
|
|
_logger.Log(logLevel, "Filter list: {0}", _remoteAddressFilter.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
_logger.Log(logLevel, "Remote IP filter is {Type}", config.IsRemoteIPFilterBlacklist ? "Blocklist" : "Allowlist");
|
|
|
|
|
|
|
|
_logger.Log(logLevel, "Filtered subnets: {Subnets}", _remoteAddressFilter.Select(s => s.Prefix + "/" + s.PrefixLength));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|