4 ms·
I've been creating something completely reckless for the last two weekends. Screenshot: http://i.imgur.com/y5b4Yy7.png http://i.imgur.com/y5b4Yy7.png Github:
by kijin 13y ago
I've been creating something completely reckless for the last two weekends.
Screenshot: http://i.imgur.com/y5b4Yy7.png http://i.imgur.com/y5b4Yy7.png
Github: https://github.com/kijin/qade https://github.com/kijin/qade (MIT License)
QADE (Quick and Dirty Editor) allows anyone who can access it over the web to view and/or edit any file that the web server process has access to, as well as execute any arbitrary shell command and view the result right on the web page (via the "Console" tab). It's written in good ol' spaghetti PHP with a generous topping of AJAX. Because why not? The idea is insane to begin with, anyway.
The screenshot shows QADE editing itself over the web. The webshell lets me commit my changes and push it to Github, right in the comfort of a web browser. The editor component is ACE, which provides syntax highlighting for every language I care about as well as a regexp-enabled find & replace function.
The "New" button currently doesn't work, so you have to use the webshell and `touch` files that you want to create.
All in all, it's a security nightmare, and it's supposed to be. It might have some legitimate uses if you put it behind TLS, a good firewall, a chroot and HTTP authentication, but you really shouldn't take any chances with it unless you know what you're doing. If anybody uploads QADE to a shared server that you control, kick them out ASAP ;)
- asadlionpk 13y agoCool! This shouldn't be on the server permanently I guess. But I am going to use it for doing quick edits on the server when in development phase. I use cpanel for that currently.
- parkovski 13y agoI think this is super cool. I've been looking for an editor that lets you do everything you need to in the browser. Ideally this would let you write code and switch quickly between your site and the editor, like an IDE's run button, but all within the same browser tab - I did a quick (and very crude) jsfiddle to show this: http://jsfiddle.net/RyT3w/1/ http://jsfiddle.net/RyT3w/1/. Like you say there are security issues but that isn't a big deal with local web dev or within a company that has firewalls to the outside world.
- kijin 13y agoI just open the live website in a different tab (browser tab, not editor tab) and use keyboard shortcuts to switch between browser tabs. It's the only way that is guaranteed to work. I could try loading the live website in an iframe inside the editor, but it will break if the live website uses X-Frame-Options: SAMEORIGIN and the editor is located on a different hostname (which it really should be for security's sake).
- parkovski 13y agoCool, didn't know about X-Frame-Options. Either way, it'd be cool if there was a good option for when you don't have access to ssh or aren't comfortable with it, which it seems like this could fill.
- theboss 13y agoJust what I need. RCE as a feature instead of a bu
- austengary 13y agoNo c99?
- kijin 13y agoSorry, I thought ACE would automatically recognize something as common as C/C++ source file extensions. Turns out it doesn't. Fixed.
- egeozcan 13y agoI was thinking about doing the same thing with cloud9[1], this seems to be a nice alternative. [1]: https://github.com/ajaxorg/cloud9 https://github.com/ajaxorg/cloud9
- kijin 13y agoQADE uses Cloud9's ACE editor, so the frontend will look very similar. The backend is written in PHP instead of node.js, though.
- scrollaway 13y agoThis sounds awesome. Keep working on it.