fix: report the real reason a batch install or uninstall is denied - #3136
Open
Dhevenddra wants to merge 1 commit into
Open
fix: report the real reason a batch install or uninstall is denied#3136Dhevenddra wants to merge 1 commit into
Dhevenddra wants to merge 1 commit into
Conversation
Fixes Comfy-Org#3128. The batch install path replaced every 404 body with a message about the "default channel" and the security level. Neither can resolve the denial it fires on most often: the risky_level == 'high' arm routes through is_dedicated_install_allowed(), which reads the allow_git_url_install flag and the listen address and never consults security_level at all. It also swallowed the informative 404s on the same route, such as "Following node pack doesn't provide `nightly` version". Dropping the branch lets the existing else arm surface the server's own body, which is what the 403 path already does. The uninstall path carried the same substitution, but that route returns 403 and 200 only, so the message could only ever appear when the endpoint itself was missing, where a note about channels is actively misleading. SECURITY_MESSAGE_FLAG_GIT_URL and SECURITY_MESSAGE_FLAG_PIP told users to set a flag without mentioning that is_dedicated_install_allowed() also requires a loopback listen address, so anyone running --listen 0.0.0.0 was sent to re-check a setting they had already enabled. Both messages now name the loopback requirement, and the existing denial-copy guard asserts it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughChangesInstallation denial diagnostics
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3128.
Problem
1. The batch install path throws away the server's 404 body.
js/custom-nodes-manager.jsreplaced every 404 with a message about the"default channel"and the security level. The denial it fires on most often cannot be resolved by either. Ininstall_custom_node, therisky_level == 'high'arm goes throughis_dedicated_install_allowed(core.get_config()['allow_git_url_install'], args.listen), which isflag AND loopbackand never readssecurity_level. Settingsecurity_level = weakchanges nothing, so the message is a false lead that users do follow.The same branch also swallowed the informative 404s on that route, for example
Following node pack doesn't provide `nightly` version, which the user never got to see.2. The uninstall path carried the same substitution for a status it never returns.
uninstall_custom_nodereturns 403 or 200 only. The 404 arm injs/common.jscould therefore only be reached when the endpoint itself was missing (an outdated or partly-installed Manager), where a note about channel configuration points in exactly the wrong direction.3.
SECURITY_MESSAGE_FLAG_GIT_URLomits half the gate.The message asks for
allow_git_url_install = trueand adds that the setting is independent ofsecurity_level, butis_dedicated_install_allowedalso requires a loopback listen address. Anyone on--listen 0.0.0.0is told to enable a flag they already enabled, with no hint about the real bound.SECURITY_MESSAGE_FLAG_PIPhas the identical gap.Fix
elsearm surfaces the server's own body. This is what the 403 path already does, and the dedicated/customnode/install/git_urlsurface already names the responsible flag throughjs/common.js.The loopback bound itself is deliberate per #2991 and is unchanged here. This is diagnostics only: no gate, status code, or policy moves.
Evidence
python -m pytest tests -qon a clean 3.12 venv:ruff check .(the CI gate) passes.The denial-copy guard in
tests/test_install_flags_gates.pynow asserts the loopback requirement. Reverting onlyglob/manager_server.pyand re-running it fails as expected:The JS side has no test harness in this repo, so those two changes are deletions that fall through to the existing
elsebranch rather than new logic.