Search code examples
pythongoogle-app-enginefabricwebapp2

disable sandboxing of google app engine dev server as a replacement for bash scripts / fabric


I want a website on my local computer that has options such as: "create file", "zip folder", etc.

When such hyperlinks are clicked on the local website, the webhandler would run commands such as open("new-file", 'w') etc.

I was wanting to use the website mainly to control my Google App Engine projects (instead of using bash scripts or fabric.

Perhaps Google App Engine / Webapp2 isn't perfect for such a task, but it saves noobs having to learn multiple frameworks.

Looking through the docs for the devserver, It says

The simulated environment enforces some sandbox restrictions, such as restricted system functions and Python module imports

but there isn't an indication that the sandboxing can be disabled. (e..g I can't even read a static file).

A) is there a way to disable SandBoxing

B) is there a better way of doing what I'm considering trying to do.


Solution

  • Do you actually need the GAE runner?

    You can run your main.py (or whatever your entry point is) directly without the GAE runner. If you're using GAE resources, stubs, etc, then you just need to set them up in your env path (i.e. site-packages/gae.pth, defining where to find GAE modules).

    Personally, for development purposes, I always just run the app directly through python main.py so I can break into debuggers and such.

    Having said all that, if you're looking to control your GAE projects on each persons local filesystem, I'd likely write a command line utility. Not only do you have to not mess around with web frameworks (needlessly imho), but you can actually automate them, which can be hugely beneficial (if not a hard requirement for some).

    Besides, it seems a little odd to me to have a web app run localhost just to do local sysadmin stuff..