Is there anyway to modify the web-based dashboard for the Pironman5 suite so that it can be forced to run only locally (ie 127.0.0.1:34001)? I do not want any computer on my local network (or any other computer anywhere!) to be able to access the dashboard or make changes to the Pironman5 settings. I like the dashboard for the GUI convenience of changing settings, so disabling (uninstalling it) is not really a desired outcome.
Currently, the dashboard can be accessed locally. We did not consider this carefully before, but the problem has been fixed.
You can enter the local address on the system to access the dashboard.
However, it cannot be modified and can only be accessed locally. Similarly, the dashboard can be accessed and controlled by accessing the host name or network IP address.
You should be able to use iptables or nftables to block external access to the port 34001 locally
Or you can try to edit the file pm_dasboard.py server variable __host__
from 0.0.0.0 to 127.0.0.1 for loopback
__host__ = '0.0.0.0'
Becomes
__host__ = '127.0.0.1'
Thank you, Spf650! That was exactly what I needed and it worked perfectly.
For anyone wanting to do the same:
#using whatever editor you prefer
sudo nano /opt/pironman5/venv/lib/python3.11/site-packages/pm_dashboard/pm_dashboard.py
#scroll to what Spf650 said and modify the value for host
#here is a snippet of the section you’re looking for, which is about 20 lines into the file
package_name = name.split(‘.’)[0]
log_path = ‘/var/log/pironman5’
www_path = str(resource_files(package_name).joinpath(‘www’))
api_prefix = ‘/api/v1.0’
host = ‘0.0.0.0’
port = 34001
log = None
#stop and start the pironman5.service
sudo systemctl stop pironman5.service
sudo systemctl start pironman5.service
You are most welcome.
Please note to anyone looking for above code, that in markup __
is the bold format on/off instruction, hence why all the underscores are stripped from no-sunFounder’s above code segment. They need to be retained if anyone else is doing the same