Commit Graph

22 Commits

Author SHA1 Message Date
Bjarke Berg
7119253e6f Add allowlist of media hosts. 2023-03-01 15:17:08 +01:00
Nikolaj Geisle
e762fa91bc V10: fix build warnings in Web.BackOffice (#12479)
* Run code cleanup

* Start manual run

* Finish dotnet format + manual cleanup

* Fix up after merge

* Fix substrings changed to [..]

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-06-20 08:37:17 +02:00
Nikolaj Geisle
a6128bfe8e Merge branch 'v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/Cache/MacroCacheRefresher.cs
#	src/Umbraco.Core/Services/MacroService.cs
#	src/Umbraco.Core/StaticApplicationLogging.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs
#	src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Infrastructure/Security/UmbracoPasswordHasher.cs
#	src/Umbraco.Web.BackOffice/Controllers/ImagesController.cs
2022-04-05 08:51:08 +02:00
Nikolaj Geisle
1a6f0e4d7b Start work on controllers 2022-04-01 11:09:51 +02:00
Nikolaj Geisle
30a30731ec Encode path (#12132)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-17 14:52:15 +01:00
Martin Bentancour
c905fdd9b5 Validate that imageUrl param is a relative path (#11606)
* Validate that imageUrl param is a relative path

To prevent open redirects, the imagePath should point to a relative path (i.e. not point to a different domain).

* LocalRedirectResult instead of RedirectResult

Uri.Relative does not prevent paths like //google.com/test.jpg
Checking for both relative and local seems to cover all the cases.
2022-02-28 23:59:18 +01:00
Ronald Barendse
22814036a1 Update FocalPointPosition and CropCoordinates constructors/properties 2021-08-10 17:20:03 +02:00
Ronald Barendse
0b9f1f4f86 Remove usage of obsolete image URL generation properties (width/height ratio, default crop, upscale and animation process mode) 2021-08-10 11:23:37 +02:00
Mole
c9ebaadf23 Netcore: File systems rework (#10181)
* Allow IMediaFileSystem to be replace in the DI, or registered with inner filesystem

* Remove GetFileSystem from Filesystems

It was only used by tests.

* Make MediaFileSystem inherit from PhysicalFileSystem directly

* Remove FileSystemWrapper

* Remove inner filesystem from MediaFileSystem

* Add MediaFileManager and bare minimum to make it testable

* Remove MediaFileSystem

* Fix unit tests using MediaFileManager

* Remove IFileSystem and rely only on FileSystem

* Hide dangerous methods in FileSystems and do some cleaning

* Apply stylecop warnings to MediaFileManager

* Add FilesystemsCreator to Tests.Common

This allows you to create an instance if FileSystems with your own specified IFileSystem for testing purposes outside our own test suite.

* Allow the stylesheet filesystem to be replaced.

* Fix tests

* Don't save stylesheetWrapper in a temporary var

* refactor(FileSystems): change how stylesheet filesystem is registered

* fix(FileSystems): unable to overwrite media filesystem

SetMediaFileSystem added the MediaManager as a Singleton instead of
replacing the existing instance.

* fix(FileSystems): calling AddFileSystems replaces MediaManager

When calling AddFileSystems after SetMediaFileSystem the MediaManager
gets replaced by the default PhysicalFileSystem, so instead of calling
SetMediaFileSystem in AddFileSystems we now call TrySetMediaFileSystem
instead. This method will not replace any existing instance of the
MediaManager if there's already a MediaManager registered.

* Use SetMediaFileSystem instead of TrySet, and rename AddFilesystems to ConfigureFileSystems

Also don't call AddFileSystems again in ConfigureFilesystems

* Don't wrap CSS filesystem twice

* Add CreateShadowWrapperInternal to avoid casting

* Throw UnauthorizedAccessException isntead of InvalidOperationException

* Remove ResetShadowId

Co-authored-by: Rasmus John Pedersen <mail@rjp.dk>
2021-04-27 09:52:17 +02:00
Mole
bf41c2eeaa Netcore: Align namespaces (#9801)
* Rename Umbraco.Core namespace to Umbraco.Cms.Core

* Move extension methods in core project to Umbraco.Extensions

* Move extension methods in core project to Umbraco.Extensions

* Rename Umbraco.Examine namespace to Umbraco.Cms.Examine

* Move examine extensions to Umbraco.Extensions namespace

* Reflect changed namespaces in Builder and fix unit tests

* Adjust namespace in Umbraco.ModelsBuilder.Embedded

* Adjust namespace in Umbraco.Persistence.SqlCe

* Adjust namespace in Umbraco.PublishedCache.NuCache

* Align namespaces in Umbraco.Web.BackOffice

* Align namespaces in Umbraco.Web.Common

* Ensure that SqlCeSupport is still enabled after changing the namespace

* Align namespaces in Umbraco.Web.Website

* Align namespaces in Umbraco.Web.UI.NetCore

* Align namespaces in Umbraco.Tests.Common

* Align namespaces in Umbraco.Tests.UnitTests

* Align namespaces in Umbraco.Tests.Integration

* Fix errors caused by changed namespaces

* Fix integration tests

* Undo the Umbraco.Examine.Lucene namespace change

This breaks integration tests on linux, since the namespace wont exists there because it's only used on windows.

* Fix merge

* Fix Merge
2021-02-18 11:06:02 +01:00
Andy Butland
87a4128705 https://github.com/umbraco/Umbraco-CMS/pull/8948 - Renamed extension from IsImageFile to IsSupportedImageFormat, to align more with what is actually tested
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-22 21:12:04 +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
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
fc054e6546 Merge remote-tracking branch 'origin/netcore/dev' into netcore/netcore
# Conflicts:
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Tests.AcceptanceTest/cypress/integration/Tour/backofficeTour.ts
#	src/Umbraco.Tests.AcceptanceTest/package.json
#	src/Umbraco.Tests/TestHelpers/TestObjects.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ImageUrlGeneratorController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ImagesController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/RelationTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs
#	src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js
#	src/Umbraco.Web.UI.Client/src/installer/steps/database.html
#	src/Umbraco.Web.UI.Client/src/less/components/tree/umb-tree.less
#	src/Umbraco.Web.UI.Client/src/less/components/umb-property-actions.less
#	src/Umbraco.Web.UI.Client/src/less/forms.less
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.html
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html
#	src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publish.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
#	src/Umbraco.Web.UI.Client/src/views/dictionary/edit.html
#	src/Umbraco.Web.UI.Client/src/views/dictionary/list.html
#	src/Umbraco.Web.UI.Client/src/views/logViewer/search.html
#	src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/mediaTypes/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/memberTypes/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/layoutconfig.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/rowconfig.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts.prevalues.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/userpicker/userpicker.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/config/lang/cs.xml
#	src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml
#	src/Umbraco.Web.UI/config/umbracoSettings.config
#	src/Umbraco.Web/Editors/BackOfficeServerVariables.cs
#	src/Umbraco.Web/Editors/DictionaryController.cs
#	src/Umbraco.Web/Editors/LogController.cs
#	src/Umbraco.Web/Editors/MediaTypeController.cs
#	src/Umbraco.Web/Editors/MemberGroupController.cs
2020-09-09 19:13:37 +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
Bjarke Berg
3d55dcd3c4 Merge remote-tracking branch 'netcore/dev' into netcore/netcore 2020-08-26 08:05:15 +02:00
Andy Butland
2cd91a5a54 Converted to IOptions over IOptionsSnapshot due to the latter only working in scoped services.
Further amends to return to booting application.
2020-08-23 23:36:48 +02:00
Andy Butland
e3a44c6717 Moved configuration setting POCOs into Umbraco.Core and adjusted references.
Amended injection of some settings to use IOptionsSnapshot.
2020-08-20 22:18:50 +01:00
Shannon
9b991f3882 Fixes back office check, adds more tests, changes area to be a constant 2020-06-09 13:01:05 +10:00
Bjarke Berg
b2b0291386 Netcore: Migration of more controllers (#8220)
* https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6587 - Migrated DictionaryController, TinyMceController and UpdateCheckController

* Removing connection string and changing to use the right variable

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2020-06-03 17:17:30 +02:00
Bjarke Berg
28c4f87236 https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6586 - Migrated ImageUrlGeneratorController + Made usage some strings into the enums in the ImageUrlGenerationOptions 2020-05-20 17:39:07 +02:00
Bjarke Berg
0d65fccd52 https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6586 - Migrated ImagesController 2020-05-20 13:51:21 +02:00