The Free Software Media System - Server Backend & API
add password to self signed cert
Luke Pulverentifc788efa49e1
diff --git a/Emby.Server.Core/ApplicationHost.cs b/Emby.Server.Core/ApplicationHost.csindex 05f6c4309f..994b942e92 100644--- a/Emby.Server.Core/ApplicationHost.cs+++ b/Emby.Server.Core/ApplicationHost.cs@@ -1138,7 +1138,7 @@ namespace Emby.Server.Core// Generate self-signed certvar certHost = GetHostnameFromExternalDns(ServerConfigurationManager.Configuration.WanDdns);- var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "1").GetMD5().ToString("N") + ".pfx");+ var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "2").GetMD5().ToString("N") + ".pfx");var password = "embycert";if (generateCertificate)diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.csindex a47a3322e6..51c9504c20 100644--- a/Emby.Server.Implementations/Library/SearchEngine.cs+++ b/Emby.Server.Implementations/Library/SearchEngine.cs@@ -165,7 +165,10 @@ namespace Emby.Server.Implementations.LibraryExcludeItemTypes = excludeItemTypes.ToArray(),IncludeItemTypes = includeItemTypes.ToArray(),Limit = query.Limit,- IncludeItemsByName = true+ IncludeItemsByName = string.IsNullOrWhiteSpace(query.ParentId),+ ParentId = string.IsNullOrWhiteSpace(query.ParentId) ? (Guid?)null : new Guid(query.ParentId),+ SortBy = new[] { ItemSortBy.SortName },+ Recursive = true});// Add search hints based on item namediff --git a/MediaBrowser.Api/SearchService.cs b/MediaBrowser.Api/SearchService.csindex d6fa4030de..b4ee923650 100644--- a/MediaBrowser.Api/SearchService.cs+++ b/MediaBrowser.Api/SearchService.cs@@ -66,6 +66,8 @@ namespace MediaBrowser.Api[ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]public string IncludeItemTypes { get; set; }+ public string ParentId { get; set; }+public GetSearchHints(){IncludeArtists = true;@@ -135,7 +137,8 @@ namespace MediaBrowser.ApiIncludeStudios = request.IncludeStudios,StartIndex = request.StartIndex,UserId = request.UserId,- IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray()+ IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),+ ParentId = request.ParentId}).ConfigureAwait(false);diff --git a/MediaBrowser.Model/Search/SearchQuery.cs b/MediaBrowser.Model/Search/SearchQuery.csindex 678dfd39d7..11d2d97f7a 100644--- a/MediaBrowser.Model/Search/SearchQuery.cs+++ b/MediaBrowser.Model/Search/SearchQuery.cs@@ -34,6 +34,7 @@ namespace MediaBrowser.Model.Searchpublic bool IncludeArtists { get; set; }public string[] IncludeItemTypes { get; set; }+ public string ParentId { get; set; }public SearchQuery(){diff --git a/MediaBrowser.Server.Startup.Common/Cryptography/CertificateGenerator.cs b/MediaBrowser.Server.Startup.Common/Cryptography/CertificateGenerator.csindex a362045d02..4f5b3d0042 100644--- a/MediaBrowser.Server.Startup.Common/Cryptography/CertificateGenerator.cs+++ b/MediaBrowser.Server.Startup.Common/Cryptography/CertificateGenerator.cs@@ -44,7 +44,7 @@ namespace Emby.Common.Implementations.Securitycb.NotAfter = notAfter;cb.SubjectName = subject;cb.SubjectPublicKey = subjectKey;-+// signaturecb.Hash = "SHA256";byte[] rawcert = cb.Sign(issuerKey);@@ -60,6 +60,7 @@ namespace Emby.Common.Implementations.Securityattributes.Add(PKCS9.localKeyId, list);p12.AddCertificate(new X509Certificate(rawcert), attributes);+ p12.Password = password;p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);p12.SaveToFile(fileName);