Commit Graph

107 Commits

Author SHA1 Message Date
Paul Johnson
5b1ccb0659 Remove the crazy Func param on AddUmbracoCore 2020-11-20 11:13:53 +00:00
Paul Johnson
daf972fc62 Closer to removing all BuildServiceProvider calls 2020-11-19 22:02:19 +00:00
Paul Johnson
8b97ce69b1 Removed CoreRuntimeBootstrapper
Establish runtime level at run time not during service registration.
2020-11-19 20:21:45 +00:00
Paul Johnson
3672a9f2f2 Add composers via extension on UmbracoBuilder
reduce scope of CoreRuntimeBootstrapper
2020-11-19 16:20:39 +00:00
Paul Johnson
48b61ec4c4 Simplify UmbracoBuilder setup 2020-11-19 09:12:39 +00:00
Paul Johnson
aec25d5007 Replace Composition with UmbracoBuilder 2020-11-18 17:41:57 +00:00
Andy Butland
b4ce2873cc NetCore: Migrated database server registrar and messenger tasks into hosted services (#9353)
* Migrated database server registrar and messenger tasks into hosted services.
Moved DatabaseServerRegistrar Options into injectable configuration.

* Added further cases for unit tests on hosted services checking execution based on runtime level.

* Migrated DatabaseServerMessengerOptions into configuration.
2020-11-10 20:02:09 +01:00
Paul Johnson
3f5f85880e NetCore: MSDI refactor split CoreRuntime & Remove Current (#9356)
* Split Bootstrap code from CoreRuntime

* Make ContentService method signatures match interface
prevents need to hide the concrete class in tests

* Remove Current

Only bit that bugs me is TreeNode for IconFilePath
I get the feeling it's dead code, but can just use a setter in cs or work out path in js if required.

* Fix tests, remember to terminate IRuntime
2020-11-10 09:50:47 +01:00
Andy Butland
2f2da679a4 Migrated scheduled publishing task to a hosted service. 2020-11-02 18:08:25 +01:00
Andy Butland
88380a17ae Migrated log scrubber backgroun task to a hosted service. 2020-10-31 14:13:24 +01:00
Andy Butland
4920fba7cb Migrated temp file cleanup background task to a hosted service. 2020-10-31 08:58:47 +01:00
Andy Butland
9cb59239d1 Migrated KeepAlive recurring task to hosted service. 2020-10-30 17:19:01 +01:00
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
Paul Johnson
4ae329589a NetCore: MSDI refactor remove IFactory & IRegister (#9308)
* Replace IFactory with IServiceProvider

* Replace IRegister with IServiceCollection

* Fix Rte.cshtml so the view can service locate.

* Replace Composing Lifetime with MSDI ServiceLifetime

* Remove ServiceProvider AddMultipleUnique extension

* Remove Umbraco.Web.Composing.Current.Reset and any calls

* Remove LightInject from net framework projects

* Brought back a helper for setting MediaFileSystem underlying IFileSystem
2020-10-30 12:16:17 +01:00
Paul Johnson
ec66990e72 NetCore: MSDI refactor phase 2 (#9280)
* Moved adapters from Infra -> Core

* Allow Composition to accept a service collection instead of an IRegister

* Composition no longer takes IRegister as constructor arg

all tests passing

* Composition no longer implements IRegister

* Lose _uniques in Composition

* lose Composition OnCreatingFactory actions

* Clean up UmbracoCoreServiceCollectionExtensions & Composition

Less IFactory

* LightInject gone where TFW == netstandard2.0 || TFW == netcoreapp3.1

* Resolve dead code issues

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later.

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later (continued)

Thought the counts were low, it's mostly extension method usage
2020-10-27 11:53:01 +01:00
Paul Johnson
a99f625f6a Netcore: Alternate approach for MSDI refactor (#9247)
* Doesn't make much sense to have Concrete on IRegister, only on IFactory

* Handle FilesTreeController requires IFileSystem of type PhysicalFileSystem

* Handle registration of default MediaFileSystem without using RegisterUniqueFor

* Remove RegisterFor / RegisterUniqueFor from IRegister

* Switch over from LightInject to wrappers around MSDI

* Made mapper dependencies more explicit

* Remove registration for AngularJsonMediaTypeFormatter

It's dependencies aren't registered so container validation fails

* Resolve lifetime issue for EnsureValidSessionId by service locating

else resolve scoped in singleton

* Make registration more explicit for backoffice UserManager

* Make install step registrations more explicit

* Disable service provider validation so site can launch

Maybe this is a problem maybe not, we build about 8000 service providers so maybe everything is fine later...

* Further cleanup of IFactory interface

* Further cleanup of IRegister interface

* Revert "Make registration more explicit for backoffice UserManager"

This reverts commit 7215fe836103c597cd0873c66737a79b91ed4c49.

* Resolve issue where NewInstallStep would fail to reset password for "SuperUser"

Before MSDI, somehow BackOfficeIdentityOptions would be configured with token provider map from IdentityBuilder.AddDefaultTokenProviders.
After switchover those config actions are lost.

Subclass IdentityBuilder to ensure BackOfficeIdentityOptions doesn't miss config setup upstream.

* Initialize current.

* Add todo to turn container validation back on.

* Migrated ScopeFileSystemsTests to integration tests

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Resolve issue where MediaFileSystem was skipping ShadowFileSystem

* Attempt to fix ScopeFileSystemsTests on azure devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Be interesting to know what the actual full path is in pipeline.

* Clarify intent of CreateMediaTest

Doesn't help resolve weird UnauthorizedAccessException but it cuts so much cognitive overhead for the future.

* Use ILoggerfactory rather than mock for the manually constructed file PhysicalFileSystem

* Maybe resolve failing test on azure pipeline.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 11:47:14 +01:00
Mole
c02e1c261d Merge pull request #9175 from umbraco/netcore/bugfix/smidge-nuglify
Update and fix Umbraco's SmidgeRuntimeMinifier implementation and update to latest Smidge
2020-10-19 09:35:39 +02:00
Shannon
ca9fab6b48 Latest version of smidge, new custom NuglifyJs processor with custom settings, fixes some JS that Nuglify throws on because it's not formatted correctly, ensures nuglify is used for the minifier 2020-10-16 12:35:53 +11:00
Mole
6664076976 Use default timeout in default session registration 2020-10-14 11:40:20 +02:00
Mole
d9b5aedca4 Register session service and middleware 2020-10-14 11:35:38 +02:00
Mole
96f6f9cede Fix logging for now
The service provider is built before logging is registered as a service, meaning that the loggerFactory was empty, rebuilding fixes the issue for now, but it's not very pretty, would be better if we could move logger registration out of CreateCompositionRoot
2020-10-13 08:46:52 +02:00
Bjarke Berg
3551d6e65e Clean up and fixed todos
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-06 21:23:15 +02:00
Mole
b5aedde616 Do some ILogger cleaning 2020-09-28 08:48:49 +02:00
Mole
25f13629cb Register logging before trying to use ILoggerFactory in UmbracoCoreServiceCollectionExtensions
Before we used serviceProvider.GetService<ILoggerFactory>() with a service provider that were build before logging was configured, therefore the loggerfactory was empty and a lot of logs were missing
2020-09-24 09:39:48 +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
Mole
4b5fbf83e1 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
2020-09-22 15:24:01 +02:00
Mole
438515fa66 Merge Netcore: Use serilog to log all messages and use appsettings as config into Netcore/feature/migrate logging 2020-09-22 15:09:16 +02:00
Bjarke Berg
6fdf7082a0 Fixed issue models builder config and changed default mode to nothing
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-22 14:16:00 +02:00
Mole
9dc17b0873 Use serviceProvider instead of Current when creating TypeFinder in CollectionExtensions
Current hasn't been initialized at this point
2020-09-22 10:16:38 +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
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
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
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
1f8d7f18be Added configuration validation for content and request handler settings. 2020-09-18 11:30:26 +02:00
berg
a2a5e25713 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/use-serilog-to-log-all-messages
Signed-off-by: berg <mail@bergmania.dk>
2020-09-18 08:34:20 +02:00
berg
f11391961f Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/use-serilog-to-log-all-messages
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.Common/Extensions/UmbracoCoreServiceCollectionExtensions.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
2020-09-18 08:31:09 +02:00
Bjarke Berg
d7ab7d3d2e Removed test code
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-18 08:30:48 +02:00
Bjarke Berg
a7c3b2dab8 Clear default log providers 2020-09-17 09:59:13 +02:00
Bjarke Berg
7d3bc9be1c Moved serilog config to appsettings and configured it to also catch MS logging messages.
Added Console log for Development
2020-09-17 09:01:10 +02:00
Nikolaj
611276a5eb Fake SiriLogger for now and start using MSLogger more places 2020-09-16 14:29:33 +02:00
Nikolaj
120e163682 Begin trying to replace logger in Current 2020-09-16 13:46:45 +02:00
Nikolaj
633d42039e Fix a whole bunch of other errors 2020-09-15 15:14:44 +02:00
Bjarke Berg
b7a48686f0 Updates based on review feedback 2020-09-15 13:18:01 +02:00
Bjarke Berg
dc8933b6b9 Removed test code 2020-09-14 15:05:32 +02:00
Nikolaj
b8c60d1666 Refactor Fatal with simple message 2020-09-14 11:23:17 +02:00
Bjarke Berg
5b90a469e9 More clean up of old configs 2020-09-14 09:01:57 +02:00
Bjarke Berg
e079bd5a50 Cleanup usages of Configs 2020-09-08 13:03:43 +02:00
Bjarke Berg
3efee8284a Post merge fixes 2020-09-07 15:28:58 +02:00