From 7367e667f78057d0e26b8dc4f2b7f8641366b86a Mon Sep 17 00:00:00 2001 From: David Date: Sat, 11 Jul 2020 12:35:18 +0200 Subject: [PATCH 1/3] Add socket support --- Jellyfin.Server/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index ef3ebe90c..025de916f 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -343,6 +343,21 @@ namespace Jellyfin.Server } } } + + // Bind to unix socket (only on OSX and Linux) + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + // TODO: allow configuration of socket path + var socketPath = $"{appPaths.DataPath}/socket.sock"; + // Workaround for https://github.com/aspnet/AspNetCore/issues/14134 + if (File.Exists(socketPath)) + { + File.Delete(socketPath); + } + + options.ListenUnixSocket(socketPath); + _logger.LogInformation($"Kestrel listening to unix socket {socketPath}"); + } }) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig)) .UseSerilog() From fa4e0a73d5eb0b33dc85dffb2a2d35033c5ce698 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 16 Jul 2020 11:21:46 +0200 Subject: [PATCH 2/3] Update Jellyfin.Server/Program.cs Co-authored-by: Cody Robibero --- Jellyfin.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 025de916f..3a414d767 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -356,7 +356,7 @@ namespace Jellyfin.Server } options.ListenUnixSocket(socketPath); - _logger.LogInformation($"Kestrel listening to unix socket {socketPath}"); + _logger.LogInformation("Kestrel listening to unix socket {socketPath}", socketPath); } }) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig)) From 0e855953a2078c2229cffedf015baa107be1cbf4 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 23 Jul 2020 12:03:46 +0200 Subject: [PATCH 3/3] Update Jellyfin.Server/Program.cs Co-authored-by: Bond-009 --- Jellyfin.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 3a414d767..444a91c02 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -356,7 +356,7 @@ namespace Jellyfin.Server } options.ListenUnixSocket(socketPath); - _logger.LogInformation("Kestrel listening to unix socket {socketPath}", socketPath); + _logger.LogInformation("Kestrel listening to unix socket {SocketPath}", socketPath); } }) .ConfigureAppConfiguration(config => config.ConfigureAppConfiguration(commandLineOpts, appPaths, startupConfig))