Ask HN: Executing shell scripts from HTTP. Good idea or ticking time bomb?
I have some endpoints like so:
/analytics/aggregate /monitor/run /job/xyz
These all run one-off processes and then return standard out over HTML. Currently this works with Node's child_process spawning a process and collecting std out.
I want to remove the Node dependency entirely by running the Bash script directly. I would just shuttle query parameters from the URL into the script as arguments. I think (hope) there is a way to do this like SQL parameterized queries, where arbitrary input can't escape from its placeholder and execute other commands.
Is there an existing HTTP server that supports this? What pitfalls would I run into? Is the whole idea stupid and I should just keep using Node?
0 comments
[ 3.9 ms ] story [ 12.0 ms ] threadNo comments yet.