瀏覽代碼

add password to self signed cert

Luke Pulverenti 8 年之前
父節點
當前提交
fc788efa49

+ 1 - 1
Emby.Server.Core/ApplicationHost.cs

@@ -1138,7 +1138,7 @@ namespace Emby.Server.Core
 
             // Generate self-signed cert
             var 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)

+ 4 - 1
Emby.Server.Implementations/Library/SearchEngine.cs

@@ -165,7 +165,10 @@ namespace Emby.Server.Implementations.Library
                 ExcludeItemTypes = 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 name

+ 4 - 1
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.Api
                 IncludeStudios = 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);
 

+ 1 - 0
MediaBrowser.Model/Search/SearchQuery.cs

@@ -34,6 +34,7 @@ namespace MediaBrowser.Model.Search
         public bool IncludeArtists { get; set; }
 
         public string[] IncludeItemTypes { get; set; }
+        public string ParentId { get; set; }
 
         public SearchQuery()
         {

+ 2 - 1
MediaBrowser.Server.Startup.Common/Cryptography/CertificateGenerator.cs

@@ -44,7 +44,7 @@ namespace Emby.Common.Implementations.Security
             cb.NotAfter = notAfter;
             cb.SubjectName = subject;
             cb.SubjectPublicKey = subjectKey;
-
+            
             // signature
             cb.Hash = "SHA256";
             byte[] rawcert = cb.Sign(issuerKey);
@@ -60,6 +60,7 @@ namespace Emby.Common.Implementations.Security
             attributes.Add(PKCS9.localKeyId, list);
 
             p12.AddCertificate(new X509Certificate(rawcert), attributes);
+            p12.Password = password;
 
             p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);
             p12.SaveToFile(fileName);