erikjanwestendorp / Our.Umbraco.Domains

Umbraco package which gives a simple overview of used domains.
5 stars 1 forks source link

Package installation resulting is a missing 404 error #4

Closed DanielOor365 closed 3 years ago

DanielOor365 commented 4 years ago

Hi, I installed the package using NuGet. I get the Domains Icon in the Settings tab. Once I click it, I get the following error: image Any clue what happend? Thanks, Daniel

erikjanwestendorp commented 4 years ago

Hi @DanielOor365 thanks for reporting this. Could you check if Our.Umbraco.Domains.Core.dll is in the bin folder?

DanielOor365 commented 4 years ago

Yes, it is in the bin folder.

erikjanwestendorp commented 4 years ago

@DanielOor365 I cannot reproduce the problem yet. Could you provide some more information? Which version of Umbraco are you using? Have you installed any other packages? Is there anything special in the log files after installation?

DanielOor365 commented 4 years ago

Thanks Erik-Jan for the reply. I'm using Umbraco version 8.6.1 Other packages are Bootstrap, RobotsTxtEditor, Slimsy, RecaptchaNet, and uSync I am using modelsbuilder LiveAppData models. Apart from a Warning: Checks for '{HealthCheckName}' completed with errors. nothing on or above warning level

ronaldbarendse commented 4 years ago

This is probably because the API URL is hard-coded into the AngularJS resource: https://github.com/erikjanwestendorp/Our.Umbraco.Domains/blob/e69815aff8c5216647ff04d1c8e871de31818142/Our.Umbraco.Domains/App_Plugins/domains/resources/domain.resource.js#L13

It's better to register the URL using ServerVariablesParser, like ModelsBuilder does here:

https://github.com/umbraco/Umbraco-CMS/blob/2bfef741914297c802bc6c77cc48780d7534f920/src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs#L83

And then use umbRequestHelper.getApiUrl to get the right URL: https://github.com/umbraco/Umbraco-CMS/blob/7ee510ed386495120666a78c61497f58ff05de8f/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js#L70-L95

erikjanwestendorp commented 4 years ago

@DanielOor365 Sorry for the delay on this! I will work on it ASAP. @ronaldbarendse Thanks for your suggestion as well, that really helps!

I've marked this issue as Help Wanted, if you wanted to work on it that would be great!

DanielOor365 commented 4 years ago

I never worked with the APIs... so not sure what exactly to change... But indeed there might be an error in the URL, as I am not using my.website/umbraco for the backoffice, but a separate directory ( like my.website/myumbraco ) for security reasons.

ronaldbarendse commented 4 years ago

a separate directory (like my.website/myumbraco) for security reasons

And that confirms my previous suspicion, changing the Umbraco.Core.Path setting causes all API routes to change as well and as these are currently hard-coded in the AngularJS domain.resource.js. The above changes are required to make this package work correctly in that situation.

Just know that changing the Umbraco back-office URL doesn't really give a real security benefit (it's basically security through obscurity) and will definitely give you more troubles like this!

erikjanwestendorp commented 3 years ago

@DanielOor365 Issue should be solved by #8 . See new version on NuGet and Our:

https://our.umbraco.com/packages/backoffice-extensions/ourumbracodomains-domains-overview/ Install-Package Our.Umbraco.Domains -Version 1.0.2

@ronaldbarendse Many thanks for your suggestion!