mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
tests - fix behind-reverse-proxy/linux
This commit is contained in:
parent
6005a8f73b
commit
790fa37aeb
4 changed files with 17 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ try :
|
||||||
logger.log("BUNKERNET", "❌", "Received error from BunkerNet API while sending register request : " + data["data"])
|
logger.log("BUNKERNET", "❌", "Received error from BunkerNet API while sending register request : " + data["data"])
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
bunkernet_id = data["data"]
|
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 :
|
else :
|
||||||
with open("/opt/bunkerweb/cache/bunkernet/instance.id", "r") as f :
|
with open("/opt/bunkerweb/cache/bunkernet/instance.id", "r") as f :
|
||||||
bunkernet_id = f.read()
|
bunkernet_id = f.read()
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ fi
|
||||||
cp haproxy.cfg /etc/haproxy
|
cp haproxy.cfg /etc/haproxy
|
||||||
sed -i "s/8080/80/" /etc/haproxy/haproxy.cfg
|
sed -i "s/8080/80/" /etc/haproxy/haproxy.cfg
|
||||||
sed -i "s/mybunker/127.0.0.1/" /etc/haproxy/haproxy.cfg
|
sed -i "s/mybunker/127.0.0.1/" /etc/haproxy/haproxy.cfg
|
||||||
|
systemctl stop bunkerweb
|
||||||
systemctl stop haproxy
|
systemctl stop haproxy
|
||||||
systemctl start haproxy
|
systemctl start haproxy
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,14 @@ class LinuxTest(Test) :
|
||||||
proc = LinuxTest.docker_exec(distro, "chown -R nginx:nginx " + dst + "/*")
|
proc = LinuxTest.docker_exec(distro, "chown -R nginx:nginx " + dst + "/*")
|
||||||
if proc.returncode != 0 :
|
if proc.returncode != 0 :
|
||||||
raise(Exception("docker exec failed for directory " + src + " (linux stack)"))
|
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)
|
sleep(60)
|
||||||
except :
|
except :
|
||||||
log("LINUX", "❌", "exception while running LinuxTest.init()\n" + format_exc())
|
log("LINUX", "❌", "exception while running LinuxTest.init()\n" + format_exc())
|
||||||
|
|
|
||||||
7
tests/www.conf
Normal file
7
tests/www.conf
Normal 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
|
||||||
Loading…
Reference in a new issue