diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-03-05 07:55:29 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-03-05 07:55:29 +0100 |
| commit | 12df3814954a4251c30fd27ccdac89647da1a0a3 (patch) | |
| tree | 1a988b159282f081ae95aaafc41f7e262d43fe71 | |
| parent | 17ca23d73b9dc440373abcde2df39e1cf7a50e35 (diff) | |
Grab content root from config and fix kestrel port bindings
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 00a5f864d..09c40ea73 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -619,19 +619,23 @@ namespace Emby.Server.Implementations FindParts(); + string contentRoot = ServerConfigurationManager.Configuration.DashboardSourcePath; + if (string.IsNullOrEmpty(contentRoot)) + { + contentRoot = Path.Combine(ServerConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web", "src"); + } + Host = new WebHostBuilder() .UseKestrel(options => { - options.Listen(IPAddress.Any, HttpPort); - options.Listen(IPAddress.Loopback, HttpPort); + options.ListenAnyIP(HttpPort); if (EnableHttps) { - options.Listen(IPAddress.Any, HttpsPort, listenOptions => { listenOptions.UseHttps(Certificate); }); - options.Listen(IPAddress.Loopback, HttpsPort, listenOptions => { listenOptions.UseHttps(Certificate); }); + options.ListenAnyIP(HttpsPort, listenOptions => { listenOptions.UseHttps(Certificate); }); } }) - .UseContentRoot(Path.Combine(Directory.GetCurrentDirectory(), "jellyfin-web", "src")) + .UseContentRoot(contentRoot) .ConfigureServices(services => { services.AddResponseCompression(); @@ -655,7 +659,7 @@ namespace Emby.Server.Implementations { if (!context.WebSockets.IsWebSocketRequest) { - await next(); + await next().ConfigureAwait(false); return; } @@ -665,7 +669,7 @@ namespace Emby.Server.Implementations { if (context.WebSockets.IsWebSocketRequest) { - await next(); + await next().ConfigureAwait(false); return; } |
