1
0
Fork 0
Commit graph

402 commits

Author SHA1 Message Date
Joao Gilberto Magalhaes
a410b34521 Documentation Refactor 2026-02-20 11:46:57 -05:00
Joao Gilberto Magalhaes
3b8818e636
Merge pull request #68 from byjg/dependabot/uv/cryptography-46.0.5
Bump cryptography from 46.0.4 to 46.0.5
2026-02-18 17:57:20 -05:00
dependabot[bot]
4c98fd48e5
Bump cryptography from 46.0.4 to 46.0.5
Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.4 to 46.0.5.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.4...46.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-18 22:52:00 +00:00
Joao Gilberto Magalhaes
deade0a928
Merge pull request #67 from byjg/ingressclassname
Add ingress status update and support for ingress class changes
2026-02-18 17:51:06 -05:00
Joao Gilberto Magalhaes
9eb0ab61a9
Merge branch 'master' into ingressclassname 2026-02-18 17:45:30 -05:00
Joao Gilberto Magalhaes
711bb43572 Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
Joao Gilberto Magalhaes
1262946a3e Refine Kubernetes E2E polling logic to check backend readiness beyond HTTP 503
- Updated polling step to consider non-503 responses (e.g., 200/401/403) as backend readiness.
- Improved logging to reflect updated readiness criteria.
- Enhanced robustness by distinguishing between transient and configured backend states.
2026-02-18 17:26:24 -05:00
Joao Gilberto Magalhaes
81495216a7 Add Docker build and cache cleanup steps in CI, prevent redundant builds in Swarm E2E tests
- Updated GitHub workflow to include Docker cache cleanup and image build steps.
- Modified Swarm E2E test logic to skip Docker image build if it already exists, optimizing CI performance.
2026-02-18 16:58:55 -05:00
Joao Gilberto Magalhaes
3710b08995 Add Docker build and cache cleanup steps in CI, prevent redundant builds in Swarm E2E tests
- Updated GitHub workflow to include Docker cache cleanup and image build steps.
- Modified Swarm E2E test logic to skip Docker image build if it already exists, optimizing CI performance.
2026-02-18 16:42:44 -05:00
Joao Gilberto Magalhaes
3fd0fe0d46 Update plugin paths from /etc/haproxy to /etc/easyhaproxy across tests, configs, and documentation 2026-02-18 16:35:57 -05:00
Joao Gilberto Magalhaes
8532d49642 Refactor Swarm E2E tests: optimize timeouts, enhance stack deployment/wait logic, consolidate replicas, and update HAProxy config refresh cycle 2026-02-18 16:10:01 -05:00
Joao Gilberto Magalhaes
5a9f14e980 Refactor Swarm E2E tests: optimize timeouts, enhance stack deployment/wait logic, consolidate replicas, and update HAProxy config refresh cycle 2026-02-18 15:56:07 -05:00
Joao Gilberto Magalhaes
d9c7ff89cc Set pytest.fixture scope to class, add Swarm E2E tests, and update Docker Swarm configurations
- Modified `pytest.fixture` scope to `class` across tests to improve fixture lifecycle and reduce setup overhead.
- Introduced a new `tests_e2e/test_swarm.py` test suite for Docker Swarm stack configurations.
- Added E2E tests for Swarm mode with scenarios such as basic services and combined plugins.
- Updated HAProxy image in Swarm stack `.yml` files to `byjg/easy-haproxy:local` for local testing consistency.
- Added `swarm` marker in `pyproject.toml` for differentiating Docker Swarm-specific tests.
- Updated GitHub workflows to include a new Swarm E2E test pipeline.
2026-02-18 15:28:07 -05:00
Joao Gilberto Magalhaes
16fcee4280 Bump version to 6.0.0 and update release notes for major changes 2026-02-18 14:14:51 -05:00
Joao Gilberto Magalhaes
53f5f39ba9 Enable manual workflow dispatch with configurable inputs in CI/CD pipeline 2026-02-18 13:15:56 -05:00
Joao Gilberto Magalhaes
d894778ddc Add Certbot and HAProxy management modules, container environment parsing, and plugin management framework
- Introduced `certbot.py` for ACME certificate management, including certificate issuance, renewal, and environment validation.
- Added `haproxy.py` for HAProxy process management, configuration validation, and dynamic command handling.
- Implemented `container_env.py` for reading and parsing environment variables with YAML overrides.
- Created `consts.py` for centralized management of static and dynamic paths.
- Added `manager.py` to enable plugin discovery, initialization, configuration, and execution.
- Refactored logging and configuration handling across modules for consistency.

Enhances modularity and scalability by introducing feature-dedicated modules and structured configuration handling.
2026-02-18 12:43:45 -05:00
Joao Gilberto Magalhaes
48f6e1f783 Migrate build assets and scripts to deploy/docker structure
- Removed `install.sh` and moved Docker-related assets to `deploy/docker`.
- Updated all Dockerfile references from `build/` to `deploy/docker/`.
- Refactored paths in E2E tests, Makefile, and documentation for consistency with new directory structure.
- Added `HAPROXY_STATS_CORS_ORIGIN` environment variable in `docker-compose.yml`.
2026-02-18 02:58:32 -05:00
Joao Gilberto Magalhaes
53c32499b5 Remove Diffie-Hellman parameter generation and references in templates and tests 2026-02-18 02:08:46 -05:00
Joao Gilberto Magalhaes
44cb3dd5e0 Refactor Dockerfile for multi-stage build and runtime optimization
- Implemented a two-stage Dockerfile: build environment with Python dependencies and lean runtime stage with HAProxy.
- Added custom entrypoint script for dynamic Docker group adjustment.
- Improved HAProxy command generation by introducing a static method for binary resolution.
- Updated tests and functional logic to dynamically resolve the `haproxy` binary path.
- Adjusted file permissions in E2E key generation script for better security.
- Streamlined `.gitignore` by removing unnecessary exclusions.
2026-02-18 01:53:27 -05:00
Joao Gilberto Magalhaes
bfd38adea5 Add standalone Python entrypoint for EasyHAProxy and pip-based installation
- Introduced `/scripts/.venv/bin/easy-haproxy` as the default entrypoint for standalone environments.
- Added `_build_parser` and `start` functions to enable CLI-driven functionality configuration.
- Updated packaging to reflect new `easyhaproxy.main` module and adapted project name from `easymapping` to `easyhaproxy`.
- Modified `Dockerfile` to align with new script paths and entrypoints for better portability.
- Enhanced documentation with dedicated sections for pip-based installation, CLI references, and systemd setup for non-Docker environments.
- Adjusted helm, plugin, and environment-related docs for accurate sidebar ordering.
- Added a new GitHub workflow to automate package publishing to PyPI.
2026-02-17 21:41:33 -05:00
Joao Gilberto Magalhaes
3805100244 Refactor E2E tests: add wait_for_json_response helper for robust JSON response handling
- Replaced direct `curl` calls with `wait_for_json_response` to improve retry logic and error handling.
- Simplified tests for header validation and backend readiness verification.
2026-02-17 16:13:40 -05:00
Joao Gilberto Magalhaes
491f4a8c09 Add support for CORS in HAProxy stats dashboard
- Introduced `HAPROXY_STATS_CORS_ORIGIN` environment variable for enabling CORS in HAProxy stats.
- Updated HAProxy configuration template to handle CORS preflight and response headers.
- Added tests for static configuration mode with CORS enabled.
- Updated documentation to include new CORS configuration details and examples.
2026-02-16 20:54:27 -05:00
Joao Gilberto Magalhaes
353fd392f6 Add support for proxy-awareness headers: X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto, X-Forwarded-Host, and X-Request-ID
- Updated HAProxy configuration template to set all standard proxy headers for HTTP requests.
- Added support for a unique request ID via `unique-id-format` and `unique-id-header` directives.
- Implemented E2E tests for header validation, request correlation, and configuration correctness.
- Enhanced documentation to explain usage and examples of proxy headers.
- Updated CI workflows to include E2E tests for proxy headers.
2026-02-16 17:49:11 -05:00
Joao Gilberto Magalhaes
776f216a36 Add support for proxy-awareness headers: X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto, X-Forwarded-Host, and X-Request-ID
- Updated HAProxy configuration template to set all standard proxy headers for HTTP requests.
- Added support for a unique request ID via `unique-id-format` and `unique-id-header` directives.
- Implemented E2E tests for header validation, request correlation, and configuration correctness.
- Enhanced documentation to explain usage and examples of proxy headers.
- Updated CI workflows to include E2E tests for proxy headers.
2026-02-16 17:26:59 -05:00
Joao Gilberto Magalhaes
4aba68dd37 Improve SSL and ACME documentation
- Clarify that EASYHAPROXY_CERTBOT_AUTOCONFIG or CERTBOT_SERVER is required
- Add complete docker-compose.yml examples for ACME setup
- Explain SSL termination at HAProxy level vs backend containers
- Reorganize SSL docs to emphasize volume method over label method
- Add troubleshooting section for common ACME warnings
- Clarify certificate storage paths and selection priority
- Add examples showing both ACME and manual certificates together

Resolves confusion about ACME configuration requirements and makes
it clear that volume-mounted certificates are the recommended method
for manual SSL certificates.
2026-02-16 15:54:32 -05:00
Joao Gilberto Magalhaes
c340de1d9d Refactor ACME E2E tests: add Pebble health check container, simplify startup logic, and replace Python-based health check 2026-02-16 14:48:39 -05:00
Joao Gilberto Magalhaes
4646572953 Update ACME E2E tests: use specific Docker Compose file and ensure correct working directory
- Replaced `compose_file` references with `docker-compose-acme-e2e.yml` for improved clarity.
- Added working directory changes for Docker Compose commands to ensure relative paths work properly.
- Restored original working directory after test execution for cleanup consistency.
2026-02-16 14:20:02 -05:00
Joao Gilberto Magalhaes
6997777f41 Add Pebble readiness debug logs and skip ACME tests in specific CI environments 2026-02-16 14:07:29 -05:00
Joao Gilberto Magalhaes
9d1e947675 Refactor ACME/Certbot E2E test fixture to use staged service startup for improved reliability 2026-02-16 13:50:25 -05:00
Joao Gilberto Magalhaes
1493beb227 Remove Pebble health check container and replace with Python-based health check in E2E tests 2026-02-16 13:18:35 -05:00
Joao Gilberto Magalhaes
b867bb724d Adjust health checks and retry logic in E2E tests for improved CI reliability 2026-02-16 12:48:59 -05:00
Joao Gilberto Magalhaes
aa518e9686 Adjust health checks and retry logic in E2E tests for improved CI reliability 2026-02-16 12:13:13 -05:00
Joao Gilberto Magalhaes
4df8666a2b Add health checks for Docker services, ACME environment readiness validation, and Certbot unit tests
- Introduced health checks to Docker Compose files for better service reliability.
- Added ACME environment readiness validation to ensure proper configuration for Certbot.
- Implemented unit tests for Certbot's `check_acme_environment_ready` method to cover edge cases.
- Improved E2E tests with startup wait adjustments and dynamic certificate issuance verification.
- Enhanced Kubernetes test cleanup with forced resource deletion for faster termination.
2026-02-16 11:47:28 -05:00
Joao Gilberto Magalhaes
045dd3817e 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.
2026-02-15 14:32:16 -05:00
Joao Gilberto Magalhaes
3e963228f3 Add ACME/Certbot E2E tests with Pebble integration and update dependencies in CI workflows
- Introduced `docker-compose-acme-e2e.yml` for end-to-end testing with Pebble test server.
- Added tests to validate ACME challenge routing, certificate issuance, HTTPS functionality, and HAProxy configuration.
- Implemented CA certificate download fixture (`create_pebble_ca_file`) for test session initialization.
- Updated `.gitignore` to exclude Pebble-related files.
- Modified CI workflows to include `needs: [Test]` dependencies for E2E jobs, ensuring proper sequencing.
2026-02-14 17:40:40 -05:00
Joao Gilberto Magalhaes
2e45c3f2e5 Add unit and integration tests for Certbot and HAProxy configuration
- Added integration tests to validate HAProxy configuration generation for Certbot's HTTP-01 challenges.
- Verified handling of ACLs, SSL redirects, multi-domain setups, and backend behaviors.
- Introduced unit tests for the Certbot class to ensure proper ACME server handling, certificate status checks, and configuration validation.
- Improved test coverage for edge cases, including EAB credentials, manual hooks, and custom ports.
- Enhanced certbot-related environment variable parsing and error scenarios.
2026-02-14 16:59:22 -05:00
Joao Gilberto Magalhaes
ece012a884 Introduce plugin initialization phase and consolidate config handling
- Added `initialize_plugins` method to `PluginManager` for requesting and processing file system resources during plugin initialization.
- Introduced `InitializationResult` and `ResourceRequest` structures for fine-grained resource management (e.g., directories, files).
- Enhanced configuration injection by separating `global_configs`, `defaults_configs`, and backend-level `haproxy_config`.
- Updated existing plugins (e.g., JWT Validator, Cloudflare) to use the initialization phase for resource setup.
- Simplified domain plugin execution by consolidating configuration logic into unified loops.
2026-02-13 16:14:05 -05:00
Joao Gilberto Magalhaes
97845b8a52 Refactor E2E tests and configuration format
- Replaced `easymapping` configuration with `containers` for better maintainability and clarity.
- Introduced `DockerComposeFixture` class in `utils.py` to manage Docker Compose lifecycle and smart build strategy.
- Enhanced YAML-to-environment variable conversion in `ContainerEnv` for dynamic configuration support.
- Updated HAProxy configurations and test fixtures to reflect the new format.
- Improved test coverage for YAML parsing, environment variable handling, and HAProxy config generation.
2026-02-13 12:01:47 -05:00
Joao Gilberto Magalhaes
c125985150 Refactor Docker Compose E2E tests: consolidate file creation and optimize build strategy
- Added `create_cloudflare_ips_file` to centralize `cloudflare_ips.lst` creation and avoid redundant logic.
- Introduced a global flag `_docker_image_built` for smart Docker image build management.
- Improved test output readability with refined print formatting.
- Simplified `docker_compose_cloud
2026-02-12 18:48:24 -05:00
Joao Gilberto Magalhaes
904a102b0a Enhance logging and error handling in E2E tests and CI workflows
- Added detailed log messages in `conftest.py` for SSL certificate and JWT generation steps.
- Improved Docker Compose E2E test output with service-specific logs during startup and cleanup.
- Adjusted pytest run options in CI workflows to use `--tb=short` for concise error traceback.
2026-02-12 18:26:59 -05:00
Joao Gilberto Magalhaes
4160babc94 Update CI workflow to adjust job dependencies and remove conditional triggers
- Removed `if` conditions for `Tests-E2E-Docker` and `Tests-E2E-Kubernetes` jobs, ensuring they always run.
- Updated `Build` job to depend on both E2E test jobs for stricter validation before building.
2026-02-12 18:13:04 -05:00
Joao Gilberto Magalhaes
bec91950c5 Update CI workflow to adjust job dependencies and remove conditional triggers
- Removed `if` conditions for `Tests-E2E-Docker` and `Tests-E2E-Kubernetes` jobs, ensuring they always run.
- Updated `Build` job to depend on both E2E test jobs for stricter validation before building.
2026-02-12 18:11:18 -05:00
Joao Gilberto Magalhaes
0a400b976c Add improved output formatting and new manual test workflows
- Added blank lines before specific print statements in E2E test scripts for better readability.
- Enabled `workflow_dispatch` in `.github/workflows/build.yml` to allow manual triggering of workflows.
- Added separate jobs for running Docker Compose and Kubernetes E2E tests in CI pipeline.
2026-02-12 18:07:01 -05:00
Joao Gilberto Magalhaes
f463020e3e Refactor and consolidate E2E test utilities and fixtures
- Introduced `utils.py` for shared test utility functions (e.g., JWT generation, pod readiness checks, etc.).
- Added shared pytest fixtures in `conftest.py`, eliminating redundancy across Kubernetes and Docker Compose tests.
- Replaced inline test logic with reusable helper functions for Kubernetes configuration validation and resource readiness.
- Updated tests to leverage new consolidated functionality for better maintainability and clarity.
- Removed outdated, duplicate code in test files, aligning with new utilities and fixture structure.
2026-02-12 17:55:09 -05:00
Joao Gilberto Magalhaes
d66c4f8595 Migrate examples to tests_e2e directory structure
- Relocated all files and scripts from `examples` to `tests_e2e` for better organization.
- Updated references and paths in configurations, scripts, and test files.
- Adjusted `bump-version.sh` to handle the new `tests_e2e` structure.
- Updated `.gitignore` to reflect path changes.
2026-02-12 17:05:04 -05:00
Joao Gilberto Magalhaes
b34d7822e4 Remove Python app example and replace with header-echo server for testing
- Deleted the `/examples/docker/python-app` directory and associated files.
- Integrated a custom `header-echo` server for Kubernetes and Docker Compose tests.
- Updated Kubernetes and Docker Compose configurations to use the new `header-echo-server:test` image.
- Enhanced Kubernetes integration tests to validate JSON responses and Cloudflare IP translation behavior.
2026-02-12 16:29:44 -05:00
Joao Gilberto Magalhaes
1fd5873dc9 Add Cloudflare plugin tests with base64-encoded IP list support
- Enhanced the Cloudflare plugin by adding support for base64-encoded IP lists, prioritizing them over built-in lists.
- Introduced Kubernetes integration tests for the Cloudflare IP restoration feature.
- Validated plugin behavior for resource creation, pod readiness, ingress access, and HAProxy configurations.
- Improved annotations in `cloudflare.yml` for Kubernetes-native compatibility.
- Updated unit tests to cover IP list precedence, invalid base64 handling, and metadata verification.
2026-02-12 16:03:50 -05:00
Joao Gilberto Magalhaes
90b01b1f13 Add Kubernetes integration tests for EasyHAProxy examples
- Introduced a suite of pytest-based integration tests for Kubernetes using `kind`.
- Automated local installation of dependencies (`kind`, `kubectl`, and `helm`) when missing.
- Implemented fixtures for Kubernetes resource management and TLS secrets.
- Added end-to-end tests for HTTP and HTTPS ingress functionality.
2026-02-12 01:42:43 -05:00
Joao Gilberto Magalhaes
5767e55dea Refactor Docker Compose examples and plugins, add pytest tests
- Adjusted Compose files to build images locally instead of pulling.
- Simplified examples by removing `/etc/hosts` entry instructions.
- Enhanced `cloudflare.py` plugin with a configurable log format.
- Improved `generate-keys.sh` for portability using `$SCRIPT_DIR`.
- Added end-to-end tests for Compose examples using pytest.
2026-02-11 19:19:08 -05:00
Joao Gilberto Magalhaes
343987ab58 Update secrets configuration in CI workflow for DOC_TOKEN
- Replaced `secrets: inherit` with explicit `DOC_TOKEN` in workflow file.
2026-02-07 23:42:57 -05:00