diff options
| -rw-r--r-- | Dockerfile | 3 | ||||
| -rw-r--r-- | Dockerfile.arm | 3 | ||||
| -rw-r--r-- | Dockerfile.arm64 | 3 | ||||
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 95 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 11 | ||||
| -rw-r--r-- | Jellyfin.Server/Program.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfiguration.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/System/PublicSystemInfo.cs | 8 |
9 files changed, 21 insertions, 122 deletions
diff --git a/Dockerfile b/Dockerfile index 483345e39..69cb5e0dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,7 @@ FROM mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION} as builder WORKDIR /repo COPY . . ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -RUN bash -c "source deployment/common.build.sh && \ - build_jellyfin Jellyfin.Server Release linux-x64 /jellyfin" +RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-x64 "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" FROM jellyfin/ffmpeg:${FFMPEG_VERSION} as ffmpeg FROM mcr.microsoft.com/dotnet/core/runtime:${DOTNET_VERSION} diff --git a/Dockerfile.arm b/Dockerfile.arm index 8a91d71be..742e050d5 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -22,8 +22,7 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN bash -c "source deployment/common.build.sh && \ - build_jellyfin Jellyfin.Server Release linux-arm /jellyfin" +RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" FROM multiarch/qemu-user-static:x86_64-arm as qemu diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index b24d5d599..8c0baf925 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -22,8 +22,7 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN bash -c "source deployment/common.build.sh && \ - build_jellyfin Jellyfin.Server Release linux-arm64 /jellyfin" +RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm64 "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 24f59478c..1d0293a5f 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1198,25 +1198,11 @@ namespace Emby.Server.Implementations private CertificateInfo GetCertificateInfo(bool generateCertificate) { - if (!string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.CertificatePath)) - { - // Custom cert - return new CertificateInfo - { - Path = ServerConfigurationManager.Configuration.CertificatePath, - Password = ServerConfigurationManager.Configuration.CertificatePassword - }; - } - - // Generate self-signed cert - var certHost = GetHostnameFromExternalDns(ServerConfigurationManager.Configuration.WanDdns); - var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "2").GetMD5().ToString("N", CultureInfo.InvariantCulture) + ".pfx"); - const string Password = "embycert"; - + // Custom cert return new CertificateInfo { - Path = certPath, - Password = Password + Path = ServerConfigurationManager.Configuration.CertificatePath, + Password = ServerConfigurationManager.Configuration.CertificatePassword }; } @@ -1403,17 +1389,6 @@ namespace Emby.Server.Implementations { var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - string wanAddress; - - if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) - { - wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); - } - else - { - wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); - } - return new SystemInfo { HasPendingRestart = HasPendingRestart, @@ -1435,7 +1410,6 @@ namespace Emby.Server.Implementations OperatingSystemDisplayName = OperatingSystem.Name, CanSelfRestart = CanSelfRestart, CanLaunchWebBrowser = CanLaunchWebBrowser, - WanAddress = wanAddress, HasUpdateAvailable = HasUpdateAvailable, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, ServerName = FriendlyName, @@ -1457,24 +1431,12 @@ namespace Emby.Server.Implementations { var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false); - string wanAddress; - - if (string.IsNullOrEmpty(ServerConfigurationManager.Configuration.WanDdns)) - { - wanAddress = await GetWanApiUrlFromExternal(cancellationToken).ConfigureAwait(false); - } - else - { - wanAddress = GetWanApiUrl(ServerConfigurationManager.Configuration.WanDdns); - } - return new PublicSystemInfo { Version = ApplicationVersion, ProductName = ApplicationProductName, Id = SystemId, OperatingSystem = OperatingSystem.Id.ToString(), - WanAddress = wanAddress, ServerName = FriendlyName, LocalAddress = localAddress }; @@ -1506,31 +1468,6 @@ namespace Emby.Server.Implementations return null; } - public async Task<string> GetWanApiUrlFromExternal(CancellationToken cancellationToken) - { - const string Url = "http://ipv4.icanhazip.com"; - try - { - using (var response = await HttpClient.Get(new HttpRequestOptions - { - Url = Url, - LogErrorResponseBody = false, - BufferContent = false, - CancellationToken = cancellationToken - }).ConfigureAwait(false)) - { - string res = await response.ReadToEndAsync().ConfigureAwait(false); - return GetWanApiUrl(res.Trim()); - } - } - catch (Exception ex) - { - Logger.LogError(ex, "Error getting WAN Ip address information"); - } - - return null; - } - /// <summary> /// Removes the scope id from IPv6 addresses. /// </summary> @@ -1573,32 +1510,6 @@ namespace Emby.Server.Implementations HttpPort.ToString(CultureInfo.InvariantCulture)); } - public string GetWanApiUrl(IPAddress ipAddress) - { - if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6) - { - var str = RemoveScopeId(ipAddress.ToString()); - - return GetWanApiUrl("[" + str + "]"); - } - - return GetWanApiUrl(ipAddress.ToString()); - } - - public string GetWanApiUrl(string host) - { - if (EnableHttps) - { - return string.Format("https://{0}:{1}", - host, - ServerConfigurationManager.Configuration.PublicHttpsPort.ToString(CultureInfo.InvariantCulture)); - } - - return string.Format("http://{0}:{1}", - host, - ServerConfigurationManager.Configuration.PublicPort.ToString(CultureInfo.InvariantCulture)); - } - public Task<List<IPAddress>> GetLocalIpAddresses(CancellationToken cancellationToken) { return GetLocalIpAddressesInternal(true, 0, cancellationToken); diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 7947edeeb..0c0c77cda 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; @@ -457,13 +458,17 @@ namespace Emby.Server.Implementations.Updates var hash = ToHexString(md5.ComputeHash(stream)); if (!string.Equals(package.checksum, hash, StringComparison.OrdinalIgnoreCase)) { - _logger.LogDebug("{0}, {1}", package.checksum, hash); - throw new InvalidDataException($"The checksums didn't match while installing {package.name}."); + _logger.LogError( + "The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}", + package.name, + package.checksum, + hash); + throw new InvalidDataException("The checksum of the received data doesn't match."); } if (Directory.Exists(targetDir)) { - Directory.Delete(targetDir); + Directory.Delete(targetDir, true); } stream.Position = 0; diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index e9e884a3f..6f1c111c6 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -125,7 +125,9 @@ namespace Jellyfin.Server Shutdown(); }; - _logger.LogInformation("Jellyfin version: {Version}", Assembly.GetEntryAssembly().GetName().Version); + _logger.LogInformation( + "Jellyfin version: {Version}", + Assembly.GetEntryAssembly().GetName().Version.ToString(3)); ApplicationHost.LogEnvironmentInfo(_logger, appPaths); diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index f5f753684..8fa6c3dac 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -965,14 +965,6 @@ namespace MediaBrowser.Api.Playback.Hls var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request); - var timeDeltaParam = string.Empty; - - if (isEncoding && state.TargetFramerate > 0) - { - float startTime = 1 / (state.TargetFramerate.Value * 2); - timeDeltaParam = string.Format(CultureInfo.InvariantCulture, "-segment_time_delta {0:F3}", startTime); - } - var segmentFormat = GetSegmentFileExtension(state.Request).TrimStart('.'); if (string.Equals(segmentFormat, "ts", StringComparison.OrdinalIgnoreCase)) { @@ -980,7 +972,7 @@ namespace MediaBrowser.Api.Playback.Hls } return string.Format( - "{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time {6} {10} -individual_header_trailer 0 -segment_format {11} -segment_list_type m3u8 -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"", + "{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -f hls -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -hls_time {6} -individual_header_trailer 0 -hls_segment_type {7} -start_number {8} -hls_segment_filename \"{9}\" -hls_playlist_type vod -hls_list_size 0 -y \"{10}\"", inputModifier, EncodingHelper.GetInputArgument(state, encodingOptions), threads, @@ -988,11 +980,10 @@ namespace MediaBrowser.Api.Playback.Hls GetVideoArguments(state, encodingOptions), GetAudioArguments(state, encodingOptions), state.SegmentLength.ToString(CultureInfo.InvariantCulture), + segmentFormat, startNumberParam, - outputPath, outputTsArg, - timeDeltaParam, - segmentFormat + outputPath ).Trim(); } } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index d64ea35eb..24e771403 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -162,7 +162,6 @@ namespace MediaBrowser.Model.Configuration public bool SkipDeserializationForBasicTypes { get; set; } public string ServerName { get; set; } - public string WanDdns { get; set; } public string BaseUrl { get; set; } public string UICulture { get; set; } diff --git a/MediaBrowser.Model/System/PublicSystemInfo.cs b/MediaBrowser.Model/System/PublicSystemInfo.cs index d6e031e42..23f6d378c 100644 --- a/MediaBrowser.Model/System/PublicSystemInfo.cs +++ b/MediaBrowser.Model/System/PublicSystemInfo.cs @@ -9,12 +9,6 @@ namespace MediaBrowser.Model.System public string LocalAddress { get; set; } /// <summary> - /// Gets or sets the wan address. - /// </summary> - /// <value>The wan address.</value> - public string WanAddress { get; set; } - - /// <summary> /// Gets or sets the name of the server. /// </summary> /// <value>The name of the server.</value> @@ -25,7 +19,7 @@ namespace MediaBrowser.Model.System /// </summary> /// <value>The version.</value> public string Version { get; set; } - + /// <summary> /// The product name. This is the AssemblyProduct name. /// </summary> |
