From 790fa37aeb7af23be8d65dd2f61e28cb2fd103fa Mon Sep 17 00:00:00 2001 From: bunkerity Date: Thu, 11 Aug 2022 13:28:30 +0200 Subject: [PATCH] tests - fix behind-reverse-proxy/linux --- core/bunkernet/jobs/bunkernet-register.py | 2 +- examples/behind-reverse-proxy/setup-linux.sh | 1 + tests/LinuxTest.py | 9 ++++++++- tests/www.conf | 7 +++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/www.conf diff --git a/core/bunkernet/jobs/bunkernet-register.py b/core/bunkernet/jobs/bunkernet-register.py index a64aad919..288b58802 100755 --- a/core/bunkernet/jobs/bunkernet-register.py +++ b/core/bunkernet/jobs/bunkernet-register.py @@ -49,7 +49,7 @@ try : logger.log("BUNKERNET", "❌", "Received error from BunkerNet API while sending register request : " + data["data"]) os._exit(1) bunkernet_id = data["data"] - logger.log("BUNKERNET", "ℹ️", "Successfully registered on BunkerNet API with instance id " + get_id()) + logger.log("BUNKERNET", "ℹ️", "Successfully registered on BunkerNet API with instance id " + data["data"]) else : with open("/opt/bunkerweb/cache/bunkernet/instance.id", "r") as f : bunkernet_id = f.read() diff --git a/examples/behind-reverse-proxy/setup-linux.sh b/examples/behind-reverse-proxy/setup-linux.sh index 9c0bb2e6f..a0f906199 100755 --- a/examples/behind-reverse-proxy/setup-linux.sh +++ b/examples/behind-reverse-proxy/setup-linux.sh @@ -17,6 +17,7 @@ fi cp haproxy.cfg /etc/haproxy sed -i "s/8080/80/" /etc/haproxy/haproxy.cfg sed -i "s/mybunker/127.0.0.1/" /etc/haproxy/haproxy.cfg +systemctl stop bunkerweb systemctl stop haproxy systemctl start haproxy diff --git a/tests/LinuxTest.py b/tests/LinuxTest.py index b6e791a80..504a3c8c0 100644 --- a/tests/LinuxTest.py +++ b/tests/LinuxTest.py @@ -59,7 +59,14 @@ class LinuxTest(Test) : proc = LinuxTest.docker_exec(distro, "chown -R nginx:nginx " + dst + "/*") if proc.returncode != 0 : raise(Exception("docker exec failed for directory " + src + " (linux stack)")) - # TODO : php install + # ubuntu : /etc/php/8.1/fpm/pool.d/www.conf / www-data + # debian : /etc/php/7.4/fpm/pool.d/www.conf / www-data + # fedora : /etc/php-fpm.d/www.conf / apache + # centos : /etc/php-fpm.d/www.conf / apache + if self.__distro in ["ubuntu", "debian"] : + LinuxTest.docker_exec(distro, "DEBIAN_FRONTEND=noninteractive apt-get install -y php-fpm") + elif self.__distro in ["centos", "fedora"] : + LinuxTest.docker_exec(distro, "dnf install -y php-fpm") sleep(60) except : log("LINUX", "❌", "exception while running LinuxTest.init()\n" + format_exc()) diff --git a/tests/www.conf b/tests/www.conf new file mode 100644 index 000000000..13961dd06 --- /dev/null +++ b/tests/www.conf @@ -0,0 +1,7 @@ +[www] +user = www-data +group = www-data +listen = /run/php/php-fpm.sock +listen.ower = www-data +listen.group = nginx +listen.mode = 0660