AGmind icon indicating copy to clipboard operation
AGmind copied to clipboard

Require Authelia for Crawl4AI and bind its port to loopback; update profiles and templates

Open botAGI opened this issue 6 months ago • 0 comments

Motivation

  • Prevent unauthenticated exposure of the Crawl4AI REST API by default and ensure agents deployments enable Authelia when Crawl4AI is selected.
  • Make the default host bind for the Crawl4AI port loopback-only to avoid exposing the backend on the LAN without an authenticated nginx proxy.
  • Keep named profiles, wizard flows, and generated artifacts consistent with the new security posture for Crawl4AI.

Description

  • Gate the nginx Crawl4AI vhost generation on both ENABLE_CRAWL4AI and ENABLE_AUTHELIA in lib/config.sh so the nginx proxy is only added when Authelia is active.
  • Prevent mDNS publishing of agmind-crawl.local unless both ENABLE_CRAWL4AI and ENABLE_AUTHELIA are true in lib/config.sh.
  • Add CRAWL4AI_BIND_ADDR default of 127.0.0.1 in templates/env.lan.template and change templates/docker-compose.yml to bind the Crawl4AI service to the configured host address (loopback by default).
  • Insert commented Authelia auth_request scaffolding into templates/nginx.conf.template for both the dedicated port vhost and the mDNS vhost for Crawl4AI.
  • Ensure the interactive and non-interactive wizard in lib/wizard.sh implicitly enables Authelia whenever Crawl4AI is selected and update the summary to only advertise agmind-crawl.local when both are enabled.
  • Update the services registry (templates/services/registry.yaml and generated lib/_registry.indexed.sh) so the agents meta-profile includes authelia and implies ENABLE_AUTHELIA=true when Crawl4AI is part of the profile, and adjust profile descriptions accordingly.
  • Update golden test fixtures (tests/golden/expected/**) and docker-compose renders to reflect the new loopback binding and env changes.
  • Add a unit test tests/unit/test_crawl4ai_auth_exposure.sh that asserts templates and scripts enforce the Authelia requirement and default loopback binding for Crawl4AI.

Testing

  • Added tests/unit/test_crawl4ai_auth_exposure.sh and updated golden expectations under tests/golden/expected; the unit test asserts template patterns and env defaults and was executed as part of the test suite.
  • Ran the repository golden/regression checks and unit tests used by CI (including the new Crawl4AI test) and they completed successfully against the updated fixtures.
  • Updated checksum files for affected golden outputs to match the rendered artifacts after the changes.

Codex Task

botAGI avatar Jun 01 '26 20:06 botAGI