easyhaproxy 6.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- easyhaproxy-6.0.0/.dockerignore +4 -0
- easyhaproxy-6.0.0/.github/FUNDING.yml +3 -0
- easyhaproxy-6.0.0/.github/dependabot.yml +11 -0
- easyhaproxy-6.0.0/.github/workflows/build.yml +333 -0
- easyhaproxy-6.0.0/.gitignore +26 -0
- easyhaproxy-6.0.0/.python-version +1 -0
- easyhaproxy-6.0.0/.run/pytest in tests.run.xml +22 -0
- easyhaproxy-6.0.0/.vscode/launch.json +35 -0
- easyhaproxy-6.0.0/.vscode/settings.json +6 -0
- easyhaproxy-6.0.0/CONTRIBUTING.md +36 -0
- easyhaproxy-6.0.0/LICENSE +21 -0
- easyhaproxy-6.0.0/Makefile +25 -0
- easyhaproxy-6.0.0/PKG-INFO +206 -0
- easyhaproxy-6.0.0/README.md +159 -0
- easyhaproxy-6.0.0/RELEASE.md +343 -0
- easyhaproxy-6.0.0/build-multiarch.sh +31 -0
- easyhaproxy-6.0.0/deploy/docker/Dockerfile +53 -0
- easyhaproxy-6.0.0/deploy/docker/assets/entrypoint.sh +13 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/conf.d/README.md +5 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/400.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/403.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/408.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/500.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/502.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/503.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/assets/etc/easyhaproxy/haproxy/errors-custom/504.http +25 -0
- easyhaproxy-6.0.0/deploy/docker/docker-compose.yml +38 -0
- easyhaproxy-6.0.0/deploy/kubernetes/README.md +91 -0
- easyhaproxy-6.0.0/deploy/kubernetes/easyhaproxy-clusterip.yml +220 -0
- easyhaproxy-6.0.0/deploy/kubernetes/easyhaproxy-daemonset.yml +195 -0
- easyhaproxy-6.0.0/deploy/kubernetes/easyhaproxy-nodeport.yml +220 -0
- easyhaproxy-6.0.0/docs/Plugins/cleanup.md +84 -0
- easyhaproxy-6.0.0/docs/Plugins/cloudflare.md +129 -0
- easyhaproxy-6.0.0/docs/Plugins/deny-pages.md +127 -0
- easyhaproxy-6.0.0/docs/Plugins/fastcgi.md +177 -0
- easyhaproxy-6.0.0/docs/Plugins/ip-whitelist.md +126 -0
- easyhaproxy-6.0.0/docs/Plugins/jwt-validator.md +385 -0
- easyhaproxy-6.0.0/docs/acme.md +294 -0
- easyhaproxy-6.0.0/docs/container-labels.md +150 -0
- easyhaproxy-6.0.0/docs/digitalocean.md +15 -0
- easyhaproxy-6.0.0/docs/docker.md +79 -0
- easyhaproxy-6.0.0/docs/dokku.md +11 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_digitalocean.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_docker.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_dokku.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_helm.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_kubernetes.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_logo.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_microk8s.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_static.png +0 -0
- easyhaproxy-6.0.0/docs/easyhaproxy_swarm.png +0 -0
- easyhaproxy-6.0.0/docs/environment-variable.md +33 -0
- easyhaproxy-6.0.0/docs/helm.md +85 -0
- easyhaproxy-6.0.0/docs/icons.xcf +0 -0
- easyhaproxy-6.0.0/docs/kubernetes.md +514 -0
- easyhaproxy-6.0.0/docs/limitations.md +38 -0
- easyhaproxy-6.0.0/docs/logo.png +0 -0
- easyhaproxy-6.0.0/docs/logo.xcf +0 -0
- easyhaproxy-6.0.0/docs/microk8s.md +80 -0
- easyhaproxy-6.0.0/docs/other.md +74 -0
- easyhaproxy-6.0.0/docs/pip.md +211 -0
- easyhaproxy-6.0.0/docs/plugin-development.md +2094 -0
- easyhaproxy-6.0.0/docs/plugins.md +422 -0
- easyhaproxy-6.0.0/docs/ssl.md +144 -0
- easyhaproxy-6.0.0/docs/static.md +140 -0
- easyhaproxy-6.0.0/docs/swarm.md +109 -0
- easyhaproxy-6.0.0/docs/video-docker-ssl.png +0 -0
- easyhaproxy-6.0.0/docs/video-docker.png +0 -0
- easyhaproxy-6.0.0/docs/video-kubernetes-letsencrypt.png +0 -0
- easyhaproxy-6.0.0/docs/video-kubernetes.png +0 -0
- easyhaproxy-6.0.0/docs/video-static.png +0 -0
- easyhaproxy-6.0.0/docs/video-tcp-mysql.png +0 -0
- easyhaproxy-6.0.0/docs/volumes.md +198 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/.helmignore +23 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/Chart.yaml +26 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/LICENSE +21 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/README.md +74 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/_helpers.tpl +62 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/clusterrole.yaml +65 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/clusterrolebinding.yaml +22 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/deployment.yaml +94 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/ingressclass.yaml +14 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/service.yaml +34 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/templates/serviceaccount.yaml +13 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/values.schema.json +19 -0
- easyhaproxy-6.0.0/helm/easyhaproxy/values.yaml +98 -0
- easyhaproxy-6.0.0/pyproject.toml +94 -0
- easyhaproxy-6.0.0/scripts/bump-version.sh +160 -0
- easyhaproxy-6.0.0/src/easyhaproxy/__init__.py +0 -0
- easyhaproxy-6.0.0/src/easyhaproxy/main.py +234 -0
- easyhaproxy-6.0.0/src/easymapping/__init__.py +4 -0
- easyhaproxy-6.0.0/src/easymapping/config_generator.py +310 -0
- easyhaproxy-6.0.0/src/easymapping/label_handler.py +52 -0
- easyhaproxy-6.0.0/src/functions/__init__.py +21 -0
- easyhaproxy-6.0.0/src/functions/certbot.py +220 -0
- easyhaproxy-6.0.0/src/functions/consts.py +59 -0
- easyhaproxy-6.0.0/src/functions/container_env.py +187 -0
- easyhaproxy-6.0.0/src/functions/filter.py +31 -0
- easyhaproxy-6.0.0/src/functions/functions.py +88 -0
- easyhaproxy-6.0.0/src/functions/haproxy.py +152 -0
- easyhaproxy-6.0.0/src/functions/loggers.py +13 -0
- easyhaproxy-6.0.0/src/plugins/__init__.py +13 -0
- easyhaproxy-6.0.0/src/plugins/builtin/__init__.py +1 -0
- easyhaproxy-6.0.0/src/plugins/builtin/cleanup.py +124 -0
- easyhaproxy-6.0.0/src/plugins/builtin/cloudflare.py +222 -0
- easyhaproxy-6.0.0/src/plugins/builtin/deny_pages.py +106 -0
- easyhaproxy-6.0.0/src/plugins/builtin/fastcgi.py +156 -0
- easyhaproxy-6.0.0/src/plugins/builtin/ip_whitelist.py +107 -0
- easyhaproxy-6.0.0/src/plugins/builtin/jwt_validator.py +335 -0
- easyhaproxy-6.0.0/src/plugins/interface.py +51 -0
- easyhaproxy-6.0.0/src/plugins/manager.py +216 -0
- easyhaproxy-6.0.0/src/plugins/types.py +46 -0
- easyhaproxy-6.0.0/src/processor/__init__.py +7 -0
- easyhaproxy-6.0.0/src/processor/docker.py +35 -0
- easyhaproxy-6.0.0/src/processor/interface.py +87 -0
- easyhaproxy-6.0.0/src/processor/kubernetes.py +462 -0
- easyhaproxy-6.0.0/src/processor/static.py +143 -0
- easyhaproxy-6.0.0/src/processor/swarm.py +50 -0
- easyhaproxy-6.0.0/src/templates/bind.j2 +8 -0
- easyhaproxy-6.0.0/src/templates/frontend-mode-http.j2 +24 -0
- easyhaproxy-6.0.0/src/templates/frontend-mode-tcp.j2 +6 -0
- easyhaproxy-6.0.0/src/templates/haproxy.cfg.j2 +136 -0
- easyhaproxy-6.0.0/src/templates/ssl_default.j2 +10 -0
- easyhaproxy-6.0.0/src/templates/ssl_loose.j2 +8 -0
- easyhaproxy-6.0.0/src/templates/ssl_strict.j2 +7 -0
- easyhaproxy-6.0.0/tests/__init__.py +0 -0
- easyhaproxy-6.0.0/tests/conftest.py +43 -0
- easyhaproxy-6.0.0/tests/expected/docker.txt +111 -0
- easyhaproxy-6.0.0/tests/expected/no-services.txt +29 -0
- easyhaproxy-6.0.0/tests/expected/services-fcgi.txt +60 -0
- easyhaproxy-6.0.0/tests/expected/services-letsencrypt.txt +103 -0
- easyhaproxy-6.0.0/tests/expected/services-multi-containers.txt +48 -0
- easyhaproxy-6.0.0/tests/expected/services-multiple-hosts.txt +84 -0
- easyhaproxy-6.0.0/tests/expected/services-redirect-ssl.txt +89 -0
- easyhaproxy-6.0.0/tests/expected/services-tcp.txt +43 -0
- easyhaproxy-6.0.0/tests/expected/services.txt +135 -0
- easyhaproxy-6.0.0/tests/expected/ssl-loose.txt +40 -0
- easyhaproxy-6.0.0/tests/expected/ssl-strict.txt +26 -0
- easyhaproxy-6.0.0/tests/expected/static-cors.txt +75 -0
- easyhaproxy-6.0.0/tests/expected/static.txt +120 -0
- easyhaproxy-6.0.0/tests/fixtures/00_haproxy.cfg +2 -0
- easyhaproxy-6.0.0/tests/fixtures/10_haproxy.cfg +2 -0
- easyhaproxy-6.0.0/tests/fixtures/no-services +5 -0
- easyhaproxy-6.0.0/tests/fixtures/run_bash.sh +7 -0
- easyhaproxy-6.0.0/tests/fixtures/services +6 -0
- easyhaproxy-6.0.0/tests/fixtures/services-changed-label +6 -0
- easyhaproxy-6.0.0/tests/fixtures/services-clone-to-ssl +2 -0
- easyhaproxy-6.0.0/tests/fixtures/services-fcgi +16 -0
- easyhaproxy-6.0.0/tests/fixtures/services-letsencrypt +4 -0
- easyhaproxy-6.0.0/tests/fixtures/services-multi-containers +2 -0
- easyhaproxy-6.0.0/tests/fixtures/services-multiple-hosts +3 -0
- easyhaproxy-6.0.0/tests/fixtures/services-redirect-ssl +3 -0
- easyhaproxy-6.0.0/tests/fixtures/services-tcp +2 -0
- easyhaproxy-6.0.0/tests/fixtures/services-with-cloudflare +8 -0
- easyhaproxy-6.0.0/tests/fixtures/services-with-deny-pages +10 -0
- easyhaproxy-6.0.0/tests/fixtures/services-with-ip-whitelist +10 -0
- easyhaproxy-6.0.0/tests/fixtures/services-with-jwt-validator +12 -0
- easyhaproxy-6.0.0/tests/fixtures/services-with-multiple-plugins +10 -0
- easyhaproxy-6.0.0/tests/fixtures/static.yml +27 -0
- easyhaproxy-6.0.0/tests/fixtures/static_cors.yml +11 -0
- easyhaproxy-6.0.0/tests/fixtures/static_multi_domain.yml +13 -0
- easyhaproxy-6.0.0/tests/test_certbot.py +888 -0
- easyhaproxy-6.0.0/tests/test_certbot_haproxy_config.py +414 -0
- easyhaproxy-6.0.0/tests/test_containerenv.py +454 -0
- easyhaproxy-6.0.0/tests/test_daemonize.py +60 -0
- easyhaproxy-6.0.0/tests/test_docker.py +108 -0
- easyhaproxy-6.0.0/tests/test_functions.py +141 -0
- easyhaproxy-6.0.0/tests/test_kubernetes_processor.py +419 -0
- easyhaproxy-6.0.0/tests/test_labels.py +33 -0
- easyhaproxy-6.0.0/tests/test_parser.py +572 -0
- easyhaproxy-6.0.0/tests/test_plugins.py +1216 -0
- easyhaproxy-6.0.0/tests/test_static.py +125 -0
- easyhaproxy-6.0.0/tests_e2e/conftest.py +90 -0
- easyhaproxy-6.0.0/tests_e2e/docker/AGENTS.md +18 -0
- easyhaproxy-6.0.0/tests_e2e/docker/README.md +52 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-acme-e2e.yml +148 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-acme.yml +99 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-changed-label.yml +71 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-cloudflare.yml +86 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-ip-whitelist.yml +85 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-jwt-validator.yml +94 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-multi-containers.yml +82 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-php-fpm.yml +88 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-plugins-combined.yml +144 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-portainer-app-example.yml +58 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-portainer.yml +115 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose-proxy-headers.yml +46 -0
- easyhaproxy-6.0.0/tests_e2e/docker/docker-compose.yml +100 -0
- easyhaproxy-6.0.0/tests_e2e/docker/pebble-config.json +12 -0
- easyhaproxy-6.0.0/tests_e2e/docker/php-app/README.md +151 -0
- easyhaproxy-6.0.0/tests_e2e/docker/php-app/index.php +152 -0
- easyhaproxy-6.0.0/tests_e2e/docker/php-app/info.php +9 -0
- easyhaproxy-6.0.0/tests_e2e/docker/php-app/test-path-info.php +106 -0
- easyhaproxy-6.0.0/tests_e2e/fixtures/header-echo/Dockerfile +11 -0
- easyhaproxy-6.0.0/tests_e2e/fixtures/header-echo/README.md +66 -0
- easyhaproxy-6.0.0/tests_e2e/fixtures/header-echo/server.py +37 -0
- easyhaproxy-6.0.0/tests_e2e/generate-keys.sh +105 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/.gitignore +9 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/README.md +50 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/cloudflare.yml +140 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/ip-whitelist.yml +124 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/jwt-validator-secret-example.yml +135 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/jwt-validator.yml +160 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/plugins-combined.yml +278 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/service.yml +137 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/service_tls.yml +143 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/setup-cluster.sh +169 -0
- easyhaproxy-6.0.0/tests_e2e/kubernetes/teardown-cluster.sh +39 -0
- easyhaproxy-6.0.0/tests_e2e/static/README.md +94 -0
- easyhaproxy-6.0.0/tests_e2e/static/conf/config-basic.yml +31 -0
- easyhaproxy-6.0.0/tests_e2e/static/conf/config-certbot.yml +82 -0
- easyhaproxy-6.0.0/tests_e2e/static/conf/config-deny-pages.yml +71 -0
- easyhaproxy-6.0.0/tests_e2e/static/conf/config-jwt-validator.yml +76 -0
- easyhaproxy-6.0.0/tests_e2e/static/docker-compose.yml +129 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/README.md +67 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/cloudflare.yml +122 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/easyhaproxy.yml +88 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/ip-whitelist.yml +113 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/jwt-validator.yml +132 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/plugins-combined.yml +201 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/portainer.yml +67 -0
- easyhaproxy-6.0.0/tests_e2e/swarm/services.yml +85 -0
- easyhaproxy-6.0.0/tests_e2e/test_docker_compose.py +1047 -0
- easyhaproxy-6.0.0/tests_e2e/test_kubernetes.py +1792 -0
- easyhaproxy-6.0.0/tests_e2e/test_proxy_headers.py +321 -0
- easyhaproxy-6.0.0/tests_e2e/test_static.py +259 -0
- easyhaproxy-6.0.0/tests_e2e/test_swarm.py +627 -0
- easyhaproxy-6.0.0/tests_e2e/utils.py +314 -0
- easyhaproxy-6.0.0/uv.lock +882 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
name: Docker
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# schedule:
|
|
5
|
+
# - cron: '0 10 1 * *'
|
|
6
|
+
push:
|
|
7
|
+
branches: [ master ]
|
|
8
|
+
# Publish semver tags as releases.
|
|
9
|
+
tags: [ '*.*.*' ]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [ master ]
|
|
12
|
+
workflow_dispatch: # Allow manual trigger
|
|
13
|
+
inputs:
|
|
14
|
+
push:
|
|
15
|
+
description: 'Push image to registry'
|
|
16
|
+
required: false
|
|
17
|
+
default: 'false'
|
|
18
|
+
type: choice
|
|
19
|
+
options:
|
|
20
|
+
- 'false'
|
|
21
|
+
- 'true'
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
# github.repository as <account>/<repo>
|
|
25
|
+
IMAGE_NAME: byjg/easy-haproxy
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
Test:
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read
|
|
33
|
+
packages: write
|
|
34
|
+
|
|
35
|
+
steps:
|
|
36
|
+
- name: Checkout repository
|
|
37
|
+
uses: actions/checkout@v4
|
|
38
|
+
|
|
39
|
+
- name: Install uv
|
|
40
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: |
|
|
44
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
45
|
+
uv sync --group dev
|
|
46
|
+
|
|
47
|
+
- name: Run tests
|
|
48
|
+
run: |
|
|
49
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
50
|
+
uv run pytest -s tests/ -vv
|
|
51
|
+
|
|
52
|
+
Tests-E2E-Docker:
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
timeout-minutes: 20
|
|
55
|
+
needs: [Test]
|
|
56
|
+
permissions:
|
|
57
|
+
contents: read
|
|
58
|
+
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout repository
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- name: Install uv
|
|
64
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
65
|
+
|
|
66
|
+
- name: Install dependencies
|
|
67
|
+
run: |
|
|
68
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
69
|
+
uv sync --group dev
|
|
70
|
+
|
|
71
|
+
- name: Run Docker Compose E2E tests
|
|
72
|
+
run: |
|
|
73
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
74
|
+
uv run pytest tests_e2e/test_docker_compose.py -sv --tb=short
|
|
75
|
+
|
|
76
|
+
Tests-E2E-Kubernetes:
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
timeout-minutes: 30
|
|
79
|
+
needs: [Test]
|
|
80
|
+
permissions:
|
|
81
|
+
contents: read
|
|
82
|
+
|
|
83
|
+
steps:
|
|
84
|
+
- name: Checkout repository
|
|
85
|
+
uses: actions/checkout@v4
|
|
86
|
+
|
|
87
|
+
- name: Install uv
|
|
88
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
89
|
+
|
|
90
|
+
- name: Install dependencies
|
|
91
|
+
run: |
|
|
92
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
93
|
+
uv sync --group dev
|
|
94
|
+
|
|
95
|
+
- name: Run Kubernetes E2E tests
|
|
96
|
+
run: |
|
|
97
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
98
|
+
uv run pytest tests_e2e/test_kubernetes.py -sv --tb=short
|
|
99
|
+
|
|
100
|
+
Tests-E2E-Additional:
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
needs: [Test]
|
|
103
|
+
timeout-minutes: 20
|
|
104
|
+
permissions:
|
|
105
|
+
contents: read
|
|
106
|
+
|
|
107
|
+
steps:
|
|
108
|
+
- name: Checkout repository
|
|
109
|
+
uses: actions/checkout@v4
|
|
110
|
+
|
|
111
|
+
- name: Install uv
|
|
112
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
113
|
+
|
|
114
|
+
- name: Install dependencies
|
|
115
|
+
run: |
|
|
116
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
117
|
+
uv sync --group dev
|
|
118
|
+
|
|
119
|
+
- name: Clean Docker build cache
|
|
120
|
+
run: docker builder prune -af
|
|
121
|
+
|
|
122
|
+
- name: Run Static E2E tests
|
|
123
|
+
run: |
|
|
124
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
125
|
+
uv run pytest tests_e2e/test_static.py -sv --tb=short
|
|
126
|
+
|
|
127
|
+
- name: Run Proxy Headers E2E tests
|
|
128
|
+
run: |
|
|
129
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
130
|
+
uv run pytest tests_e2e/test_proxy_headers.py -sv --tb=short
|
|
131
|
+
|
|
132
|
+
Tests-E2E-Swarm:
|
|
133
|
+
runs-on: ubuntu-latest
|
|
134
|
+
timeout-minutes: 30
|
|
135
|
+
needs: [Test]
|
|
136
|
+
permissions:
|
|
137
|
+
contents: read
|
|
138
|
+
|
|
139
|
+
steps:
|
|
140
|
+
- name: Checkout repository
|
|
141
|
+
uses: actions/checkout@v4
|
|
142
|
+
|
|
143
|
+
- name: Install uv
|
|
144
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
145
|
+
|
|
146
|
+
- name: Install dependencies
|
|
147
|
+
run: |
|
|
148
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
149
|
+
uv sync --group dev
|
|
150
|
+
|
|
151
|
+
- name: Clean Docker build cache
|
|
152
|
+
run: docker builder prune -af
|
|
153
|
+
|
|
154
|
+
- name: Build Docker image
|
|
155
|
+
env:
|
|
156
|
+
DOCKER_BUILDKIT: "0"
|
|
157
|
+
run: docker build -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .
|
|
158
|
+
|
|
159
|
+
- name: Run Swarm E2E tests
|
|
160
|
+
run: |
|
|
161
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
162
|
+
uv run pytest tests_e2e/test_swarm.py -sv --tb=short
|
|
163
|
+
|
|
164
|
+
Build:
|
|
165
|
+
runs-on: ubuntu-latest
|
|
166
|
+
needs: [Test, Tests-E2E-Docker, Tests-E2E-Kubernetes, Tests-E2E-Additional, Tests-E2E-Swarm]
|
|
167
|
+
permissions:
|
|
168
|
+
contents: read
|
|
169
|
+
packages: write
|
|
170
|
+
|
|
171
|
+
steps:
|
|
172
|
+
- name: Checkout repository
|
|
173
|
+
uses: actions/checkout@v4
|
|
174
|
+
|
|
175
|
+
- name: Set up QEMU
|
|
176
|
+
uses: docker/setup-qemu-action@v3
|
|
177
|
+
|
|
178
|
+
- name: Set up Docker Buildx
|
|
179
|
+
uses: docker/setup-buildx-action@v3
|
|
180
|
+
|
|
181
|
+
- name: Log into registry
|
|
182
|
+
if: github.event_name == 'push' || github.event.inputs.push == 'true'
|
|
183
|
+
uses: docker/login-action@v3
|
|
184
|
+
with:
|
|
185
|
+
registry: ${{ secrets.DOCKER_REGISTRY }}
|
|
186
|
+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
|
187
|
+
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
|
188
|
+
|
|
189
|
+
# Extract metadata (tags, labels) for Docker
|
|
190
|
+
# https://github.com/docker/metadata-action
|
|
191
|
+
- name: Extract Docker metadata
|
|
192
|
+
id: meta
|
|
193
|
+
uses: docker/metadata-action@v5
|
|
194
|
+
with:
|
|
195
|
+
images: ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
196
|
+
|
|
197
|
+
- uses: actions/github-script@v6
|
|
198
|
+
id: tags
|
|
199
|
+
with:
|
|
200
|
+
script: |
|
|
201
|
+
tags = `${{ join(steps.meta.outputs.tags, ',') }}`
|
|
202
|
+
result = []
|
|
203
|
+
tags.split("\n").forEach(function (item) {
|
|
204
|
+
short_tag = item.trim().split(":")[1];
|
|
205
|
+
if (short_tag == "master" || short_tag == "main") {
|
|
206
|
+
result.push("latest");
|
|
207
|
+
} else if (short_tag != "latest") {
|
|
208
|
+
result.push(short_tag);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
return result.join(",");
|
|
212
|
+
result-encoding: string
|
|
213
|
+
|
|
214
|
+
- name: Get Tags
|
|
215
|
+
run: |
|
|
216
|
+
echo "${{ steps.tags.outputs.result }}"
|
|
217
|
+
|
|
218
|
+
- uses: actions/github-script@v6
|
|
219
|
+
id: normalized
|
|
220
|
+
with:
|
|
221
|
+
script: |
|
|
222
|
+
tags = `${{ join(steps.meta.outputs.tags, ',') }}`
|
|
223
|
+
result = []
|
|
224
|
+
tags.split("\n").forEach(function (item) {
|
|
225
|
+
short_tag = item.trim().split(":")[1];
|
|
226
|
+
if (short_tag == "master" || short_tag == "main") {
|
|
227
|
+
result.push("${{ env.IMAGE_NAME }}:latest");
|
|
228
|
+
} else if (short_tag != "latest") {
|
|
229
|
+
result.push("${{ env.IMAGE_NAME }}:" + short_tag);
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
return result.join(",");
|
|
233
|
+
result-encoding: string
|
|
234
|
+
|
|
235
|
+
- name: Get Normalized Docker Image
|
|
236
|
+
run: |
|
|
237
|
+
echo "${{ steps.normalized.outputs.result }}"
|
|
238
|
+
|
|
239
|
+
# Build and push Docker image with Buildx (don't push on PR)
|
|
240
|
+
# https://github.com/docker/build-push-action
|
|
241
|
+
- name: Build and push Docker image
|
|
242
|
+
uses: docker/build-push-action@v5
|
|
243
|
+
with:
|
|
244
|
+
context: .
|
|
245
|
+
file: deploy/docker/Dockerfile
|
|
246
|
+
build-args: |
|
|
247
|
+
RELEASE_VERSION_ARG="${{ steps.tags.outputs.result }}"
|
|
248
|
+
platforms: linux/amd64,linux/arm64
|
|
249
|
+
push: ${{ github.event_name == 'push' || github.event.inputs.push == 'true' }}
|
|
250
|
+
tags: ${{ steps.normalized.outputs.result }}
|
|
251
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
252
|
+
|
|
253
|
+
outputs:
|
|
254
|
+
tags: "${{ steps.tags.outputs.result }}"
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
# - name: Docker Hub Description
|
|
258
|
+
# if: github.event_name == 'push' || github.event.inputs.push == 'true'
|
|
259
|
+
# run: |
|
|
260
|
+
# 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
|
|
261
|
+
# chmod +x $HOME/.docker/cli-plugins/docker-pushrm
|
|
262
|
+
# docker pushrm ${{ env.IMAGE_NAME }}
|
|
263
|
+
|
|
264
|
+
Publish-PyPI:
|
|
265
|
+
runs-on: ubuntu-latest
|
|
266
|
+
needs: [Test, Tests-E2E-Docker, Tests-E2E-Kubernetes, Tests-E2E-Additional, Tests-E2E-Swarm]
|
|
267
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
268
|
+
permissions:
|
|
269
|
+
contents: read
|
|
270
|
+
id-token: write # Required for OIDC trusted publisher
|
|
271
|
+
|
|
272
|
+
steps:
|
|
273
|
+
- name: Checkout repository
|
|
274
|
+
uses: actions/checkout@v4
|
|
275
|
+
|
|
276
|
+
- name: Install uv
|
|
277
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
278
|
+
|
|
279
|
+
- name: Build package
|
|
280
|
+
run: |
|
|
281
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
282
|
+
uv build
|
|
283
|
+
|
|
284
|
+
- name: Publish to PyPI
|
|
285
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
286
|
+
|
|
287
|
+
Helm:
|
|
288
|
+
runs-on: 'ubuntu-latest'
|
|
289
|
+
needs: Build
|
|
290
|
+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
|
|
291
|
+
env:
|
|
292
|
+
DOC_GITHUB_TOKEN: '${{ secrets.DOC_TOKEN }}'
|
|
293
|
+
steps:
|
|
294
|
+
- uses: actions/checkout@v4
|
|
295
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
296
|
+
with:
|
|
297
|
+
ref: master
|
|
298
|
+
|
|
299
|
+
- uses: actions/checkout@v4
|
|
300
|
+
if: github.ref == 'refs/heads/master'
|
|
301
|
+
|
|
302
|
+
- name: Get result
|
|
303
|
+
run: echo "${{ needs.Build.outputs.tags }}"
|
|
304
|
+
|
|
305
|
+
- name: Verify versions are pre-bumped
|
|
306
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
307
|
+
run: |
|
|
308
|
+
TAG="${{ needs.Build.outputs.tags }}"
|
|
309
|
+
if [ "$TAG" = "latest" ]; then
|
|
310
|
+
echo "Skipping latest tag verification"
|
|
311
|
+
exit 0
|
|
312
|
+
fi
|
|
313
|
+
./scripts/bump-version.sh --verify "$TAG"
|
|
314
|
+
|
|
315
|
+
HelmDeploy:
|
|
316
|
+
if: github.ref == 'refs/heads/master'
|
|
317
|
+
needs: Helm
|
|
318
|
+
uses: byjg/byjg.github.io/.github/workflows/add-helm.yaml@master
|
|
319
|
+
with:
|
|
320
|
+
repo: ${{ github.event.repository.name }}
|
|
321
|
+
folder: helm
|
|
322
|
+
project: easyhaproxy
|
|
323
|
+
secrets: inherit
|
|
324
|
+
|
|
325
|
+
Documentation:
|
|
326
|
+
if: github.ref == 'refs/heads/master'
|
|
327
|
+
needs: HelmDeploy
|
|
328
|
+
uses: byjg/byjg.github.io/.github/workflows/add-doc.yaml@master
|
|
329
|
+
with:
|
|
330
|
+
folder: devops
|
|
331
|
+
project: ${{ github.event.repository.name }}
|
|
332
|
+
secrets:
|
|
333
|
+
DOC_TOKEN: ${{ secrets.DOC_TOKEN }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.idea
|
|
2
|
+
*~
|
|
3
|
+
venv
|
|
4
|
+
.docker_data
|
|
5
|
+
__pycache__
|
|
6
|
+
.pytest_cache
|
|
7
|
+
*.pyc
|
|
8
|
+
.env
|
|
9
|
+
|
|
10
|
+
# uv
|
|
11
|
+
.venv/
|
|
12
|
+
|
|
13
|
+
# Build artifacts
|
|
14
|
+
dist/
|
|
15
|
+
*.egg-info/
|
|
16
|
+
|
|
17
|
+
/tests_e2e/static/conf/config.yml
|
|
18
|
+
/tests_e2e/docker/certs/haproxy/.place_holder_cert.pem
|
|
19
|
+
/tests_e2e/static/host1.local.pem
|
|
20
|
+
/tests_e2e/swarm/certs/host1.local.pem
|
|
21
|
+
/tests_e2e/docker/host2.local.pem
|
|
22
|
+
/tests_e2e/swarm/certs/host2.local.pem
|
|
23
|
+
/tests_e2e/docker/jwt_private.pem
|
|
24
|
+
/tests_e2e/docker/jwt_pubkey.pem
|
|
25
|
+
/tests_e2e/docker/cloudflare_ips.lst
|
|
26
|
+
/tests_e2e/docker/pebble-ca.pem
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="pytest in tests" type="tests" factoryName="py.test" nameIsGenerated="true">
|
|
3
|
+
<module name="docker-easy-haproxy" />
|
|
4
|
+
<option name="ENV_FILES" value="" />
|
|
5
|
+
<option name="INTERPRETER_OPTIONS" value="" />
|
|
6
|
+
<option name="PARENT_ENVS" value="true" />
|
|
7
|
+
<option name="SDK_HOME" value="" />
|
|
8
|
+
<option name="SDK_NAME" value="uv (docker-easy-haproxy)" />
|
|
9
|
+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src" />
|
|
10
|
+
<option name="IS_MODULE_SDK" value="false" />
|
|
11
|
+
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
12
|
+
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
13
|
+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
|
14
|
+
<option name="RUN_TOOL" value="true" />
|
|
15
|
+
<option name="_new_keywords" value="""" />
|
|
16
|
+
<option name="_new_parameters" value="""" />
|
|
17
|
+
<option name="_new_additionalArguments" value="""" />
|
|
18
|
+
<option name="_new_target" value=""$PROJECT_DIR$/tests"" />
|
|
19
|
+
<option name="_new_targetType" value=""PATH"" />
|
|
20
|
+
<method v="2" />
|
|
21
|
+
</configuration>
|
|
22
|
+
</component>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "PyTest Current File",
|
|
9
|
+
"type": "python",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"module": "pytest",
|
|
12
|
+
"justMyCode": true,
|
|
13
|
+
"console": "integratedTerminal",
|
|
14
|
+
"cwd": "${workspaceFolder}/src",
|
|
15
|
+
"args": [
|
|
16
|
+
"-vv",
|
|
17
|
+
"${file}"
|
|
18
|
+
],
|
|
19
|
+
"env": {
|
|
20
|
+
"PYTHONPATH": "${cwd}/src"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Python: Current File",
|
|
25
|
+
"type": "python",
|
|
26
|
+
"request": "launch",
|
|
27
|
+
"program": "${file}",
|
|
28
|
+
"console": "integratedTerminal",
|
|
29
|
+
"cwd": "${workspaceFolder}/src",
|
|
30
|
+
"env": {
|
|
31
|
+
"PYTHONPATH": "${cwd}/src"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributing to byjg/docker-easy-haproxy
|
|
2
|
+
|
|
3
|
+
First of all, thank you for taking the time to contribute!
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
|
|
7
|
+
### Issues
|
|
8
|
+
|
|
9
|
+
If you encounter any issues, have questions, or need clarification, please open an issue on our [Issues page](https://github.com/your-repo/issues). This helps us track and prioritize bug fixes and enhancements.
|
|
10
|
+
|
|
11
|
+
### Branches
|
|
12
|
+
|
|
13
|
+
We have three main branches in this project:
|
|
14
|
+
|
|
15
|
+
- **master**: Contains the latest code. It is generally stable, but we recommend using it with caution.
|
|
16
|
+
- **a.b**: Use this branch for creating PRs. The naming convention follows `a.b`, where `a` is the major release and `b` is the minor release of the current version. For example, if the current release is 4.9.2, use the branch `4.9` for your PR. You can also use `4.9.x-dev` in your composer for development purposes.
|
|
17
|
+
- **future release**: This branch is typically `(a+1).0`. For instance, if the current release is 4.9.2, the future release branch will be `5.0`.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Code Style and Guidelines
|
|
21
|
+
|
|
22
|
+
- **Write Clear Commit Messages**: Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
|
|
23
|
+
- **Documentation**: Update the documentation for any new features or changes.
|
|
24
|
+
|
|
25
|
+
### Common Practices
|
|
26
|
+
|
|
27
|
+
- **Keep Pull Requests Small**: Smaller PRs are easier to review and merge. Focus on one feature or fix per PR.
|
|
28
|
+
- **Write Tests**: Ensure your changes are covered by tests. We aim for a high level of test coverage.
|
|
29
|
+
- **Respect Reviewers' Time**: Be responsive to feedback and willing to make necessary changes.
|
|
30
|
+
|
|
31
|
+
### Community
|
|
32
|
+
|
|
33
|
+
- **Be Respectful**.
|
|
34
|
+
- **Collaborate**: We encourage collaboration and open discussion. Don’t hesitate to ask for help or provide feedback.
|
|
35
|
+
|
|
36
|
+
Thank you for contributing to byjg/docker-easy-haproxy! Your help is appreciated and makes a big difference.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Joao Gilberto Magalhães
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
VERSION := $(shell git rev-parse --short HEAD)
|
|
2
|
+
|
|
3
|
+
.PHONY: build
|
|
4
|
+
build:
|
|
5
|
+
docker build -t byjg/easy-haproxy --build-arg RELEASE_VERSION_ARG="$(VERSION)" -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .
|
|
6
|
+
|
|
7
|
+
.PHONY: test
|
|
8
|
+
test:
|
|
9
|
+
uv run pytest tests/ -vv
|
|
10
|
+
|
|
11
|
+
.PHONY: sync
|
|
12
|
+
sync:
|
|
13
|
+
uv sync --dev
|
|
14
|
+
|
|
15
|
+
.PHONY: lint
|
|
16
|
+
lint:
|
|
17
|
+
uv run ruff check src/ tests/
|
|
18
|
+
|
|
19
|
+
.PHONY: fix
|
|
20
|
+
fix:
|
|
21
|
+
uv run ruff check --fix src/ tests/
|
|
22
|
+
|
|
23
|
+
.PHONY: format
|
|
24
|
+
format:
|
|
25
|
+
uv run ruff format src/ tests/
|