btc-raspberrypiclub / piclub-bot

The official bot for the BTC Rasperry Pi Club Discord server
MIT License
0 stars 1 forks source link

Add command to ping services / Pi's #2

Open Agent-E11 opened 2 months ago

Agent-E11 commented 2 months ago

This should take security into account. Using os.system(f"ping -c 1 {service}") to ping a service would be insecure (e.g. someone could make service be google; sudo rm -rf /)

In this case, I think subprocess.run(["ping", "-c", "1", service]) would be more secure

Agent-E11 commented 2 months ago

Related to #1, and #6, because it might be a good idea to make a command that creates new services to ping, and only "bot moderators" should be able to use it

Agent-E11 commented 2 months ago

There also could be a healthcheck option. Which pings all services, and gives a report