From 045dd3817e6732c340ed7e78073d9f8b76ff93c7 Mon Sep 17 00:00:00 2001 From: Joao Gilberto Magalhaes Date: Sun, 15 Feb 2026 14:32:16 -0500 Subject: [PATCH] Migrate configuration paths to `/etc/easyhaproxy` and improve health check support in E2E tests - Refactored HAProxy configuration files, templates, and paths to use `/etc/easyhaproxy` instead of `/etc/haproxy`. - Updated Dockerfile to generate DH params and placeholder certificates in the new configuration directory. - Added health check support with timeout to `DockerComposeFixture` in E2E test utilities. - Adjusted tests, templates, and plugins to use the new `Consts`-based configuration paths. - Introduced pytest fixtures for environment isolation and temporary directory management. --- .gitignore | 1 + .run/pytest in tests.run.xml | 5 +- build/Dockerfile | 13 +- .../etc/easyhaproxy/haproxy/conf.d/README.md | 5 + .../haproxy/errors-custom/400.http | 2 +- .../haproxy/errors-custom/403.http | 0 .../haproxy/errors-custom/408.http | 0 .../haproxy/errors-custom/500.http | 0 .../haproxy/errors-custom/502.http | 0 .../haproxy/errors-custom/503.http | 0 .../haproxy/errors-custom/504.http | 0 build/assets/etc/haproxy/conf.d/README.md | 3 - deploy/docker/docker-compose.yml | 4 +- docs/Plugins/cleanup.md | 4 +- docs/Plugins/cloudflare.md | 28 +-- docs/Plugins/deny-pages.md | 2 +- docs/Plugins/fastcgi.md | 20 +- docs/Plugins/ip-whitelist.md | 2 +- docs/Plugins/jwt-validator.md | 28 +-- docs/acme.md | 8 +- docs/environment-variable.md | 29 +-- docs/kubernetes.md | 2 +- docs/other.md | 6 +- docs/plugin-development.md | 46 ++--- docs/plugins.md | 22 +- docs/ssl.md | 6 +- docs/static.md | 4 +- docs/volumes.md | 194 +++++++++++++++++- pyproject.toml | 1 + src/functions/__init__.py | 68 +++++- src/plugins/__init__.py | 6 +- src/plugins/builtin/cloudflare.py | 10 +- src/plugins/builtin/fastcgi.py | 6 +- src/plugins/builtin/jwt_validator.py | 10 +- src/templates/bind.j2 | 2 +- src/templates/haproxy.cfg.j2 | 14 +- src/templates/ssl_default.j2 | 2 +- src/templates/ssl_loose.j2 | 2 +- tests/conftest.py | 43 ++++ tests/expected/docker.txt | 4 +- tests/expected/no-services.txt | 2 +- tests/expected/services-fcgi.txt | 2 +- tests/expected/services-letsencrypt.txt | 18 +- tests/expected/services-multi-containers.txt | 2 +- tests/expected/services-multiple-hosts.txt | 16 +- tests/expected/services-redirect-ssl.txt | 4 +- tests/expected/services-tcp.txt | 2 +- tests/expected/services.txt | 4 +- tests/expected/ssl-loose.txt | 2 +- tests/expected/static.txt | 18 +- tests/fixtures/services-with-multiple-plugins | 1 - tests/test_daemonize.py | 11 +- tests/test_plugins.py | 37 ++-- tests_e2e/docker/docker-compose-acme-e2e.yml | 6 +- tests_e2e/docker/docker-compose-acme.yml | 8 +- .../docker/docker-compose-cloudflare.yml | 4 +- .../docker/docker-compose-jwt-validator.yml | 4 +- .../docker-compose-plugins-combined.yml | 6 +- tests_e2e/docker/docker-compose-portainer.yml | 4 +- tests_e2e/docker/docker-compose.yml | 2 +- tests_e2e/kubernetes/cloudflare.yml | 4 +- tests_e2e/kubernetes/jwt-validator.yml | 4 +- tests_e2e/kubernetes/plugins-combined.yml | 2 +- tests_e2e/static/README.md | 2 +- tests_e2e/static/conf/config-basic.yml | 4 +- tests_e2e/static/conf/config-certbot.yml | 12 +- tests_e2e/static/conf/config-deny-pages.yml | 2 +- .../static/conf/config-jwt-validator.yml | 12 +- tests_e2e/static/docker-compose.yml | 10 +- tests_e2e/test_docker_compose.py | 28 +-- tests_e2e/test_kubernetes.py | 12 +- tests_e2e/test_static.py | 6 +- tests_e2e/utils.py | 34 ++- 73 files changed, 600 insertions(+), 287 deletions(-) create mode 100644 build/assets/etc/easyhaproxy/haproxy/conf.d/README.md rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/400.http (99%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/403.http (100%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/408.http (100%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/500.http (100%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/502.http (100%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/503.http (100%) rename build/assets/etc/{ => easyhaproxy}/haproxy/errors-custom/504.http (100%) delete mode 100644 build/assets/etc/haproxy/conf.d/README.md create mode 100644 tests/conftest.py diff --git a/.gitignore b/.gitignore index 41c15f8..f81b658 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ __pycache__ # Build artifacts dist/ build/ +!build/assets/ *.egg-info/ /tests_e2e/static/conf/config.yml diff --git a/.run/pytest in tests.run.xml b/.run/pytest in tests.run.xml index 9b5784c..c72dc30 100644 --- a/.run/pytest in tests.run.xml +++ b/.run/pytest in tests.run.xml @@ -5,16 +5,17 @@