Recklessly turns a shell command into a plain HTTP endpoint. There is no security.
svcize <cmd> <args>
Now you have an HTTP server running on port 8080, which you can hit with GET requests.
-
The request body will be passed to stdin.
-
STDOUT
andSTDERR
fromcmd
will be dumped to the response body. -
If the command returns 0, the server will return
200 OK
. If the command returns non-zero, the server will return503 Internal Server Error
. -
If you really care, the actual exit code is stuffed into the
Exit-Status
header. -
HTTP headers and query parameters will be passed as environment variables. Yes, this means you can overwrite
$PATH
. Do it if you want. There is no security. -
Any environment variable can be substituted into an argument by using
%var%
:`svcize ls %p%`
Now we can pass in an argument with the
p
query parameter:$ curl "http://localhost:8080?p=." Gemfile Gemfile.lock LICENSE README.md svcize
That's it. The end.
There is no security.
Delicious. But no.
You probably can't. This is a super basic tool for building the most micro of web services.
svcize bash -c %cmd%