AGmind
AGmind copied to clipboard
Require Authelia for Crawl4AI and bind its port to loopback; update profiles and templates
Motivation
- Prevent unauthenticated exposure of the Crawl4AI REST API by default and ensure agents deployments enable
AutheliawhenCrawl4AIis 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_CRAWL4AIandENABLE_AUTHELIAinlib/config.shso the nginx proxy is only added when Authelia is active. - Prevent mDNS publishing of
agmind-crawl.localunless bothENABLE_CRAWL4AIandENABLE_AUTHELIAare true inlib/config.sh. - Add
CRAWL4AI_BIND_ADDRdefault of127.0.0.1intemplates/env.lan.templateand changetemplates/docker-compose.ymlto bind the Crawl4AI service to the configured host address (loopback by default). - Insert commented
Autheliaauth_requestscaffolding intotemplates/nginx.conf.templatefor both the dedicated port vhost and the mDNS vhost for Crawl4AI. - Ensure the interactive and non-interactive wizard in
lib/wizard.shimplicitly enablesAutheliawheneverCrawl4AIis selected and update the summary to only advertiseagmind-crawl.localwhen both are enabled. - Update the services registry (
templates/services/registry.yamland generatedlib/_registry.indexed.sh) so theagentsmeta-profile includesautheliaand impliesENABLE_AUTHELIA=truewhenCrawl4AIis part of the profile, and adjust profile descriptions accordingly. - Update golden test fixtures (
tests/golden/expected/**) anddocker-composerenders to reflect the new loopback binding and env changes. - Add a unit test
tests/unit/test_crawl4ai_auth_exposure.shthat asserts templates and scripts enforce the Authelia requirement and default loopback binding for Crawl4AI.
Testing
- Added
tests/unit/test_crawl4ai_auth_exposure.shand updated golden expectations undertests/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.