Commit Graph

832 Commits

Author SHA1 Message Date
Andy Butland
bdb8f34da3 Netcore: Health check notifier hosted service (#9295)
* Implemented health check notifier as a hosted service.
Added validation to health check settings.

* Registered health check notifier as a hosted service.
Modified health check nested settings to use concrete classes to align with other configuration models.

* Resolved issues with email sending using development server.

* PR review comments and fixed failing unit test.

* Changed period and delay millisecond and hourly values to TimeSpans.
Changed configuration of first run time for health check notifications to use H:mm format.

* Set up SecureSocketOptions as a locally defined enum.

* Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan.

* Aligned naming and namespace of health check configuration related classes with other configuration classes.

* Created constants for hex colors used in formatting health check results as HTML.

* Revert "Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan."

This reverts commit f9bb8a7a825bcb58146879f18b47922e09453e2d.

* Renamed method to be clear validation is of a TimeSpan and not a time.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-30 13:56:13 +01:00
berg
070307ea88 Ensure unit tests run on linux
Signed-off-by: berg <mail@bergmania.dk>
2020-10-21 21:04:10 +02:00
Emma L Garland
7a570110d0 Netcore/feature/healthcheck replaceconfiglogic (#8934)
* Started moving to JSON instead of config.
Mild refactoring but overall keeping it the same, except for injecting IConfiguration and JSON parsing instead of XML
Tests currently unaffected, need to increase coverage

* Moved to constants for appsettings keys
Moved from IConfiguration to global settings - later to be replaced with IOptions
Updated translation messages
Installed IOptions ready for new PR
Updated to new interface, IConfigurationService

* Post-merge fix

* Namespace move from Umbraco.Web to Umbraco.Core where appropriate

* Renamed abstractsettings (from abstractconfig)
Moving out of configservice into the POCO config check

* Made the IIsCustomErrors healthcheck as obsolete, as no web.config setting). Investigate reintroducing this check in the .NET Core way (UseDevelopment).
Reducing use of abstractsettings as not needed - we don't need a config service to read the config settings anymore as they're all explicit POCOs.
Consolidated health-checks in project.

* Removed test views that weren't meant to be added

* Returned to use of abstractsettings with different use

* Moved more health checks into correct folder/namespace, and enum into their own file

* Correct namespace

* Git history/compare lost due to file move, temporarily moving back to original folder. Will do another PR to move after this

* Use existing GetStatus in abstract check for Debug mode

* Updating to return to previous logic and putting files back into line

* Macro errors returned to previous logic

* Reuse abstractsettings class

* Swapped order to assist with reviewing PR

* Updated to include itempath

* Not implemented comment to avoid confusion
Implemented NotificationEmailCheck

* Changed to IOptionsMonitor as per PR comments. Removed configurationservice as we need to rethink the fixing strategy. Updated logger.
Needs to show fix message instead of fixing. Temporary fix for IIS version

* Switched to IOptionsMonitor for all

* No longer attempts to actually fix header in config. Still need to show suggestions.

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2020-10-21 11:29:25 +02:00
Shannon
779214f9d3 preserve function names and update smidge 2020-10-16 15:23:02 +11:00
Bjarke Berg
35443f0e71 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/Search/ExamineComponent.cs
#	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
2020-09-24 08:24:35 +02:00
Bjarke Berg
435cf2623a Updated ImageSharp.Web to 1.0.0
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-23 14:00:08 +02:00
Mole
8258178c5a Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts:
#	src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs
#	src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
#	src/Umbraco.Tests/Models/MediaXmlTest.cs
#	src/Umbraco.Tests/Routing/MediaUrlProviderTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2020-09-23 13:32:49 +02:00
Bjarke Berg
f413f279eb Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs
#	src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
#	src/Umbraco.Tests.Integration/Implementations/TestHelper.cs
#	src/Umbraco.Tests.Integration/Persistence/Repositories/TemplateRepositoryTest.cs
#	src/Umbraco.Tests.Integration/RuntimeTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ColorListValidatorTest.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/EnsureUniqueValuesValidatorTest.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/MultiValuePropertyEditorTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs
#	src/Umbraco.Tests/Components/ComponentTests.cs
#	src/Umbraco.Tests/IO/ShadowFileSystemTests.cs
#	src/Umbraco.Tests/Models/VariationTests.cs
#	src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
#	src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
#	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs
#	src/Umbraco.Tests/Published/ConvertersTests.cs
#	src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs
#	src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs
#	src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs
#	src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs
#	src/Umbraco.Tests/Routing/UmbracoModuleTests.cs
#	src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs
#	src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
#	src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs
#	src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
2020-09-23 07:59:10 +02:00
Bjarke Berg
2b8d5b7edd Merge remote-tracking branch 'origin/netcore/netcore' into feature/8651-move-image-file-types-from-config
# Conflicts:
#	src/Umbraco.Core/Configuration/Models/ContentImagingSettings.cs
#	src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs
2020-09-22 21:10:19 +02:00
Andy Butland
f42e8856db Removed supported image file types from configuration and set up as a property on IImageUrlGenerator, so different providers can indicate support for different sets of images. 2020-09-22 15:06:22 +02:00
Andy Butland
fe158ec7d9 Removed custom validation of configuration enum values, reverting to framework based validation when binding direct to the enum values. 2020-09-21 21:20:46 +02:00
Andy Butland
574e4d6446 Reverted change to enum parse from string configuration value, as we can't avoid the property being evaluated before the validation has occurred. 2020-09-21 16:23:58 +02:00
Andy Butland
1a59d6a978 Created constants for all configuration sections and used this and nameof expressions for building up configuration validation error messages. 2020-09-21 16:23:12 +02:00
Mole
d3ae921293 Remove most of the last references and rename LoggerFactory_ to LoggerFactory in UmbracoTestBase 2020-09-21 13:04:57 +02:00
Andy Butland
cce091de74 Throw exception on unexpected failure of creation on enum value from configuration, rather than falling back to a default.
This shouldn't happen in practice due to the configuration validation (e.g. by ContentSettingsValidator), so any failure of parsing here should be considered an exception.
2020-09-21 12:04:30 +02:00
Andy Butland
e032af5b06 Fixed failing tests. 2020-09-21 10:04:34 +02:00
Mole
894abdd183 Remove a bunch of references to the old logger 2020-09-21 09:41:18 +02:00
Andy Butland
903e964925 Set default value for SmtpSettings DeliveryMethod configuration. 2020-09-21 08:54:03 +02:00
Andy Butland
d55b54ce49 Added unit tests for introduced unit test configuration setting builders. 2020-09-21 08:54:03 +02:00
Andy Butland
8aadbe02d6 Added unit tests for configuration validators. 2020-09-21 08:54:03 +02:00
Andy Butland
bae4f2fb53 Changed NuCache settings to use a nullable integer. 2020-09-21 08:54:03 +02:00
Andy Butland
b9e67dde55 Added configuration validation for models builder and hosting settings.
Renamed models builder config class suffix to match others.
2020-09-18 12:53:10 +02:00
Mole
d61b9f54fa Merge options 2020-09-18 12:53:06 +02:00
Andy Butland
eb62789b68 Added configuration validation for content imaging settings. 2020-09-18 12:02:12 +02:00
Andy Butland
1f8d7f18be Added configuration validation for content and request handler settings. 2020-09-18 11:30:26 +02:00
Nikolaj
dda6fb12a3 Remove LogError<T> from LoggerExtensions 2020-09-16 09:40:49 +02:00
Bjarke Berg
b7a48686f0 Updates based on review feedback 2020-09-15 13:18:01 +02:00
Bjarke Berg
5836ca3da4 Bugfix - Imagesharp cache folder is not relative to root but to the wwwroot. "~" is not replaced with root 2020-09-15 10:27:23 +02:00
Bjarke Berg
b4353585c3 Simplifyed the ConnectionStrings config 2020-09-15 09:11:36 +02:00
Nikolaj
02828db8fd Add work on PublishedSnapshotService 2020-09-15 08:45:40 +02:00
Bjarke Berg
4a4b57ef87 bugfixes related to no umbraco connection string
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-14 21:53:56 +02:00
Bjarke Berg
ce2da18304 Fixed based on review comments
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-14 21:27:31 +02:00
Bjarke Berg
e74570c0ac More clean up of old configs 2020-09-14 14:12:38 +02:00
Bjarke Berg
acb46119be More clean up of old configs 2020-09-14 12:57:47 +02:00
Bjarke Berg
1b4b17cbae More clean up of old configs 2020-09-14 11:56:22 +02:00
Bjarke Berg
e6ad34da1d More clean up of old configs 2020-09-14 09:13:53 +02:00
Nikolaj
d7e3bce741 Rename Error to align it with MS ILogger 2020-09-14 09:10:53 +02:00
Bjarke Berg
5b90a469e9 More clean up of old configs 2020-09-14 09:01:57 +02:00
Bjarke Berg
2eee6d7386 Removed some of the old legacy configs
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-11 21:13:18 +02:00
Bjarke Berg
dc643ab6a6 Merge remote-tracking branch 'origin/netcore/netcore' into feature/8651-config-options-patten
# Conflicts:
#	src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs
#	src/Umbraco.ModelsBuilder.Embedded/BackOffice/ContentTypeModelValidatorBase.cs
#	src/Umbraco.ModelsBuilder.Embedded/BackOffice/ModelsBuilderDashboardController.cs
#	src/Umbraco.ModelsBuilder.Embedded/Building/ModelsGenerator.cs
#	src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComposer.cs
#	src/Umbraco.ModelsBuilder.Embedded/ModelsGenerationError.cs
#	src/Umbraco.ModelsBuilder.Embedded/OutOfDateModelsStatus.cs
#	src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
#	src/Umbraco.Web.BackOffice/Controllers/RedirectUrlManagementController.cs
2020-09-10 14:01:38 +02:00
Bjarke Berg
a4e5029912 Refactored to remove Configs 2020-09-10 13:51:59 +02:00
Bjarke Berg
1923cf013c Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/ModelsBuilderEmbedded-migration-roslyn-compiler 2020-09-09 12:38:16 +02:00
Elitsa Marinovska
78dd6c40da Fixes issue https://github.com/umbraco/Umbraco-CMS/issues/8835 on alpha001 regarding disabling/enabling url tracking 2020-09-08 15:50:52 +02:00
Bjarke Berg
e079bd5a50 Cleanup usages of Configs 2020-09-08 13:03:43 +02:00
Nikolaj
00b30f74c7 Fix 2020-09-07 09:06:46 +02:00
Andy Butland
b87630250b Removed unused private field and constructor variable for configuration global settings from UmbracoVersion.
Updated singleton created instances in CreateCompositionRoot to accept IOptions based parameters for configuration.
2020-09-03 11:36:57 +02:00
Nikolaj
1eb7e9c1eb Add further progress 2020-09-02 14:44:01 +02:00
Andy Butland
f1bda37a64 Updates following PR review. 2020-09-01 18:10:12 +02:00
Andy Butland
e6ac534069 Resolved post-merge issues. 2020-08-27 09:27:11 +02:00
Andy Butland
2a59a8385c Merge branch 'netcore/netcore' into feature/8651-config-options-patten
# Conflicts:
#	src/Umbraco.Tests.Common/Builders/GlobalSettingsBuilder.cs
#	src/Umbraco.Tests/TEMP/DatabaseContextTests.sdf
#	src/Umbraco.Web.BackOffice/Controllers/ImagesController.cs
2020-08-27 09:03:01 +02:00