ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
35 stars 3 forks source link

Unable to load Favicon in some environments #2497

Open MattHarrisUltima opened 1 year ago

MattHarrisUltima commented 1 year ago

Version

4.0.2

Severity

Visual

Steps to Reproduce

I have tested this in 2 environments on versions 4.0.1 and 4.0.2.

Environment 1: Docker Desktop deployment on Windows 11 using images 4.0.1-ubuntu-20.04 and 4.0.2-ubuntu-20.04 . Environment 2: Azure Container Instance using images 4.0.1-ubuntu-20.04 and 4.0.2-ubuntu-20.04

On environment 1 I have placed my favicon at /root/favicon.ico and this loads. When I go to perform the same action in the same location on environment 2 the favicon fails to load. I have attempted changing the location with no success. The default favicon still loads.

Logging does not show any errors however, I can not seam to find the drop down box for debug logging in PSU 4.

I have attached screenshots of the problem

expected actual

Expected behavior

Favicon to load

Actual behavior

The default favicon loads

Additional Environment data

No response

Visuals

No response

MattHarrisUltima commented 1 year ago

Thanks @adamdriscoll,

Please feel free to reach out if you need any more info

adamdriscoll commented 1 year ago

@MattHarrisUltima - If you open the Azure Log Stream for your web app, it should have more info and a possible error message. I misconfigured this the first time I tried to reproduce, and it had a pretty clear error message. It looks like it's attempting to load the file from the repository path.

                var favIconPath = Path.GetFullPath(Path.Combine(repository, dashboard.FavIcon));
                var physicalPathResult = new PhysicalFileResult(favIconPath, "image/x-icon");

Maybe that is helpful info. I'm also going to add support for loading URLs and not just local file paths so that might be helpful as you could also use a published folder to host the icon.

MattHarrisUltima commented 1 year ago

Hi @adamdriscoll,

We are using Azure Container Instances, therefore we do not have this option. I am happy to set something up to capture the errors if you can take us through how you wish the WebApp to be setup in order to capture these errors.

Everything we do is via dev-ops ARM templates, so this would need configuring from scratch. Once we have an Environment in your desired state, I can copy over our dev dashboard and replicate the error.

adamdriscoll commented 1 year ago

@adamdriscoll - Logs are output via STDOUT and to the SystemLogPath ("SystemLogPath": "%HOME%/PowerShellUniversal/systemLog.txt").

We just rolled out 4.0.3 and this includes the change to support published folders as well. You could give that a shot by creating a published folder for the folder containing the favicon and then configure the favicon on the dashboard to use the request path of the published folder + favicon.

MattHarrisUltima commented 1 year ago

Thanks @adamdriscoll

I will update PSU later this week and update you.

MattHarrisUltima commented 1 year ago

Regarding this problem..

I have noticed this in the browser logs:

2023-07-28 10_32_01-Developer Tools — PowerShell Universal — https___deviacloud ia-cloud io_iacloud_

I suspect there may be an Azure AD related problem there.

MattHarrisUltima commented 1 year ago

While working on another problem I found this which may point to the error: 2023-08-08 16_16_18-IA-Cloud ps1 - Autonomous Cloud - Partner Version (Workspace) - Visual Studio Co