Skip to content

Conversation

@pujitm
Copy link
Member

@pujitm pujitm commented Aug 25, 2025

Stop appending wanport to LAN FQDN when remote access is enabled.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected port selection for FQDN-based server URLs: now uses the LAN HTTPS port for local interfaces and the configured WAN port for external access, with sensible fallback to HTTPS when needed.
    • Improves accuracy of generated links and connectivity across network interfaces.
    • Other URL resolution paths remain unchanged.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adjusts FQDN URL construction in url-resolver.service.ts: for FQDN entries, selects port based on interface type (LAN uses nginx.httpsPort; non-LAN uses wanport if present, else nginx.httpsPort) and passes that value to getUrlForField. Other resolution paths remain unchanged. No exported/public signatures altered.

Changes

Cohort / File(s) Summary of Changes
URL resolver FQDN port selection
packages/unraid-api-plugin-connect/src/network/url-resolver.service.ts
Modified getServerIps to compute port per interface for FQDN entries (LAN → nginx.httpsPort; non-LAN → wanport fallback to nginx.httpsPort) and pass Number(portToUse) to getUrlForField. Other URL resolution paths (default, LAN, MDNS) unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Caller
  participant R as UrlResolver
  participant N as getServerIps
  participant U as getUrlForField

  C->>R: resolve URLs
  R->>N: getServerIps()
  N->>N: For each entry
  alt entry is FQDN
    alt Interface = LAN
      Note over N: portToUse = nginx.httpsPort
    else Interface ≠ LAN
      Note over N: portToUse = wanport || nginx.httpsPort
    end
    N->>U: getUrlForField(..., portSsl=Number(portToUse))
    U-->>N: URL
  else Other entry types
    N->>U: getUrlForField(..., existing logic)
    U-->>N: URL
  end
  N-->>R: URLs
  R-->>C: Result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge the ports with whiskered care,
LAN gets its cozy HTTPS lair;
WAN might boast, or borrow a spare,
FQDNs now match the paths they wear.
Thump-thump! says the rabbit—tidy and fair,
URLs hop true through the network air. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b2e7801 and 5ea4057.

📒 Files selected for processing (1)
  • packages/unraid-api-plugin-connect/src/network/url-resolver.service.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/lan-fqdn-connect

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pujitm pujitm merged commit aa58888 into main Aug 25, 2025
9 of 10 checks passed
@pujitm pujitm deleted the fix/lan-fqdn-connect branch August 25, 2025 17:15
@github-actions
Copy link
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR1625/dynamix.unraid.net.plg

elibosley pushed a commit that referenced this pull request Aug 27, 2025
🤖 I have created a release *beep* *boop*
---


## [4.16.0](v4.15.1...v4.16.0)
(2025-08-27)


### Features

* add `parityCheckStatus` field to `array` query
([#1611](#1611))
([c508366](c508366))
* generated UI API key management + OAuth-like API Key Flows
([#1609](#1609))
([674323f](674323f))


### Bug Fixes

* **connect:** clear `wanport` upon disabling remote access
([#1624](#1624))
([9df6a3f](9df6a3f))
* **connect:** valid LAN FQDN while remote access is enabled
([#1625](#1625))
([aa58888](aa58888))
* correctly parse periods in share names from ini file
([#1629](#1629))
([7d67a40](7d67a40))
* **rc.unraid-api:** remove profile sourcing
([#1622](#1622))
([6947b5d](6947b5d))
* remove unused api key calls
([#1628](#1628))
([9cd0d6a](9cd0d6a))
* retry VMs init for up to 2 min
([#1612](#1612))
([b2e7801](b2e7801))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants