CGI with Ruby and JSON.
The main idea is to expose any kind of code inside the registry
folder to the web. The request object (parameters, etc.) is serialized to JSON and passed as environment variable to non-ruby binaries/scripts.
There is no kind of sandboxing implemented (and probably never will be).
Never run this as root
user in production!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Please see the requirements.txt for dependencies.
Clone the repository:
git clone https://github.com/doomguy/chimera
Run Chimera:
ruby chimera.rb
Interact with it:
curl localhost:4567/helloRuby
Hello, World!
This is Ruby!
curl localhost:4567/helloRuby?name=FooBar
Hello, FooBar!
This is Ruby!
curl localhost:4567/helloPython
Hello, World!
This is Python!
curl localhost:4567/helloPython?name=FooBar
Hello, FooBar!
This is Python!
Please note: Examples for other languages may need some more work to run. See the README.md in the respective example folder.
For new scripts follow these simple steps:
- Create a new folder under
registry
(CamelCase recommended). - For native ruby code, just have a look at the
helloRuby
example. - For non-ruby code, copy the helper.rb into the folder and rename it to the folder name. By default GET and POST is supported.
- Put your binary/script with the name
main
into the folder. Make it executable (chmod +x main
)! - (Re)Start Chimera
- Sinatra - The framework used
Just send in your pull request if you feel like it.
SemVer is used for versioning. For the versions available, see the tags on this repository.
- doomguy - Initial work - doomguy
See also the list of contributors who participated in this project.
This project is licensed under the Unlicense - see the LICENSE file for details.
- Hat tip to anyone whose code was used!
- Inspired by OpenLambda