Commit Graph

602 Commits

Author SHA1 Message Date
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
Shannon
99247d7fbe Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
# Conflicts:
#	src/Umbraco.Infrastructure/PropertyEditors/PropertyEditorsComposer.cs
2020-11-18 16:02:51 +11:00
Elitsa Marinovska
dd5f400cf3 Netcore: Migration of Model classes from Umbraco.Infrastructure to Core (#9404)
* Migrating more model, mapping and tree classes

* Migrating files from Mapping dir without Newtonsoft dependency

* Migrating files from PublishedContent and Editors dirs without Newtonsoft dependency + some more of the same kind

* Migrating DataType class without the usage of Newtonsoft.Json and making the corresponding changes to all classes affected

* Combining 3 ContentExtensions files into 1

* Refactoring from migrating ContentExtensions

* Migrating more classes

* Migrating ContentRepositoryExtensions - combining it with existing file in Umbraco.Core

* removing Newtonsoft json dependency & migrating file. Adding partial migration of ConfigurationEditor, so PropertyTagsExtensions can be migrated

* Migrating ContentTagsExtensions, and refactoring from changes in PropertyTagsExtensions

* Changes that should be reverted once ConfigurationEditor class is fully migrated

* VS couldn't find Composing, so build was failing. Removing the using solves the problem

* Handling a single case for deserializing a subset of an input

* Small changes and added tests to JsonNetSerializer

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

* Migrated ConfigurationEditor

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

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-11-17 20:27:10 +01:00
Paul Johnson
d498c1a2cd Netcore: Turn container validation back on (#9401)
* Remove RuntimeLevelAttribute & disable filtering

* Remove RuntimeLevelAttribute usage on Composers

* Fix broken tests

* Resolve UserManager registration issues.

* Turn container validation back on.

* Resolve lifetime issue post install backoffice.

* Remove final TODO: MSDI
2020-11-17 08:56:04 +01:00
Elitsa Marinovska
a1f9bc9b17 NetCore: Install page db checks (#9388)
* Making more explicit checks for the db type

* Fixed confusion with both ints and strings

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-11-13 08:50:35 +01:00
Bjarke Berg
e46a248832 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComposer.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Testing/UmbracoTestBase.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web.BackOffice/Runtime/BackOfficeComposer.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
#	src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs
#	src/Umbraco.Web.UI.NetCore/appsettings.json
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
2020-11-12 13:10:19 +01:00
Bjarke Berg
d756248c7c Merge remote-tracking branch 'origin/netcore/dev' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs
#	src/Umbraco.Tests/Services/MemberServiceTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Preview.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/config/umbracoSettings.config
2020-11-12 12:57:03 +01:00
Bjarke Berg
eaf6543f99 post merge 2020-11-12 09:50:55 +01:00
Bjarke Berg
b2bcdb898e Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Web.UI/Umbraco/Views/Preview/Index.cshtml
#	src/Umbraco.Web.UI/config/umbracoSettings.config
#	src/Umbraco.Web/Services/IconService.cs
2020-11-12 09:13:53 +01: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
Bjarke Berg
27fd71225e Merge pull request #9287 from umbraco/netcore/feature/AB9042-migrate-from-infrastructure
Netcore: Migration of classes from Umbraco.Infrastructure
2020-11-05 13:02:49 +01:00
Elitsa Marinovska
6d23075d9a Migrating the rest of the files from ContentEditing\ 2020-11-03 16:36:59 +01:00
Bjarke Berg
3cf45c9e88 Merge pull request #9329 from AndyButland/feature/amend-health-check-notifier-first-run-time-to-crontab
.NetCore: change health check notifier first run time to cron expression
2020-11-03 12:06:34 +01:00
Bjarke Berg
94b9f7453c Fix boot issue, because hosted services uses IServerMessenger that uses ISqlContext before the db is ready
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-03 11:20:51 +01:00
Bjarke Berg
8e44d89856 Introducing interface for our needs of a CronTabParser. And inject it where needed
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-03 09:36:56 +01:00
Bjarke Berg
2da6c8517a Merge remote-tracking branch 'origin/netcore/netcore' into feature/amend-health-check-notifier-first-run-time-to-crontab
# Conflicts:
#	src/Umbraco.Core/ServiceCollectionExtensions.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
2020-11-03 07:09:15 +01:00
Andy Butland
2f2da679a4 Migrated scheduled publishing task to a hosted service. 2020-11-02 18:08:25 +01:00
Andy Butland
21c29d6446 Fixes failing unit test due to null reference.
Amended signatures of method under test to support testing without the previously observed behaviour of an erroring test passing but crashing the test runner process.
2020-11-02 11:59:39 +01:00
Andy Butland
0bffe9aa55 Updated health check configuration validation tests to match change to cron expression. 2020-11-01 08:41:17 +01:00
Andy Butland
a0ce44c9fc Changed configuration of first run time for health check notifier from a time string to a cron expression. 2020-10-31 22:49:12 +01:00
Andy Butland
a60fe36c33 Fixed amended temp file clean-up routine to restore behaviour of continuing on single file error. 2020-10-31 14:46:56 +01:00
Andy Butland
433fdbb047 Change LoggingSettings.MaxLogAge from integer (minutes) to a TimeSpan. 2020-10-31 14:25:40 +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
Elitsa Marinovska
77544812e6 Migrating some more classes that are using EntityBasic 2020-10-29 12:45:35 +01:00
Elitsa Marinovska
c304bf07cb Registering UdiJsonConverter globally so that we can migrate EntityBasic to Umbraco.Core 2020-10-27 15:44:11 +01:00
Elitsa Marinovska
a6e0afe57d Migrating classes not inhering or having dependencies to EntityBasic 2020-10-27 15:42:59 +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
Bjarke Berg
715071a33f Merge remote-tracking branch 'origin/netcore/task/6973-migrating-authenticationcontroller' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web/Logging/WebProfilerComponent.cs
#	src/Umbraco.Web/Logging/WebProfilerComposer.cs
2020-10-26 14:37:56 +01:00
Bjarke Berg
b47f946ffe Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
2020-10-26 14:34:06 +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
Bjarke Berg
109ccb19b3 Merge pull request #9252 from umbraco/netcore/feature/AB8969-email-message-abstraction
NetCore: Email message abstraction
2020-10-23 14:20:10 +02:00
Bjarke Berg
5fe849c8e2 https://github.com/umbraco/Umbraco-CMS/pull/9252 - Changed EmailMessage to be completely immutable
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-23 12:37:23 +02:00
Shannon
64d8b56eca It builds! 2020-10-23 14:18:53 +11:00
Shannon
1400a02798 Merge branch 'netcore/dev' into netcore/task/6973-migrating-authenticationcontroller
# Conflicts:
#	src/Umbraco.Core/Constants-Security.cs
#	src/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactory.cs
#	src/Umbraco.Infrastructure/BackOffice/BackOfficeUserManager.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Tests.AcceptanceTest/cypress/integration/Tour/backofficeTour.ts
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Controllers/DenyLocalLoginAuthorizationAttribute.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/Extensions/HtmlHelperBackOfficeExtensions.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.Common/Security/ExternalSignInAutoLinkOptions.cs
#	src/Umbraco.Web.UI.Client/src/common/interceptors/_module.js
#	src/Umbraco.Web.UI.Client/src/common/interceptors/requiredheaders.interceptor.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/Filters/IsCurrentUserModelFilterAttribute.cs
#	src/Umbraco.Web/Security/AppBuilderExtensions.cs
#	src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs
#	src/Umbraco.Web/UmbracoDefaultOwinStartup.cs
2020-10-23 10:10:02 +11:00
Bjarke Berg
1dd7384747 Merge remote-tracking branch 'origin/netcore/netcore' into unique-nodename-refactor 2020-10-22 20:04:14 +02:00
Elitsa Marinovska
d7eca3d0d5 Abstracting MailMessage 2020-10-22 15:08:07 +02:00
Bjarke Berg
ca8e54ffc6 https://github.com/umbraco/Umbraco-CMS/pull/9248>
- Removed BackOfficeArea
- Injected IEmailSender
- Uses nameof instead of magic strings
- Uses GetControllerName instead of magic strings

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-22 13:37:47 +02:00
Bjarke Berg
6905e5e734 Cleanup of different stuff that can be deleted from Umbraco.Web
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-22 12:25:52 +02:00
Shannon
2b1dfc5888 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
# Conflicts:
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Mvc/UmbracoController.cs
2020-10-22 21:16:44 +11:00
Anthony
759eee042f Refactored according to PR feedback. 2020-10-21 20:57:21 +01: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
Bjarke Berg
85718e9b86 Merge remote-tracking branch 'origin/v8/dev' into netcore/merge_umbraco_id_into_netcore_dev
# Conflicts:
#	src/Umbraco.Core/Migrations/Upgrade/V_8_8_0/ExternalLoginTableUserData.cs
#	src/Umbraco.Core/Migrations/Upgrade/V_8_9_0/ExternalLoginTableUserData.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_8_0/ExternalLoginTableUserData.cs
#	src/Umbraco.Web/Services/IconService.cs
2020-10-21 09:07:30 +02:00
Shannon
d1b35deb43 Migrates remaining backofficecontroller but still a bunch of work to do , streamlines Backoffice to BackOffice (but is that what we want?) 2020-10-21 16:51:00 +11:00