Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass location.hostname as host_ip to app.query #11356

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

mortie
Copy link
Contributor

@mortie mortie commented Jan 19, 2025

Changes:

Pass location.hostname to the host_ip argument to app.query API calls. This makes it so that portals use a URL based on the hostname used to access the TrueNAS web UI, rather than a URL based on the IP address which is the default when not passing a host_ip.

I believe that this was the intention of the existing code, since https://github.com/truenas/webui/blob/master/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.ts#L116-L126 already replaces 0.0.0.0 with window.location.hostname. However, after truenas/middleware#14057, the portal URI which we get from the back-end is already transformed to replace 0.0.0.0 with the value passed from host_ip, so that code doesn't have an effect anymore.

Testing:

Click a portal (e.g "Web UI") for an installed app using a domain name (typically, <truenas hostname>.local will work thanks to mDNS). Before this PR, it will take you to a URL containing the IPv4 address of the TrueNAS host (or do nothing if the websocket uses IPv6; see https://ixsystems.atlassian.net/browse/NAS-133655). After this PR, it should take you to a URL containing the domain you used to access the TrueNAS web UI.

@mortie mortie requested a review from a team as a code owner January 19, 2025 09:25
@mortie mortie requested review from bvasilenko and removed request for a team January 19, 2025 09:25
Copy link
Contributor

@bvasilenko bvasilenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mortie , I've tested it and found no regressions

@undsoft undsoft added the backport-25.04-RC.1 Fangtooth RC1 label Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.29%. Comparing base (a9a859f) to head (bab67cf).
Report is 63 commits behind head on master.

Files with missing lines Patch % Lines
...rc/app/pages/apps/services/applications.service.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11356      +/-   ##
==========================================
+ Coverage   82.83%   83.29%   +0.45%     
==========================================
  Files        1659     1677      +18     
  Lines       59376    60238     +862     
  Branches     6241     6390     +149     
==========================================
+ Hits        49184    50173     +989     
+ Misses      10192    10065     -127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@undsoft undsoft merged commit 86f1468 into truenas:master Feb 1, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-25.04-RC.1 Fangtooth RC1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants