[GeoNode-users] Error on uploading (GeoServer response with 403)
Watermeyer, Andreas
Andreas.Watermeyer at its-digital.de
Thu May 24 01:21:16 PDT 2018
Hi Alessio,
thanks for your response!
>sorry, at this time I cannot be much useful on this topic since I had no time to test the latest changes on CentOS.
Ok. But I think this is not a matter of the underlying OS. There must be some kind of switch in GeoNode which is the reason for the different approaches.
Approach 1) Import via /geoserver/rest/import
Approach 2) Import via /geoserver/rest/workspaces/geonode/datastores/gdi/file.shp?charset=UTF-8&target=shp&update=overwrite&filename=lalala.zip
Any idea?
Maybe just a different configuration in GeoServer/GeoNode, a different "default" workspace, a different GeoNode version, GeoServer "Import-Client" version, I dont know..
Best regards,
Andreas
________________________________
Von: Alessio Fabiani <alessio.fabiani at geo-solutions.it>
Gesendet: Donnerstag, 24. Mai 2018 10:03
An: Watermeyer, Andreas
Cc: geonode-users at lists.osgeo.org
Betreff: Re: [GeoNode-users] Error on uploading (GeoServer response with 403)
Hello Andreas,
sorry, at this time I cannot be much useful on this topic since I had no time to test the latest changes on CentOS.
Hopefully I could be able to find some time during the weekend / next week.
Before moving on with the release, we should test all the installations again and update the documentation accordingly.
Btw any help is much appreciated!
Regards,
Alessio Fabiani
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==
Ing. Alessio Fabiani
@alfa7691
Founder/Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
2018-05-24 10:00 GMT+02:00 Watermeyer, Andreas <Andreas.Watermeyer at its-digital.de<mailto:Andreas.Watermeyer at its-digital.de>>:
Hello list,
there is one more strange thing: I have another GeoNode installation on Ubuntu, installed via PPA, which is working fine. On CentOS the layer upload is broken.
There is a difference on layer upload in the tomcat access logs between Ubuntu and CentOS:
- On *CentOS* there are serveral request to "/geoserver/rest/imports/*". The last one results in a 403. As a result the entire upload fails:
"PUT /geoserver/rest/imports/52/tasks/0/target HTTP/1.1" 403
- On *Ubuntu* the requests to "/geoserver/rest/imports/*" are completely missing in the tomcat access logs. But the upload of the layer works. What I found in the logs instead:
"PUT /geoserver/rest/workspaces/geonode/datastores/gdi/file.shp?charset=UTF-8&target=shp&update=overwrite&filename=lalala.zip HTTP/1.1" 201 -
So: It seems on Ubuntu a different HTTP-API is used to upload the data, which is working.
What may be the reason for this? How can I fix this? Maybe different versions of GeoNode?
Best regards,
Andreas
________________________________
Von: geonode-users <geonode-users-bounces at lists.osgeo.org<mailto:geonode-users-bounces at lists.osgeo.org>> im Auftrag von Watermeyer, Andreas <Andreas.Watermeyer at its-digital.de<mailto:Andreas.Watermeyer at its-digital.de>>
Gesendet: Mittwoch, 23. Mai 2018 18:35:21
An: geonode-users at lists.osgeo.org<mailto:geonode-users at lists.osgeo.org>
Betreff: [GeoNode-users] Error on uploading (GeoServer response with 403)
Hi all,
I am new to GeoNode and I have a problem with uploading shapefiles.
Environment: CentOS 7, GeoNode 2.8, installation according to "GeoNode (v2.8) installation on CentOS 7", with a couple of tweaks to make it work:
http://docs.geonode.org/en/master/tutorials/install_and_admin/setup_on_centos/index.html
Initially uploads were possible. But maps where broken, because GeoNode is not running on localhost. Then I adjusted the siteurl and the related parameters. Maps are working now, but the uploads are broken. Apparently I am not able to fully revert the changes for testing purposes; the uploads remain broken.
Problem:
"Unespected error!" when uploading a shapefile using the GeoNode "Upload Layer" wizard.
Logs files: See below.
What I found out:
This GeoNode request to GeoServer results in a 403:
10.11.202.130 - - [23/May/2018:18:06:15 +0200] "PUT /geoserver/rest/imports/51/tasks/0/target HTTP/1.1" 403 997 "-" "Python-httplib2/0.10.3 (gzip)"
According to the GeoNode docs the communication between GeoNode and GeoServer is using Basic Authentication. However this request contains no Basic Auth headers, see attached Apache Forensic Logs.
GeoNode uses httplib2 to issue the HTTP request and it is configured using the required username and password. But apparently httplib requires an 401 response from the server first, otherwise it will not send the credentials:
https://github.com/httplib2/httplib2/issues/16
But GeoServer does not send a 401 but 403. If I tweak the GeoNode code and send the Basic Authentication header manually along with the request everything works fine.
I suppose this is a side effect of a broken configuration but I have no idea where to look. I have double checked many config files in GeoServer and GeoNode and replaced localhost with the real hostname. Also recreated the oauth conf using an adapted version of the Ubuntu updateip-script etc.
Any hints are much appreciated!
Best regards,
Andreas
----- Apache Log Errror Log -------
[Wed May 23 11:06:15.168589 2018] [:error] [pid 12859] Traceback (most recent call last):
[Wed May 23 11:06:15.168604 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode/geonode/upload/views.py", line 643, in view
[Wed May 23 11:06:15.168608 2018] [:error] [pid 12859] resp = _steps[step](req, upload_session)
[Wed May 23 11:06:15.168611 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode/geonode/upload/views.py", line 417, in check_step_view
[Wed May 23 11:06:15.168614 2018] [:error] [pid 12859] return next_step_response(request, upload_session)
[Wed May 23 11:06:15.168616 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode/geonode/upload/utils.py", line 377, in next_step_response
[Wed May 23 11:06:15.168619 2018] [:error] [pid 12859] return run_response(req, upload_session)
[Wed May 23 11:06:15.168622 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode/geonode/upload/utils.py", line 618, in run_response
[Wed May 23 11:06:15.168624 2018] [:error] [pid 12859] run_import(upload_session)
[Wed May 23 11:06:15.168627 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode/geonode/upload/utils.py", line 590, in run_import
[Wed May 23 11:06:15.168629 2018] [:error] [pid 12859] task.set_target(target.name<http://target.name>, target.workspace.name<http://target.workspace.name>)
[Wed May 23 11:06:15.168632 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode-virtualenv/lib/python2.7/site-packages/gsimporter/api.py", line 285, in set_target
[Wed May 23 11:06:15.168642 2018] [:error] [pid 12859] self.target.change_datastore(store_name, workspace)
[Wed May 23 11:06:15.168645 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode-virtualenv/lib/python2.7/site-packages/gsimporter/api.py", line 211, in change_datastore
[Wed May 23 11:06:15.168649 2018] [:error] [pid 12859] self._client().put_json(self.href,json.dumps(target_rep))
[Wed May 23 11:06:15.168651 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode-virtualenv/lib/python2.7/site-packages/gsimporter/client.py", line 149, in put_json
[Wed May 23 11:06:15.168654 2018] [:error] [pid 12859] "Content-type" : "application/json",
[Wed May 23 11:06:15.168657 2018] [:error] [pid 12859] File "/opt/gdi/geonode/geonode-virtualenv/lib/python2.7/site-packages/gsimporter/client.py", line 176, in _request
[Wed May 23 11:06:15.168660 2018] [:error] [pid 12859] raise RequestFailed(resp.status,content)
[Wed May 23 11:06:15.168664 2018] [:error] [pid 12859] RequestFailed: (403, '<html><head><title>Apache Tomcat/7.0.76 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Zugriff verweigert</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Zugriff verweigert</u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.76</h3></body></html>')
------------ Apache Access Log ----------
10.11.202.130 - - [23/May/2018:18:06:13 +0200] "GET /geoserver/rest/imports/50/tasks/0/progress HTTP/1.1" 200 43 "-" "Python-httplib2/0.10.3 (gzip)"
10.11.100.215 - - [23/May/2018:18:06:13 +0200] "GET /upload/progress?id=50 HTTP/1.1" 200 18 "http://myhost.local/layers/upload" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
10.11.202.130 - - [23/May/2018:18:06:13 +0200] "GET /api/users/admin HTTP/1.1" 200 68 "-" "Apache-HttpClient/4.5.1 (Java/1.8.0_171)"
10.11.202.130 - - [23/May/2018:18:06:13 +0200] "GET /api/roles HTTP/1.1" 200 34 "-" "Apache-HttpClient/4.5.1 (Java/1.8.0_171)"
10.11.202.130 - - [23/May/2018:18:06:13 +0200] "GET /api/roles HTTP/1.1" 200 34 "-" "Apache-HttpClient/4.5.1 (Java/1.8.0_171)"
10.11.202.130 - - [23/May/2018:18:06:13 +0200] "GET /api/roles HTTP/1.1" 200 34 "-" "Apache-HttpClient/4.5.1 (Java/1.8.0_171)"
10.11.100.215 - - [23/May/2018:18:06:13 +0200] "POST /upload/ HTTP/1.1" 200 112 "http://myhost.local/layers/upload" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
10.11.100.215 - - [23/May/2018:18:06:14 +0200] "GET /upload/srs?id=51&force_ajax=true HTTP/1.1" 200 114 "http://myhost.local/layers/upload" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"
10.11.202.130 - - [23/May/2018:18:06:15 +0200] "PUT /geoserver/rest/imports/51/tasks/0/target HTTP/1.1" 403 997 "-" "Python-httplib2/0.10.3 (gzip)"
------ geoserver Logs -----------
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_oauth2_geonode_login'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_oauth2_geonode_login/'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_security_logout'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_security_logout/'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_oauth2_geonode_logout'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/j_spring_oauth2_geonode_logout/'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Checking match of request : 'Path: /rest/imports/51/tasks/0/target, QueryString: null'; against '/rest/**'
2018-05-23 16:06:15,132 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] - Matched Path: /rest/imports/51/tasks/0/target, QueryString: null with /rest/**
2018-05-23 16:06:15,158 DEBUG [geoserver.security] - Inspecting the http request looking for the GeoNode Session ID.
2018-05-23 16:06:15,158 DEBUG [geoserver.security] - Found no cookies!
2018-05-23 16:06:15,158 DEBUG [geoserver.security] - preAuthenticatedPrincipal = null, trying to authenticate
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Converted URL to lowercase, from: '/rest/imports/51/tasks/0/target'; to: '/rest/imports/51/tasks/0/target' and httpMethod= PUT
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~ antPath= /rest/process/batchdownload/download/* methodList= [GET]
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is: '/rest/imports/51/tasks/0/target'; antPath is /rest/process/batchdownload/download/*; matchedPath=false; matchedMethods=false
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~ antPath= /rest/printing/* methodList= [GET, POST]
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is: '/rest/imports/51/tasks/0/target'; antPath is /rest/printing/*; matchedPath=false; matchedMethods=false
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~ antPath= /** methodList= [GET]
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is: '/rest/imports/51/tasks/0/target'; antPath is /**; matchedPath=true; matchedMethods=false
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~ antPath= /** methodList= [POST, DELETE, PUT]
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is: '/rest/imports/51/tasks/0/target'; antPath is /**; matchedPath=true; matchedMethods=true
2018-05-23 16:06:15,159 DEBUG [security.RESTfulPathBasedFilterInvocationDefinitionMap] - returning ROLE_ADMINISTRATOR
2018-05-23 16:06:15,159 DEBUG [filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed
2018-05-23 16:06:37,890 DEBUG [geoserver.security] - AuthenticationCache Eviction task running
2018-05-23 16:06:37,891 DEBUG [geoserver.security] - Cache entries #: 1
2018-05-23 16:06:37,891 DEBUG [geoserver.security] - AuthenticationCache Eviction task completed
2018-05-23 16:06:37,891 DEBUG [geoserver.security] - Cache entries #: 1
2018-05-23 16:06:46,790 DEBUG [geoserver.wps] - Removing statuses matching [[[ NOT [ completionTime IS NULL ] ] AND org.geotools.filter.temporal.BeforeImpl at 3fe5cc15] AND [[ NOT [ lastUpdated IS NULL ] ] AND org.geotools.filter.temporal.BeforeImpl at 3ae17701]]
2018-05-23 16:07:46,791 DEBUG [geoserver.wps] - Removing statuses matching [[[ NOT [ completionTime IS NULL ] ] AND org.geotools.filter.temporal.BeforeImpl at 440106f5] AND [[ NOT [ lastUpdated IS NULL ] ] AND org.geotools.filter.temporal.BeforeImpl at 3efcb1e1]]
------ Apache Forensic Logs -------------
+WwWRdb9KGjJnr-C8P4dlvQAAAAc|GET /api/users/admin HTTP/1.1|Host:myhost.local|Connection:Keep-Alive|User-Agent:Apache-HttpClient/4.5.1 (Java/1.8.0_171)|Accept-Encoding:gzip,deflate
-WwWRdcvNymUGf1Y2uJyl3gAAAAQ
-WwWRdTtXhtCEmXsif6wu9QAAAAA
-WwWRdb9KGjJnr-C8P4dlvQAAAAc
+WwWRdb9KGjJnr-C8P4dlvgAAAAc|GET /api/roles HTTP/1.1|Host:myhost.local|Connection:Keep-Alive|User-Agent:Apache-HttpClient/4.5.1 (Java/1.8.0_171)|Accept-Encoding:gzip,deflate
-WwWRdb9KGjJnr-C8P4dlvgAAAAc
+WwWRdb9KGjJnr-C8P4dlvwAAAAc|GET /api/roles HTTP/1.1|Host:myhost.local|Connection:Keep-Alive|User-Agent:Apache-HttpClient/4.5.1 (Java/1.8.0_171)|Accept-Encoding:gzip,deflate
-WwWRdb9KGjJnr-C8P4dlvwAAAAc
+WwWRdb9KGjJnr-C8P4dlwAAAAAc|GET /api/roles HTTP/1.1|Host:myhost.local|Connection:Keep-Alive|User-Agent:Apache-HttpClient/4.5.1 (Java/1.8.0_171)|Accept-Encoding:gzip,deflate
-WwWRdb9KGjJnr-C8P4dlwAAAAAc
-WwWRdeA-J21YttgLDfeNPAAAAAI
+WwWRduA-J21YttgLDfeNPQAAAAI|GET /upload/srs?id=51&force_ajax=true HTTP/1.1|Host:myhost.local|Accept:*/*|X-Requested-With:XMLHttpRequest|User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHT
ML, like Gecko) Chrome/66.0.3359.181 Safari/537.36|Referer:http%3a//myhost.local/layers/upload|Accept-Encoding:gzip, deflate|Accept-Language:de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7|Cookie:csrftoken=gTCyxBP1jPafdvuoD4y
b7iIixtXdmHNi; sessionid=xqm2ssjmclf7sk8r0la1gi31gps850d6|Connection:keep-alive
-WwWRduA-J21YttgLDfeNPQAAAAI
+WwWRduA-J21YttgLDfeNPgAAAAI|GET /upload/check?id=51&force_ajax=true HTTP/1.1|Host:myhost.local|Accept:*/*|X-Requested-With:XMLHttpRequest|User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (K
HTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36|Referer:http%3a//myhost.local/layers/upload|Accept-Encoding:gzip, deflate|Accept-Language:de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7|Cookie:csrftoken=gTCyxBP1jPafdvuoD
4yb7iIixtXdmHNi; sessionid=xqm2ssjmclf7sk8r0la1gi31gps850d6|Connection:keep-alive
+WwWRd4Jc7dBshm8NrAoivwAAAAE|PUT /geoserver/rest/imports/51/tasks/0/target HTTP/1.1|Host:myhost.local|Content-Length:87|content-type:application/json|accept-encoding:gzip, deflate|user-agent:Python-httplib2/0.10.3 (gzip)
-WwWRd4Jc7dBshm8NrAoivwAAAAE
-WwWRduA-J21YttgLDfeNPgAAAAI
---------- local_settings.py ----------
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
import os
from geonode.settings import *
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.getenv('MEDIA_ROOT', os.path.join(PROJECT_ROOT, "uploaded"))
STATIC_ROOT = os.getenv('STATIC_ROOT',
os.path.join(PROJECT_ROOT, "static_root")
)
# SECRET_KEY = '************************'
SITEURL = "http://myhost.local/"
#SITEURL = "http://localhost/"
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '::1', 'myhost.local']
PROXY_ALLOWED_HOSTS = ("127.0.0.1", 'localhost', '::1', 'myhost.local' )
POSTGIS_VERSION = (2, 4, 0)
# TIME_ZONE = 'Europe/Paris'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
# "default" and "data" use the same DB but different schemas.
# each user "gdi" and "geonode" has a corresponding DB "search_path".
#'OPTIONS': {
# 'options': '-c search_path=geonode,public'
# },
'NAME': 'gdi',
'USER': 'geonode',
'PASSWORD': 'geonode',
'HOST': 'localhost',
'PORT': '5432',
'CONN_TOUT': 900,
},
# vector datastore for uploads
'datastore': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
#'OPTIONS': {
# 'options': '-c search_path=gdi,public'
#},
'NAME': 'gdi',
'USER': 'gdi',
'PASSWORD': 'gdi',
'HOST': 'localhost',
'PORT': '5432',
'CONN_TOUT': 900,
}
}
GEOSERVER_LOCATION = os.getenv(
'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/'
)
GEOSERVER_PUBLIC_LOCATION = os.getenv(
# 'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', 'http://myhost.local/geoserver/'
)
OGC_SERVER_DEFAULT_USER = os.getenv(
'GEOSERVER_ADMIN_USER', 'admin'
)
OGC_SERVER_DEFAULT_PASSWORD = os.getenv(
'GEOSERVER_ADMIN_PASSWORD', 'geoserver'
)
# OGC (WMS/WFS/WCS) Server Settings
OGC_SERVER = {
'default': {
'BACKEND': 'geonode.geoserver',
'LOCATION': GEOSERVER_LOCATION,
'LOGIN_ENDPOINT': 'j_spring_oauth2_geonode_login',
'LOGOUT_ENDPOINT': 'j_spring_oauth2_geonode_logout',
# PUBLIC_LOCATION needs to be kept like this because in dev mode
# the proxy won't work and the integration tests will fail
# the entire block has to be overridden in the local_settings
'PUBLIC_LOCATION': GEOSERVER_PUBLIC_LOCATION,
'USER': OGC_SERVER_DEFAULT_USER,
'PASSWORD': OGC_SERVER_DEFAULT_PASSWORD,
'MAPFISH_PRINT_ENABLED': True,
'PRINT_NG_ENABLED': True,
'GEONODE_SECURITY_ENABLED': True,
'GEOFENCE_SECURITY_ENABLED': True,
'GEOGIG_ENABLED': False,
'WMST_ENABLED': False,
'BACKEND_WRITE_ENABLED': True,
'WPS_ENABLED': False,
'LOG_FILE': '%s/geoserver/data/logs/geoserver.log' % os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir)),
# Set to dictionary identifier of database containing spatial data in DATABASES dictionary to enable
'DATASTORE': 'datastore',
'PG_GEOGIG': False,
'TIMEOUT': 10 # number of seconds to allow for HTTP requests
}
}
# WARNING: Map Editing is affected by this. GeoExt Configuration is cached for 5 minutes
# CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
# 'LOCATION': '/var/tmp/django_cache',
# }
# }
# If you want to enable Mosaics use the following configuration
UPLOADER = {
# 'BACKEND': 'geonode.rest',
'BACKEND': 'geonode.importer',
'OPTIONS': {
'TIME_ENABLED': True,
'MOSAIC_ENABLED': False,
'GEOGIG_ENABLED': False,
},
'SUPPORTED_CRS': [
'EPSG:4326',
'EPSG:3785',
'EPSG:3857',
'EPSG:900913',
'EPSG:32647',
'EPSG:32736'
],
'SUPPORTED_EXT': [
'.shp',
'.csv',
'.kml',
'.kmz',
'.json',
'.geojson',
'.tif',
'.tiff',
'.geotiff',
'.gml',
'.xml'
]
}
CATALOGUE = {
'default': {
# The underlying CSW implementation
# default is pycsw in local mode (tied directly to GeoNode Django DB)
'ENGINE': 'geonode.catalogue.backends.pycsw_local',
# pycsw in non-local mode
# 'ENGINE': 'geonode.catalogue.backends.pycsw_http',
# GeoNetwork opensource
# 'ENGINE': 'geonode.catalogue.backends.geonetwork',
# deegree and others
# 'ENGINE': 'geonode.catalogue.backends.generic',
# The FULLY QUALIFIED base url to the CSW instance for this GeoNode
'URL': '%s/catalogue/csw' % SITEURL,
# 'URL': 'http://localhost:8080/geonetwork/srv/en/csw',
# 'URL': 'http://localhost:8080/deegree-csw-demo-3.0.4/services',
# login credentials (for GeoNetwork)
'USER': 'admin',
'PASSWORD': 'admin',
'ALTERNATES_ONLY': True,
}
}
# pycsw settings
PYCSW = {
# pycsw configuration
'CONFIGURATION': {
# uncomment / adjust to override server config system defaults
# 'server': {
# 'maxrecords': '10',
# 'pretty_print': 'true',
# 'federatedcatalogues': 'http://catalog.data.gov/csw'
# },
'metadata:main': {
'identification_title': 'GeoNode Catalogue',
'identification_abstract': 'GeoNode is an open source platform' \
' that facilitates the creation, sharing, and collaborative use' \
' of geospatial data',
'identification_keywords': 'sdi, catalogue, discovery, metadata,' \
' GeoNode',
'identification_keywords_type': 'theme',
'identification_fees': 'None',
'identification_accessconstraints': 'None',
'provider_name': 'Organization Name',
'provider_url': SITEURL,
'contact_name': 'Lastname, Firstname',
'contact_position': 'Position Title',
'contact_address': 'Mailing Address',
'contact_city': 'City',
'contact_stateorprovince': 'Administrative Area',
'contact_postalcode': 'Zip or Postal Code',
'contact_country': 'Country',
'contact_phone': '+xx-xxx-xxx-xxxx',
'contact_fax': '+xx-xxx-xxx-xxxx',
'contact_email': 'Email Address',
'contact_url': 'Contact URL',
'contact_hours': 'Hours of Service',
'contact_instructions': 'During hours of service. Off on ' \
'weekends.',
'contact_role': 'pointOfContact',
},
'metadata:inspire': {
'enabled': 'true',
'languages_supported': 'eng,gre',
'default_language': 'eng',
'date': 'YYYY-MM-DD',
'gemet_keywords': 'Utility and governmental services',
'conformity_service': 'notEvaluated',
'contact_name': 'Organization Name',
'contact_email': 'Email Address',
'temp_extent': 'YYYY-MM-DD/YYYY-MM-DD',
}
}
}
# GeoNode javascript client configuration
# default map projection
# Note: If set to EPSG:4326, then only EPSG:4326 basemaps will work.
DEFAULT_MAP_CRS = "EPSG:3857"
# Where should newly created maps be focused?
DEFAULT_MAP_CENTER = (0, 0)
# How tightly zoomed should newly created maps be?
# 0 = entire world;
# maximum zoom is between 12 and 15 (for Google Maps, coverage varies by area)
DEFAULT_MAP_ZOOM = 0
# Default preview library
# GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'geoext' # DEPRECATED use HOOKSET instead
GEONODE_CLIENT_HOOKSET = "geonode.client.hooksets.GeoExtHookSet"
# To enable the REACT based Client enable those
# INSTALLED_APPS += ('geonode-client', )
# GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'react' # DEPRECATED use HOOKSET instead
# GEONODE_CLIENT_HOOKSET = "geonode.client.hooksets.ReactHookSet"
# To enable the Leaflet based Client enable those
# GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'leaflet' # DEPRECATED use HOOKSET instead
# GEONODE_CLIENT_HOOKSET = "geonode.client.hooksets.LeafletHookSet"
# To enable the MapStore2 based Client enable those
# INSTALLED_APPS += ('geonode_mapstore_client', )
# GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'mapstore' # DEPRECATED use HOOKSET instead
# GEONODE_CLIENT_HOOKSET = "geonode_mapstore_client.hooksets.MapStoreHookSet"
# LEAFLET_CONFIG = {
# 'TILES': [
# # Find tiles at:
# # http://leaflet-extras.github.io/leaflet-providers/preview/
#
# # Map Quest
# ('Map Quest',
# 'http://otile4.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png<http://otile4.mqcdn.com/tiles/1.0.0/osm/%7Bz%7D/%7Bx%7D/%7By%7D.png>',
# 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a<http://www.mapquest.com/%22%3EMapQuest%3C/a>> '
# '— Map data © '
# '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a<http://www.openstreetmap.org/copyright%22%3EOpenStreetMap%3C/a>>'),
# # Stamen toner lite.
# # ('Watercolor',
# # 'http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png<http://%7Bs%7D.tile.stamen.com/watercolor/%7Bz%7D/%7Bx%7D/%7By%7D.png>',
# # 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, \
# # <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © \
# # <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, \
# # <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a<http://creativecommons.org/licenses/by-sa/2.0/%22%3ECC-BY-SA%3C/a>>'),
# # ('Toner Lite',
# # 'http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}.png<http://%7Bs%7D.tile.stamen.com/toner-lite/%7Bz%7D/%7Bx%7D/%7By%7D.png>',
# # 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, \
# # <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © \
# # <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, \
# # <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a<http://creativecommons.org/licenses/by-sa/2.0/%22%3ECC-BY-SA%3C/a>>'),
# ],
# 'PLUGINS': {
# 'esri-leaflet': {
# 'js': 'lib/js/esri-leaflet.js',
# 'auto-include': True,
# },
# 'leaflet-fullscreen': {
# 'css': 'lib/css/leaflet.fullscreen.css',
# 'js': 'lib/js/Leaflet.fullscreen.min.js',
# 'auto-include': True,
# },
# },
# 'SRID': 3857,
# 'RESET_VIEW': False
#}
ALT_OSM_BASEMAPS = os.environ.get('ALT_OSM_BASEMAPS', False)
CARTODB_BASEMAPS = os.environ.get('CARTODB_BASEMAPS', False)
STAMEN_BASEMAPS = os.environ.get('STAMEN_BASEMAPS', False)
THUNDERFOREST_BASEMAPS = os.environ.get('THUNDERFOREST_BASEMAPS', False)
MAPBOX_ACCESS_TOKEN = os.environ.get('MAPBOX_ACCESS_TOKEN', None)
BING_API_KEY = os.environ.get('BING_API_KEY', None)
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY', None)
MAP_BASELAYERS = [{
"source": {"ptype": "gxp_olsource"},
"type": "OpenLayers.Layer",
"args": ["No background"],
"name": "background",
"visibility": False,
"fixed": True,
"group":"background"
},
# {
# "source": {"ptype": "gxp_olsource"},
# "type": "OpenLayers.Layer.XYZ<http://OpenLayers.Layer.XYZ>",
# "title": "TEST TILE",
# "args": ["TEST_TILE", "http://test_tiles/tiles/${z}/${x}/${y}.png<http://test_tiles/tiles/$%7Bz%7D/$%7Bx%7D/$%7By%7D.png>"],
# "name": "background",
# "attribution": "© TEST TILE",
# "visibility": False,
# "fixed": True,
# "group":"background"
# },
{
"source": {"ptype": "gxp_osmsource"},
"type": "OpenLayers.Layer.OSM",
"name": "mapnik",
"visibility": True,
"fixed": True,
"group": "background"
}]
if 'geonode.geoserver' in INSTALLED_APPS:
LOCAL_GEOSERVER = {
"source": {
"ptype": "gxp_wmscsource",
"url": OGC_SERVER['default']['PUBLIC_LOCATION'] + "wms",
"restUrl": "/gs/rest"
}
}
baselayers = MAP_BASELAYERS
MAP_BASELAYERS = [LOCAL_GEOSERVER]
MAP_BASELAYERS.extend(baselayers)
# Use kombu broker by default
# REDIS_URL = 'redis://localhost:6379/1'
# BROKER_URL = REDIS_URL
# CELERY_RESULT_BACKEND = REDIS_URL
CELERYD_HIJACK_ROOT_LOGGER = True
CELERYD_CONCURENCY = 1
# Set this to False to run real async tasks
CELERY_ALWAYS_EAGER = True
CELERYD_LOG_FILE = None
CELERY_REDIRECT_STDOUTS = True
CELERYD_LOG_LEVEL = 1
# Haystack Search Backend Configuration. To enable,
# first install the following:
# - pip install django-haystack
# - pip install elasticsearch==2.4.0
# - pip install woosh
# - pip install pyelasticsearch
# Set HAYSTACK_SEARCH to True
# Run "python manage.py rebuild_index"
# HAYSTACK_SEARCH = False
# Avoid permissions prefiltering
SKIP_PERMS_FILTER = False
# Update facet counts from Haystack
HAYSTACK_FACET_COUNTS = True
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'haystack',
},
# 'db': {
# 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
# 'EXCLUDED_INDEXES': ['thirdpartyapp.search_indexes.BarIndex'],
# }
}
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
# HAYSTACK_SEARCH_RESULTS_PER_PAGE = 20
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d '
'%(thread)d %(message)s'
},
'simple': {
'format': '%(message)s',
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR', 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
}
},
"loggers": {
"django": {
"handlers": ["console"], "level": "ERROR", },
"geonode": {
"handlers": ["console"], "level": "DEBUG", },
"gsconfig.catalog": {
"handlers": ["console"], "level": "DEBUG", },
"owslib": {
"handlers": ["console"], "level": "DEBUG", },
"pycsw": {
"handlers": ["console"], "level": "ERROR", },
"Client": {
"handlers": ["console"], "level": "DEBUG", },
},
}
# Additional settings
CORS_ORIGIN_ALLOW_ALL = True
GEOIP_PATH = "/usr/local/share/GeoIP"
# add following lines to your local settings to enable monitoring
MONITORING_ENABLED = True
if MONITORING_ENABLED:
if 'geonode.contrib.monitoring' not in INSTALLED_APPS:
INSTALLED_APPS += ('geonode.contrib.monitoring',)
if 'geonode.contrib.monitoring.middleware.MonitoringMiddleware' not in MIDDLEWARE_CLASSES:
MIDDLEWARE_CLASSES += \
('geonode.contrib.monitoring.middleware.MonitoringMiddleware',)
MONITORING_CONFIG = None
MONITORING_SERVICE_NAME = 'local-geonode'
#Define email service on GeoNode
EMAIL_ENABLE = True
if EMAIL_ENABLE:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'Example.com <no-reply at localhost>'
# Documents Thumbnails
UNOCONV_ENABLE = True
if UNOCONV_ENABLE:
UNOCONV_EXECUTABLE = os.getenv('UNOCONV_EXECUTABLE', '/usr/bin/unoconv')
UNOCONV_TIMEOUT = os.getenv('UNOCONV_TIMEOUT', 30) # seconds
# Advanced Security Workflow Settings
CLIENT_RESULTS_LIMIT = 20
API_LIMIT_PER_PAGE = 1000
FREETEXT_KEYWORDS_READONLY = False
RESOURCE_PUBLISHING = False
ADMIN_MODERATE_UPLOADS = False
GROUP_PRIVATE_RESOURCES = False
GROUP_MANDATORY_RESOURCES = False
MODIFY_TOPICCATEGORY = True
USER_MESSAGES_ALLOW_MULTIPLE_RECIPIENTS = True
DISPLAY_WMS_LINKS = True
# For more information on available settings please consult the Django docs at
# https://docs.djangoproject.com/en/dev/ref/settings
Best regards,
Andreas
_______________________________________________
geonode-users mailing list
geonode-users at lists.osgeo.org<mailto:geonode-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/geonode-users
_______________________________________________
geonode-users mailing list
geonode-users at lists.osgeo.org<mailto:geonode-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/geonode-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20180524/75bd7847/attachment-0001.html>
More information about the geonode-users
mailing list