tests - fix behind-reverse-proxy/linux

This commit is contained in:
bunkerity 2022-08-11 13:28:30 +02:00
parent 6005a8f73b
commit 790fa37aeb
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
4 changed files with 17 additions and 2 deletions

View File

@ -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()

View File

@ -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

View File

@ -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())

7
tests/www.conf Normal file
View File

@ -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