mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-21 15:10:44 +01:00
Merge remote-tracking branch 'upstream/master' into UrlDecoding
This commit is contained in:
@@ -20,6 +20,7 @@ using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.IO;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -36,18 +37,21 @@ namespace Jellyfin.Server
|
||||
/// <param name="applicationPaths">The <see cref="ServerApplicationPaths" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="loggerFactory">The <see cref="ILoggerFactory" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="options">The <see cref="StartupOptions" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="startupConfig">The <see cref="IConfiguration" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="fileSystem">The <see cref="IFileSystem" /> to be used by the <see cref="CoreAppHost" />.</param>
|
||||
/// <param name="collection">The <see cref="IServiceCollection"/> to be used by the <see cref="CoreAppHost"/>.</param>
|
||||
public CoreAppHost(
|
||||
IServerApplicationPaths applicationPaths,
|
||||
ILoggerFactory loggerFactory,
|
||||
IStartupOptions options,
|
||||
IConfiguration startupConfig,
|
||||
IFileSystem fileSystem,
|
||||
IServiceCollection collection)
|
||||
: base(
|
||||
applicationPaths,
|
||||
loggerFactory,
|
||||
options,
|
||||
startupConfig,
|
||||
fileSystem,
|
||||
collection)
|
||||
{
|
||||
|
||||
@@ -225,14 +225,13 @@ namespace Jellyfin.Server.Extensions
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
// Update all properties that are set in JsonDefaults
|
||||
var jsonOptions = JsonDefaults.GetPascalCaseOptions();
|
||||
var jsonOptions = JsonDefaults.PascalCaseOptions;
|
||||
|
||||
// From JsonDefaults
|
||||
options.JsonSerializerOptions.ReadCommentHandling = jsonOptions.ReadCommentHandling;
|
||||
options.JsonSerializerOptions.WriteIndented = jsonOptions.WriteIndented;
|
||||
options.JsonSerializerOptions.DefaultIgnoreCondition = jsonOptions.DefaultIgnoreCondition;
|
||||
options.JsonSerializerOptions.NumberHandling = jsonOptions.NumberHandling;
|
||||
options.JsonSerializerOptions.PropertyNameCaseInsensitive = jsonOptions.PropertyNameCaseInsensitive;
|
||||
|
||||
options.JsonSerializerOptions.Converters.Clear();
|
||||
foreach (var converter in jsonOptions.Converters)
|
||||
@@ -261,15 +260,16 @@ namespace Jellyfin.Server.Extensions
|
||||
{
|
||||
return serviceCollection.AddSwaggerGen(c =>
|
||||
{
|
||||
var version = typeof(ApplicationHost).Assembly.GetName().Version?.ToString(3) ?? "0.0.1";
|
||||
c.SwaggerDoc("api-docs", new OpenApiInfo
|
||||
{
|
||||
Title = "Jellyfin API",
|
||||
Version = "v1",
|
||||
Version = version,
|
||||
Extensions = new Dictionary<string, IOpenApiExtension>
|
||||
{
|
||||
{
|
||||
"x-jellyfin-version",
|
||||
new OpenApiString(typeof(ApplicationHost).Assembly.GetName().Version?.ToString())
|
||||
new OpenApiString(version)
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -319,7 +319,7 @@ namespace Jellyfin.Server.Extensions
|
||||
c.OperationFilter<FileResponseFilter>();
|
||||
c.OperationFilter<FileRequestFilter>();
|
||||
c.OperationFilter<ParameterObsoleteFilter>();
|
||||
c.DocumentFilter<WebsocketModelFilter>();
|
||||
c.DocumentFilter<AdditionalModelFilter>();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.ApiClient;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
@@ -9,9 +10,9 @@ using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
namespace Jellyfin.Server.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// Add models used in websocket messaging.
|
||||
/// Add models not directly used by the API, but used for discovery and websockets.
|
||||
/// </summary>
|
||||
public class WebsocketModelFilter : IDocumentFilter
|
||||
public class AdditionalModelFilter : IDocumentFilter
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
|
||||
@@ -25,6 +26,9 @@ namespace Jellyfin.Server.Filters
|
||||
context.SchemaGenerator.GenerateSchema(typeof(GeneralCommandType), context.SchemaRepository);
|
||||
|
||||
context.SchemaGenerator.GenerateSchema(typeof(GroupUpdate<object>), context.SchemaRepository);
|
||||
|
||||
context.SchemaGenerator.GenerateSchema(typeof(SessionMessageType), context.SchemaRepository);
|
||||
context.SchemaGenerator.GenerateSchema(typeof(ServerDiscoveryInfo), context.SchemaRepository);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Jellyfin.Api.Attributes;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Jellyfin.Server.Formatters
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class.
|
||||
/// </summary>
|
||||
public CamelCaseJsonProfileFormatter() : base(JsonDefaults.GetCamelCaseOptions())
|
||||
public CamelCaseJsonProfileFormatter() : base(JsonDefaults.CamelCaseOptions)
|
||||
{
|
||||
SupportedMediaTypes.Clear();
|
||||
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.CamelCaseMediaType));
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Jellyfin.Server.Formatters
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class.
|
||||
/// </summary>
|
||||
public PascalCaseJsonProfileFormatter() : base(JsonDefaults.GetPascalCaseOptions())
|
||||
public PascalCaseJsonProfileFormatter() : base(JsonDefaults.PascalCaseOptions)
|
||||
{
|
||||
SupportedMediaTypes.Clear();
|
||||
// Add application/json for default formatter
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
<AssemblyName>jellyfin</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Nullable>enable</Nullable>
|
||||
<DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers>
|
||||
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
|
||||
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
|
||||
<!-- <DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers> -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -26,25 +29,20 @@
|
||||
|
||||
<!-- Code Analyzers-->
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
|
||||
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
|
||||
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="5.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="5.0.5" />
|
||||
<PackageReference Include="prometheus-net" Version="4.1.1" />
|
||||
<PackageReference Include="prometheus-net.AspNetCore" Version="4.1.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Networking.Configuration;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Server.Middleware
|
||||
@@ -29,9 +27,8 @@ namespace Jellyfin.Server.Middleware
|
||||
/// </summary>
|
||||
/// <param name="httpContext">The current HTTP context.</param>
|
||||
/// <param name="networkManager">The network manager.</param>
|
||||
/// <param name="serverConfigurationManager">The server configuration manager.</param>
|
||||
/// <returns>The async task.</returns>
|
||||
public async Task Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
|
||||
public async Task Invoke(HttpContext httpContext, INetworkManager networkManager)
|
||||
{
|
||||
if (httpContext.IsLocal())
|
||||
{
|
||||
@@ -42,32 +39,8 @@ namespace Jellyfin.Server.Middleware
|
||||
|
||||
var remoteIp = httpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback;
|
||||
|
||||
if (serverConfigurationManager.GetNetworkConfiguration().EnableRemoteAccess)
|
||||
if (!networkManager.HasRemoteAccess(remoteIp))
|
||||
{
|
||||
// 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.
|
||||
var remoteAddressFilter = networkManager.RemoteAddressFilter;
|
||||
|
||||
if (remoteAddressFilter.Count > 0 && !networkManager.IsInLocalNetwork(remoteIp))
|
||||
{
|
||||
// remoteAddressFilter is a whitelist or blacklist.
|
||||
bool isListed = remoteAddressFilter.ContainsAddress(remoteIp);
|
||||
if (!serverConfigurationManager.GetNetworkConfiguration().IsRemoteIPFilterBlacklist)
|
||||
{
|
||||
// Black list, so flip over.
|
||||
isListed = !isListed;
|
||||
}
|
||||
|
||||
if (!isListed)
|
||||
{
|
||||
// If your name isn't on the list, you arn't coming in.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!networkManager.IsInLocalNetwork(remoteIp))
|
||||
{
|
||||
// Remote not enabled. So everyone should be LAN.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Networking.Configuration;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
@@ -16,9 +16,12 @@ namespace Jellyfin.Server.Migrations
|
||||
Applied = new List<(Guid Id, string Name)>();
|
||||
}
|
||||
|
||||
// .Net xml serializer can't handle interfaces
|
||||
#pragma warning disable CA1002 // Do not expose generic lists
|
||||
/// <summary>
|
||||
/// Gets the list of applied migration routine names.
|
||||
/// </summary>
|
||||
public List<(Guid Id, string Name)> Applied { get; }
|
||||
#pragma warning restore CA1002
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,15 +40,15 @@ namespace Jellyfin.Server.Migrations
|
||||
.Select(m => ActivatorUtilities.CreateInstance(host.ServiceProvider, m))
|
||||
.OfType<IMigrationRoutine>()
|
||||
.ToArray();
|
||||
var migrationOptions = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<MigrationOptions>(MigrationsListStore.StoreKey);
|
||||
var migrationOptions = ((IConfigurationManager)host.ConfigurationManager).GetConfiguration<MigrationOptions>(MigrationsListStore.StoreKey);
|
||||
|
||||
if (!host.ServerConfigurationManager.Configuration.IsStartupWizardCompleted && migrationOptions.Applied.Count == 0)
|
||||
if (!host.ConfigurationManager.Configuration.IsStartupWizardCompleted && migrationOptions.Applied.Count == 0)
|
||||
{
|
||||
// If startup wizard is not finished, this is a fresh install.
|
||||
// Don't run any migrations, just mark all of them as applied.
|
||||
logger.LogInformation("Marking all known migrations as applied because this is a fresh install");
|
||||
migrationOptions.Applied.AddRange(migrations.Where(m => !m.PerformOnNewInstall).Select(m => (m.Id, m.Name)));
|
||||
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
|
||||
host.ConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
|
||||
}
|
||||
|
||||
var appliedMigrationIds = migrationOptions.Applied.Select(m => m.Id).ToHashSet();
|
||||
@@ -77,7 +77,7 @@ namespace Jellyfin.Server.Migrations
|
||||
// Mark the migration as completed
|
||||
logger.LogInformation("Migration '{Name}' applied successfully", migrationRoutine.Name);
|
||||
migrationOptions.Applied.Add((migrationRoutine.Id, migrationRoutine.Name));
|
||||
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
|
||||
host.ConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
|
||||
logger.LogDebug("Migration '{Name}' marked as applied in configuration.", migrationRoutine.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
var databasePath = Path.Join(_serverApplicationPaths.DataPath, DbFilename);
|
||||
using var connection = SQLite3.Open(databasePath, ConnectionFlags.ReadWrite, null);
|
||||
_logger.LogInformation("Creating index idx_TypedBaseItemsUserDataKeyType");
|
||||
connection.Execute("CREATE INDEX idx_TypedBaseItemsUserDataKeyType ON TypedBaseItems(UserDataKey, Type);");
|
||||
connection.Execute("CREATE INDEX IF NOT EXISTS idx_TypedBaseItemsUserDataKeyType ON TypedBaseItems(UserDataKey, Type);");
|
||||
_logger.LogInformation("Creating index idx_PeopleNameListOrder");
|
||||
connection.Execute("CREATE INDEX idx_PeopleNameListOrder ON People(Name, ListOrder);");
|
||||
connection.Execute("CREATE INDEX IF NOT EXISTS idx_PeopleNameListOrder ON People(Name, ListOrder);");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
{
|
||||
var existingConfigJson = JToken.Parse(File.ReadAllText(oldConfigPath));
|
||||
return _defaultConfigHistory
|
||||
.Select(historicalConfigText => JToken.Parse(historicalConfigText))
|
||||
.Select(JToken.Parse)
|
||||
.Any(historicalConfigJson => JToken.DeepEquals(existingConfigJson, historicalConfigJson));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Server.Migrations.Routines
|
||||
|
||||
@@ -126,13 +126,13 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
ShowSidebar = dto.ShowSidebar,
|
||||
ScrollDirection = dto.ScrollDirection,
|
||||
ChromecastVersion = chromecastVersion,
|
||||
SkipForwardLength = dto.CustomPrefs.TryGetValue("skipForwardLength", out var length)
|
||||
? int.Parse(length, CultureInfo.InvariantCulture)
|
||||
SkipForwardLength = dto.CustomPrefs.TryGetValue("skipForwardLength", out var length) && int.TryParse(length, out var skipForwardLength)
|
||||
? skipForwardLength
|
||||
: 30000,
|
||||
SkipBackwardLength = dto.CustomPrefs.TryGetValue("skipBackLength", out length)
|
||||
? int.Parse(length, CultureInfo.InvariantCulture)
|
||||
SkipBackwardLength = dto.CustomPrefs.TryGetValue("skipBackLength", out length) && !string.IsNullOrEmpty(length) && int.TryParse(length, out var skipBackwardLength)
|
||||
? skipBackwardLength
|
||||
: 10000,
|
||||
EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled)
|
||||
EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled) && !string.IsNullOrEmpty(enabled)
|
||||
? bool.Parse(enabled)
|
||||
: true,
|
||||
DashboardTheme = dto.CustomPrefs.TryGetValue("dashboardtheme", out var theme) ? theme : string.Empty,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Emby.Server.Implementations.Data;
|
||||
using Emby.Server.Implementations.Serialization;
|
||||
using Jellyfin.Data.Entities;
|
||||
@@ -76,7 +74,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
|
||||
foreach (var entry in queryResult)
|
||||
{
|
||||
UserMockup? mockup = JsonSerializer.Deserialize<UserMockup>(entry[2].ToBlob(), JsonDefaults.GetOptions());
|
||||
UserMockup? mockup = JsonSerializer.Deserialize<UserMockup>(entry[2].ToBlob(), JsonDefaults.Options);
|
||||
if (mockup == null)
|
||||
{
|
||||
continue;
|
||||
@@ -104,7 +102,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||
_ => policy.LoginAttemptsBeforeLockout
|
||||
};
|
||||
|
||||
var user = new User(mockup.Name, policy.AuthenticationProviderId, policy.PasswordResetProviderId)
|
||||
var user = new User(mockup.Name, policy.AuthenticationProviderId!, policy.PasswordResetProviderId!)
|
||||
{
|
||||
Id = entry[1].ReadGuidFromBlob(),
|
||||
InternalId = entry[0].ToInt64(),
|
||||
|
||||
@@ -12,12 +12,10 @@ using System.Threading.Tasks;
|
||||
using CommandLine;
|
||||
using Emby.Server.Implementations;
|
||||
using Emby.Server.Implementations.IO;
|
||||
using Jellyfin.Api.Controllers;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Extensions;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
@@ -164,6 +162,7 @@ namespace Jellyfin.Server
|
||||
appPaths,
|
||||
_loggerFactory,
|
||||
options,
|
||||
startupConfig,
|
||||
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
|
||||
serviceCollection);
|
||||
|
||||
@@ -172,7 +171,7 @@ namespace Jellyfin.Server
|
||||
// If hosting the web client, validate the client content path
|
||||
if (startupConfig.HostWebClient())
|
||||
{
|
||||
string? webContentPath = appHost.ServerConfigurationManager.ApplicationPaths.WebPath;
|
||||
string? webContentPath = appHost.ConfigurationManager.ApplicationPaths.WebPath;
|
||||
if (!Directory.Exists(webContentPath) || Directory.GetFiles(webContentPath).Length == 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
@@ -198,11 +197,11 @@ namespace Jellyfin.Server
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.LogError("Kestrel failed to start! This is most likely due to an invalid address or port bind - correct your bind configuration in system.xml and try again.");
|
||||
_logger.LogError("Kestrel failed to start! This is most likely due to an invalid address or port bind - correct your bind configuration in network.xml and try again.");
|
||||
throw;
|
||||
}
|
||||
|
||||
await appHost.RunStartupTasksAsync().ConfigureAwait(false);
|
||||
await appHost.RunStartupTasksAsync(_tokenSource.Token).ConfigureAwait(false);
|
||||
|
||||
stopWatch.Stop();
|
||||
|
||||
@@ -221,7 +220,7 @@ namespace Jellyfin.Server
|
||||
}
|
||||
finally
|
||||
{
|
||||
appHost?.Dispose();
|
||||
appHost.Dispose();
|
||||
}
|
||||
|
||||
if (_restartOnShutdown)
|
||||
@@ -280,7 +279,7 @@ namespace Jellyfin.Server
|
||||
bool flagged = false;
|
||||
foreach (IPObject netAdd in addresses)
|
||||
{
|
||||
_logger.LogInformation("Kestrel listening on {0}", netAdd);
|
||||
_logger.LogInformation("Kestrel listening on {Address}", netAdd.Address == IPAddress.IPv6Any ? "All Addresses" : netAdd);
|
||||
options.Listen(netAdd.Address, appHost.HttpPort);
|
||||
if (appHost.ListenWithHttps)
|
||||
{
|
||||
@@ -622,7 +621,7 @@ namespace Jellyfin.Server
|
||||
string commandLineArgsString;
|
||||
if (options.RestartArgs != null)
|
||||
{
|
||||
commandLineArgsString = options.RestartArgs ?? string.Empty;
|
||||
commandLineArgsString = options.RestartArgs;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -21,4 +21,4 @@ using System.Runtime.InteropServices;
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: InternalsVisibleTo("Jellyfin.Api.Tests")]
|
||||
[assembly: InternalsVisibleTo("Jellyfin.Server.Tests")]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using Jellyfin.Networking.Configuration;
|
||||
using Jellyfin.Server.Extensions;
|
||||
using Jellyfin.Server.Implementations;
|
||||
@@ -67,6 +71,12 @@ namespace Jellyfin.Server
|
||||
var acceptJsonHeader = new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json, 1.0);
|
||||
var acceptXmlHeader = new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Xml, 0.9);
|
||||
var acceptAnyHeader = new MediaTypeWithQualityHeaderValue("*/*", 0.8);
|
||||
Func<IServiceProvider, HttpMessageHandler> defaultHttpClientHandlerDelegate = (_) => new SocketsHttpHandler()
|
||||
{
|
||||
AutomaticDecompression = DecompressionMethods.All,
|
||||
RequestHeaderEncodingSelector = (_, _) => Encoding.UTF8
|
||||
};
|
||||
|
||||
services
|
||||
.AddHttpClient(NamedClient.Default, c =>
|
||||
{
|
||||
@@ -75,7 +85,7 @@ namespace Jellyfin.Server
|
||||
c.DefaultRequestHeaders.Accept.Add(acceptXmlHeader);
|
||||
c.DefaultRequestHeaders.Accept.Add(acceptAnyHeader);
|
||||
})
|
||||
.ConfigurePrimaryHttpMessageHandler(x => new DefaultHttpClientHandler());
|
||||
.ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate);
|
||||
|
||||
services.AddHttpClient(NamedClient.MusicBrainz, c =>
|
||||
{
|
||||
@@ -84,7 +94,7 @@ namespace Jellyfin.Server
|
||||
c.DefaultRequestHeaders.Accept.Add(acceptXmlHeader);
|
||||
c.DefaultRequestHeaders.Accept.Add(acceptAnyHeader);
|
||||
})
|
||||
.ConfigurePrimaryHttpMessageHandler(x => new DefaultHttpClientHandler());
|
||||
.ConfigurePrimaryHttpMessageHandler(defaultHttpClientHandlerDelegate);
|
||||
|
||||
services.AddHealthChecks()
|
||||
.AddDbContextCheck<JellyfinDb>();
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CommandLine;
|
||||
using Emby.Server.Implementations;
|
||||
using Emby.Server.Implementations.EntryPoints;
|
||||
using Emby.Server.Implementations.Udp;
|
||||
using Emby.Server.Implementations.Updates;
|
||||
using MediaBrowser.Controller.Extensions;
|
||||
|
||||
namespace Jellyfin.Server
|
||||
@@ -77,7 +74,7 @@ namespace Jellyfin.Server
|
||||
|
||||
/// <inheritdoc />
|
||||
[Option("published-server-url", Required = false, HelpText = "Jellyfin Server URL to publish via auto discover process")]
|
||||
public Uri? PublishedServerUrl { get; set; }
|
||||
public string? PublishedServerUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the command line options as a dictionary that can be used in the .NET configuration system.
|
||||
@@ -94,7 +91,7 @@ namespace Jellyfin.Server
|
||||
|
||||
if (PublishedServerUrl != null)
|
||||
{
|
||||
config.Add(UdpServer.AddressOverrideConfigKey, PublishedServerUrl.ToString());
|
||||
config.Add(UdpServer.AddressOverrideConfigKey, PublishedServerUrl);
|
||||
}
|
||||
|
||||
if (FFmpegPath != null)
|
||||
|
||||
Reference in New Issue
Block a user