Skip to content

fix: behind_proxy setting ignored across ~30 files, not just WingsAdminController#188

Open
MyMonsterVR wants to merge 3 commits into
MythicalLTD:mainfrom
MyMonsterVR:fix/wings-admin-controller-behind-proxy
Open

fix: behind_proxy setting ignored across ~30 files, not just WingsAdminController#188
MyMonsterVR wants to merge 3 commits into
MythicalLTD:mainfrom
MyMonsterVR:fix/wings-admin-controller-behind-proxy

Conversation

@MyMonsterVR

@MyMonsterVR MyMonsterVR commented Jul 17, 2026

Copy link
Copy Markdown

Turns out this bug is way bigger than I first thought. Opened this originally just for WingsAdminController, but it's actually every single new Wings(...) call in the codebase except Wings::fromNode() - 62 call sites across 30 files (server controllers, backup/power/logs controllers, node controllers, every chatbot tool, transfer status, etc).

All of them skip the 6th constructor arg and default behindProxy to false, so anything that talks to a proxied node hits the raw daemon port instead of going through the proxy. Was breaking server creation, backups, power actions, chatbot tools, basically everything node-related once behind_proxy is actually set to true.

Fixed the same way everywhere - added WingsUrlHelper::isBehindProxy($node) as the 6th arg, matching whatever the node variable is called in that spot ($node, $nodeInfo, $sourceNode, $destinationNode).

Tested on my own instance behind Caddy, server creation/backups/power actions all work now.

Summary by CodeRabbit

  • Bug Fixes
    • Improved node operations for nodes configured behind proxies, so administrator workflows (system utilization, Docker management, module enable/disable, and configuration updates) connect with the correct proxy-aware settings.
    • Updated user-facing actions and automation (status checks, logs, power actions, backups/restore, file operations, and container commands) to use the appropriate proxy-aware connection handling for each target node.

Every new Wings(...) call in this controller omits the 6th
$behindProxy constructor argument, so it always defaults to false
regardless of the node's actual behind_proxy DB value. This makes
Wings API calls always append the raw daemon port to the URL instead
of respecting "Behind Proxy", causing connection failures
(cURL error 7: Failed to connect ... port <daemonListen>) for any
node running behind a reverse proxy — even when correctly configured.

Pass WingsUrlHelper::isBehindProxy($node) through on all 10 call
sites, matching what Wings::fromNode() already does correctly.
@MyMonsterVR
MyMonsterVR requested a review from NaysKutzu as a code owner July 17, 2026 23:05
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@MyMonsterVR, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b712bad5-aa2e-4dda-8f12-142863dc8288

📥 Commits

Reviewing files that changed from the base of the PR and between ef26548 and cc98076.

📒 Files selected for processing (6)
  • backend/app/Controllers/Admin/NodeStatusController.php
  • backend/app/Controllers/Admin/NodesController.php
  • backend/app/Controllers/User/NodeStatusController.php
  • backend/app/Services/Chatbot/Tools/CompressFilesTool.php
  • backend/app/Services/Chatbot/Tools/DecompressArchiveTool.php
  • backend/app/Services/Chatbot/Tools/GetServerStatusTool.php

Walkthrough

WingsUrlHelper::isBehindProxy($node) is now passed into Wings client construction across administrative controllers, user server operations, chatbot tools, and supporting services.

Changes

Wings proxy support

Layer / File(s) Summary
Administrative Wings operations
backend/app/Controllers/Wings/WingsAdminController.php, backend/app/Controllers/Admin/*, backend/app/Controllers/Wings/Transfer/*
Administrative node, scan, status, server lifecycle, and transfer operations now initialize Wings with node proxy status.
User server Wings operations
backend/app/Controllers/User/NodeStatusController.php, backend/app/Controllers/User/Server/*
Status, logs, power, and backup flows now pass proxy status when constructing Wings clients.
Chatbot Wings tool integration
backend/app/Services/Chatbot/Tools/*
Chatbot file, backup, allocation, status, firewall, and power tools now use proxy-aware Wings initialization.
Service Wings operations
backend/app/Services/FeatherZeroTrust/SuspensionService.php, backend/app/Services/Server/LifecycleHookExecutorService.php, backend/app/Services/UserDataExport/UserDataExportService.php
Suspension, lifecycle command, and server backup export services now derive proxy status from the target node during Wings construction.

Suggested reviewers: nayskutzu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main fix: proxy-aware Wings construction updated across many files, not just WingsAdminController.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Same issue as WingsAdminController - turns out it's not just that one
file, every new Wings(...) call across the codebase (chatbot tools,
server controllers, backup/power/logs controllers, node controllers,
etc) has the same missing 6th argument and defaults behindProxy to
false. Fixed all of them the same way, using WingsUrlHelper::isBehindProxy()
with whatever the node variable is called in each spot ($node,
$nodeInfo, $sourceNode, $destinationNode).

This was blocking basically anything that talks to a proxied node -
creating a server, backups, power actions, chatbot tools, etc all hit
the same wrong port.
@MyMonsterVR MyMonsterVR changed the title fix: WingsAdminController ignores node's behind_proxy setting fix: behind_proxy setting ignored across ~30 files, not just WingsAdminController Jul 17, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
backend/app/Controllers/User/Server/ServerBackupController.php (1)

348-349: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Replace the magic number with a constant or explicit variable.

Ah, 30. The universal magical incantation for "I hope the network doesn't drop before this finishes." Hardcoding timeouts directly into positional argument soup across half the codebase? Truly a bold strategy for when things inevitably hang on a Friday night. Extract this to a $timeout variable (like you did in ServerLogsController) or a class constant before the network gods punish your hubris.

  • backend/app/Controllers/User/Server/ServerBackupController.php#L348-L349: extract 30 to a named variable or constant.
  • backend/app/Services/Chatbot/Tools/CopyFilesTool.php#L140-L141: extract 30 to a named variable or constant.
  • backend/app/Services/Chatbot/Tools/WriteFileTool.php#L132-L133: extract 30 to a named variable or constant.
  • backend/app/Services/FeatherZeroTrust/SuspensionService.php#L99-L100: extract 30 to a named variable or constant.
  • backend/app/Services/Server/LifecycleHookExecutorService.php#L260-L261: extract 30 to a named variable or constant.
  • backend/app/Services/UserDataExport/UserDataExportService.php#L782-L783: extract 30 to a named variable or constant.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/app/Controllers/User/Server/ServerBackupController.php` around lines
348 - 349, Replace each hardcoded 30-second timeout with a named local variable
or class constant in ServerBackupController, CopyFilesTool, WriteFileTool,
SuspensionService, LifecycleHookExecutorService, and UserDataExportService at
the listed sites. Reuse the named timeout in the corresponding network or
operation call while preserving the existing 30-second behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/app/Controllers/Admin/NodeStatusController.php`:
- Around line 104-105: Fix the malformed argument lists by moving each separator
comma before its inline comment: update
backend/app/Controllers/Admin/NodeStatusController.php lines 104-105 to use 10,
before the comment; update backend/app/Controllers/Admin/NodesController.php
lines 1146-1147 to place the comma after ($timeoutSeconds ?? 60) + 10; and
update lines 1572-1573 to use 10, before the version-check comment.

In `@backend/app/Controllers/User/NodeStatusController.php`:
- Around line 153-154: Move the parameter-separating comma out of the inline
comment in NodeStatusController’s status-check call at
backend/app/Controllers/User/NodeStatusController.php:153-154, placing it after
the timeout argument. Apply the same correction to the status call at
backend/app/Services/Chatbot/Tools/GetServerStatusTool.php:109-110, removing the
comma from the “10 second timeout” comment and restoring valid PHP syntax.

In `@backend/app/Services/Chatbot/Tools/CompressFilesTool.php`:
- Around line 145-147: The timeout argument is being replaced by a duplicate
proxy boolean in both tool calls. In
backend/app/Services/Chatbot/Tools/CompressFilesTool.php lines 145-147 and
backend/app/Services/Chatbot/Tools/DecompressArchiveTool.php lines 125-127,
update the first duplicated proxy argument to the integer 30, while preserving
the subsequent WingsUrlHelper::isBehindProxy($node) argument.

---

Nitpick comments:
In `@backend/app/Controllers/User/Server/ServerBackupController.php`:
- Around line 348-349: Replace each hardcoded 30-second timeout with a named
local variable or class constant in ServerBackupController, CopyFilesTool,
WriteFileTool, SuspensionService, LifecycleHookExecutorService, and
UserDataExportService at the listed sites. Reuse the named timeout in the
corresponding network or operation call while preserving the existing 30-second
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d4c56969-66d1-43b2-9d62-ab82d41a918e

📥 Commits

Reviewing files that changed from the base of the PR and between f153320 and ef26548.

📒 Files selected for processing (30)
  • backend/app/Controllers/Admin/FeatherZeroTrustController.php
  • backend/app/Controllers/Admin/NodeStatusController.php
  • backend/app/Controllers/Admin/NodesController.php
  • backend/app/Controllers/Admin/ServersController.php
  • backend/app/Controllers/User/NodeStatusController.php
  • backend/app/Controllers/User/Server/Logs/ServerLogsController.php
  • backend/app/Controllers/User/Server/Power/ServerPowerController.php
  • backend/app/Controllers/User/Server/ServerBackupController.php
  • backend/app/Controllers/Wings/Transfer/WingsTransferStatusController.php
  • backend/app/Services/Chatbot/Tools/AutoAllocateTool.php
  • backend/app/Services/Chatbot/Tools/CompressFilesTool.php
  • backend/app/Services/Chatbot/Tools/CopyFilesTool.php
  • backend/app/Services/Chatbot/Tools/CreateBackupTool.php
  • backend/app/Services/Chatbot/Tools/CreateDirectoryTool.php
  • backend/app/Services/Chatbot/Tools/DecompressArchiveTool.php
  • backend/app/Services/Chatbot/Tools/DeleteAllocationTool.php
  • backend/app/Services/Chatbot/Tools/DeleteBackupTool.php
  • backend/app/Services/Chatbot/Tools/DeleteFilesTool.php
  • backend/app/Services/Chatbot/Tools/GetFileContentTool.php
  • backend/app/Services/Chatbot/Tools/GetFilesTool.php
  • backend/app/Services/Chatbot/Tools/GetServerFirewallRulesTool.php
  • backend/app/Services/Chatbot/Tools/GetServerStatusTool.php
  • backend/app/Services/Chatbot/Tools/PullFileTool.php
  • backend/app/Services/Chatbot/Tools/RenameFileTool.php
  • backend/app/Services/Chatbot/Tools/ServerPowerActionTool.php
  • backend/app/Services/Chatbot/Tools/SetPrimaryAllocationTool.php
  • backend/app/Services/Chatbot/Tools/WriteFileTool.php
  • backend/app/Services/FeatherZeroTrust/SuspensionService.php
  • backend/app/Services/Server/LifecycleHookExecutorService.php
  • backend/app/Services/UserDataExport/UserDataExportService.php

Comment thread backend/app/Controllers/Admin/NodeStatusController.php Outdated
Comment thread backend/app/Controllers/User/NodeStatusController.php Outdated
Comment thread backend/app/Services/Chatbot/Tools/CompressFilesTool.php
A few of the call sites had a trailing inline comment on the timeout
line (e.g. "10 // Short timeout for status checks"), and my earlier
fix appended the comma after the comment instead of before it - so
the comment swallowed the comma and PHP saw two args with nothing
separating them. Fixed by moving the comma before the comment on
those 4 lines.

CompressFilesTool and DecompressArchiveTool had a different issue:
their original calls only had 4 args (no timeout, no behindProxy), so
the patch landed the new arg in the timeout slot instead of adding a
6th one, and somehow ended up duplicated on top of that. Fixed by
putting an explicit 30 back in the timeout slot and keeping just one
WingsUrlHelper::isBehindProxy($node) after it.

Ran php -l on all 31 changed files, all clean now.
@NaysKutzu

Copy link
Copy Markdown
Member

Thank you for your contribution <3

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