From e8803e346f0310e96d4107ab151942a1077338fb Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 30 Oct 2023 21:33:54 +0100 Subject: [PATCH] cache linux test images, fix linux example of proxy protocol and add more logs to k8s tests --- .github/workflows/linux-build.yml | 2 ++ examples/proxy-protocol/variables.env | 2 ++ tests/KubernetesTest.py | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 1f2196ee7..15c561c37 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -148,3 +148,5 @@ jobs: push: true tags: ghcr.io/bunkerity/${{ inputs.LINUX }}-tests:${{ inputs.RELEASE }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=${{ inputs.LINUX }}-${{ inputs.RELEASE }}-tests + cache-to: type=gha,scope=${{ inputs.LINUX }}-${{ inputs.RELEASE }}-tests,mode=min diff --git a/examples/proxy-protocol/variables.env b/examples/proxy-protocol/variables.env index 3cfa19c28..b913ccb19 100644 --- a/examples/proxy-protocol/variables.env +++ b/examples/proxy-protocol/variables.env @@ -1,5 +1,7 @@ DNS_RESOLVERS=8.8.8.8 8.8.4.4 API_LISTEN_IP=127.0.0.1 +HTTP_PORT=8080 +HTTPS_PORT=8443 # replace with your domains SERVER_NAME=www.example.com # real IP settings diff --git a/tests/KubernetesTest.py b/tests/KubernetesTest.py index 0675b764f..3faf986cb 100644 --- a/tests/KubernetesTest.py +++ b/tests/KubernetesTest.py @@ -36,10 +36,10 @@ def init(): "USE_LETS_ENCRYPT_STAGING": "yes", "USE_REAL_IP": "yes", "USE_PROXY_PROTOCOL": "yes", - "REAL_IP_FROM": "100.64.0.0/16", + "REAL_IP_FROM": "100.64.0.0/10 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8", "REAL_IP_HEADER": "proxy_protocol", } - replace_env = {"API_WHITELIST_IP": "127.0.0.1/8 100.64.0.0/10"} + replace_env = {"API_WHITELIST_IP": "127.0.0.1/8 100.64.0.0/10 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8"} for yaml in data: if yaml["metadata"]["name"] == "bunkerweb": for k, v in append_env.items(): @@ -133,6 +133,11 @@ def init(): cwd="/tmp/kubernetes", shell=True, ) + run( + "kubectl describe pods", + cwd="/tmp/kubernetes", + shell=True, + ) raise (Exception("k8s stack is not healthy")) sleep(60) except: