The Free Software Media System - Server Backend & API
Merge branch 'master' into NetworkPR2
BaronGreenbackec245dce9074
diff --cc Jellyfin.Server/Program.csindex 61f7da16a6,97a51c202b..2e9def9af7--- a/Jellyfin.Server/Program.cs+++ b/Jellyfin.Server/Program.cs@@@ -271,38 -272,65 +271,36 @@@ namespace Jellyfin.Servereturn builder.UseKestrel((builderContext, options) =>{- var addresses = appHost.ServerConfigurationManager- .Configuration- .LocalNetworkAddresses- .Select(x => appHost.NormalizeConfiguredLocalAddress(x))- .Where(i => i != null)- .ToHashSet();- if (addresses.Count > 0 && !addresses.Contains(IPAddress.Any))- {- if (!addresses.Contains(IPAddress.Loopback))- {- // we must listen on loopback for LiveTV to function regardless of the settings- addresses.Add(IPAddress.Loopback);- }+ var addresses = appHost.NetManager.GetAllBindInterfaces();- foreach (var address in addresses)- {- _logger.LogInformation("Kestrel listening on {IpAddress}", address);- options.Listen(address, appHost.HttpPort);-- if (appHost.ListenWithHttps)- {- options.Listen(- address,- appHost.HttpsPort,- listenOptions => listenOptions.UseHttps(appHost.Certificate));- }- else if (builderContext.HostingEnvironment.IsDevelopment())- {- try- {- options.Listen(address, appHost.HttpsPort, listenOptions => listenOptions.UseHttps());- }- catch (InvalidOperationException ex)- {- _logger.LogError(ex, "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted.");- }- }- }- }- else+ bool flagged = false;+ foreach (IPObject netAdd in addresses){- _logger.LogInformation("Kestrel listening on all interfaces");- options.ListenAnyIP(appHost.HttpPort);-+ _logger.LogInformation("Kestrel listening on {0}", netAdd);+ options.Listen(netAdd.Address, appHost.HttpPort);if (appHost.ListenWithHttps){- options.Listen(netAdd.Address, appHost.HttpsPort, listenOptions =>- {- listenOptions.UseHttps(appHost.Certificate);- listenOptions.Protocols = HttpProtocols.Http1AndHttp2;- });- options.ListenAnyIP(- appHost.HttpsPort,++ options.Listen(++ netAdd.Address,++ appHost.HttpsPort,+ listenOptions => listenOptions.UseHttps(appHost.Certificate));}else if (builderContext.HostingEnvironment.IsDevelopment()){try{- options.Listen(netAdd.Address, appHost.HttpsPort, listenOptions =>- {- listenOptions.UseHttps();- listenOptions.Protocols = HttpProtocols.Http1AndHttp2;- });- options.ListenAnyIP(appHost.HttpsPort, listenOptions => listenOptions.UseHttps());++ options.Listen(++ netAdd.Address,++ appHost.HttpsPort,++ listenOptions => listenOptions.UseHttps());}- catch (InvalidOperationException ex)+ catch (InvalidOperationException){- _logger.LogError(ex, "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted.");+ if (!flagged)+ {+ _logger.LogWarning("Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted.");+ flagged = true;+ }}}}diff --cc MediaBrowser.Model/Configuration/ServerConfiguration.csindex a40105212b,23a5201f7a..08bda14ba4--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs@@@ -425,6 -269,131 +425,11 @@@ namespace MediaBrowser.Model.Configurat/// <summary>/// Gets or sets the known proxies./// </summary>- public string[] KnownProxies { get; set; }+ public string[] KnownProxies { get; set; } = Array.Empty<string>();++ /// <summary>+ /// Gets or sets the number of days we should retain activity logs.+ /// </summary>- public int? ActivityLogRetentionDays { get; set; }-- /// <summary>- /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.- /// </summary>- public ServerConfiguration()- {- UninstalledPlugins = Array.Empty<string>();- RemoteIPFilter = Array.Empty<string>();- LocalNetworkSubnets = Array.Empty<string>();- LocalNetworkAddresses = Array.Empty<string>();- CodecsUsed = Array.Empty<string>();- PathSubstitutions = Array.Empty<PathSubstitution>();- IgnoreVirtualInterfaces = false;- EnableSimpleArtistDetection = false;- SkipDeserializationForBasicTypes = true;-- PluginRepositories = new List<RepositoryInfo>();-- DisplaySpecialsWithinSeasons = true;- EnableExternalContentInSuggestions = true;-- ImageSavingConvention = ImageSavingConvention.Compatible;- PublicPort = DefaultHttpPort;- PublicHttpsPort = DefaultHttpsPort;- HttpServerPortNumber = DefaultHttpPort;- HttpsPortNumber = DefaultHttpsPort;- EnableMetrics = false;- EnableHttps = false;- EnableDashboardResponseCaching = true;- EnableCaseSensitiveItemIds = true;- EnableNormalizedItemByNameIds = true;- DisableLiveTvChannelUserDataName = true;- EnableNewOmdbSupport = true;-- EnableRemoteAccess = true;- QuickConnectAvailable = false;-- EnableUPnP = false;- MinResumePct = 5;- MaxResumePct = 90;-- // 5 minutes- MinResumeDurationSeconds = 300;-- LibraryMonitorDelay = 60;-- ContentTypes = Array.Empty<NameValuePair>();-- PreferredMetadataLanguage = "en";- MetadataCountryCode = "US";-- SortReplaceCharacters = new[] { ".", "+", "%" };- SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };- SortRemoveWords = new[] { "the", "a", "an" };-- BaseUrl = string.Empty;- UICulture = "en-US";-- MetadataOptions = new[]- {- new MetadataOptions()- {- ItemType = "Book"- },- new MetadataOptions()- {- ItemType = "Movie"- },- new MetadataOptions- {- ItemType = "MusicVideo",- DisabledMetadataFetchers = new[] { "The Open Movie Database" },- DisabledImageFetchers = new[] { "The Open Movie Database" }- },- new MetadataOptions- {- ItemType = "Series",- DisabledMetadataFetchers = new[] { "TheMovieDb" },- DisabledImageFetchers = new[] { "TheMovieDb" }- },- new MetadataOptions- {- ItemType = "MusicAlbum",- DisabledMetadataFetchers = new[] { "TheAudioDB" }- },- new MetadataOptions- {- ItemType = "MusicArtist",- DisabledMetadataFetchers = new[] { "TheAudioDB" }- },- new MetadataOptions- {- ItemType = "BoxSet"- },- new MetadataOptions- {- ItemType = "Season",- DisabledMetadataFetchers = new[] { "TheMovieDb" },- },- new MetadataOptions- {- ItemType = "Episode",- DisabledMetadataFetchers = new[] { "The Open Movie Database", "TheMovieDb" },- DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }- }- };-- EnableSlowResponseWarning = true;- SlowResponseThresholdMs = 500;- CorsHosts = new[] { "*" };- KnownProxies = Array.Empty<string>();- ActivityLogRetentionDays = 30;- }- }-- public class PathSubstitution- {- public string From { get; set; }-- public string To { get; set; }++ public int? ActivityLogRetentionDays { get; set; } = 30;}--}++}