Commit Graph
158 Commits
Author SHA1 Message Date
Dr.Lt.Data 9117bce3e1 Fix git_exe, the commit and submodules of a node pack and the git steps of install and update
Three fixes. The CHANGELOG has an entry for each.

- Use the git executable set as git_exe
- Read the commit of a node pack whose refs are packed, and bring its
  submodules to the commit that is checked out
- Fail an update whose pull or submodule update failed, leave the node pack
  at its commit, remove what a clone that failed left, and refuse an install
  of a node pack that another install is working on
2026-11-18 00:10:04 +09:00
Dr.Lt.Data 3a2177fb24 Fix failure answers, console messages and settings (#3543)
Five fixes. The CHANGELOG has an entry for each.

- Log a failed read of the ComfyUI versions instead of raising
- Print the messages of manager_core as they are
- Answer 400 to an install request whose body is not usable
- Refuse a db_mode, update_policy or component_policy request the server cannot use
- Keep a setting chosen while the Manager menu is loading it
2026-11-17 12:39:56 +09:00
Perfect Johny bfd65e7173 Write cache files whole and age them by their last write (#3432)
The cache files of the channel lists and of the registry's node list
were written in place. A write that stopped part-way left a truncated
file, which get_data reads as an empty list.

is_file_created_within_one_day read os.path.getctime. On Windows that
is the creation time, which stays the same when the file is rewritten,
so a cache first created more than a day ago counted as expired however
recently it was written.

- Add write_cache_file, which writes a temporary file beside the cache
  and replaces the cache with it, keeping the mode of the existing
  file. Where the written file cannot be put in place, as on Windows
  while another reader has the cache open, the replace is tried three
  times, 0.1 s apart. A cache that stays open is left as it is, with a
  warning; the caller gets no error and goes on with its data. A
  failure while writing the temporary file leaves the cache as it is
  as well. Where the mode cannot be set, the cache is replaced all the
  same. A temporary file that cannot be removed, because a scanner
  holds it open, is left behind and does not fail the write
- Use it for the four writes of a cache file: two in manager_util, one
  in get_data_by_mode and one in default_cache_update
- Read the modification time for the age
- Add tests for a write that fails and one that runs out of space, the
  mode, a mode that cannot be set, a replace that is refused for a
  moment and one that stays refused, a temporary file that is held
  open, and the age
- Add a CHANGELOG entry

The same change for manager-v4 is #3532.
2026-11-15 14:30:12 +09:00
Perfect Johny 54e4ee5977 Read workflow files as UTF-8 when collecting node types (#3510)
get_node_types_in_workflows opened workflow files with the locale
encoding. On a non-UTF-8 locale, such as a Windows ANSI code page, a
UTF-8 workflow either failed to decode and was skipped with a
warning, or was read with garbled non-ASCII node type names. Read
with utf-8-sig, which takes files with and without a BOM.

A workflow file saved in the ANSI code page is no longer read.
ComfyUI saves workflows as UTF-8.

Fixes #3441
2026-11-14 12:39:34 +09:00
Perfect Johny 94abb6175c Reject form POSTs to update_all before the autosave snapshot (#3429)
update_all wrote the autosave snapshot before it read the request
body, so a cross-origin <form method=POST>, which needs no CORS
preflight, reached the snapshot write. Reject the simple form
Content-Types first, as the handlers without a body do, and describe
the scope of the gate in the helper docstring.

A client that sends the JSON body with a form Content-Type, such as
curl -d without a Content-Type header, now gets 400.
2026-11-14 11:26:43 +09:00
Perfect Johny 3ab17e228e Match the download url in the model whitelist (#3428)
check_whitelist_for_model compared save_path, base and filename with
the model list, but not the url the file is downloaded from, so a
request with a listed name and another url was queued as given.
Compare the url too.
2026-11-13 20:27:02 +09:00
Perfect Johny e66b7b71c7 Verify the TLS certificate when fetching the notice (#3424)
The notice route fetched the News page from GitHub with
verify_ssl=False, so certificate verification was off for every user:
whoever sat on the connection could present any certificate for
github.com and choose the notice text and links. The sanitizer limits
the markup, but it cannot tell whose content it is.

- Turn verification off for the notice only when bypass_ssl is set, as
  manager_util.get_data does
- Answer a certificate or connection failure with "Unable to retrieve
  Notice" where it raised and the notice area showed the server's 500
  page
- Add tests that run get_notice against a local HTTPS server behind a
  local CONNECT proxy: an untrusted certificate and a trusted
  certificate for another host are rejected; bypass_ssl accepts the
  untrusted certificate; a CA trusted through SSL_CERT_FILE is
  accepted; a closed proxy, a proxy answering 502 and a proxy that
  never answers end in the unavailable notice, each with one warning
  naming the cause
- Add a CHANGELOG entry

Fixes #3302
2026-11-13 08:19:55 +09:00
Pablo Apiolazza ecc09f1a12 Fix restart losing quotes around arguments that contain spaces (#3488)
os.execv on Windows joins its arguments with spaces and quotes nothing, so
only the interpreter and script path (quoted by hand) survived a restart.
Any other argument with a space, e.g. --browser-profile "Profile 1", was
split in two and ComfyUI failed to start with 'unrecognized arguments'.

Build the command in one helper, manager_util.build_restart_command, used by
both the reboot endpoint and the prestartup restart. On Windows every entry
is quoted with subprocess.list2cmdline; other platforms are unchanged.

Fixes #3339
2026-11-12 18:06:37 +09:00
Dr.Lt.Data 572f363696 v3: Prevent HTML and URL injection in the Manager UI (#3296) 2026-09-19 08:22:26 +09:00
Dr.Lt.Data ea7534fae8 v3: Restrict Flagged CNR installs on non-local listeners (#3298) 2026-09-19 07:47:20 +09:00
Dr.Lt.Data ffb2f03e92 fix(security-messages): state the actual gate in install-denial messages (#3128)
The install-denial diagnostics named the wrong gate, sending users to
settings that could not resolve their denial:

- SECURITY_MESSAGE_FLAG_GIT_URL / _FLAG_PIP omitted the loopback half of
  the flag-AND-loopback predicate, telling users to enable a flag that
  was often already enabled. They now state both conditions, print the
  live --listen value at every emission site, and explain that both
  values are read once at startup (stop the server, edit, then start).
- SECURITY_MESSAGE_MIDDLE_OR_BELOW instructed setting security_level to
  'middle', a value that does not exist; it now names only real values
  (any level other than 'strong': normal, normal-, weak).
- The blocked-risk arm reused SECURITY_MESSAGE_GENERAL, blaming
  security_level although no value of it can help there; it now emits a
  dedicated SECURITY_MESSAGE_BLOCKED_RISK stating this is not a
  configuration problem.
- SECURITY_MESSAGE_NORMAL_MINUS_MODEL now names its loopback-listener
  condition and the same restart guidance.
- The js/common.js dedicated-403 messages mirror the loopback clause.
2026-08-13 12:38:11 +09:00
dehypnotic e634489a97 Update manager_server.py 2026-07-20 23:45:17 +02:00
Dr.Lt.Data 79dd5e2358 Merge pull request #2152 from jfcantu/main
New feature: Node Usage Analyzer
2026-07-20 20:13:04 +09:00
Dr.Lt.Data e4c5401dd5 feat(security): dedicated install flags decoupled from security_level (#2991)
* feat(security): add dedicated install flags decoupled from security_level

Gate 'install via git URL' and 'install via pip' with dedicated opt-in
boolean flags (allow_git_url_install / allow_pip_install) in config.ini
[default], fully replacing the security_level term on those surfaces
(REPLACE, not AND — a strict level no longer denies when the flag is on;
a weak level no longer allows when the flag is off).

- glob/manager_server.py: pure predicate is_dedicated_install_allowed
  (flag AND loopback, request-time args.listen); REPLACE gates at
  /customnode/install/git_url and /customnode/install/pip; batch
  unknown-URL arm routes through the same full predicate at the risky
  position (loopback term is load-bearing — the middle entry gate has
  no network-position term; the entry gate itself stays in force);
  unknown-pip in batch stays unconditionally blocked; new
  SECURITY_MESSAGE_FLAG_* denial constants name the responsible flag;
  security_403_response gains flag_token (comfyui_outdated keeps precedence)
- glob/manager_core.py: register both keys (read via get_bool default-false,
  write list, exception fallback); "true"-only truthy; restart-only activation
- js/common.js: 403 dialog copy names the responsible flag at the two
  install call sites
- README.md: security-policy docs for both flags (per-surface scope incl.
  the batch entry-gate qualifier, REPLACE decoupling, loopback bound,
  opt-in config snippet, default-deny + migration note); stale tier lists
  corrected against the actual gates
- CHANGELOG.md: opt-in migration note + accepted residual risk (flags
  bypass the forced-strong outdated-ComfyUI hardening on loopback,
  opt-in only), decoupling claim qualified for the batch entry gate

Tests: unit suite (predicate truth table, REPLACE litmus both directions,
AST binding-proofs against live handlers, subprocess-isolated config
contract) plus a real-server E2E suite that mounts the Manager-under-test
via git worktree (exact-SHA pin, detached) against a real ComfyUI and
exercises both flag surfaces and both arms — deny arms (403 + flag-naming
body/log + no install artifact), git-URL allow arm (real clone), pip allow
arm as a two-phase reservation oracle — with zero-residual self-clean.
Module skips without E2E_COMFYUI_ROOT; unit suite unaffected.

The manager-v4 branch ships the identical policy (shared invariants +
config contract); this tree uses the degraded predicate 'flag AND
loopback' (no personal_cloud-equivalent mode here).

* bump version to v3.41
2026-06-16 03:34:10 +09:00
Dr.Lt.Data 491f847bbc fix(security): harden CSRF with Content-Type gate and OpenAPI sync (#2819)
Defense-in-depth over GET→POST alone: reject the three CORS-safelisted
simple-form Content-Types (x-www-form-urlencoded, multipart/form-data,
text/plain) on 5 no-body POST handlers (snapshot/save,
manager/queue/{reset,start,update_comfyui}, manager/reboot) to block
<form method=POST> CSRF that bypasses method-only gating. Convert 10 pure
state-changing endpoints (fetch_updates, queue/{update_all,reset,start,
update_comfyui}, snapshot/{remove,restore,save}, comfyui_switch_version,
reboot) from GET to POST and split 5 config endpoints
(db_mode/preview_method/channel_url_list/policy/{component,update}) into
GET(read) + POST(write, JSON body). Emit the in_progress + done event pair
from the /manager/queue/install sync-enable fast-path so client UI
finalizes (previously only queue/start's empty worker done fired, leaving
item.restart unset and the Enable button visible after a successful enable).
Harden js/custom-nodes-manager.js completion path: await onQueueCompleted
with try/catch (surfaces silent turbogrid stale-item throws), replace the
{}.length == 0 no-op empty guard, set install_context before queue/install
to avoid a sync-completion race, wrap classList/updateCell in try/catch.
Resynchronize openapi.yaml with the converted routes (method → post, query
params → requestBody JSON schema, sibling post on 5 split endpoints).
Update 31 JS fetchApi call sites across 7 files; add
tests/test_csrf_content_type_helper.py covering 5 Content-Type cases via
aiohttp TestClient.

Reported-by: XlabAI Team of Tencent Xuanwu Lab
CVSS: 8.1 (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H)
2026-04-22 05:04:07 +09:00
Dr.Lt.Data f4fa394e0f fix(security): add input sanitization and path traversal protection
- Sanitize config string values to prevent CRLF injection attacks
- Add get_safe_snapshot_path() helper to validate snapshot targets
- Block path traversal attempts in remove_snapshot and restore_snapshot endpoints
- Reject targets containing /, \, .., or null characters
2026-01-08 18:29:14 +09:00
Dr.Lt.Data f4fdd51ce9 feat(preview): disable Manager preview method when ComfyUI native feature is available
- Add detection for ComfyUI PR #11261 (per-queue preview override)
- Return DISABLED status when native feature is detected
- Improve UI loading state and prevent flash of enabled state
- Add accessibility attributes and visual feedback for disabled state
- Show user notification when feature transitions to native
- Version bump to 3.39
2025-12-19 23:05:52 +09:00
John Cantu 1bdcd1bdbf Merge branch 'main' of https://github.com/jfcantu/ComfyUI-Manager 2025-12-14 18:11:34 -08:00
Dr.Lt.Data aaed1dc3d5 feat(security): Support System User Protection API with security migration (V3.38) (#2338)
- Migrate Manager data path: default/ComfyUI-Manager → __manager
- Force security_level=strong on outdated ComfyUI (block installations)
- Auto-migrate config.ini only; backup legacy files for manual verification
- Raise weak/normal- to normal during migration
- Add /manager/startup_alerts API for UI warnings
- Differentiate 403 responses: comfyui_outdated vs security_level
- Block startup scripts execution on old ComfyUI

Requires ComfyUI v0.3.76+ for full functionality.
Backward compatible with older versions (uses legacy path).
2025-12-03 00:42:12 +09:00
John Cantu 67d03530a3 Changes and new code for Node Usage Analyzer 2025-09-14 22:49:54 -07:00
Bas Nijholt ad09e53f60 Remove file argument from logging.error in manager_server.py (#1977)
Otherwise this results in:
```python
TypeError: Logger._log() got an unexpected keyword argument 'file' 
```
2025-07-08 08:48:16 +09:00
Dr.Lt.Data 815784e809 fixed: Fix issue where some nodepacks were displayed redundantly in custom nodes manager. 2025-06-25 00:18:18 +09:00
Dr.Lt.Data a3fb847773 fixed: Don't override preview method if --preview-method is given
https://github.com/Comfy-Org/ComfyUI-Manager/issues/1887
2025-06-08 06:33:42 +09:00
Dr.Lt.Data 0048754fe8 fixed: An issue occurs when attempting to update a node pack installed via git clone if its URL has changed or if the node is not registered in custom-nodes-list.json.
https://github.com/Comfy-Org/ComfyUI-Manager/issues/1834#issuecomment-2907690538
2025-05-26 02:21:25 +09:00
Dr.Lt.Data 87a652d038 fixed: channel error when DB: local is selected 2025-03-24 01:17:07 +09:00
Dr.Lt.Data 1f3274d3f5 fixed: Removed -> str | None typing.
- Python versions below 3.10 do not support it.

https://github.com/ltdrdata/ComfyUI-Manager/issues/1663
2025-03-15 20:14:08 +09:00
Dr.Lt.Data 39eaa76b8a fixed: remove migration code completely
https://github.com/ltdrdata/ComfyUI-Manager/issues/1659
2025-03-14 18:24:30 +09:00
Dr.Lt.Data c3eed981c0 fixed: robust validation when model downloading #2 2025-03-12 21:24:31 +09:00
Dr.Lt.Data bbb54d4a08 fixed: robust validation when model downloading 2025-03-12 21:10:02 +09:00
Dr.Lt.Data 4566c585db fixed: a condition code wasn’t saved after editing... lol 2025-03-12 21:00:05 +09:00
Dr.Lt.Data a946338a18 fixed: invalid channel exception when startup 2025-03-12 17:28:17 +09:00
Dr.Lt.Data 0a60a44478 fixed: several security bugs
refactor: remove serveal unused code
2025-03-12 11:32:16 +09:00
Dr.Lt.Data 04fa540a8c fixed: crash on desktop version when displaying to print version information 2025-03-08 10:15:23 +09:00
Alexander Piskun 8b16ef641b small fix for running as py-module on windows (#1615) 2025-03-06 21:48:08 +09:00
Dr.Lt.Data bebc16d5a6 fixed: invalid log message 2025-03-04 22:07:15 +09:00
Dr.Lt.Data 22f723b920 modified: show more detailed info if updating failed 2025-03-04 12:37:39 +09:00
Dr.Lt.Data e71e68e298 modified: better error log when failed to update comfyui
https://github.com/ltdrdata/ComfyUI-Manager/issues/1576
2025-03-02 17:42:31 +09:00
Dr.Lt.Data f6be5ad839 modified: verbose reporting when initial fecthing is failed.
https://github.com/ltdrdata/ComfyUI-Manager/issues/1594
2025-03-02 17:07:00 +09:00
Dr.Lt.Data 5a5a37dfee fixed: robust initial caching
https://github.com/comfyanonymous/ComfyUI/issues/7003#issuecomment-2690687621

modified: store `db_mode` setting to `config.ini`
https://github.com/ltdrdata/ComfyUI-Manager/issues/1582#issuecomment-2687332355

remove: fetch updates / skip updates
- 'updates' filter will trigger fetching
https://github.com/ltdrdata/ComfyUI-Manager/issues/1584

added: support for `disable_front` or `DISABLE_COMFYUI_MANAGER_FRONT`
2025-03-01 01:06:17 +09:00
Dr.Lt.Data f1b7f5f52f fixed: Fixed the issue where attempting to install the nightly version resulted in installing the latest version instead. 2025-02-26 21:50:31 +09:00
Dr.Lt.Data ea7aafb3e6 fixed: When enabling the selected items, it fixed an issue where it performed a latest installation instead of enabling the previously disabled ones.
fixed: robust skipping installing/uninstalling/enabling of ComfyUI-Manager
2025-02-25 22:19:07 +09:00
Alexander Piskun 42b15ad4a5 restart action: support running as Python module (#1578) 2025-02-25 17:16:36 +09:00
Dr.Lt.Data 5dd8ea8aab feat: update policy for updating ComfyUI
https://github.com/ltdrdata/ComfyUI-Manager/issues/1552

fixed: comfyui versions should be based on commit date
https://github.com/ltdrdata/ComfyUI-Manager/issues/1566

fixed: invalid identifying of nightly node packs which has `git@github.com:...` url
fixed: switch comfyui should be based on `master` branch instead of `main` branch
fixed: switch_to_default_branch - more robust switching
refactor: endpoints for policies
2025-02-19 21:34:13 +09:00
Dr.Lt.Data 41172be796 modified: don't show outdated ComfyUI message if desktop mode
modified: use __COMFYUI_DESKTOP_VERSION__ in notice board if desktop mode
2025-02-19 07:41:54 +09:00
Dr.Lt.Data fa1b514440 improved: Update All - Show link on the result board
fixed: Update All - Updates for unknown nodes were not being applied
fixed: corner case crash whilte install/updating

https://github.com/ltdrdata/ComfyUI-Manager/issues/1168
2025-02-16 14:25:57 +09:00
Dr.Lt.Data 12351bada7 improved: is_local_mode - use ipaddress module instead of string match
refactor: get_config() - ensure lowercase option when returning dict

https://github.com/ltdrdata/ComfyUI-Manager/issues/1546
2025-02-15 10:02:25 +09:00
Dr.Lt.Data 3b0709f5f2 improved: cm-cli.py save-snapshot - validate output path
fixed: Update all - Properly display the results of the ComfyUI update.
fixed: Update all - An issue where the action results of the custom nodes manager were reflected in the main dialog.

https://github.com/ltdrdata/ComfyUI-Manager/issues/1548
2025-02-15 09:23:04 +09:00
Robin Huangandpythongosssss eebace1652 Add support for custom node only snapshots (#4) (#1542)
* Add support for custom node only snapshots (#4)

* Fix ruff lint.

---------

Co-authored-by: pythongosssss <125205205+pythongosssss@users.noreply.github.com>
2025-02-14 07:26:35 +09:00
Dr.Lt.Data 6ff6e05408 improve: update all - background updating
modified: update all - don't update ComfyUI
2025-02-13 22:34:36 +09:00
Dr.Lt.Data 5b2e2fcf9d feat: config.ini - network_mode is added.
- public | private | offline

https://github.com/ltdrdata/ComfyUI-Manager/issues/1537
2025-02-13 08:24:54 +09:00