1
0
Fork 0
Commit graph

417 commits

Author SHA1 Message Date
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
Joao Gilberto Magalhaes
a07c3fc9e3 Add --current flag to bump-version.sh for displaying current versions
- Introduced `--current` flag to show the current App and Chart versions.
- Improved user guidance with updated usage instructions and scripts output.
- Added post-merge steps to the version bump process.
2026-02-07 22:02:53 -05:00
Joao Gilberto Magalhaes
8d24cdb513 Update logo ASCII art in main.py and bump Alpine base image to 3.23 2026-02-06 21:07:45 -05:00
Joao Gilberto Magalhaes
714fe2fc5b Remove .gitpod.yml and uv.lock, update Dockerfile to include uv sync
- Deleted `.gitpod.yml` to stop using Gitpod-specific configuration.
- Added `uv.lock` for dependency versioning.
- Updated Dockerfile to include `uv sync --no-dev` in the build process.
2026-02-06 20:52:10 -05:00
Joao Gilberto Magalhaes
7363538b5e Switch to uv for dependency management and streamline Dockerfile
- Replaced `pip install` with `uv sync --frozen` for improved dependency handling.
- Simplified Dockerfile by removing unused packages and redundant commands.
- Updated test and execution steps to utilize `uv` for consistency.
2026-02-06 20:36:26 -05:00
Joao Gilberto Magalhaes
17f40bf2bd Update CI workflow to use uv sync for dependency installation and streamline test execution
- Replaced `pip install` with `uv sync --group dev` for dependency management.
- Adjusted test step to ensure `uv` commands are properly initialized in the PATH.
2026-02-06 20:23:58 -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 Gilberto Magalhaes
b8848c8303 Update containerenv tests to include new ingress status fields
- Added support for new configuration fields: `update_ingress_status`, `deployment_mode`, `external_hostname`, and `ingress_status_update_interval`.
- Updated assertions in test cases to validate the presence of these fields.
2025-12-15 21:18:49 -05:00
Joao Gilberto Magalhaes
542fab1607 Add ingress status update functionality to support various deployment modes
- Introduced `ingressStatus` configuration in Helm values to enable status updates and customize deployment modes (auto, daemonset, nodeport, clusterip).
- Implemented logic in the processor to detect deployment mode, retrieve ingress addresses, and update ingress status dynamically.
- Updated Kubernetes manifests to grant required permissions for `ingresses/status` operations and pass necessary environment variables for configuration.
- Adjusted Helm templates and associated Kubernetes examples to reflect the new ingress status update capability.
2025-12-15 21:11:02 -05:00
Joao Gilberto Magalhaes
c8f8320cfe Add IngressClass resource and update references to spec.ingressClassName across templates, examples, and documentation for consistency and backward compatibility
- Introduced new IngressClass resource in Helm templates to define `easyhaproxy` as the default ingress class.
- Updated Kubernetes examples to replace `easyhaproxy-ingress` with `easyhaproxy` as the ingress class name.
- Enhanced processor logic to support both the new `spec.ingressClassName` field and the deprecated `kubernetes.io/ingress.class` annotation.
- Revised documentation to reflect the changes and ensure alignment with Kubernetes recommendations.
2025-12-15 20:33:51 -05:00
Joao Gilberto Magalhaes
e8aceda402 Replace deprecated kubernetes.io/ingress.class annotation with spec.ingressClassName in Kubernetes examples and processor logic for compatibility with Kubernetes v1.22+. Updated documentation and examples to reflect the change while maintaining backward compatibility. 2025-12-15 19:58:08 -05:00
Joao Gilberto Magalhaes
a577601e52 Add Sponsor and Artifact Hub badges to README.md 2025-12-04 21:07:11 -05:00
Joao Gilberto Magalhaes
71ca8f6a9d Bump version to 5.0.0 across repository for major release
- Updated all references from `4.6.0` to `5.0.0` in Docker, Kubernetes, and Swarm configurations, as well as Helm chart and documentation.
- Updated `RELEASE.md` with new version history and highlights.
- Aligned all deployment examples and documentation with the new version to ensure consistency.
2025-12-04 13:12:12 -05:00
Joao Gilberto Magalhaes
be9a99eb79 Automate version bumping with bump-version.sh script
- Added `scripts/bump-version.sh` to centralize and streamline version updates across repository components (images, docs, Helm chart).
- Updated release process in `RELEASE.md` to incorporate the version bump script for creating PRs and manual version verification.
- Modified CI workflows to verify pre-bumped versions instead of auto-updating during tag builds.
- Simplified version management and enhanced consistency in deployment artifacts.
2025-12-04 13:07:24 -05:00
Joao Gilberto Magalhaes
0324267adf
Merge pull request #64 from byjg/plugins
Implement Plugin System with Built-in Plugins and Comprehensive Examples
2025-12-04 11:40:07 -05:00
Joao Gilberto Magalhaes
85ba5723a0 Bump chart version to 1.0.0 to signify stable release. 2025-12-04 11:29:33 -05:00
Joao Gilberto Magalhaes
525e1b170d Reorganize documentation sidebar positions and update HAProxy stats configuration
- Updated sidebar positions across multiple documentation files for improved navigation and logical grouping.
- Revised HAProxy stats configuration to require `HAPROXY_PASSWORD` for enabling statistics.
- Clarified environment variable descriptions and usage in `environment-variable.md`.
2025-12-04 11:27:18 -05:00
Joao Gilberto Magalhaes
3c7ef2d2a8 Update Swarm documentation to replace tags dynamically during release
- Added release tag replacement logic for `docs/swarm.md` to align with Kubernetes and Helm documentation updates.
- Ensured consistency in versioning across all deployment examples and documentation.
2025-12-04 11:18:19 -05:00
Joao Gilberto Magalhaes
0add881a87 Update JWT Validator examples and documentation with key generation steps
- Updated `docker-compose-jwt-validator.yml` to reference `generate-keys.sh` for key generation.
- Revised plugin documentation to include detailed steps for generating JWT keys directly.
- Simplified configuration instructions to improve clarity and consistency.
2025-12-04 11:02:32 -05:00
Joao Gilberto Magalhaes
e1d2cb3b59 Update Cloudflare examples to improve IP list as part of idempotent configuration
- Added `echo Are there some specific_headers missing?`
- These required unlocks plugin documentation consistency
2025-12-04 10:22:16 -05:00
Joao Gilberto Magalhaes
b9a9bee0b9 Revamp Swarm example documentation and streamline deployment instructions
- Consolidated and simplified Swarm example README to focus on YAML header comments for documentation.
- Removed redundant and extended sections, replacing with concise steps for getting started.
- Standardized YAML headers across `easyhaproxy.yml`, `services.yml`, and `portainer.yml` with a clearer and more readable format.
- Enhanced user guidance for deployment, setup requirements, verification, and cleanup.
2025-12-04 10:07:17 -05:00
Joao Gilberto Magalhaes
5397f0166e Remove version directive from all Docker Compose and Swarm configuration files.
- Eliminated the `version` field across various examples and documentation for simplicity and alignment with newer Docker Compose and Swarm standards.
- Updated relevant documentation and example usage instructions accordingly.
2025-12-04 09:25:05 -05:00
Joao Gilberto Magalhaes
99f4ff325b Update logging level for plugin loading and extend static example documentation
- Changed logging level from `info` to `debug` in plugin loading to reduce verbosity during runtime.
- Significantly expanded `examples/static/README.md` with new sections, examples (basic, certbot, deny pages, JWT validator), and detailed usage instructions.
- Improved `examples/docker/docker-compose-changed-label.yml` with clearer redirect syntax using JSON for better readability.
- Fixed handling of empty or invalid JSON in labels within `easymapping` with fallback to default values and error logging.
- Added additional entries to `.gitignore` to exclude dynamic and temporary files like auto-generated configuration files and certificates.
2025-12-04 09:09:33 -05:00
Joao Gilberto Magalhaes
3a4b428e46 Add generate-keys.sh script for SSL and JWT key generation and update examples
- Added `generate-keys.sh` script to automate the generation of SSL certificates and JWT keys for testing.
- Updated examples and documentation across Docker, Kubernetes, Swarm, and static directories to include instructions for running the script.
- Removed hardcoded .pem files and replaced with dynamically generated keys and certificates.
- Emphasized testing-only usage of self-signed certificates.
2025-12-02 12:28:22 -05:00
Joao Gilberto Magalhaes
d3149637b4 Add detailed release guide and update Makefile test command
- Introduced `RELEASE.md` with comprehensive steps for creating, automating, and troubleshooting EasyHAProxy releases.
- Enhanced the Makefile `test` command to include verbosity in the pytest execution.
2025-12-02 11:54:47 -05:00
Joao Gilberto Magalhaes
50ffb4fe16 Add environment variable documentation for all plugins, reorganize plugin files for consistency
- Introduced environment variable support in documentation for Cloudflare, Cleanup, Deny Pages, IP Whitelist, JWT Validator, and FastCGI plugins.
- Updated plugin files with consistent headings, examples, and tables for easier configuration reference.
- Adjusted `README.md` and `plugins.md` to reflect updated plugin paths and environment variable usage.
2025-12-02 11:47:19 -05:00
Joao Gilberto Magalhaes
b4944ac544 Add use_builtin_ips support and reorganize plugin documentation
- Enhanced Cloudflare Plugin with `use_builtin_ips` option to automatically use and update built-in IP ranges.
- Updated Cloudflare IP restoration logic, including metadata and HAProxy config generation.
- Reorganized plugin documentation with sidebar positions for improved accessibility.
- Extended Cloudflare documentation to detail built-in IP ranges, examples, and configurations.
- Added new test cases to validate `use_builtin_ips` functionality and file handling.
2025-12-01 18:00:52 -05:00
Joao Gilberto Magalhaes
56fc86d77d Add allow_anonymous option to JwtValidatorPlugin
- Introduced `allow_anonymous` configuration option to permit requests without an Authorization header.
- Updated HAProxy configuration to handle optional JWT validation for anonymous access.
- Enhanced documentation with use cases, examples, and configuration details for `allow_anonymous`.
- Adjusted tests and plugin logic to support anonymous access scenarios.
2025-12-01 17:43:05 -05:00
Joao Gilberto Magalhaes
ae6eb1b55a Add detailed plugin documentation for Cleanup, Cloudflare, Deny Pages, IP Whitelist, JWT Validator, and FastCGI plugins
- Added individual markdown files with examples, configuration options, and HAProxy outputs for each plugin.
- Updated `README.md` to link plugin-specific documentation.
- Enhanced `plugins.md` to summarize plugin features and usage.
- Included Docker, Kubernetes, Swarm, and static configuration examples for all plugins.
2025-12-01 13:36:11 -05:00
Joao Gilberto Magalhaes
883521e7e1 Add FastCGI Plugin for PHP-FPM support with examples, tests, and documentation
- Introduced `FastcgiPlugin` for automatic HAProxy `fcgi-app` configuration generation.
- Added example Docker Compose setup for PHP-FPM with FastCGI.
- Updated documentation with detailed examples and usage instructions for FastCGI.
- Included test cases to validate plugin behavior and generated configurations.
- Enhanced `easymapping` to support `fcgi-app` definitions in global configs.
2025-12-01 13:04:32 -05:00
Joao Gilberto Magalhaes
a993025718 Add FastCGI support for PHP-FPM and backend server protocol configuration
- Introduced `proto` and `socket` options for backend communication, supporting protocols like FastCGI (fcgi) and HTTP/2 (h2).
- Updated HAProxy configuration templates to handle Unix socket paths and protocol-specific settings.
- Enhanced documentation with examples for FastCGI using Unix sockets and TCP connections.
- Added new tests to validate FastCGI support, including expected configuration generation.
2025-11-30 13:23:56 -05:00
Joao Gilberto Magalhaes
51f8cd4659 Add path-based JWT validation support in JwtValidatorPlugin
- Introduced `paths` and `only_paths` configuration options to define protected API paths.
- Enhanced HAProxy configuration generation to handle path-specific JWT validation.
- Updated plugin metadata to include path details and validation logic.
- Modified documentation with detailed examples for protecting paths.
- Added comprehensive tests for path-based validation scenarios and edge cases.
2025-11-28 10:38:09 -05:00
Joao Gilberto Magalhaes
90e0df42a1 Fix blank line addition in docker.txt configuration 2025-11-27 20:36:41 -05:00
Joao Gilberto Magalhaes
d3637e737a Refactor plugin configuration examples and improve formatting in documentation
- Replaced `config.yml` with modular configuration examples: `config-basic.yml`, `config-certbot.yml`, `config-deny-pages.yml`, and `config-jwt-validator.yml`.
- Improved examples with detailed usage instructions, prerequisites, and testing steps for each configuration.
- Fixed indentation and formatting inconsistencies across plugin files and HAProxy configuration generation.
- Streamlined README comparison table for static vs. dynamic discovery.
- Updated `docker-compose-jwt-validator.yml` to correct audience key formatting.
2025-11-27 19:49:32 -05:00