My father and I are making a webserver so Grafana will be able to access a few python scripts; Grafana only allows you to add links to buttons. Earlier today we created the webserver. Then I started work on two python files, "smartThingy.py" and "printLight.cgi". After those were created I put them on the network hard drive and my dad moved them onto the centos 8 machine that was running apache. It worked after getting the files to not be in DOS format. Currently, we are getting a small error https://pastebin.com/TXhXFPwm . Can someone please help debug the code so we can turn on and off a light by going to http://PrivateIpOfTheServer/cgi-bin/printLight.cgi
Here is my code. Its only missing the bits that allows it to output text onto the page.
https://pastebin.com/qn2EMYhZ - smartThingy.py (a module so it will be easier to create more cgi files)
https://pastebin.com/9J8HMYS7 - printLight.cgi (controls light above 3d printers)
Edit: I am using https://pypi.org/project/pysmartthings/ for smartThings
SELinux is preventing /usr/libexec/platform-python3.6 from name_connect access on the tcp_socket port 443.
***** Plugin catchall_boolean (47.5 confidence) suggests ******************
If you want to allow httpd to can network connect
Then you must tell SELinux about this by enabling the 'httpd_can_network_connect' boolean.
Do
setsebool -P httpd_can_network_connect 1
SELinux was just being mean to us.