[GeoNode-users] Error adding remote service

Simone Dalmasso simone.dalmasso at gmail.com
Wed Oct 14 01:29:22 PDT 2015


David,
unfortunately the remote wms in the map composer has po pass through the
geonode proxy, this because the browsers do not allow http request to other
sources if they are not for images or few other things. In our case the map
composer has to do a GetCapabilities to the remote WMS to get the list of
layers and this is forbidden by the client. So we pass this request through
the geonode proxy that has the same origin. But we have to protect the
proxy otherwise could be used to do any kind of requests by anyone to
everywhere (you can imagine the risk), so this is the reason of the
PROXY_ALLOWED_HOSTS where you have to authorize the endpoints that can be
contacted by the proxy.

An alternative could be to register geonode services, but this will fill
geonode with the remote layers available for everyone and I don't think
that this is ideal for you.

Hope this explain the reason. I'm anyway opening a ticket to propose a more
evolved proxy to allow this kind of situations.

Ciao


2015-10-14 9:28 GMT+02:00 David Alda Fernandez de Lezea <dalda at hazi.eus>:

> Hi Simone,
>
> Thanks for your help. I changed what you said And now I'm getting
>
> DEBUG is set to False but the host of the path provided to the proxy
> service is not in the PROXY_ALLOWED_HOSTS setting.
>
> After a lot of changes here's what I have in my local_settings.py
>
> ALLOWED_HOSTS=["192.168.1.190", "localhost","127.0.0.1",]
> PROXY_ALLOWED_HOSTS=("192.168.1.190", "localhost", "127.0.0.1",)
>
> Where 192.168.1.190 is the IP of my geonode instance
>
> By the way, I've been searching on the web about this subject and I've
> found some confusing comments... From my point of view I got some
> thoughts/questions..
>
> In my case what I want to achieve is that any user can add an
> external/remote WMS from any source in the world. Taking into account this
> premise, do I have to add in the PROXY_ALLOWED_HOSTS every WMS that exists
> in the world?
>
> I was expecting a dynamic functionality..
>
> I hope I explained myself clear enough.
>
> Thanks in advance.
>
> Agur bero bat,
>
>
>
> David Alda Fernández de Lezea
> Área de Sistemas de Información Geográfica, Planificación Territorial y
> Forestal Informazio Geografikoen Sistemak, Lurralde eta Baso Antolaketaren
> Arloa.
> dalda at hazi.eus | www.hazi.eus
> T 945 003 240 – M 627 923 170 – F 945 003 290
> Hazi | Granja Modelo de Arkaute s/n | 01192 Arkaute – Araba
>
> *********************  LEGE OHARRA   *******************   AVISOLEGAL
> *******************   DISCLAIMER   *****************************
> Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabilera
> debekatua dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta
> kontserbatu gabe.
> Este mensaje es personal y confidencial y su uso no autorizado está
> prohibido legalmente. Si usted no es el destinatario, proceda a borrarlo,
> sin reenviarlo ni conservarlo.
> This message is personal and confidential, unauthorised use is legally
> prohibited. If you are not the intended recipient, delete it without
> resending or backing it.
>
> De: Simone Dalmasso [mailto:simone.dalmasso at gmail.com]
> Enviado el: martes, 13 de octubre de 2015 14:40
> Para: David Alda Fernandez de Lezea
> CC: geonode-users at lists.osgeo.org
> Asunto: Re: [GeoNode-users] Error adding remote service
>
> Hi, seems that you have set a PROXY_ALLOWED_HOSTS = ['ip1', 'ip2',] using
> square brackets, you should use normal parenthesis PROXY_ALLOWED_HOSTS =
> ('ip1','ip2',)
>
> 2015-10-13 14:29 GMT+02:00 David Alda Fernandez de Lezea <dalda at hazi.eus>:
> Hi list,
>
> From the user interface, while creating a Map, I'm trying to add a remote
> WMS, from another organization but without success, indeed I'm getting the
> following error:
>
> [Tue Oct 13 07:24:33 2015] [error] Internal Server Error: /proxy/
> [Tue Oct 13 07:24:33 2015] [error] Traceback (most recent call last):
> [Tue Oct 13 07:24:33 2015] [error]   File
> "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115,
> in get_response
> [Tue Oct 13 07:24:33 2015] [error]     response = callback(request,
> *callback_args, **callback_kwargs)
> [Tue Oct 13 07:24:33 2015] [error]   File
> "/usr/local/lib/python2.7/dist-packages/geonode/proxy/views.py", line 31,
> in proxy
> [Tue Oct 13 07:24:33 2015] [error]     PROXY_ALLOWED_HOSTS =
> (ogc_server_settings.hostname,) + getattr(settings, 'PROXY_ALLOWED_HOSTS',
> ())
> [Tue Oct 13 07:24:33 2015] [error] TypeError: can only concatenate tuple
> (not "list") to tuple
> [Tue Oct 13 07:24:33 2015] [error] Internal Server Error: /proxy/
> [Tue Oct 13 07:24:33 2015] [error] Traceback (most recent call last):
> [Tue Oct 13 07:24:33 2015] [error]   File
> "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115,
> in get_response
> [Tue Oct 13 07:24:33 2015] [error]     response = callback(request,
> *callback_args, **callback_kwargs)
> [Tue Oct 13 07:24:33 2015] [error]   File
> "/usr/local/lib/python2.7/dist-packages/geonode/proxy/views.py", line 31,
> in proxy
> [Tue Oct 13 07:24:33 2015] [error]     PROXY_ALLOWED_HOSTS =
> (ogc_server_settings.hostname,) + getattr(settings, 'PROXY_ALLOWED_HOSTS',
> ())
> [Tue Oct 13 07:24:33 2015] [error] TypeError: can only concatenate tuple
> (not "list") to tuple
>
> Do I have to configure anything related with grants or something like that?
>
> Thanks in advance,
>
> Agur bero bat,
>
>
> David Alda Fernández de Lezea
> Área de Sistemas de Información Geográfica, Planificación Territorial y
> Forestal Informazio Geografikoen Sistemak, Lurralde eta Baso Antolaketaren
> Arloa.
> dalda at hazi.eus | www.hazi.eus
> T 945 003 240 - M 627 923 170 - F 945 003 290
> Hazi | Granja Modelo de Arkaute s/n | 01192 Arkaute - Araba
>
> *********************  LEGE OHARRA   *******************   AVISOLEGAL
> *******************   DISCLAIMER   *****************************
> Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabilera
> debekatua dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta
> kontserbatu gabe.
> Este mensaje es personal y confidencial y su uso no autorizado está
> prohibido legalmente. Si usted no es el destinatario, proceda a borrarlo,
> sin reenviarlo ni conservarlo.
> This message is personal and confidential, unauthorised use is legally
> prohibited. If you are not the intended recipient, delete it without
> resending or backing it.
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>
>
>
>
> --
> Simone
>



-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20151014/88f0e25a/attachment-0001.html>


More information about the geonode-users mailing list