Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e8aceda
Replace deprecated `kubernetes.io/ingress.class` annotation with `spe…
byjg Dec 16, 2025
c8f8320
Add IngressClass resource and update references to `spec.ingressClass…
byjg Dec 16, 2025
542fab1
Add ingress status update functionality to support various deployment…
byjg Dec 16, 2025
b8848c8
Update `containerenv` tests to include new ingress status fields
byjg Dec 16, 2025
55d0d1a
Modernizing PyThon Projec
byjg Jan 23, 2026
62e5c05
Refactor: modernize codebase by replacing deprecated patterns, simpli…
byjg Jan 23, 2026
dc28b18
Fix lint errors
byjg Jan 23, 2026
17f40bf
Update CI workflow to use `uv sync` for dependency installation and s…
byjg Feb 7, 2026
7363538
Switch to `uv` for dependency management and streamline Dockerfile
byjg Feb 7, 2026
714fe2f
Remove `.gitpod.yml` and `uv.lock`, update Dockerfile to include `uv …
byjg Feb 7, 2026
8d24cdb
Update logo ASCII art in `main.py` and bump Alpine base image to 3.23
byjg Feb 7, 2026
a07c3fc
Add `--current` flag to `bump-version.sh` for displaying current vers…
byjg Feb 8, 2026
343987a
Update secrets configuration in CI workflow for `DOC_TOKEN`
byjg Feb 8, 2026
5767e55
Refactor Docker Compose examples and plugins, add pytest tests
byjg Feb 12, 2026
90b01b1
Add Kubernetes integration tests for EasyHAProxy examples
byjg Feb 12, 2026
1fd5873
Add Cloudflare plugin tests with base64-encoded IP list support
byjg Feb 12, 2026
b34d782
Remove Python app example and replace with header-echo server for tes…
byjg Feb 12, 2026
d66c4f8
Migrate examples to `tests_e2e` directory structure
byjg Feb 12, 2026
f463020
Refactor and consolidate E2E test utilities and fixtures
byjg Feb 12, 2026
0a400b9
Add improved output formatting and new manual test workflows
byjg Feb 12, 2026
bec9195
Update CI workflow to adjust job dependencies and remove conditional …
byjg Feb 12, 2026
4160bab
Update CI workflow to adjust job dependencies and remove conditional …
byjg Feb 12, 2026
904a102
Enhance logging and error handling in E2E tests and CI workflows
byjg Feb 12, 2026
c125985
Refactor Docker Compose E2E tests: consolidate file creation and opti…
byjg Feb 12, 2026
97845b8
Refactor E2E tests and configuration format
byjg Feb 13, 2026
ece012a
Introduce plugin initialization phase and consolidate config handling
byjg Feb 13, 2026
2e45c3f
Add unit and integration tests for Certbot and HAProxy configuration
byjg Feb 14, 2026
3e96322
Add ACME/Certbot E2E tests with Pebble integration and update depende…
byjg Feb 14, 2026
045dd38
Migrate configuration paths to `/etc/easyhaproxy` and improve health …
byjg Feb 15, 2026
4df8666
Add health checks for Docker services, ACME environment readiness val…
byjg Feb 16, 2026
aa518e9
Adjust health checks and retry logic in E2E tests for improved CI rel…
byjg Feb 16, 2026
b867bb7
Adjust health checks and retry logic in E2E tests for improved CI rel…
byjg Feb 16, 2026
1493beb
Remove Pebble health check container and replace with Python-based he…
byjg Feb 16, 2026
9d1e947
Refactor ACME/Certbot E2E test fixture to use staged service startup …
byjg Feb 16, 2026
6997777
Add Pebble readiness debug logs and skip ACME tests in specific CI en…
byjg Feb 16, 2026
4646572
Update ACME E2E tests: use specific Docker Compose file and ensure co…
byjg Feb 16, 2026
c340de1
Refactor ACME E2E tests: add Pebble health check container, simplify …
byjg Feb 16, 2026
4aba68d
Improve SSL and ACME documentation
byjg Feb 16, 2026
776f216
Add support for proxy-awareness headers: X-Forwarded-For, X-Forwarded…
byjg Feb 16, 2026
353fd39
Add support for proxy-awareness headers: X-Forwarded-For, X-Forwarded…
byjg Feb 16, 2026
491f4a8
Add support for CORS in HAProxy stats dashboard
byjg Feb 17, 2026
3805100
Refactor E2E tests: add `wait_for_json_response` helper for robust JS…
byjg Feb 17, 2026
bfd38ad
Add standalone Python entrypoint for EasyHAProxy and pip-based instal…
byjg Feb 18, 2026
44cb3dd
Refactor Dockerfile for multi-stage build and runtime optimization
byjg Feb 18, 2026
53c3249
Remove Diffie-Hellman parameter generation and references in template…
byjg Feb 18, 2026
48f6e1f
Migrate build assets and scripts to `deploy/docker` structure
byjg Feb 18, 2026
d894778
Add Certbot and HAProxy management modules, container environment par…
byjg Feb 18, 2026
16fcee4
Bump version to 6.0.0 and update release notes for major changes
byjg Feb 18, 2026
d9c7ff8
Set `pytest.fixture` scope to `class`, add Swarm E2E tests, and updat…
byjg Feb 18, 2026
5a9f14e
Refactor Swarm E2E tests: optimize timeouts, enhance stack deployment…
byjg Feb 18, 2026
8532d49
Refactor Swarm E2E tests: optimize timeouts, enhance stack deployment…
byjg Feb 18, 2026
3fd0fe0
Update plugin paths from `/etc/haproxy` to `/etc/easyhaproxy` across …
byjg Feb 18, 2026
3710b08
Add Docker build and cache cleanup steps in CI, prevent redundant bui…
byjg Feb 18, 2026
8149521
Add Docker build and cache cleanup steps in CI, prevent redundant bui…
byjg Feb 18, 2026
1262946
Refine Kubernetes E2E polling logic to check backend readiness beyond…
byjg Feb 18, 2026
711bb43
Prepare version 6.0.0
byjg Feb 18, 2026
9eb0ab6
Merge branch 'master' into ingressclassname
byjg Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 150 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,134 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install requirements
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
cd src/
pip install -r requirements.txt
export PATH="$HOME/.local/bin:$PATH"
uv sync --group dev

- name: Run tests
run: |
cd src/
pytest -s tests/ -vv
export PATH="$HOME/.local/bin:$PATH"
uv run pytest -s tests/ -vv

Tests-E2E-Docker:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [Test]
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
export PATH="$HOME/.local/bin:$PATH"
uv sync --group dev

- name: Run Docker Compose E2E tests
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run pytest tests_e2e/test_docker_compose.py -sv --tb=short

Tests-E2E-Kubernetes:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [Test]
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
export PATH="$HOME/.local/bin:$PATH"
uv sync --group dev

- name: Run Kubernetes E2E tests
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run pytest tests_e2e/test_kubernetes.py -sv --tb=short

Tests-E2E-Additional:
runs-on: ubuntu-latest
needs: [Test]
timeout-minutes: 20
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
export PATH="$HOME/.local/bin:$PATH"
uv sync --group dev

- name: Clean Docker build cache
run: docker builder prune -af

- name: Run Static E2E tests
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run pytest tests_e2e/test_static.py -sv --tb=short

- name: Run Proxy Headers E2E tests
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run pytest tests_e2e/test_proxy_headers.py -sv --tb=short

Tests-E2E-Swarm:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [Test]
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
export PATH="$HOME/.local/bin:$PATH"
uv sync --group dev

- name: Clean Docker build cache
run: docker builder prune -af

- name: Build Docker image
env:
DOCKER_BUILDKIT: "0"
run: docker build -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .

- name: Run Swarm E2E tests
run: |
export PATH="$HOME/.local/bin:$PATH"
uv run pytest tests_e2e/test_swarm.py -sv --tb=short

Build:
runs-on: ubuntu-latest
needs: Test
needs: [Test, Tests-E2E-Docker, Tests-E2E-Kubernetes, Tests-E2E-Additional, Tests-E2E-Swarm]
permissions:
contents: read
packages: write
Expand All @@ -64,7 +179,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log into registry
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
if: github.event_name == 'push' || github.event.inputs.push == 'true'
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
Expand Down Expand Up @@ -127,11 +242,11 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: build/Dockerfile
file: deploy/docker/Dockerfile
build-args: |
RELEASE_VERSION_ARG="${{ steps.tags.outputs.result }}"
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }}
push: ${{ github.event_name == 'push' || github.event.inputs.push == 'true' }}
tags: ${{ steps.normalized.outputs.result }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -140,12 +255,35 @@ jobs:


# - name: Docker Hub Description
# if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
# if: github.event_name == 'push' || github.event.inputs.push == 'true'
# run: |
# wget -q https://github.com/christian-korneck/docker-pushrm/releases/download/v1.8.0/docker-pushrm_linux_amd64 -O $HOME/.docker/cli-plugins/docker-pushrm
# chmod +x $HOME/.docker/cli-plugins/docker-pushrm
# docker pushrm ${{ env.IMAGE_NAME }}

Publish-PyPI:
runs-on: ubuntu-latest
needs: [Test, Tests-E2E-Docker, Tests-E2E-Kubernetes, Tests-E2E-Additional, Tests-E2E-Swarm]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
id-token: write # Required for OIDC trusted publisher

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Build package
run: |
export PATH="$HOME/.local/bin:$PATH"
uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

Helm:
runs-on: 'ubuntu-latest'
needs: Build
Expand Down Expand Up @@ -191,4 +329,5 @@ jobs:
with:
folder: devops
project: ${{ github.event.repository.name }}
secrets: inherit
secrets:
DOC_TOKEN: ${{ secrets.DOC_TOKEN }}
27 changes: 18 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ __pycache__
.pytest_cache
*.pyc
.env
/examples/static/conf/config.yml
/examples/docker/certs/haproxy/.place_holder_cert.pem
/examples/static/host1.local.pem
/examples/swarm/certs/host1.local.pem
/examples/docker/host2.local.pem
/examples/swarm/certs/host2.local.pem
/examples/docker/jwt_private.pem
/examples/docker/jwt_pubkey.pem
/examples/docker/cloudflare_ips.lst

# uv
.venv/

# Build artifacts
dist/
*.egg-info/

/tests_e2e/static/conf/config.yml
/tests_e2e/docker/certs/haproxy/.place_holder_cert.pem
/tests_e2e/static/host1.local.pem
/tests_e2e/swarm/certs/host1.local.pem
/tests_e2e/docker/host2.local.pem
/tests_e2e/swarm/certs/host2.local.pem
/tests_e2e/docker/jwt_private.pem
/tests_e2e/docker/jwt_pubkey.pem
/tests_e2e/docker/cloudflare_ips.lst
/tests_e2e/docker/pebble-ca.pem
9 changes: 0 additions & 9 deletions .gitpod.yml

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
5 changes: 3 additions & 2 deletions .run/pytest in tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="SDK_NAME" value="Python 3.12 (docker-easy-haproxy)" />
<option name="SDK_NAME" value="uv (docker-easy-haproxy)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="RUN_TOOL" value="true" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/src/tests&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
Expand Down
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@ VERSION := $(shell git rev-parse --short HEAD)

.PHONY: build
build:
docker build -t byjg/easy-haproxy --build-arg RELEASE_VERSION_ARG="$(VERSION)" -t byjg/easy-haproxy:local -f build/Dockerfile .
docker build -t byjg/easy-haproxy --build-arg RELEASE_VERSION_ARG="$(VERSION)" -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .

.PHONY: test
test:
cd src/ && pytest tests/ -vv
uv run pytest tests/ -vv

.PHONY: sync
sync:
uv sync --dev

.PHONY: lint
lint:
uv run ruff check src/ tests/

.PHONY: fix
fix:
uv run ruff check --fix src/ tests/

.PHONY: format
format:
uv run ruff format src/ tests/
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,47 @@ Detailed configuration guides for advanced setups:
- [Other Configurations](docs/other.md) - Additional configurations (ports, custom errors, etc.)
- [Limitations](docs/limitations.md) - Important limitations and considerations

## Development

### Requirements

- Python 3.11 or higher
- [uv](https://github.com/astral-sh/uv) package manager

### Installation for Development

```bash
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/byjg/docker-easy-haproxy.git
cd docker-easy-haproxy

# Install dependencies (creates virtual environment automatically)
uv sync --dev

# Run tests
make test
# or directly: uv run pytest tests/ -vv

# Run linting
make lint

# Format code
make format
```

### Installing the Package

```bash
# Install with uv
uv pip install easymapping

# Or install from source
uv pip install -e ".[dev]"
```

## See EasyHAProxy in action

Click on the image to see the videos (use HD for better visualization)
Expand All @@ -111,7 +152,7 @@ Click on the image to see the videos (use HD for better visualization)
[![Static Configuration](docs/video-static.png)](https://youtu.be/B_bYZnRTGJM)
[![TCP Mode](docs/video-tcp-mysql.png)](https://youtu.be/JHqcq9crbDI)

[Here is the code](https://gist.github.com/byjg/e125e478a0562190176d69ea795fd3d4) applied in the examples above.
[Here is the code](https://gist.github.com/byjg/e125e478a0562190176d69ea795fd3d4) applied in the test examples above.


----
Expand Down
5 changes: 3 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ EasyHAProxy follows [Semantic Versioning](https://semver.org/):
- **MINOR**: New features, plugin additions, backward-compatible changes
- **PATCH**: Bug fixes, documentation updates, minor improvements

**Current Version:** `5.0.0` (as of Chart.yaml)
**Current Version:** `6.0.0` (as of Chart.yaml)

## Automated Release (Recommended)

Expand All @@ -80,7 +80,7 @@ The automated release process is triggered by pushing a semantic version tag.
```bash
make build
# Or manually:
docker build -t byjg/easy-haproxy:local -f build/Dockerfile .
docker build -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .
```

### Step 2: Bump Versions (script + PR)
Expand Down Expand Up @@ -329,6 +329,7 @@ helm show chart byjg/easyhaproxy

| Version | Release Date | Type | Highlights |
|---------|--------------|-------|---------------------------------------------------------------------------------------------------------------------------------------|
| 6.0.0 | 2026-XX-XX | Major | Python module refactoring (one-class-per-file), IngressClassName support (spec.ingressClassName + deprecated annotation fallback), modernized build system (uv/pyproject.toml), improved version management and release tooling, GitHub Actions workflow_dispatch push control |
| 5.0.0 | 2025-12-04 | Major | Plugin framework (builtin plugins: JWT, FastCGI, Cloudflare, IP whitelist, deny pages, cleanup), docs restructure, examples refreshed |
| 4.6.0 | 2024-11-27 | Minor | FastCGI plugin, JWT enhancements |
| 4.5.0 | 2024-XX-XX | Minor | Previous release |
Expand Down
2 changes: 1 addition & 1 deletion build-multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ podman run --rm --events-backend=file --cgroup-manager=cgroupfs --privileged doc

for VERSION in $VERSIONS
do
DOCKERFILE=build/Dockerfile
DOCKERFILE=deploy/docker/Dockerfile

buildah manifest create byjg/easy-haproxy:$VERSION

Expand Down
Loading