From d8f0af1a94d14fc9b79882e11be4bddcf79b3fb1 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Tue, 22 Jan 2019 20:37:47 +0100 Subject: [PATCH 1/7] Fix plural localization --- src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index b4ab08422e..3223478dd7 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -1458,9 +1458,9 @@ Mange hilsner fra Umbraco robotten Makroer Medietyper Medlemmer - Medlemsgruppe + Medlemsgrupper Roller - Medlemstype + Medlemstyper Dokumenttyper Relationstyper Pakker From 832ec68140026c8256af00ac5991a36356ba25aa Mon Sep 17 00:00:00 2001 From: Paul Seal Date: Mon, 21 Jan 2019 23:38:38 +0000 Subject: [PATCH 2/7] - tls check to check if the site is set up to use at least TLS 1.2 for outgoing connections. - added translations for all languages which have a healthcheck section in the language file. --- .../Umbraco/config/lang/zh_tw.xml | 5 +- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 3 ++ .../umbraco/config/lang/en_us.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/es.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/fr.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/nl.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/pl.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 3 ++ src/Umbraco.Web.UI/umbraco/config/lang/zh.xml | 3 ++ .../HealthCheck/Checks/Security/TlsCheck.cs | 51 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + 11 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml index 16387728b1..ba30581267 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml @@ -1331,6 +1331,9 @@ SMTP伺服器 %0% : %1% 無法連接。請確認在Web.config 檔案中 system.net/mailsettings 設定正確。 %0%。]]> %0%。]]> + + 您的網站設置為使用TLS 1.2或更高版本進行傳出連接。 + 來自您網站的傳出連接通過舊協議提供。您應該考慮將其更新為使用TLS 1.2或更高版本。 停止網址追蹤器 @@ -1350,4 +1353,4 @@ 轉址追蹤器已開啟。 啟動轉址追蹤器錯誤,更多資訊請參閱您的紀錄檔。 - \ No newline at end of file + diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 7d3bfa7c99..06a7fbb109 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -2206,6 +2206,9 @@ To manage your website, simply open the Umbraco back office and start adding con %0%.]]>

Results of the scheduled Umbraco Health Checks run on %0% at %1% are as follows:

%2%]]>
Umbraco Health Check Status: %0% + + Your website is set up to use TLS 1.2 or greater for outgoing connections. + Outgoing connections from your website are being served over an old protocol. You should consider updating it to use TLS 1.2 or higher. Disable URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 0a1756038f..766d2eec9e 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -2199,6 +2199,9 @@ To manage your website, simply open the Umbraco back office and start adding con %0%.]]>

Results of the scheduled Umbraco Health Checks run on %0% at %1% are as follows:

%2%]]>
Umbraco Health Check Status: %0% + + Your website is set up to use TLS 1.2 or greater for outgoing connections. + Outgoing connections from your website are being served over an old protocol. You should consider updating it to use TLS 1.2 or higher. Disable URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml index ba0027aef0..607050c235 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml @@ -1856,6 +1856,9 @@ %0%.]]>

Los resultados de los Chequeos de Salud de Umbraco programados para ejecutarse el %0% a las %1% son:

%2%]]>
Status de los Chequeos de Salud de Umbraco: %0% + + Su sitio web está configurado para usar TLS 1.2 o superior para las conexiones salientes. + Las conexiones salientes de su sitio web están siendo servidas a través de un protocolo antiguo. Deberías considerar actualizarlo para usar TLS 1.2 o superior. Desactivar URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml index fd2b4c53a8..dab9f49120 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml @@ -2170,6 +2170,9 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à %0%.]]>

Les résultats de l'exécution du Umbraco Health Checks planifiée le %0% à %1% sont les suivants :

%2%]]>
Statut du Umbraco Health Check: %0% + + Votre site Web est configuré pour utiliser TLS version 1.2 ou supérieure pour les connexions sortantes. + Les connexions sortantes de votre site Web sont servies via un ancien protocole. Vous devriez envisager de le mettre à jour pour utiliser TLS 1.2 ou supérieur. Désactiver URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index 26b057e49f..4680d0dfc5 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -1623,6 +1623,9 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de %0%.]]> %0%.]]> + + Uw website is ingesteld om TLS 1.2 of hoger te gebruiken voor uitgaande verbindingen. + Uitgaande verbindingen van uw website worden via een oud protocol bediend. U zou moeten overwegen om het bij te werken om TLS 1.2 of hoger te gebruiken. URL tracker uitzetten diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml index 9affa43727..bb36628757 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml @@ -1674,6 +1674,9 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb %0%.]]> %0%.]]> + + Twoja strona internetowa jest skonfigurowana do używania protokołu TLS 1.2 lub nowszego dla połączeń wychodzących. + Połączenia wychodzące z Twojej witryny są obsługiwane przez stary protokół. Należy rozważyć zaktualizowanie go do korzystania z TLS w wersji 1.2 lub nowszej. Wyłącz śledzenie URL diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index fd33e647ad..37a4613d43 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -870,6 +870,9 @@ %0%.]]>

Зафиксированы следующие результаты автоматической проверки состояния Umbraco по расписанию, запущенной на %0% в %1%:

%2%]]>
Результат проверки состояния Umbraco: %0% + + Ваш веб-сайт настроен на использование TLS 1.2 или выше для исходящих соединений. + Исходящие соединения с вашего сайта обслуживаются по старому протоколу. Вы должны рассмотреть возможность его обновления для использования TLS 1.2 или выше. перейти к diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml index a918b78f95..471925ccd5 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml @@ -1598,6 +1598,9 @@ The SMTP server configured with host '%0%' and port '%1%' could not be reached. Please check to ensure the SMTP settings in the Web.config file system.net/mailsettings are correct. %0%.]]> %0%.]]> + + 您的网站设置为使用TLS 1.2或更高版本进行传出连接。 + 来自您网站的传出连接通过旧协议提供。您应该考虑将其更新为使用TLS 1.2或更高版本。 禁用 url 跟踪程序 diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs new file mode 100644 index 0000000000..8d41965395 --- /dev/null +++ b/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Net; +using Umbraco.Core.Services; + +namespace Umbraco.Web.HealthCheck.Checks.Security +{ + [HealthCheck("6D7D4E11-758E-4697-BA72-7E02A530CBD4", + "TLS Check", + Description = "Checks that your site is set up to use at least TLS 1.2 for outgoing connections.", + Group = "Security")] + public class TlsCheck : HealthCheck + { + private readonly ILocalizedTextService _textService; + + public TlsCheck(HealthCheckContext healthCheckContext) : base(healthCheckContext) + { + _textService = healthCheckContext.ApplicationContext.Services.TextService; + } + + public override IEnumerable GetStatus() + { + return new[] { CheckTls() }; + } + + public override HealthCheckStatus ExecuteAction(HealthCheckAction action) + { + throw new InvalidOperationException("TlsCheck has no executable actions"); + } + + public HealthCheckStatus CheckTls() + { + bool success = (int)ServicePointManager.SecurityProtocol >= (int)SecurityProtocolType.Tls12; + + string message = success + ? _textService.Localize("healthcheck/tlsHealthCheckSuccess") + : _textService.Localize("healthcheck/tlsHealthCheckWarn"); + + var actions = new List(); + + return + new HealthCheckStatus(message) + { + ResultType = success + ? StatusResultType.Success + : StatusResultType.Warning, + Actions = actions + }; + } + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 1b668b06c8..a66e960e97 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -338,6 +338,7 @@ + From 9eb2b28232772532cc74686cd4d01efdf13905f6 Mon Sep 17 00:00:00 2001 From: Alkaersig Date: Thu, 17 Jan 2019 12:08:53 +0100 Subject: [PATCH 3/7] Added (Doctype) Name and Description to PublishedContentType --- .../Models/PublishedContent/PublishedContentType.cs | 10 ++++++++-- src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs | 4 ++-- src/Umbraco.Tests/LibraryTests.cs | 2 +- .../Membership/DynamicMemberContentTests.cs | 2 +- .../PublishedContent/DynamicDocumentTestsBase.cs | 4 ++-- .../PublishedContent/PublishedContentDataTableTests.cs | 4 ++-- .../PublishedContent/PublishedContentMoreTests.cs | 6 +++--- .../PublishedContent/PublishedContentTestBase.cs | 4 ++-- .../PublishedContent/PublishedContentTestElements.cs | 8 ++++---- .../PublishedContent/PublishedContentTests.cs | 2 +- src/Umbraco.Tests/TestHelpers/BaseWebTest.cs | 2 +- src/Umbraco.Tests/Views/site1/template2.cshtml | 4 ++++ 12 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 src/Umbraco.Tests/Views/site1/template2.cshtml diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs index 63164cf271..4ca32bb718 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs @@ -25,6 +25,8 @@ namespace Umbraco.Core.Models.PublishedContent { Id = contentType.Id; Alias = contentType.Alias; + Name = contentType.Name; + Description = contentType.Description; _compositionAliases = new HashSet(contentType.CompositionAliases(), StringComparer.InvariantCultureIgnoreCase); _propertyTypes = contentType.CompositionPropertyTypes .Select(x => new PublishedPropertyType(this, x)) @@ -33,10 +35,12 @@ namespace Umbraco.Core.Models.PublishedContent } // internal so it can be used for unit tests - internal PublishedContentType(int id, string alias, IEnumerable compositionAliases, IEnumerable propertyTypes) + internal PublishedContentType(int id, string alias, string name, string description, IEnumerable compositionAliases, IEnumerable propertyTypes) { Id = id; Alias = alias; + Name = name; + Description = description; _compositionAliases = new HashSet(compositionAliases, StringComparer.InvariantCultureIgnoreCase); _propertyTypes = propertyTypes.ToArray(); foreach (var propertyType in _propertyTypes) @@ -46,7 +50,7 @@ namespace Umbraco.Core.Models.PublishedContent // create detached content type - ie does not match anything in the DB internal PublishedContentType(string alias, IEnumerable compositionAliases, IEnumerable propertyTypes) - : this(0, alias, compositionAliases, propertyTypes) + : this(0, alias, string.Empty, string.Empty, compositionAliases, propertyTypes) { } private void InitializeIndexes() @@ -63,6 +67,8 @@ namespace Umbraco.Core.Models.PublishedContent public int Id { get; private set; } public string Alias { get; private set; } + public string Name { get; private set; } + public string Description { get; private set; } public HashSet CompositionAliases { get { return _compositionAliases; } } #endregion diff --git a/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs b/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs index 5fe2efaa2c..6f64ef8b69 100644 --- a/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs +++ b/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs @@ -83,7 +83,7 @@ namespace Umbraco.Tests.CodeFirst new PublishedPropertyType("articleDate", 0, "?"), new PublishedPropertyType("pageTitle", 0, "?"), }; - var type = new AutoPublishedContentType(0, "anything", propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; Debug.Print("INIT STRONG {0}", PublishedContentType.Get(PublishedItemType.Content, "anything") @@ -148,4 +148,4 @@ namespace Umbraco.Tests.CodeFirst } #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/LibraryTests.cs b/src/Umbraco.Tests/LibraryTests.cs index 086395f456..42e218835c 100644 --- a/src/Umbraco.Tests/LibraryTests.cs +++ b/src/Umbraco.Tests/LibraryTests.cs @@ -43,7 +43,7 @@ namespace Umbraco.Tests // AutoPublishedContentType will auto-generate other properties new PublishedPropertyType("content", 0, "?"), }; - var type = new AutoPublishedContentType(0, "anything", propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; Debug.Print("INIT LIB {0}", PublishedContentType.Get(PublishedItemType.Content, "anything") diff --git a/src/Umbraco.Tests/Membership/DynamicMemberContentTests.cs b/src/Umbraco.Tests/Membership/DynamicMemberContentTests.cs index 4c1272550d..7bfe75f9aa 100644 --- a/src/Umbraco.Tests/Membership/DynamicMemberContentTests.cs +++ b/src/Umbraco.Tests/Membership/DynamicMemberContentTests.cs @@ -41,7 +41,7 @@ namespace Umbraco.Tests.Membership new PublishedPropertyType("bodyText", 0, "?"), new PublishedPropertyType("author", 0, "?") }; - var type = new AutoPublishedContentType(0, "anything", propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; } diff --git a/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs b/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs index 07787d8e2c..fd736f0700 100644 --- a/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs +++ b/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs @@ -50,7 +50,7 @@ namespace Umbraco.Tests.PublishedContent new PublishedPropertyType("creatorName", 0, "?"), new PublishedPropertyType("blah", 0, "?"), // ugly error when that one is missing... }; - var type = new AutoPublishedContentType(0, "anything", propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; } @@ -729,4 +729,4 @@ namespace Umbraco.Tests.PublishedContent return s.Contains(val.ToString()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index 8efe6efd72..c57bacad29 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs @@ -24,7 +24,7 @@ namespace Umbraco.Tests.PublishedContent // need to specify a custom callback for unit tests // AutoPublishedContentTypes generates properties automatically - var type = new AutoPublishedContentType(0, "anything", new PublishedPropertyType[] {}); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", new PublishedPropertyType[] {}); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; // need to specify a different callback for testing @@ -251,4 +251,4 @@ namespace Umbraco.Tests.PublishedContent } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index 1c83691d04..1f2f43de8b 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -234,9 +234,9 @@ namespace Umbraco.Tests.PublishedContent new PublishedPropertyType("prop1", 1, "?"), }; - var contentType1 = new PublishedContentType(1, "ContentType1", Enumerable.Empty(), props); - var contentType2 = new PublishedContentType(2, "ContentType2", Enumerable.Empty(), props); - var contentType2s = new PublishedContentType(3, "ContentType2Sub", Enumerable.Empty(), props); + var contentType1 = new PublishedContentType(1, "ContentType1", "ContentType1", "ContentType1", Enumerable.Empty(), props); + var contentType2 = new PublishedContentType(2, "ContentType2", "ContentType2", "ContentType2", Enumerable.Empty(), props); + var contentType2s = new PublishedContentType(3, "ContentType2Sub", "ContentType2Sub", "ContentType2Sub", Enumerable.Empty(), props); cache.Add(new SolidPublishedContent(contentType1) { diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs index 789d9f7218..c0fff5f8da 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs @@ -29,7 +29,7 @@ namespace Umbraco.Tests.PublishedContent // AutoPublishedContentType will auto-generate other properties new PublishedPropertyType("content", 0, Constants.PropertyEditors.TinyMCEAlias), }; - var type = new AutoPublishedContentType(0, "anything", propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; var rCtx = GetRoutingContext("/test", 1234); @@ -65,4 +65,4 @@ namespace Umbraco.Tests.PublishedContent UmbracoContext.Current = null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs index 82115d670e..2ebc8c2e4b 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs @@ -354,12 +354,12 @@ namespace Umbraco.Tests.PublishedContent { private static readonly PublishedPropertyType Default = new PublishedPropertyType("*", 0, "?"); - public AutoPublishedContentType(int id, string alias, IEnumerable propertyTypes) - : base(id, alias, Enumerable.Empty(), propertyTypes) + public AutoPublishedContentType(int id, string alias, string name, string description, IEnumerable propertyTypes) + : base(id, alias, name, description, Enumerable.Empty(), propertyTypes) { } - public AutoPublishedContentType(int id, string alias, IEnumerable compositionAliases, IEnumerable propertyTypes) - : base(id, alias, compositionAliases, propertyTypes) + public AutoPublishedContentType(int id, string alias, string name, string description, IEnumerable compositionAliases, IEnumerable propertyTypes) + : base(id, alias, name, description, compositionAliases, propertyTypes) { } public override PublishedPropertyType GetPropertyType(string alias) diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index 5ec34ea781..4358f5de47 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -49,7 +49,7 @@ namespace Umbraco.Tests.PublishedContent new PublishedPropertyType("testRecursive", 0, "?"), }; var compositionAliases = new[] { "MyCompositionAlias" }; - var type = new AutoPublishedContentType(0, "anything", compositionAliases, propertyTypes); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", compositionAliases, propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; } diff --git a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs index dfc6317d32..c7fe2d0168 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs @@ -15,7 +15,7 @@ namespace Umbraco.Tests.TestHelpers // need to specify a custom callback for unit tests // AutoPublishedContentTypes generates properties automatically - var type = new AutoPublishedContentType(0, "anything", new PublishedPropertyType[] {}); + var type = new AutoPublishedContentType(0, "anything", "anything", "anything", new PublishedPropertyType[] {}); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; } diff --git a/src/Umbraco.Tests/Views/site1/template2.cshtml b/src/Umbraco.Tests/Views/site1/template2.cshtml new file mode 100644 index 0000000000..3e82f2f0d2 --- /dev/null +++ b/src/Umbraco.Tests/Views/site1/template2.cshtml @@ -0,0 +1,4 @@ +@inherits Umbraco.Web.Mvc.UmbracoTemplatePage +@{ + Layout = null; +} \ No newline at end of file From 7acafe67a48f8b30cbeb75a965be616a1e228adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Alk=C3=A6rsig?= Date: Thu, 17 Jan 2019 13:23:35 +0100 Subject: [PATCH 4/7] Delete template2.cshtml Auto-generated test file --- src/Umbraco.Tests/Views/site1/template2.cshtml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 src/Umbraco.Tests/Views/site1/template2.cshtml diff --git a/src/Umbraco.Tests/Views/site1/template2.cshtml b/src/Umbraco.Tests/Views/site1/template2.cshtml deleted file mode 100644 index 3e82f2f0d2..0000000000 --- a/src/Umbraco.Tests/Views/site1/template2.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@inherits Umbraco.Web.Mvc.UmbracoTemplatePage -@{ - Layout = null; -} \ No newline at end of file From c9819b2d89fe9b17a726c5b0afc045c1e87ffa29 Mon Sep 17 00:00:00 2001 From: Paul Seal Date: Sat, 26 Jan 2019 14:01:03 +0000 Subject: [PATCH 5/7] - disabled the duplicated community health checks (#4175) --- src/Umbraco.Web.UI/config/HealthChecks.config | 30 +++++++++---------- .../HealthCheck/HealthCheckController.cs | 4 +-- .../Scheduling/HealthCheckNotifier.cs | 2 +- src/Umbraco.Web/WebBootManager.cs | 13 ++++++++ 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI/config/HealthChecks.config b/src/Umbraco.Web.UI/config/HealthChecks.config index 4e927e8bb6..5cb99e195b 100644 --- a/src/Umbraco.Web.UI/config/HealthChecks.config +++ b/src/Umbraco.Web.UI/config/HealthChecks.config @@ -8,19 +8,19 @@ For details on the format of this configuration file see: https://our.umbraco.com/documentation/reference/config/healthchecks --> - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs index 34d201d5fe..dee62e936b 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs @@ -82,7 +82,7 @@ namespace Umbraco.Web.HealthCheck public object GetStatus(Guid id) { var check = GetCheckById(id); - + try { //Core.Logging.LogHelper.Debug("Running health check: " + check.Name); @@ -113,4 +113,4 @@ namespace Umbraco.Web.HealthCheck return check; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs index d6e72f936b..7d42a90e58 100644 --- a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs +++ b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs @@ -16,7 +16,7 @@ namespace Umbraco.Web.Scheduling private readonly ApplicationContext _appContext; private readonly IHealthCheckResolver _healthCheckResolver; - public HealthCheckNotifier(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, + public HealthCheckNotifier(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, ApplicationContext appContext) : base(runner, delayMilliseconds, periodMilliseconds) { diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index dbab3d2346..faf1418b42 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -544,6 +544,19 @@ namespace Umbraco.Web () => PluginManager.ResolveTypes()); HealthCheckNotificationMethodResolver.Current = new HealthCheckNotificationMethodResolver(LoggerResolver.Current.Logger, () => PluginManager.ResolveTypes()); + + // Disable duplicate community health checks which appear in Our.Umbraco.HealtchChecks and Umbraco Core. + // See this issue to understand why https://github.com/umbraco/Umbraco-CMS/issues/4174 + var disabledHealthCheckTypes = new[] + { + "Our.Umbraco.HealthChecks.Checks.Security.HstsCheck", + "Our.Umbraco.HealthChecks.Checks.Security.TlsCheck" + }.Select(TypeFinder.GetTypeByName).WhereNotNull(); + + foreach (var type in disabledHealthCheckTypes) + { + HealthCheckResolver.Current.RemoveType(type); + } } /// From 7a2f09643abf4ba9db5e648c8a816e0e6c95d37f Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Wed, 23 Jan 2019 23:50:02 +0100 Subject: [PATCH 6/7] Changed health check to indicate HTTPS endpoint connectivity using TLS 1.2 --- .../Umbraco/config/lang/zh_tw.xml | 3 -- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 4 +- .../umbraco/config/lang/en_us.xml | 4 +- src/Umbraco.Web.UI/umbraco/config/lang/fr.xml | 3 -- src/Umbraco.Web.UI/umbraco/config/lang/nl.xml | 4 +- src/Umbraco.Web.UI/umbraco/config/lang/pl.xml | 3 -- src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 3 -- src/Umbraco.Web.UI/umbraco/config/lang/zh.xml | 3 -- .../HealthCheck/Checks/Security/TlsCheck.cs | 51 ------------------ .../HealthCheck/Checks/Services/Tls12Check.cs | 52 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 11 files changed, 59 insertions(+), 73 deletions(-) delete mode 100644 src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs create mode 100644 src/Umbraco.Web/HealthCheck/Checks/Services/Tls12Check.cs diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml index ba30581267..d765b7cecf 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml @@ -1331,9 +1331,6 @@ SMTP伺服器 %0% : %1% 無法連接。請確認在Web.config 檔案中 system.net/mailsettings 設定正確。 %0%。]]> %0%。]]> - - 您的網站設置為使用TLS 1.2或更高版本進行傳出連接。 - 來自您網站的傳出連接通過舊協議提供。您應該考慮將其更新為使用TLS 1.2或更高版本。 停止網址追蹤器 diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 06a7fbb109..53a58bd7b1 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -2207,8 +2207,8 @@ To manage your website, simply open the Umbraco back office and start adding con

Results of the scheduled Umbraco Health Checks run on %0% at %1% are as follows:

%2%]]>
Umbraco Health Check Status: %0% - Your website is set up to use TLS 1.2 or greater for outgoing connections. - Outgoing connections from your website are being served over an old protocol. You should consider updating it to use TLS 1.2 or higher. + Your site can use the TLS 1.2 security protocol when making outbound connections to HTTPS endpoints. + Your site isn't configured to allow the TLS 1.2 security protocol when making outbound connections: some HTTPS endpoints might not be reachable using a less secure protocol. Disable URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 766d2eec9e..a2b7e6d040 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -2200,8 +2200,8 @@ To manage your website, simply open the Umbraco back office and start adding con

Results of the scheduled Umbraco Health Checks run on %0% at %1% are as follows:

%2%]]>
Umbraco Health Check Status: %0% - Your website is set up to use TLS 1.2 or greater for outgoing connections. - Outgoing connections from your website are being served over an old protocol. You should consider updating it to use TLS 1.2 or higher. + Your site can use the TLS 1.2 security protocol when making outbound connections to HTTPS endpoints. + Your site isn't configured to allow the TLS 1.2 security protocol when making outbound connections: some HTTPS endpoints might not be reachable using a less secure protocol. Disable URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml index dab9f49120..fd2b4c53a8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml @@ -2170,9 +2170,6 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à %0%.]]>

Les résultats de l'exécution du Umbraco Health Checks planifiée le %0% à %1% sont les suivants :

%2%]]>
Statut du Umbraco Health Check: %0% - - Votre site Web est configuré pour utiliser TLS version 1.2 ou supérieure pour les connexions sortantes. - Les connexions sortantes de votre site Web sont servies via un ancien protocole. Vous devriez envisager de le mettre à jour pour utiliser TLS 1.2 ou supérieur. Désactiver URL tracker diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index 4680d0dfc5..dc867823c2 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -1624,8 +1624,8 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de %0%.]]> %0%.]]> - Uw website is ingesteld om TLS 1.2 of hoger te gebruiken voor uitgaande verbindingen. - Uitgaande verbindingen van uw website worden via een oud protocol bediend. U zou moeten overwegen om het bij te werken om TLS 1.2 of hoger te gebruiken. + Uw website kan het TLS 1.2 beveiligingsprotocol gebruiken bij het maken van uitgaande verbindingen naar HTTPS-eindpunten. + Uw website is niet geconfigureerd om het TLS 1.2 beveiligingsprotocol te kunnen gebruiken bij het maken van uitgaande verbindingen: sommige HTTPS-eindpunten zijn mogelijk niet bereikbaar via een minder veilig protocol. URL tracker uitzetten diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml index bb36628757..9affa43727 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml @@ -1674,9 +1674,6 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb %0%.]]> %0%.]]> - - Twoja strona internetowa jest skonfigurowana do używania protokołu TLS 1.2 lub nowszego dla połączeń wychodzących. - Połączenia wychodzące z Twojej witryny są obsługiwane przez stary protokół. Należy rozważyć zaktualizowanie go do korzystania z TLS w wersji 1.2 lub nowszej. Wyłącz śledzenie URL diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index 37a4613d43..fd33e647ad 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -870,9 +870,6 @@ %0%.]]>

Зафиксированы следующие результаты автоматической проверки состояния Umbraco по расписанию, запущенной на %0% в %1%:

%2%]]>
Результат проверки состояния Umbraco: %0% - - Ваш веб-сайт настроен на использование TLS 1.2 или выше для исходящих соединений. - Исходящие соединения с вашего сайта обслуживаются по старому протоколу. Вы должны рассмотреть возможность его обновления для использования TLS 1.2 или выше. перейти к diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml index 471925ccd5..a918b78f95 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml @@ -1598,9 +1598,6 @@ The SMTP server configured with host '%0%' and port '%1%' could not be reached. Please check to ensure the SMTP settings in the Web.config file system.net/mailsettings are correct. %0%.]]> %0%.]]> - - 您的网站设置为使用TLS 1.2或更高版本进行传出连接。 - 来自您网站的传出连接通过旧协议提供。您应该考虑将其更新为使用TLS 1.2或更高版本。 禁用 url 跟踪程序 diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs deleted file mode 100644 index 8d41965395..0000000000 --- a/src/Umbraco.Web/HealthCheck/Checks/Security/TlsCheck.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using Umbraco.Core.Services; - -namespace Umbraco.Web.HealthCheck.Checks.Security -{ - [HealthCheck("6D7D4E11-758E-4697-BA72-7E02A530CBD4", - "TLS Check", - Description = "Checks that your site is set up to use at least TLS 1.2 for outgoing connections.", - Group = "Security")] - public class TlsCheck : HealthCheck - { - private readonly ILocalizedTextService _textService; - - public TlsCheck(HealthCheckContext healthCheckContext) : base(healthCheckContext) - { - _textService = healthCheckContext.ApplicationContext.Services.TextService; - } - - public override IEnumerable GetStatus() - { - return new[] { CheckTls() }; - } - - public override HealthCheckStatus ExecuteAction(HealthCheckAction action) - { - throw new InvalidOperationException("TlsCheck has no executable actions"); - } - - public HealthCheckStatus CheckTls() - { - bool success = (int)ServicePointManager.SecurityProtocol >= (int)SecurityProtocolType.Tls12; - - string message = success - ? _textService.Localize("healthcheck/tlsHealthCheckSuccess") - : _textService.Localize("healthcheck/tlsHealthCheckWarn"); - - var actions = new List(); - - return - new HealthCheckStatus(message) - { - ResultType = success - ? StatusResultType.Success - : StatusResultType.Warning, - Actions = actions - }; - } - } -} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Services/Tls12Check.cs b/src/Umbraco.Web/HealthCheck/Checks/Services/Tls12Check.cs new file mode 100644 index 0000000000..d93fa28b49 --- /dev/null +++ b/src/Umbraco.Web/HealthCheck/Checks/Services/Tls12Check.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Net; +using Umbraco.Core.Services; + +namespace Umbraco.Web.HealthCheck.Checks.Services +{ + [HealthCheck("6D7D4E11-758E-4697-BA72-7E02A530CBD4", + "HTTPS endpoints (TLS 1.2)", + Description = "Checks whether the TLS 1.2 security protocol can be used when making outbound connections to HTTPS endpoints.", + Group = "Services")] + public class Tls12Check : HealthCheck + { + private readonly ILocalizedTextService _textService; + + public Tls12Check(HealthCheckContext healthCheckContext) : base(healthCheckContext) + { + _textService = healthCheckContext.ApplicationContext.Services.TextService; + } + + public override IEnumerable GetStatus() + { + return new[] { CheckTls() }; + } + + public override HealthCheckStatus ExecuteAction(HealthCheckAction action) + { + throw new InvalidOperationException("This check has no executable actions."); + } + + public HealthCheckStatus CheckTls() + { + // When set to 0 (SystemDefault), allows the operating system to choose the best protocol to use, and to block protocols that are not secure (this allows TLS 1.2 by default). + var success = ServicePointManager.SecurityProtocol == 0 || + ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12); + + var message = success + ? _textService.Localize("healthcheck/tls12HealthCheckSuccess") + : _textService.Localize("healthcheck/tls12HealthCheckWarn"); + + var actions = new List(); + + return new HealthCheckStatus(message) + { + ResultType = success + ? StatusResultType.Success + : StatusResultType.Warning, + Actions = actions + }; + } + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index a66e960e97..036cb96b50 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -338,7 +338,7 @@ - + From 52a56c8852f0053fe293f5107902158302d30f30 Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Thu, 24 Jan 2019 00:24:37 +0100 Subject: [PATCH 7/7] Only add TLS 1.2 if explicit protocols are defined --- src/Umbraco.Web/WebBootManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index faf1418b42..950676355e 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -131,9 +131,9 @@ namespace Umbraco.Web InstallHelper insHelper = new InstallHelper(UmbracoContext.Current); insHelper.DeleteLegacyInstaller(); - // Tell .net 4.5 that we also want to try connecting over TLS 1.2, not just 1.1 - if (ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12) == false) - ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls12; + // Tell .NET 4.5 that we also want to try connecting over TLS 1.2, not just TLS 1.1 (but only if specific protocols are defined) + if (ServicePointManager.SecurityProtocol != 0) + ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; return this; }