Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanedwards/svcizer
Recklessly turns a shell command into an HTTP endpoint
https://github.com/seanedwards/svcizer
Last synced: 3 days ago
JSON representation
Recklessly turns a shell command into an HTTP endpoint
- Host: GitHub
- URL: https://github.com/seanedwards/svcizer
- Owner: seanedwards
- License: mit
- Created: 2014-07-30T01:45:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-30T04:48:22.000Z (over 10 years ago)
- Last Synced: 2023-03-23T13:06:56.394Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 199 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
svcizer
=======Recklessly turns a shell command into a plain HTTP endpoint. _There is no security._
Usage
=====svcize
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` and `STDERR` from `cmd` 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 return `503 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
svcizeThat's it. The end.
Potential FAQ
============="Security?"
-----------
_There is no security._"Cookies?"
----------
Delicious. But no."What about...?"
--------------
You probably can't. This is a super basic tool for building the most micro of web services."How do I perform maximum evil?"
--------------------------------
svcize bash -c %cmd%