A Docker-inspired Heroku clone in 100 lines of PHP(gist.github.com) |
A Docker-inspired Heroku clone in 100 lines of PHP(gist.github.com) |
Requires Symfony.
Silex, not Symfony, and better to rely on trusted library code than to reinvent the wheel and introduce vulnerabilities...
This comment is an example of the type of negativity that is unhelpful and creates the toxic atmosphere HN is renown for, and I believe you know that considering you posted with a throwaway.
Heroku does slightly more than stage and place apps, guys.
One cannot seriously consider this for anything except a proof that basic utilities like zip, netcat, supervisord and php can be scripted with a higher-level language to hack together something that somehow works.
That being said, I like this cool hack.
Is it possible to craft a zip file that will write data to parent directories, or an explicit path?
It doesn't appear to attempt to sandbox the uploaded code at all. This is obviously not meant to be exposed to untrusted parties.
FWIW space processing in command line args is a bit... difficult given our mode of transport (ssh). This is something we're thinking about fixing somehow, though there isn't a great solution yet.
The irony is that for this very project, Both Silex and Symfony\Process are completely redundant, especially with PHP bloated core APIs.
The only other required libraries for Silex to function are the event dispatcher, routing (which you can swap out for something like nikic/FastRoute), and the request/response stuff. I'm not sure if you think that's a "lot" of code, but if you're rolling your own you'd probably end up using the HTTPFoundation stuff anyway.
That's exactly what I said, what is the point of your message? With Silex there is no configuration through XML or YAML. What is not correct?
Event dispatching + kernel (basically a handler) + request/response isn't particularly complex, is it?