How can I run a command visiting a URL?
I have been looking for a quick and reliable way to run a python script that requires sudo by accessing a URL, but didn't have much luck.
I found a service which might have been a good fit - it's called Webhook Relay - the owner is a great guy and helped me at the beginning, but unfortunately I can't afford to pay for the premium plan, nor I fully understand how to reliably use the service.
Basically, I have a smart lock (Sherlock S2) which has a bluetooth remote. I opened it up and wired the remote to a Raspberry Pi, and I'm using the GPIOs of the RPi to power it and emulate a button press sending "pulses" using a python script (I need to run it with sudo because apparently that's required to control the GPIOs).
TL;DR: what I'd like to achieve is to be able to execute a python script when I visit, let's say, http://192.168.1.2/open_the_door and have the Raspberry Pi open the door.
Is there an easy way to do this? I read about many tools which I don't know how to use (Django and many many others) and I was wondering if there was an easier way or some sort of workaround.
Any help would be greatly appreciated!