refactor: remove ENABLED_PLUGINS config, use PLUGINS as the single plugin selector

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) <noreply@anthropic.com>
This commit is contained in:
Nick Sweeting 2026-05-31 02:49:53 -07:00
parent 249cbcdc82
commit 76c8ca4ca8
No known key found for this signature in database
3 changed files with 6 additions and 10 deletions

View File

@ -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)

View File

@ -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()

View File

@ -304,7 +304,7 @@
<div class="error">{{ form.config.errors }}</div>
{% endif %}
<div class="help-text">
Override any config option for this crawl (e.g., TIMEOUT, USER_AGENT, CHROME_BINARY, etc.). <code>URL_ALLOWLIST</code>, <code>URL_DENYLIST</code>, and <code>ENABLED_PLUGINS</code> are updated automatically from the fields above.
Override any config option for this crawl (e.g., TIMEOUT, USER_AGENT, CHROME_BINARY, etc.). <code>URL_ALLOWLIST</code>, <code>URL_DENYLIST</code>, and <code>PLUGINS</code> are updated automatically from the fields above.
</div>
</div>
</details>
@ -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) {