Closed toshibochan closed 7 years ago
It wasn't really designed with a session or authentication in mind. I would suggest using nginx or apache as a proxy in front of sprinklerspi and use http basic auth capability of those.
I would suggest exposing to the internet using ngrok as a tunnelling system with authentication. I chose this option myself, I found it handy.
sudo wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngrok-stable-linux-arm.zip
<sign up into ngrok web portal and create an authtoken>
./ngrok authtoken <your_brand_new_authtoken>
./ngrok http -auth="username:password" -region eu 8080
You can follow this guide on how to get nginx working with http basic auth and using nginx as a reverse proxy in front of the sprinkler software.
you'll need to add the following lines inside of your location / {}
block
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://<ip_to_pi_web>:<port_to_pi_web>;
so something like this should be sufficient:
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://<ip_to_pi_web>:<port_to_pi_web>;
auth_basic "Private Property";
auth_basic_user_file /etc/nginx/.htpasswd;
}
thanks for make great sprinkler system. you can add password for login to the web app?