Hey everyone! I’m stuck on a problem and could use some advice.
I’ve got this Ubuntu machine where I keep some scripts. Right now, I have to SSH in to run them. But I’m thinking it’d be cool to have a web interface to control these scripts. The thing is, I’m not sure how to make the website talk to my machine and run the scripts.
At first, I thought about using a database. The website could write commands there, and my scripts would check for new stuff. But that seems like it might waste resources, especially since some scripts need user input.
Does anyone have ideas on how to set this up without making it super complicated or slow? I’m open to any suggestions that could help me connect my web frontend with the backend scripts smoothly. Thanks in advance for your help!
Have you considered using a reverse proxy setup with Nginx or Apache? This approach could be quite effective for your needs. You’d set up a web server on your Ubuntu machine that acts as an intermediary between your web interface and your scripts. The web server can handle incoming requests, execute the appropriate scripts, and return the results. This method is secure, as you can implement authentication and SSL encryption. It’s also scalable and doesn’t require constant polling or resource-intensive processes. You’d need to write some server-side code to handle the requests and execute your scripts, but it’s a clean solution that gives you a lot of control. Plus, it’s a commonly used method in professional environments, so there’s plenty of documentation and support available if you run into issues.
yo, try using a simple api setup. build a small flask api on your ubuntu machine to listen for requests from your web interface. it can run the correct scripts. make sure u secure the endpoint so unauthorized folks dont use it!
hey, have u tried websockets? they r cool for real-tim comm on a ubuntu machine. setting up a simple ws server might run scripts on-demand without constant polling. wonder if this simpler approach works for u. what u think?