1
0
Fork 0
Commit graph

49 commits

Author SHA1 Message Date
Joao Gilberto Magalhaes
52558e9277 Add log-stderr, keep-conn, and path_info presets to FastCGI plugin 2026-06-25 22:46:35 -04:00
Joao Gilberto Magalhaes
5eee2fcf19 Add pass_headers support to FastCGI plugin 2026-06-25 22:34:51 -04:00
Joao Gilberto Magalhaes
4dda1ed631 Enable health checking for HAProxy backend servers
- Updated HAProxy configuration templates to include `check` for `srv_stats` and `srv_dashboard` backends.
- Adjusted expected test case outputs to account for the added health check settings.
2026-02-22 20:03:12 -05:00
Joao Gilberto Magalhaes
7e3134155a Introduce embedded HTTP server for HAProxy monitoring dashboard
- Added a Python-based HTTP server to serve `dashboard.html` at `/` or `/dashboard.html` paths.
- Updated HAProxy configuration to integrate backend for the dashboard.
- Enhanced handling of index paths with conditional redirects to the dashboard page.
- Modified tests and updated expected outputs to reflect these changes.
2026-02-22 19:42:51 -05:00
Joao Gilberto Magalhaes
67cfcf3aff Add HAProxy monitoring dashboard features
- Introduced a new `dashboard` frontend in HAProxy configuration to serve a real-time monitoring dashboard.
- Added support for returning prebuilt `dashboard.html` for `/` or `/index.html` paths.
- Updated test cases and expected outputs to accommodate the new frontend.
2026-02-22 18:10:00 -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
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
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
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
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
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
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
dc28b18351 Fix lint errors 2026-01-22 22:05:49 -05:00
Joao Gilberto Magalhaes
62e5c054f4 Refactor: modernize codebase by replacing deprecated patterns, simplifying imports, and applying type hinting refinements. 2026-01-22 21:47:33 -05:00
Joao Gilberto Magalhaes
55d0d1a105 Modernizing PyThon Projec 2026-01-22 20:14:22 -05:00
Joao M
7d959f892a Refactoring to Python 2022-08-24 01:00:26 +00:00
Joao M
78e9ae3d08 Documentation Update 2022-08-18 17:37:37 +00:00
Joao M
2e2640c859 Fix tests 2022-08-18 15:24:55 +00:00
Joao M
e6d5842098 Change statistics 2022-08-18 04:00:52 +00:00
Joao M
fee0126442 Fixed 2022-08-17 22:04:10 +00:00
Joao M
ad8aef16a2 Fix SSL 2022-08-17 21:55:25 +00:00
Joao M
1a6472a5b3 Fix loop in redirect_ssl 2022-08-17 02:28:24 +00:00
Joao M
0a4f78a153 Fix redirect loop 2022-08-16 20:34:32 +00:00
Joao M
3e561e557f Change SSL Certs folder 2022-08-16 20:07:57 +00:00
Joao M
b363abea8c Add redirect-ssl and different ssl_modes 2022-08-16 16:39:51 +00:00
Joao M
d0f91c6718 Multiple Hosts 2022-08-15 20:20:18 +00:00
Joao M
c62db6e573 Change redirect label to JSON 2022-08-15 19:39:25 +00:00
Joao M
076a51d143 Enforcing some SSL configurations 2022-08-15 17:02:55 +00:00
Joao M
22cac26555 Some controls improvements for certbot. 2022-08-15 14:27:49 +00:00
Joao M
9fa9dc9841 Some refactory to support letsencrypt 2022-08-15 04:31:50 +00:00
Joao M
bdc97fa10d Fixing HAProxy conditional 2022-08-15 01:17:54 +00:00
Joao M
10ed037d94 First part letsencrypt 2022-08-15 00:34:45 +00:00
Joao M
4a1c36d003 Find definitions dynamically 2022-08-12 14:49:48 +00:00
Joao M
c62834c52b Inverted order of the definitions 2022-08-12 02:01:11 +00:00
Joao M
d278629671 Organizing code to refactory labels 2022-08-12 01:00:18 +00:00
Joao M
c6bef882ca Add unit tests 2022-08-11 22:18:28 +00:00
Joao Gilberto Magalhaes
50af051a33 Added tests for multi-container 2022-03-27 18:52:52 -05:00
zhipeng
d41364f1af support multi containers 2022-03-27 16:28:54 +08:00
Joao Gilberto
13c4ebfd2d Reduce the label name 2021-08-11 10:54:17 -05:00
Joao Gilberto Magalhães
74413882fa Fix SSL Parsing; Changed all tests; 2020-06-07 22:31:00 -05:00
Joao Gilberto Magalhães
ddfa2e34ae Minor adjustment in Static unittest. 2020-06-07 21:36:02 -05:00
till
75deebc783
Update: more tests and ssl health-check
- restructure more tests for the "mode http"
 - add tests tests for "mode tcp"
 - add the ability to ssl health check on a backend (in mode tcp)
2020-06-05 16:50:04 +02:00
till
08de132450
Refactor: tried to refactor code
- move scripts to assets/scripts (and updated build)
 - put most logic into HaproxyConfigGenerator
 - created DockerLabelHandler for all label handling from previous code
 - added unit tests and fixtures to cover HaproxyConfigGenerator and DockerLabelHandler
 - added a Makefile with build (for docker build) and test targets
2020-06-05 16:46:40 +02:00