[Qgis-developer] QEP: QGIS Mapserver Python Plugins

Marco Hugentobler marco.hugentobler at sourcepole.ch
Fri Aug 29 02:56:39 PDT 2014


Hi Alessandro

Thanks for this interesting input. I'm happy to look at it in detail, 
but need a bit of time to review it and think about it thoroughly. Also 
I'd like to do some testing (e.g. run some of my internal server 
benchmarks here).

As a fery first 2c: Python on the server can open some interesting 
options (expression functions in python, custom renderers, ...). Of 
course it needs the possibility to turn python off for server.

Regards,
Marco

On 28.08.2014 14:49, Alessandro Pasotti wrote:
> Hello,
>
> as anticipated to some of you during the last HF, I've started to add
> Python plugins support for the server side.
>
> The rationale behind server plugins is doublefold: first they could
> provide additional services without the need to touch the C++
> codebase, second they allow for GUI-based configuration since the
> server plugins are not separated from the desktop plugins (of course
> the environment and permissions should be carefully configured to
> allow information sharing from the desktop user to the webserver user
> ).
>
> I've already coded a first working implementation and a few
> proof-of-concept plugins.
>
> The current implementation is based on the following ideas:
>
> QGIS Python plugins can have additional metatags to specify what
> SERVICE and REQUEST they expose, for example:
>
> service=HELLO
> methods=GetCapabilities,GetOutput,RemoteConsole
>
> This plugin will respond to calls like
> /cgi-bin/qgis_mapserv.fcgi?SERVICE=HELLO&REQUEST=RemoteConsole
>
>
> The current implementation is pretty simple and CGI-style, whatever
> the plugin prints to sdtout is captured and sent back to the client,
> the return value from the method is the (optional) content type.
>
> I would like to discuss this ideas during the next HF (or sooner), in
> particular:
>
> * I'm not happy with the current request handling and I think we need
> a mehod to pass cached parsed project instances to the plugins when
> needed and a better handling of HTTP headers
> * I 'd like to see signals/slots implementation instead of static
> function calls, but maybe it's just syntactic sugar
> * from the python side, we don't have an iface to pass to the plugins,
> so I'm currently stuck to @staticmethod
>
>
> The code is in a branch:
> https://github.com/elpaso/QGIS/tree/serverplugins
>
> HelloServer demo plugin:
> https://github.com/elpaso/qgis-helloserver
> It is a test plugin and it provides a remote console (web shell),
> insanely insecure DO NOT USE IN PRODUCTION!! and arbitrary python code
> execution configurable through the QGIS desktop plugin GUI.
>
> Here is a short demo of the HelloServer plugin:
> http://youtu.be/ys9VVxQ8uac
>
> Have fun !!
>
>


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list