From b9a23d52acffcffa2e345d43cdbae8626581f64f Mon Sep 17 00:00:00 2001 From: Florian Hoedt Date: Fri, 1 Mar 2019 09:23:43 +0100 Subject: [PATCH] squash merge commits from base repo to fork (#3) * introduce new GEOSERVER_WEB_UI_LOCATION options * Added chinese to ALL_LANGUAGES enumeration * improve layer_thumbnail view * improve map_thumbnail view * fix map_thumbnail returned None instead. * fix layer_thumbnail returned None instead. * proxy auth refactoring with extended checks * use requests retry to improve geonode/geoserver connection * fix import * fix force list status code * Related to fix for #4178 * - fix pavemenet cmdopts options * fix flake8 * fix flake8 * fixed mixing of token object and string in login/logout * fixed pep8 issues * fixed another pep8 issue * Adding all Oauth2 endpoints to lockdown exempt uris * fixed exception retrieving token object from empty session token * - Backporting GEOSERVER_WEB_UI_LOCATION to sample local settings * Update oauth.py * Cleaning up session if no valid access_token key has been found * [Security Cleanup] - Remove unuseful and potentially blocking calls from signals and login/out calls * Use gs instead of geoserver for URLs in Docker * Includes additional fields in the search index * add async_thumbnail to improve upload time * use celery first if enabled * disable threading in test we need to use TestCase threading aware * Fix handling of missing layers. When a missing layer is found during map_new the layer _resolve_layer was not throwing a missing object exception but was throwing Http404. As Http404 was uncaught it was causing the loop to fail instead of ignoring the missing data. * use celery task to generate thumbnails * Remove unwanted line of code in worldmap client * moved login/logout callbacks to profile module; renamed oauth utils to auth * remove unused import * Make sure geogig can be created in a schema other than public * Fix missing replacement of geoserver public location (#4215) * Fix missing replacement of geoserver public location * Fix diff visualization * Revert " Includes additional layer fields in the search index" (#4217) * Revert " Includes additional layer fields in the search index" * Keep fields which don't affect the upload failure * Remove not used settings sample * [Related to #4219] - mitigates the issue: Delayed Security Sync Task seems causing issues with sqlite queries * Update requirements.txt * Update requirements_docs.txt * Update requirements.txt * Update requirements_docs.txt * filter by vector time layers is not working when haystack is enabled. as for vector_time layer, 'vectorTimeSeries' is indexed instead of 'vector_time' * for haystack also get 'vector_time' layers when 'vector' type is selected as 'vector' is super type of 'vector_time'(same behavior of rest api) * Add rabbitmq volume * [minor] There was a wrong 'expiring' check on purging old tokens * use regex to extract schema * Add rabbitmq volume to main docker-compose.yml * Wait for GeoServer and PostgreSQL instead of failing * Use geoserver instead of gs (partial revert) * fix Object of type Map is not JSON serializable * - add missing header to Python file * Add suffix geoserver to BASEURL * Fixed a broken link in WorldMap documentation * use 'update' queue instead if using the default set task queue for the thumbnail_task to 'update' queue instead of using the default * Remove extra Postgres wait * Add ON_ERROR_STOP=1 * Use custom Postgres password * Use DATABASE_URL in pgdumper * Improve comment about POSTGRES_PASSWORD * Update GeoServer to 2.14.2 * Add support for plugins * Typo fix * Test with geonode-selenium * Import SSL Certificate for GeoServer * [Fixes #4247] 404 error on CSV upload * Fixes Travis geonode-selenium build * Fixes Travis geonode-selenium build * Fixes Travis geonode-selenium build * Fixes Travis geonode-selenium build * Fixes Travis geonode-selenium build * Fixes Travis geonode-selenium build * [Closes #4249] Contribute back upstream menu management from IGAD * - Fix smoke test cases * - Fix smoke test cases * Bump django-geoexplorer-worldmap==4.0.63 * Disable system_site_packages for geonode-selenium * Removes unnecessary dependencies from the requirements.txt and settings.py files. * Adds back pyopenssl to requirements.txt. * [Fixes #4254] Pavement YAMLLoadWarning * [minor] removing redoundant middleware class from settings --- .travis.yml | 470 ++++--- docker-compose.override.localhost.yml | 4 +- docker-compose.override.yml | 4 +- docker-compose.yml | 5 +- docs/reference/worldmap.txt | 4 +- .../customize/theme_admin.txt | 108 ++ .../img/admin_base_section.png | Bin 0 -> 32400 bytes .../customize_lookfeel/img/admin_menu.png | Bin 0 -> 14735 bytes .../customize_lookfeel/img/admin_menu_2.png | Bin 0 -> 14956 bytes .../img/admin_menu_item_1_1.png | Bin 0 -> 16397 bytes .../img/admin_menu_item_1_2.png | Bin 0 -> 16762 bytes .../img/admin_menu_item_2_1.png | Bin 0 -> 16809 bytes .../admin_menu_placeholder_initial_data.png | Bin 0 -> 15048 bytes .../img/admin_menu_placeholders.png | Bin 0 -> 15841 bytes .../customize_lookfeel/img/custom_menu_1.png | Bin 0 -> 49345 bytes .../customize_lookfeel/img/custom_menu_2.png | Bin 0 -> 49874 bytes .../img/custom_right_menu.png | Bin 0 -> 76270 bytes .../geonode_install/create_geonode_db.txt | 2 +- .../geonode_install/setup_configure_httpd.txt | 6 +- .../geonode_update/26_to_27/index.txt | 2 +- .../resources/docker-compose.yml | 4 +- .../setup_on_centos/install_geonode.txt | 4 +- geonode/api/resourcebase_api.py | 3 + geonode/api/tests.py | 1 + geonode/base/admin.py | 24 +- geonode/base/auth.py | 144 ++ geonode/base/enumerations.py | 1 + geonode/base/fixtures/initial_data.json | 7 + .../migrations/0036_auto_20190129_1433.py | 61 + .../migrations/0037_auto_20190222_1347.py | 20 + geonode/base/models.py | 239 +--- geonode/base/templates/base/menu.html | 50 + geonode/base/templatetags/base_tags.py | 23 +- geonode/base/tests.py | 412 +++++- geonode/contrib/worldmap/wm_extra/views.py | 4 +- geonode/geoserver/helpers.py | 100 +- geonode/geoserver/signals.py | 20 +- geonode/geoserver/tasks.py | 24 +- geonode/geoserver/utils.py | 53 + geonode/geoserver/views.py | 26 +- geonode/layers/search_indexes.py | 4 +- geonode/layers/views.py | 61 +- geonode/local_settings.py.geoserver.sample | 5 + geonode/local_settings.py.psql_test | 140 -- geonode/maps/views.py | 45 +- geonode/messaging/consumer.py | 5 +- geonode/people/models.py | 49 +- geonode/proxy/tests.py | 10 +- geonode/proxy/views.py | 55 +- geonode/security/tasks.py | 132 +- geonode/security/utils.py | 1212 ++++++++--------- geonode/settings.py | 25 +- geonode/static/geonode/js/upload/LayerInfo.js | 2 +- geonode/static/geonode/js/upload/csv.js | 2 +- geonode/templates/base.html | 50 +- geonode/tests/integration.py | 1 - geonode/upload/utils.py | 9 +- package/support/geonode.local_settings | 2 +- pavement.py | 23 +- requirements.txt | 75 +- requirements_docs.txt | 2 +- scripts/docker/env/production/celery.env | 2 +- scripts/docker/env/production/django.env | 2 +- scripts/spcgeonode/.env | 3 + scripts/spcgeonode/django/initialize.py | 67 +- scripts/spcgeonode/docker-compose.yml | 13 +- scripts/spcgeonode/geoserver/Dockerfile | 36 +- .../spcgeonode/geoserver/docker-entrypoint.sh | 55 +- scripts/spcgeonode/pgdumper/Dockerfile | 9 +- scripts/spcgeonode/pgdumper/crontab | 2 +- .../spcgeonode/pgdumper/docker-entrypoint.sh | 7 + tasks.py | 2 +- 72 files changed, 2408 insertions(+), 1524 deletions(-) create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_base_section.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_2.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_item_1_1.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_item_1_2.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_item_2_1.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_placeholder_initial_data.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/admin_menu_placeholders.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/custom_menu_1.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/custom_menu_2.png create mode 100644 docs/tutorials/admin/customize_lookfeel/img/custom_right_menu.png create mode 100644 geonode/base/auth.py create mode 100644 geonode/base/migrations/0036_auto_20190129_1433.py create mode 100644 geonode/base/migrations/0037_auto_20190222_1347.py create mode 100644 geonode/base/templates/base/menu.html create mode 100644 geonode/geoserver/utils.py delete mode 100644 geonode/local_settings.py.psql_test create mode 100755 scripts/spcgeonode/pgdumper/docker-entrypoint.sh diff --git a/.travis.yml b/.travis.yml index e4bcf7c215d..1760be9599c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,211 +1,259 @@ -sudo: false - -language: python - -cache: - pip: true - directories: - - $HOME/buildout-cache - -before_cache: - - rm -f $HOME/.cache/pip/log/debug.log - -virtualenv: - system_site_packages: true - -services: - - docker - - postgresql - -addons: - hosts: - - geonode - postgresql: 9.6 - apt: - packages: - - postgresql-9.6-postgis-2.3 - - nginx - -matrix: - fast_finish: true - include: - - name: "GeoServer-backend Core Modules Smoke Tests" - python: 2.7 - env: - - BACKEND: 'geonode.geoserver' - ON_TRAVIS: 'True' - TEST_RUN_CORE: 'True' - MONITORING_ENABLED: 'False' - - name: "GeoServer-backend Contrib Apps Smoke Tests" - python: 2.7 - env: - - BACKEND: 'geonode.geoserver' - ON_TRAVIS: 'True' - TEST_RUN_INTERNAL_APPS: 'True' - MONITORING_ENABLED: 'False' - - name: "GeoServer-backend Integration Tests" - python: 2.7 - env: - - BACKEND: 'geonode.geoserver' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is GeoServer server address - GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ - GEOSERVER_SERVER_PORT: 8080 - ON_TRAVIS: 'True' - TEST_RUN_INTEGRATION: 'True' - TEST_RUN_INTEGRATION_CSW: 'False' - TEST_RUN_INTEGRATION_BDD: 'False' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - - name: "GeoServer-backend Integration CSW Tests" - python: 2.7 - env: - - BACKEND: 'geonode.geoserver' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is GeoServer server address - GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ - GEOSERVER_SERVER_PORT: 8080 - ON_TRAVIS: 'True' - TEST_RUN_INTEGRATION: 'False' - TEST_RUN_INTEGRATION_CSW: 'True' - TEST_RUN_INTEGRATION_BDD: 'False' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - - name: "GeoServer-backend Integration BDD Tests" - python: 2.7 - env: - - BACKEND: 'geonode.geoserver' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is GeoServer server address - GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ - GEOSERVER_SERVER_PORT: 8080 - ON_TRAVIS: 'True' - TEST_RUN_INTEGRATION: 'False' - TEST_RUN_INTEGRATION_CSW: 'False' - TEST_RUN_INTEGRATION_BDD: 'True' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - - name: "QGis Server-backend Core Modules Smoke Tests" - python: 2.7 - env: - - BACKEND: 'geonode.qgis_server' - DJANGO_SETTINGS_MODULE: 'geonode.local_settings' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is qgis server address - QGIS_SERVER_URL: http://localhost:9000/ - # This is the location of docker network bridge - # So QGIS server can access this address - SITEURL: http://localhost:8000/ - QGIS_SERVER_PORT: 9000 - ON_TRAVIS: 'True' - TEST_RUN_CORE: 'True' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - - name: "QGis Server-backend Contrib Apps Smoke Tests" - python: 2.7 - env: - - BACKEND: 'geonode.qgis_server' - DJANGO_SETTINGS_MODULE: 'geonode.local_settings' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is qgis server address - QGIS_SERVER_URL: http://localhost:9000/ - # This is the location of docker network bridge - # So QGIS server can access this address - SITEURL: http://localhost:8000/ - QGIS_SERVER_PORT: 9000 - ON_TRAVIS: 'True' - TEST_RUN_INTERNAL_APPS: 'True' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - - name: "QGis Server-backend Integration Tests" - python: 2.7 - env: - - BACKEND: 'geonode.qgis_server' - DJANGO_SETTINGS_MODULE: 'geonode.local_settings' - DOCKER_COMPOSE_VERSION: 1.19.0 - # This is qgis server address - QGIS_SERVER_URL: http://localhost:9000/ - # This is the location of docker network bridge - # So QGIS server can access this address - SITEURL: http://localhost:8000/ - QGIS_SERVER_PORT: 9000 - ON_TRAVIS: 'True' - TEST_RUN_INTEGRATION: 'True' - MONITORING_ENABLED: 'False' - CELERY_ALWAYS_EAGER: 'True' - -branches: - only: - - master - - 2.8.x - - 2.6.x - -before_install: - - mkdir -p $HOME/buildout-cache/{eggs,downloads} - - scripts/misc/geoserver_server_setup.sh before_install - - scripts/misc/qgis_server_setup.sh before_install - - chmod +x scripts/misc/bdd_setup.sh - - scripts/misc/bdd_setup.sh before_install - -install: - - sudo apt-get -qq -y update - - sudo apt-get install -y libgdal1h python-gdal gdal-bin spatialite-bin - - sudo apt-get install -y python-virtualenv python-imaging python-lxml python-pyproj python-shapely python-nose python-httplib2 python-httplib2 gettext - - sudo apt-get install -y python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk - - sudo add-apt-repository -y ppa:webupd8team/java - - sudo apt-get update - - sudo apt-get install -y --force-yes oracle-java8-set-default ant maven --no-install-recommends - - sudo update-java-alternatives --set java-8-oracle - - pip install -r requirements.txt --upgrade - - pip install -e . --upgrade - - pip install pygdal==`gdal-config --version` - - pip install codecov - -before_script: - # Initialize DB - # - sudo apt-get install postgresql-9.6-postgis-2.3 -y -q - - psql -U postgres -c "create extension postgis" - - chmod +x scripts/misc/create_dbs_travis.sh - - scripts/misc/create_dbs_travis.sh before_script - # For GeoServer Server Travis steps - - scripts/misc/geoserver_server_setup.sh before_script - # For QGIS Server Travis steps - - scripts/misc/qgis_server_setup.sh before_script - - scripts/misc/bdd_setup.sh before_script - - # Start NGINX server - - sudo nginx -s stop - - sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf - - # Setup GeoNode - - paver setup - -script: - - paver run_tests --coverage --local false - -after_script: - # For GeoServer Server Travis steps - - scripts/misc/geoserver_server_setup.sh after_script - # For QGIS Server Travis steps - - scripts/misc/qgis_server_setup.sh after_script - - # Stop NGINX server - - sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf -s stop - - # Cleanup - - paver reset_hard - -# after_success: - # - codecov - # - bash <(curl -s https://codecov.io/bash) -t 2c0e7780-1640-45f0-93a3-e103b057d8c8 - -notifications: - # irc: - # channels: - # - "irc.freenode.org#geonode" - # use_notice: true - email: - - alessio.fabiani@gmail.com - # - ingenieroariel@gmail.com - # - simone.dalmasso@gmail.com - # slack: geonode-sprint:oQylJRkU9feZ8JruGi6czWwe +sudo: required +language: python +dist: xenial + +cache: + pip: true + directories: + - $HOME/buildout-cache + +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log + +services: + - docker + - postgresql + +addons: + hosts: + - geonode + postgresql: 9.6 + apt: + packages: + - postgresql-9.6-postgis-2.4 + - nginx + firefox: "latest-esr" + +matrix: + fast_finish: true + include: + - name: "GeoServer-backend Core Modules Smoke Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.geoserver' + DOCKER_COMPOSE_VERSION: 1.19.0 + ON_TRAVIS: 'True' + TEST_RUN_CORE: 'True' + MONITORING_ENABLED: 'False' + - name: "GeoServer-backend Contrib Apps Smoke Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.geoserver' + DOCKER_COMPOSE_VERSION: 1.19.0 + ON_TRAVIS: 'True' + TEST_RUN_INTERNAL_APPS: 'True' + MONITORING_ENABLED: 'False' + - name: "GeoServer-backend Integration Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.geoserver' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is GeoServer server address + GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ + GEOSERVER_SERVER_PORT: 8080 + ON_TRAVIS: 'True' + TEST_RUN_INTEGRATION: 'True' + TEST_RUN_INTEGRATION_CSW: 'False' + TEST_RUN_INTEGRATION_BDD: 'False' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "GeoServer-backend Integration CSW Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.geoserver' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is GeoServer server address + GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ + GEOSERVER_SERVER_PORT: 8080 + ON_TRAVIS: 'True' + TEST_RUN_INTEGRATION: 'False' + TEST_RUN_INTEGRATION_CSW: 'True' + TEST_RUN_INTEGRATION_BDD: 'False' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "GeoServer-backend Integration BDD Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.geoserver' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is GeoServer server address + GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/ + GEOSERVER_SERVER_PORT: 8080 + ON_TRAVIS: 'True' + TEST_RUN_INTEGRATION: 'False' + TEST_RUN_INTEGRATION_CSW: 'False' + TEST_RUN_INTEGRATION_BDD: 'True' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "QGis Server-backend Core Modules Smoke Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.qgis_server' + DJANGO_SETTINGS_MODULE: 'geonode.local_settings' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is qgis server address + QGIS_SERVER_URL: http://localhost:9000/ + # This is the location of docker network bridge + # So QGIS server can access this address + SITEURL: http://localhost:8000/ + QGIS_SERVER_PORT: 9000 + ON_TRAVIS: 'True' + TEST_RUN_CORE: 'True' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "QGis Server-backend Contrib Apps Smoke Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.qgis_server' + DJANGO_SETTINGS_MODULE: 'geonode.local_settings' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is qgis server address + QGIS_SERVER_URL: http://localhost:9000/ + # This is the location of docker network bridge + # So QGIS server can access this address + SITEURL: http://localhost:8000/ + QGIS_SERVER_PORT: 9000 + ON_TRAVIS: 'True' + TEST_RUN_INTERNAL_APPS: 'True' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "QGis Server-backend Integration Tests" + python: 2.7 + virtualenv: + system_site_packages: true + env: + - BACKEND: 'geonode.qgis_server' + DJANGO_SETTINGS_MODULE: 'geonode.local_settings' + DOCKER_COMPOSE_VERSION: 1.19.0 + # This is qgis server address + QGIS_SERVER_URL: http://localhost:9000/ + # This is the location of docker network bridge + # So QGIS server can access this address + SITEURL: http://localhost:8000/ + QGIS_SERVER_PORT: 9000 + ON_TRAVIS: 'True' + TEST_RUN_INTEGRATION: 'True' + MONITORING_ENABLED: 'False' + CELERY_ALWAYS_EAGER: 'True' + - name: "Selenium Integration Tests" + python: 3.5 + env: + - TEST_RUN_SELENIUM: 'True' + +branches: + only: + - master + - 2.8.x + - 2.6.x + +before_install: + - if [ "$TEST_RUN_SELENIUM" = "True" ]; then + git clone --depth 1 https://github.com/GeoNode/geonode-selenium.git; + export GEONODE_REPOSITORY=$(pwd); + GECKODRIVER_VERSION="v0.24.0"; + else + sudo apt-get update + sudo /etc/init.d/postgresql stop + sudo /etc/init.d/postgresql start 9.6 + mkdir -p $HOME/buildout-cache/{eggs,downloads}; + scripts/misc/geoserver_server_setup.sh before_install; + scripts/misc/qgis_server_setup.sh before_install; + chmod +x scripts/misc/bdd_setup.sh; + scripts/misc/bdd_setup.sh before_install; + fi + +install: + - if [ "$TEST_RUN_SELENIUM" = "True" ]; then + pip install -r geonode-selenium/requirements.txt; + wget https://download.osgeo.org/geotiff/samples/spot/chicago/UTM2GTIF.TIF -P geonode-selenium/data; + wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -O geckodriver.tar.gz; + mkdir bin; + tar zxf geckodriver.tar.gz -C bin; + export PATH=$PATH:$PWD/bin; + else + sudo apt-get -qq -y update; + sudo apt-get install -y libgdal1i python-gdal gdal-bin spatialite-bin; + sudo apt-get install -y python-virtualenv python-imaging python-lxml python-pyproj python-shapely python-nose python-httplib2 python-httplib2 gettext; + sudo apt-get install -y python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk; + sudo apt-add-repository -y ppa:webupd8team/java; sudo apt update; + echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections; + echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections; + sudo apt install -y oracle-java8-set-default ant maven; + sudo update-java-alternatives --set java-8-oracle; + export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") + export PATH=$JAVA_HOME'bin/java':$PATH + pip install -r requirements.txt --upgrade; + pip install -e . --upgrade; + pip install pygdal==`gdal-config --version`.*; + pip install codecov; + fi + +before_script: + - if [ "$TEST_RUN_SELENIUM" = "True" ]; then + sudo service nginx stop; + else + echo "Initialize DB"; + psql -U postgres -c "create extension postgis"; + chmod +x scripts/misc/create_dbs_travis.sh; + scripts/misc/create_dbs_travis.sh before_script; + echo "For GeoServer Server Travis steps"; + scripts/misc/geoserver_server_setup.sh before_script; + echo "For QGIS Server Travis steps"; + scripts/misc/qgis_server_setup.sh before_script; + scripts/misc/bdd_setup.sh before_script; + echo "Start NGINX server"; + sudo nginx -s stop; + sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf; + echo "Setup GeoNode"; + paver setup; + fi + +script: + - if [ "$TEST_RUN_SELENIUM" = "True" ]; then + geonode-selenium/test-docker.sh; + else + paver run_tests --coverage --local false; + fi + +after_script: + - if [ "$TEST_RUN_SELENIUM" = "True" ]; then + true; + else + echo "For GeoServer Server Travis steps"; + scripts/misc/geoserver_server_setup.sh after_script; + echo "For QGIS Server Travis steps"; + scripts/misc/qgis_server_setup.sh after_script; + echo "Stop NGINX server"; + sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf -s stop; + echo "Cleanup"; + paver reset_hard; + fi + +# after_success: + # - codecov + # - bash <(curl -s https://codecov.io/bash) -t 2c0e7780-1640-45f0-93a3-e103b057d8c8 + +notifications: + # irc: + # channels: + # - "irc.freenode.org#geonode" + # use_notice: true + email: + - alessio.fabiani@gmail.com + # - ingenieroariel@gmail.com + # - simone.dalmasso@gmail.com + # slack: geonode-sprint:oQylJRkU9feZ8JruGi6czWwe diff --git a/docker-compose.override.localhost.yml b/docker-compose.override.localhost.yml index 57b597979e6..75c68c79141 100644 --- a/docker-compose.override.localhost.yml +++ b/docker-compose.override.localhost.yml @@ -14,7 +14,7 @@ services: - GEONODE_LB_PORT=80 - SITEURL=http://localhost/ - ALLOWED_HOSTS=['localhost', ] - - GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ + - GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/ celery: build: . @@ -26,7 +26,7 @@ services: - GEONODE_LB_PORT=80 - SITEURL=http://localhost/ - ALLOWED_HOSTS=['localhost', ] - - GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ + - GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/ geoserver: environment: diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 57b597979e6..75c68c79141 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -14,7 +14,7 @@ services: - GEONODE_LB_PORT=80 - SITEURL=http://localhost/ - ALLOWED_HOSTS=['localhost', ] - - GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ + - GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/ celery: build: . @@ -26,7 +26,7 @@ services: - GEONODE_LB_PORT=80 - SITEURL=http://localhost/ - ALLOWED_HOSTS=['localhost', ] - - GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ + - GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/ geoserver: environment: diff --git a/docker-compose.yml b/docker-compose.yml index 7a3e6ad0040..cb2fb9f5261 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: labels: org.geonode.component: rabbitmq org.geonode.instance.name: geonode + volumes: + - rabbitmq:/var/lib/rabbitmq celery: restart: unless-stopped @@ -138,4 +140,5 @@ volumes: name: ${COMPOSE_PROJECT_NAME}-dbdata dbbackups: name: ${COMPOSE_PROJECT_NAME}-dbbackups - + rabbitmq: + name: ${COMPOSE_PROJECT_NAME}-rabbitmq diff --git a/docs/reference/worldmap.txt b/docs/reference/worldmap.txt index 83733d2f939..567f2223cfe 100644 --- a/docs/reference/worldmap.txt +++ b/docs/reference/worldmap.txt @@ -59,7 +59,7 @@ Set the following environment variables as needed (change SITE_NAME and SERVER_I export OWNER=$PG_USERNAME export ALLOWED_HOSTS="localhost, $SERVER_IP, " export GEOSERVER_LOCATION=http://localhost:8080/geoserver/ - export GEOSERVER_PUBLIC_LOCATION=http://$SERVER_IP/geoserver/ + export GEOSERVER_PUBLIC_LOCATION=http://$SERVER_IP/gs/ export SOLR_URL =http://localhost:8983/solr/hypermap/select/ export HYPERMAP_REGISTRY_URL =http://localhost:8001 export MAPPROXY_URL=http://localhost:8001 @@ -123,7 +123,7 @@ Hypermap Registry GeoNode with the WorldMap contribute module requires a Hypermap Registry (Hypermap) running instance. -You can install Hypermap by following these instructions (use the "Manual Installation" section): https://github.com/cga-harvard/HHypermap/blob/master/_docs/developers.md +You can install Hypermap by following these instructions (use the "Manual Installation" section): http://cga-harvard.github.io/Hypermap-Registry/installation.html Note that you can bypass Java 8 installation as it was installed previously. As a search engine you should install Solr, as we haven't tested Elasticsearch with WorldMap so far. Create a specific virtual environment for Hypermap in order not to interfere with the GeoNode/WorldMap virtual environment. diff --git a/docs/tutorials/admin/customize_lookfeel/customize/theme_admin.txt b/docs/tutorials/admin/customize_lookfeel/customize/theme_admin.txt index b3deb40af55..ae02ba3107c 100644 --- a/docs/tutorials/admin/customize_lookfeel/customize/theme_admin.txt +++ b/docs/tutorials/admin/customize_lookfeel/customize/theme_admin.txt @@ -244,6 +244,114 @@ From here you can continue to customize your :file:`site_index.html` template to Other theming options --------------------- +Additional menus +~~~~~~~~~~~~~~~~ + +An interesting customization could be to insert `additional menus` in the navbar. +It can be done very easily through the **render_nav_menu** inclusion tags which allow to have ready-to-use dropdown menus without any further front-end implementation needed. +This template tag takes the `placeholder name` as argument and renders all the menus which belong to it through ``
  • `` tags. + +GeoNode provides a **TOPBAR_MENU** named placeholder by default inside the `extra_tab` block of the ``base.html``: + +.. code-block:: html + + {% block extra_tab %} + + {% render_nav_menu 'TOPBAR_MENU' %} + + {% endblock %} + +A placeholder is a logical container for menus, to make it work you should load the `intial_data.json` (see :ref:`geonode_install_initialization` for references) or create the placeholder from the `Admin` panel (pay attention to the `Name`, it must be 'TOPBAR_MENU'): + +.. figure:: ../img/admin_menu_placeholder_initial_data.png + +Once the placeholder has been created you can add your menus from the 'Admin' panel. +The following is a basic example. + +Open the `Admin panel` http://localhost:8000/admin/, go to the BASE section and take a look at the models inside the red rectangle in the picture below: + +.. figure:: ../img/admin_base_section.png + +Follow these steps: + +#. Check if **TOPBAR_MENU** exists in the **Menu placeholder** section (if not create it as described in the section above): + + .. figure:: ../img/admin_menu_placeholders.png + +#. Create **Menu**\s. They are links containers, give them a `title` and choose the placeholder they belong to (the **TOPBAR_MENU** placeholder in this case). A menu will be shown before or after another menu based on the `order` field: + + .. figure:: ../img/admin_menu.png + + .. figure:: ../img/admin_menu_2.png + +#. Create **Menu Item**\s. They can be internal or external links. For each link a `menu` must be selected. The `title` is the link visible label and the `order` field determines the mutual position between all the links in a menu: + + .. figure:: ../img/admin_menu_item_1_1.png + + .. figure:: ../img/admin_menu_item_1_2.png + + .. figure:: ../img/admin_menu_item_2_1.png + +#. See the result: + + .. figure:: ../img/custom_menu_1.png + + .. figure:: ../img/custom_menu_2.png + +You could want your menu on the right side of the top navbar, near the `search` function for example. It can be accomplished in few simple steps: + +#. Add a block (`my_extra_right_tab` in the example below) in the :file:`base.html` template, inside the ``navbar-right``