linux - fix unknown scheme error and do nginx reload as root in UI
This commit is contained in:
parent
8a4eb3f2a3
commit
fde14d1621
@ -836,6 +836,12 @@ if [ "$OS" != "alpine" ] ; then
|
|||||||
fi
|
fi
|
||||||
# Allow RX access to others on /opt/bunkerized-nginx
|
# Allow RX access to others on /opt/bunkerized-nginx
|
||||||
do_and_check_cmd chmod 755 /opt/bunkerized-nginx
|
do_and_check_cmd chmod 755 /opt/bunkerized-nginx
|
||||||
|
# Allow nginx group to do nginx reload as root
|
||||||
|
if [ "$OS" != "alpine" ] ; then
|
||||||
|
do_and_check_cmd chown root:nginx /opt/bunkerized-nginx/ui/nginx-reload.sh
|
||||||
|
do_and_check_cmd chmod 750 /opt/bunkerized-nginx/ui/nginx-reload.sh
|
||||||
|
do_and_check_cmd chmod u+s /opt/bunkerized-nginx/ui/nginx-reload.sh
|
||||||
|
fi
|
||||||
|
|
||||||
# Prepare log files and folders
|
# Prepare log files and folders
|
||||||
echo "[*] Prepare log files and folders"
|
echo "[*] Prepare log files and folders"
|
||||||
|
|||||||
@ -12,4 +12,5 @@ rm -f /lib/systemd/system/basic.target.wants/*;\
|
|||||||
rm -f /lib/systemd/system/anaconda.target.wants/*;\
|
rm -f /lib/systemd/system/anaconda.target.wants/*;\
|
||||||
rm -f /lib/systemd/system/*tmpfiles*;\
|
rm -f /lib/systemd/system/*tmpfiles*;\
|
||||||
rm -f /lib/systemd/user/*tmpfiles*;\
|
rm -f /lib/systemd/user/*tmpfiles*;\
|
||||||
find /lib/systemd/ -type f -iname "*.service" -exec rm -f {} \;
|
find /lib/systemd/ -type f -iname "*.service" -exec rm -f {} \;;\
|
||||||
|
find /etc/systemd/ -type f -inaùe "*.service" -exec rm -f {} \;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ User=nginx
|
|||||||
Group=nginx
|
Group=nginx
|
||||||
WorkingDirectory=/opt/bunkerized-nginx/ui
|
WorkingDirectory=/opt/bunkerized-nginx/ui
|
||||||
EnvironmentFile=/opt/bunkerized-nginx/ui/variables.env
|
EnvironmentFile=/opt/bunkerized-nginx/ui/variables.env
|
||||||
ExecStart=gunicorn --bind 127.0.0.1:5000 -m 007 wsgi:app
|
ExecStart=gunicorn --config config.py --bind 127.0.0.1:5000 -m 007 wsgi:app
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
1
ui/config.py
Normal file
1
ui/config.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
secure_scheme_headers = {'X-FORWARDED-PROTOCOL': 'https', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
|
||||||
5
ui/linux-reload.sh
Normal file
5
ui/linux-reload.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
systemctl reload nginx
|
||||||
|
|
||||||
|
exit $?
|
||||||
@ -107,7 +107,7 @@ class Instances :
|
|||||||
if proc.returncode != 0 :
|
if proc.returncode != 0 :
|
||||||
result = False
|
result = False
|
||||||
else :
|
else :
|
||||||
proc = subprocess.run(["/usr/sbin/nginx", "-s", "reload"], capture_output=True)
|
proc = subprocess.run(["/opt/bunkerized-nginx/ui/nginx-reload.sh"], capture_output=True)
|
||||||
result = proc.returncode == 0
|
result = proc.returncode == 0
|
||||||
elif instance["type"] == "container" or instance["type"] == "service" :
|
elif instance["type"] == "container" or instance["type"] == "service" :
|
||||||
result = self.__api_request(instance, "/reload")
|
result = self.__api_request(instance, "/reload")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user