From d53c54d4b8c6d3fec6402df92819da38bbc389e7 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 10 Aug 2022 15:18:33 +0200 Subject: [PATCH] tests - add behind-reverse-proxy/linux --- examples/behind-reverse-proxy/setup-linux.sh | 21 ++++++++++++++++++++ examples/behind-reverse-proxy/tests.json | 3 ++- examples/behind-reverse-proxy/variables.env | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 examples/behind-reverse-proxy/setup-linux.sh create mode 100644 examples/behind-reverse-proxy/variables.env diff --git a/examples/behind-reverse-proxy/setup-linux.sh b/examples/behind-reverse-proxy/setup-linux.sh new file mode 100755 index 000000000..28ae19809 --- /dev/null +++ b/examples/behind-reverse-proxy/setup-linux.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ $(id -u) -ne 0 ] ; then + echo "❌ Run me as root" + exit 1 +fi + +DNF=$(which dnf) +APT=$(which apt) + +if [ ! -z $DNF ] ; then + dnf install -y haproxy +elif [ ! -z $APT ] ; then + apt install -y haproxy +fi + +cp haproxy.cfg /etc/haproxy +systemctl stop haproxy +systemctl start haproxy + +echo "hello" > /opt/bunkerweb/www/index.html \ No newline at end of file diff --git a/examples/behind-reverse-proxy/tests.json b/examples/behind-reverse-proxy/tests.json index aad171c55..cc461bb19 100644 --- a/examples/behind-reverse-proxy/tests.json +++ b/examples/behind-reverse-proxy/tests.json @@ -1,7 +1,8 @@ { "name": "behind-reverse-proxy", "kinds": [ - "docker" + "docker", + "linux" ], "timeout": 60, "tests": [ diff --git a/examples/behind-reverse-proxy/variables.env b/examples/behind-reverse-proxy/variables.env new file mode 100644 index 000000000..64f7b73c7 --- /dev/null +++ b/examples/behind-reverse-proxy/variables.env @@ -0,0 +1,8 @@ +HTTP_PORT=80 +HTTPS_PORT=443 +DNS_RESOLVERS=8.8.8.8 8.8.4.4 +# replace with your domains +SERVER_NAME=www.example.com +# real IP settings +USE_REAL_IP=yes +REAL_IP_FROM=127.0.0.0/8 \ No newline at end of file