From 76c8ca4ca8711e13e6da44e1180795d2c701a04d Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sun, 31 May 2026 02:49:53 -0700 Subject: [PATCH] refactor: remove ENABLED_PLUGINS config, use PLUGINS as the single plugin selector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ENABLED_PLUGINS and PLUGINS were two near-identical config keys: PLUGINS was the CLI/per-run whitelist (--plugins flag, runner config), while ENABLED_PLUGINS was the UI/API "persisted enabled set" — but both ended up steering the same plugin resolution. Consolidating on PLUGINS as the single source of truth. - archivebox/config/common.py: drop the ENABLED_PLUGINS Field entirely (no alias, no compat shim — the migration is one-shot). - archivebox/hooks.py:get_enabled_plugins(): read PLUGINS instead of ENABLED_PLUGINS. Function name kept (describes the return value). - archivebox/templates/core/add.html: admin "Add" form JS now writes to PLUGINS; help text updated to reference PLUGINS. views.py:1302 and runner.py:585 already read/wrote PLUGINS; they're now consistent with the resolver. abx-dl is unaffected — it receives selected_plugins as a Python list argument and never reads either config key. Co-Authored-By: Claude Opus 4.7 (1M context) --- archivebox/config/common.py | 4 ---- archivebox/hooks.py | 8 ++++---- archivebox/templates/core/add.html | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/archivebox/config/common.py b/archivebox/config/common.py index 0a29bbc6..31e8abf5 100644 --- a/archivebox/config/common.py +++ b/archivebox/config/common.py @@ -283,10 +283,6 @@ class ArchivingConfig(BaseConfigSet): default="", description="Comma-separated plugin selection for this run. Empty means use enabled plugin defaults.", ) - ENABLED_PLUGINS: str = Field( - default="", - description="Comma-separated plugin selection override used by the UI and API.", - ) ONLY_NEW: bool = Field(default=True) diff --git a/archivebox/hooks.py b/archivebox/hooks.py index 81dfe266..0e9a4fbf 100644 --- a/archivebox/hooks.py +++ b/archivebox/hooks.py @@ -681,10 +681,10 @@ def get_enabled_plugins(config: ConfigLookup | None = None, **config_kwargs: Any return [str(plugin).strip() for plugin in value if str(plugin).strip()] return [str(value).strip()] if str(value).strip() else [] - # Support explicit ENABLED_PLUGINS override - enabled_plugins = config.get("ENABLED_PLUGINS") - if enabled_plugins: - return normalize_enabled_plugins(enabled_plugins) + # Support explicit PLUGINS override + plugins_override = config.get("PLUGINS") + if plugins_override: + return normalize_enabled_plugins(plugins_override) # Filter all plugins by enabled status all_plugins = get_plugins() diff --git a/archivebox/templates/core/add.html b/archivebox/templates/core/add.html index 31cc6d74..806e0aa7 100644 --- a/archivebox/templates/core/add.html +++ b/archivebox/templates/core/add.html @@ -304,7 +304,7 @@
{{ form.config.errors }}
{% endif %}
- Override any config option for this crawl (e.g., TIMEOUT, USER_AGENT, CHROME_BINARY, etc.). URL_ALLOWLIST, URL_DENYLIST, and ENABLED_PLUGINS are updated automatically from the fields above. + Override any config option for this crawl (e.g., TIMEOUT, USER_AGENT, CHROME_BINARY, etc.). URL_ALLOWLIST, URL_DENYLIST, and PLUGINS are updated automatically from the fields above.
@@ -477,7 +477,7 @@ .map(cb => cb.value) .filter(Boolean) .sort((left, right) => left.localeCompare(right)); - setConfigRow('ENABLED_PLUGINS', selectedPlugins.join(',')); + setConfigRow('PLUGINS', selectedPlugins.join(',')); } function replaceConfigRows(config) {