Files
MajoorWaldi-ComfyUI-Majoor-…/pyproject.toml
T
Ewald 0894657274 security: honor UI prefs at runtime + LAN-friendly defaults
The Settings -> Security toggles (Allow Remote Full Access, Allow HTTP Token Transport, Require Token For All Writes) were persisted in the DB but ignored by _check_write_access() and the bootstrap-token endpoint, which only read MAJOOR_* env vars. Remote LAN clients hit 'Write access is blocked' even with all toggles enabled.

- New security_prefs_snapshot module: thread-safe in-memory snapshot of persisted prefs, hydrated at ensure_security_bootstrap() and republished on every set_security_prefs(). Read synchronously by guards.

- security.py::_resolve_security_flag(pref_key, env_var, default): single read site, snapshot-first / env-fallback. Used for allow_remote_write, require_auth, allow_insecure_token_transport.

- _bootstrap_enabled() also returns True when allow_remote_write is set in the snapshot (UI consent for remote bootstrap).

- bootstrap-token / rotate-token accept plain HTTP transport when allow_insecure_token_transport is on.

- Friendlier defaults so first install works zero-config on LAN: allow_remote_write=True, allow_insecure_token_transport=True. Auto-generated API token still gates writes.

- Error messages updated to point users to Settings -> Security instead of only env vars.

- README rewritten to put the UI flow first; env vars as headless fallback.

- pyproject.toml: per-file ignore F401 for routes/core/security.py since it is the single import point that re-exports from sub-modules.
2026-04-24 15:33:15 +02:00

118 lines
4.0 KiB
TOML

[project]
name = "majoor-assetsmanager"
description = "Majoor Assets Manager is an advanced asset browser for ComfyUI that provides a comprehensive solution for managing, organizing, and viewing your generated assets. It integrates directly into ComfyUI, offering features like full-text search, metadata extraction, rating and tagging systems, and advanced viewing capabilities."
version = "2.4.6"
requires-python = ">=3.10, <3.14"
license = {file = "LICENSE"}
authors = [
{ name = "MajoorWaldi" },
]
# classifiers = [
# # For OS-independent nodes (works on all operating systems)
# "Operating System :: OS Independent",
#
# # OR for OS-specific nodes, specify the supported systems:
# "Operating System :: Microsoft :: Windows", # Windows specific
# "Operating System :: POSIX :: Linux", # Linux specific
# "Operating System :: MacOS", # macOS specific
#
# # GPU Accelerator support. Pick the ones that are supported by your extension.
# "Environment :: GPU :: NVIDIA CUDA", # NVIDIA CUDA support
# "Environment :: GPU :: AMD ROCm", # AMD ROCm support
# "Environment :: GPU :: Intel Arc", # Intel Arc support
# "Environment :: NPU :: Huawei Ascend", # Huawei Ascend support
# "Environment :: GPU :: Apple Metal", # Apple Metal support
# ]
dependencies = [
"aiohttp>=3.8.0,<4.0.0",
"aiosqlite>=0.20.0,<1.0.0",
"pillow>=10.0.0,<13.0.0",
"hachoir>=3.3.0,<4.0.0",
"send2trash>=1.8.0,<3.0.0",
"watchdog>=3.0.0,<7.0.0",
"pywin32>=300,<312; sys_platform == 'win32'",
# Note: tkinter is required for native folder browser functionality
# tkinter is included in standard Python distribution but may be missing in minimal installs
]
[project.optional-dependencies]
vector = [
"sentence-transformers>=2.2.0,<6.0.0",
"transformers>=4.44.0,<6.0.0",
"huggingface-hub>=0.24.0,<2.0.0",
"safetensors>=0.4.0,<1.0.0",
"protobuf>=3.20.0,<8.0.0",
"timm>=0.9.0,<2.0.0",
"einops>=0.7.0,<1.0.0",
"sentencepiece>=0.1.99,<1.0.0",
"opencv-python-headless>=4.8.0,<5.0.0",
"faiss-cpu>=1.7.0,<2.0.0",
"scikit-learn>=1.3.0,<2.0.0",
]
dev = [
"pytest>=8.0.0,<10.0.0",
"pytest-asyncio>=0.22.0,<2.0.0",
"pytest-cov>=6.0.0,<8.0.0",
"pytest-timeout>=2.3.0,<3.0.0",
"pre-commit>=4.3.0,<5.0.0",
"radon>=6.0.1,<7.0.0",
"xenon>=0.9.3,<1.0.0",
"ruff>=0.12.0,<1.0.0",
"mypy>=1.11.0,<2.0.0",
"pip-audit>=2.9.0,<3.0.0",
"bandit>=1.8.0,<2.0.0",
]
[project.urls]
Homepage = "https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager"
Repository = "https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager"
# Used by Comfy Registry https://registry.comfy.org
Documentation = "https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/blob/main/user_guide.html"
"Bug Tracker" = "https://github.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/issues"
[tool.setuptools.packages.find]
where = ["."]
include = ["mjr_am_shared*", "mjr_am_backend*"]
exclude = ["js*", "vendor*", "plugins*", "ressources*"]
[tool.comfy]
PublisherId = "majoor-waldi"
DisplayName = "ComfyUI-Majoor-AssetsManager"
Icon = "https://raw.githubusercontent.com/MajoorWaldi/ComfyUI-Majoor-AssetsManager/main/ressources/icon.png"
includes = []
"requires-comfyui" = ">=0.13.0"
[tool.black]
line-length = 100
target-version = ["py310", "py311", "py312", "py313"]
include = '\.pyi?$'
[tool.ruff]
line-length = 100
target-version = "py310"
src = ["mjr_am_backend", "mjr_am_shared", "tests"]
respect-gitignore = false
exclude = [
".git",
".mypy_cache",
".mypy_cache_tmp",
".ruff_cache",
"build",
"majoor_assetsmanager.egg-info",
"node_modules",
"plugins",
]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "S"]
ignore = ["E501", "S105", "S110", "S112", "S311", "S603", "S607", "S608"]
[tool.ruff.lint.per-file-ignores]
"scripts/junit_to_html.py" = ["S314"]
"tests/**/*.py" = ["S101", "S108", "S605"]
# security.py is the single import point that re-exports from sub-modules;
# ruff would otherwise trim those re-exports as unused.
"mjr_am_backend/routes/core/security.py" = ["F401"]