Skip to content

Forward the client IP to the API in WebGUI 7.4 - #2848

Merged
tom mortensen (limetech) merged 1 commit into
masterfrom
fix/webgui-oidc-client-ip-74
Dec 5, 2026
Merged

tom mortensen (limetech) merged 1 commit into
masterfrom
fix/webgui-oidc-client-ip-74

Conversation

@SimonFair

@SimonFair SimonFair commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The WebGUI's nginx configuration proxies API requests over a Unix socket, so the API cannot get the client IP from the socket. Set X-Forwarded-For from nginx's client address in the generated /graphql location. The rule takes effect through WebGUI's normal nginx configuration lifecycle.

Shell syntax and generated location checks passed. Paired QAVM validation with API #2128 remains open.

Work Intent: OS-1092
API counterpart: unraid/api#2128

Summary by CodeRabbit

  • Bug Fixes
    • Requests routed through the GraphQL proxy now include the client’s connecting IP address in the X-Forwarded-For header. This allows the receiving service to see the source address associated with the incoming connection, rather than relying on a missing or inaccurate forwarded address.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The GraphQL proxy location now sets the X-Forwarded-For header to $remote_addr.

Changes

GraphQL Proxy Header

Layer / File(s) Summary
Forward client address
etc/rc.d/rc.nginx
The GraphQL proxy location sets X-Forwarded-For to $remote_addr.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Feature

Merge Risk: Minimal · up to d6e38

The GraphQL proxy now passes the client address to the API so per-client handling can work over the Unix socket. No concrete merge-blocking risk was found. Paired validation with the API change is still worth completing.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Forward the client IP to the API in WebGUI 7.4" matches the main change. The raw summary shows the GraphQL proxy location in etc/rc.d/rc.nginx now sets X-Forwarded-For to $remote_addr, whic…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Forward the client IP to the API in WebGUI 7.4" matches the main change. The raw summary shows the GraphQL proxy location in etc/rc.d/rc.nginx now sets X-Forwarded-For to $remote_addr, which forwards the client IP to the API. The objectives confirm the purpose: API requests proxy over a Unix socket, which does not carry the client IP. The title is short, specific, and names the target release. The changeset is one line in one file, so the title describes it accurately.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit hops beside the proxy line
“The client’s address now travels fine!”
One header joins the forwarding stream
Through nginx, neat and clear as a dream
I twitch my nose and celebrate the change!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21dc40c2-902d-49a6-9ff0-289ea778065a
Commits

Reviewing files that changed from the base of the PR and between d513b6d and d6e38ee.

Files selected for processing: 1

  • etc/rc.d/rc.nginx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.11.17.1452
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2848/webgui-pr-2848.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
etc/rc.d/rc.nginx

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2848, or run:

plugin remove webgui-pr-2848

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@SimonFair
SimonFair marked this pull request as ready for review December 4, 2026 08:09
@unraid-bot Unraid Bot (unraid-bot) added QA Ready Ready for QA (auto-managed by notification-worker) QA Passed QA passed (auto-managed by notification-worker) and removed QA Ready Ready for QA (auto-managed by notification-worker) labels Dec 4, 2026
@limetech
tom mortensen (limetech) merged commit 949b722 into master Dec 5, 2026
1 check passed
@limetech
tom mortensen (limetech) deleted the fix/webgui-oidc-client-ip-74 branch December 5, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Passed QA passed (auto-managed by notification-worker)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants