diff --git a/docker-compose.yml b/docker-compose.yml index 32a1a77a019..72fff4da9b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: image: rabbitmq django: - image: geonode/django + image: geonode/geonode:geonode links: - postgres - elasticsearch @@ -21,7 +21,7 @@ services: - ./scripts/docker/env/production/django.env celery: - image: geonode/django + image: geonode/geonode:geonode links: - rabbitmq - postgres @@ -31,7 +31,7 @@ services: - ./scripts/docker/env/production/django.env consumers: - image: geonode/django + image: geonode/geonode:geonode links: - rabbitmq - postgres diff --git a/docs/tutorials/admin/geoserver_geonode_security/index.txt b/docs/tutorials/admin/geoserver_geonode_security/index.txt index 21353a2d307..6d8eb7b375b 100644 --- a/docs/tutorials/admin/geoserver_geonode_security/index.txt +++ b/docs/tutorials/admin/geoserver_geonode_security/index.txt @@ -529,6 +529,14 @@ Setup of the GeoNode REST Role Service Once everything has been setup and it is working, choose the ``Administrator role`` and ``Group administrator role`` as ``ROLE_ADMIN`` +Allow GeoFence to validate rules with ``ROLES`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. warning:: The following instruction are different accordingly to the GeoServer version you are currently using. + +GeoServer 2.9.x and 2.10.x +-------------------------- + #. Access the ``Security`` > ``Settings`` section .. figure:: img/oauth011.png @@ -537,6 +545,19 @@ Setup of the GeoNode REST Role Service .. figure:: img/oauth012.png +GeoServer 2.12.x and above +-------------------------- + +With the latest updates to GeoFence Plugin, the latter no more recognizes the Role Service from the default settings but from the ``geofence-server.properties`` file. + +That said, it is important that the ``Security`` > ``Settings`` role service will be set to **default**, in order to allow GeoServer following the standard authorization chain. + +On the other side, you will need to be sure that the ``geofence-server.properties`` file under the ``$GEOSERVER_DATA_DIR/geofence`` folder, contains the two following additional properties: :: + + gwc.context.suffix=gwc + org.geoserver.rest.DefaultUserGroupServiceName=geonode REST role service + + Setup of the GeoServer OAuth2 Authentication Filter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/tutorials/install_and_admin/geonode_install/all_together.txt b/docs/tutorials/install_and_admin/geonode_install/all_together.txt index b17b0e88426..6f360c99b1e 100644 --- a/docs/tutorials/install_and_admin/geonode_install/all_together.txt +++ b/docs/tutorials/install_and_admin/geonode_install/all_together.txt @@ -4,192 +4,17 @@ Finish installation =================== -In previous sections you've setup all the applications we need to run GeoNode. - -In this section we are going to `glue` all the pieces together and finalize GeoNode -setup. - -GeoNode Configuration -===================== - -Now that all applications have been configured we are going to instruct GeoNode on -how to connect to `PostgreSQL` and `GeoServer`. Also we are going to instruct GeoNode -on who is allowed to connect to it. - -First navigate to geonode configuration folder:: - - cd /home/geonode/geonode/geonode/ - -Copy the `local_settings.py` sample file called `local_settings.py.geoserver.sample`:: - - sudo cp local_settings.py.geoserver.sample local_settings.py - -Then edit the configuration file:: - - sudo gedit local_settings.py - -Add the `ALLOWED_HOSTS` and `PROXY_ALLOWED_HOSTS` variables at the top with the -following values:: - - ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '::1'] - PROXY_ALLOWED_HOSTS = ("127.0.0.1", 'localhost', '::1') - -Add the `POSTGIS_VERSION` variable matching your PostGIS version:: - - POSTGIS_VERSION = (2, 2, 1) - -This will instruct GeoNode to listen on connections from your local machine. - -Change the value of the `SITEURL` to your server's host name:: - - SITEURL = "http:///" - -Now configure database access: -Uncomment the `ENGINE`: `django.contrib.gis.db.backends.postgis` line -and comment the one with empty `ENGINE` variable. Also set the `NAME` variable to -`geonode_data`:: - - DATABASES = { - 'default': { - ... - }, - 'datastore' : { - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - #'ENGINE': '', # Empty ENGINE name disables, - 'NAME': 'geonode_data', - ... - } - -Then configure GeoServer location: -Change the value of the `LOCATION` and `PUBLIC_LOCATION` variables as follows, -also set the `DATASTORE` variable to `datastore`:: - - OGC_SERVER = { - 'default' : { - ... - 'LOCATION' : 'http://localhost/geoserver/', - 'PUBLIC_LOCATION' : 'http://localhost/geoserver/', - ... - 'DATASTORE': 'datastore', - } - -The resulting configuration file should look like this:: - - import os - - PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) - - SITEURL = "http:///" - - ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '::1'] - PROXY_ALLOWED_HOSTS = ("127.0.0.1", 'localhost', '::1') - POSTGIS_VERSION = (2, 2, 1) - - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'geonode', - 'USER': 'geonode', - 'PASSWORD': 'geonode', - }, - # vector datastore for uploads - 'datastore' : { - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - #'ENGINE': '', # Empty ENGINE name disables - 'NAME': 'geonode_data', - 'USER' : 'geonode', - 'PASSWORD' : 'geonode', - 'HOST' : 'localhost', - 'PORT' : '5432', - } - } - - # OGC (WMS/WFS/WCS) Server Settings - OGC_SERVER = { - 'default' : { - 'BACKEND' : 'geonode.geoserver', - 'LOCATION' : 'http://localhost/geoserver/', - 'PUBLIC_LOCATION' : 'http://localhost/geoserver/', - 'USER' : 'admin', - 'PASSWORD' : 'geoserver', - 'MAPFISH_PRINT_ENABLED' : True, - 'PRINT_NG_ENABLED' : True, - 'GEONODE_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 name of database in DATABASES dictionary to enable - 'DATASTORE': 'datastore', #'datastore', - } - } - - 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': '%scatalogue/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', - } - } - - # Default preview library - #LAYER_PREVIEW_LIBRARY = 'geoext' - -Initialize the Database -======================= - -We' ve already setup GeoNode databases and user permissions for PostgreSQL. And -instruct GeoNode on how to access the database. Now let's get the database ready -running the following:: - - cd /home/geonode/geonode - python manage.py migrate - python manage.py loaddata geonode/base/fixtures/initial_data.json - -If you get an error message it is likely that database access is not set properly. -Check you pg_hba.conf file and GeoNode `local_settings.py` file. Remember to restart -PostgreSQL to make any changes to pg_hba.conf effective. - -Test that you are able to connect to the database as follows:: - - psql -U geonode geonode - -and:: - - psql -U geonode geonode_data - -Create GeoNode Superuser -======================== - -Now create the admin user for GeoNode running the following:: - - python manage.py createsuperuser - -You will be prompted for the username, email address and password for the user +In previous sections you' ve setup all the applications we need to run GeoNode. Test the installation ===================== We are ready to restart GeoNode (Apache) and test the installation. -Restart Apache:: +Restart Apache - sudo service apache2 restart +.. code-block:: bash + + $ sudo service apache2 restart Open the browser and navigate to http://localhost/ @@ -213,10 +38,6 @@ Now open the main menu and click on `GeoServer` You will be redirected to GeoServer user interface. You will automatically be logged in as administrator in GeoServer. -.. note:: - If you connect to GeoNode as administrator for the first time , you will need to connect to - GeoServer manually (The default credentials are: user:admin, password:geoserver). - .. image:: img/geoserver_admin.png :width: 600px :alt: GeoServer Admin diff --git a/docs/tutorials/install_and_admin/geonode_install/create_geonode_db.txt b/docs/tutorials/install_and_admin/geonode_install/create_geonode_db.txt index ce16cd25841..6d8eb2640a5 100644 --- a/docs/tutorials/install_and_admin/geonode_install/create_geonode_db.txt +++ b/docs/tutorials/install_and_admin/geonode_install/create_geonode_db.txt @@ -1,53 +1,66 @@ .. _create_geonode_db: -================= -Create GeoNode DB -================= +========================================== +Create GeoNode DB & Finalize GeoNode Setup +========================================== In this section we are going to setup users and databases for GeoNode in PostgreSQL. -Users and Permissions -===================== +.. warning:: Be sure you have successfully completed the steps in the previous section. +Databases and Permissions +========================= First create the `geonode` user. GeoNode is going to use this user to access the -database:: +database - sudo -u postgres createuser -P geonode +.. code-block:: bash + + $ sudo -u postgres createuser -P geonode You will be prompted asked to set a password for the user. Enter `geonode` as password -Create `geonode` database with owner `geonode`:: +Create `geonode` database with owner `geonode` + +.. code-block:: bash + + $ sudo -u postgres createdb -O geonode geonode + +And database `geonode_data` with owner `geonode` - sudo -u postgres createdb -O geonode geonode +.. code-block:: bash -And database `geonode_data` with owner `geonode`:: + $ sudo -u postgres createdb -O geonode geonode_data - sudo -u postgres createdb -O geonode geonode_data +Switch to user `postgres` and create PostGIS extension -Switch to user `postgres` and create PostGIS extension:: +.. code-block:: bash - sudo su postgres - psql -d geonode_data -c 'CREATE EXTENSION postgis;' + $ sudo -u postgres psql -d geonode_data -c 'CREATE EXTENSION postgis;' -Then adjust permissions:: +Then adjust permissions - psql -d geonode_data -c 'GRANT ALL ON geometry_columns TO PUBLIC;' - psql -d geonode_data -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;' +.. code-block:: bash -And switch back to the 'geo' user:: + $ sudo -u postgres psql -d geonode_data -c 'GRANT ALL ON geometry_columns TO PUBLIC;' + $ sudo -u postgres psql -d geonode_data -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;' + $ sudo -u postgres psql -d geonode_data -c 'GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO geonode;' - exit +Now we are going to change user access policy for local connections in file `pg_hba.conf` -Now we are going to change user access policy for local connections in file `pg_hba.conf`:: +.. code-block:: bash - sudo gedit /etc/postgresql/9.5/main/pg_hba.conf + $ sudo vim /etc/postgresql/9.5/main/pg_hba.conf -Scroll down to the bottom of the document. We only need to edit one line. Change:: +Scroll down to the bottom of the document. We only need to edit one line. Change + +.. code-block:: bash # "local" is for Unix domain socket connections only local all all peer -Into::: +Into + +.. code-block:: bash # "local" is for Unix domain socket connections only local all all trust @@ -58,11 +71,310 @@ Into::: remote access to the databases in the pg_hba.conf for the `geonode` user and tell PostgreSQL to accept non local connections in your `postgresql.conf` file -Then restart `PostgreSQL` to make the change effective::: +Then restart `PostgreSQL` to make the change effective - sudo service postgresql restart +.. code-block:: bash + + $ sudo service postgresql restart PostgreSQL is now ready. To test the configuration try to connect to the `geonode` -database as `geonode`::: +database as `geonode` + +.. code-block:: bash + + $ psql -U geonode geonode + +Finalize GeoNode Setup +====================== +Once the DB has been correctly configured, we can finalize the `GeoNode` setup. + +**If not already active** let's activate the new `geonode` Python Virtual Environment: + +.. code-block:: bash + + $ workon geonode + +Move into the `geonode` home folder + +.. code-block:: bash + + $ cd /home/geonode + +Move into the ``my_geonode`` custom project base folder + +.. code-block:: bash + + $ cd my_geonode + +First of all we need to tweak a bit the `my_geonode` ``local_settings``. +In order to do that, rename the ``my_geonode/local_settings.py.sample`` file to ``my_geonode/local_settings.py`` end edit it: + + .. code-block:: bash + + $ cp my_geonode/local_settings.py.sample my_geonode/local_settings.py + $ vim my_geonode/local_settings.py + + Update the following sections at the accordingly to your server configuration + + .. code-block:: python + + ... + SITE_HOST_NAME = os.getenv('SITE_HOST_NAME', "localhost") + SITE_HOST_PORT = os.getenv('SITE_HOST_PORT', "8000") + SITEURL = os.getenv('SITEURL', "http://%s:%s/" % (SITE_HOST_NAME, SITE_HOST_PORT)) + + ... + + 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 = '{{ project_name }} ' + + ... + + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'geonode', + 'USER': 'geonode', + 'PASSWORD': 'geonode', + 'CONN_TOUT': 900, + }, + # vector datastore for uploads + 'datastore' : { + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'ENGINE': '', # Empty ENGINE name disables + 'NAME': 'geonode_data', + 'USER' : 'geonode', + 'PASSWORD' : 'geonode', + 'HOST' : 'localhost', + 'PORT' : '5432', + 'CONN_TOUT': 900, + } + } + + ... + + OGC_SERVER_DEFAULT_USER = os.getenv( + 'GEOSERVER_ADMIN_USER', 'admin' + ) + + OGC_SERVER_DEFAULT_PASSWORD = os.getenv( + 'GEOSERVER_ADMIN_PASSWORD', 'geoserver' + ) + + ... + + +You may also want to tweak some configuration on `my_geonode` ``settings``. +This file inherits `my_geonode` ``local_settings`` and set some GeoNode default settings: + + .. code-block:: bash + + $ vim my_geonode/settings.py + + Update the following sections at the accordingly to your server configuration + + .. code-block:: python + + ... + # Make sure GeoNode recognizes your servers + + ALLOWED_HOSTS = # Add here your hosts + + ... + # Modify time zone accordingly + + TIME_ZONE = os.getenv('TIME_ZONE', "America/Chicago") + + ... + # Tweak GeoNode behavior with the following settings + # (see GeoNode documentation for more details) + + 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 = True + MODIFY_TOPICCATEGORY = True + USER_MESSAGES_ALLOW_MULTIPLE_RECIPIENTS = True + DISPLAY_WMS_LINKS = True + + # prevent signing up by default + ACCOUNT_OPEN_SIGNUP = True + ACCOUNT_EMAIL_REQUIRED = True + ACCOUNT_EMAIL_VERIFICATION = 'optional' + ACCOUNT_EMAIL_CONFIRMATION_EMAIL = True + ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = True + ACCOUNT_CONFIRM_EMAIL_ON_GET = True + ACCOUNT_APPROVAL_REQUIRED = True + + ... + # Modify your maps and backgrounds + + # 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 + + 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', '') + BING_API_KEY = os.environ.get('BING_API_KEY', None) + + MAP_BASELAYERS = [{ + ... + + # Enable/Disable the notification system + # (see GeoNode documentation for more details) + + NOTIFICATION_ENABLED = True + + ... + + # Enable/Disable the integrated monitoring system + # (see GeoNode documentation for more details) + + MONITORING_ENABLED = False + + # Tweak the logging options + + LOGGING = { + ... + "loggers": { + "django": { + "handlers": ["console"], "level": "INFO", }, + "geonode": { + "handlers": ["console"], "level": "INFO", }, + "gsconfig.catalog": { + "handlers": ["console"], "level": "INFO", }, + "owslib": { + "handlers": ["console"], "level": "INFO", }, + "pycsw": { + "handlers": ["console"], "level": "INFO", }, + "{{ project_name }}": { + "handlers": ["console"], "level": "DEBUG", }, + }, + } + + + +Finalize GeoNode Setup & Test +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The following Python commands will finalize the setup, configure and create DB tables and download GeoServer. + +.. warning:: + Before running the next commands be sure that: + + * You have completed all the steps from the beginning of this chapter + + * You are located into the ``my_geonode`` custom project base folder + + * The `geonode` Python Virtual Environment is enabled + +Stop all the services + +.. code-block:: bash + + $ sudo service apache2 stop + $ sudo service tomcat8 stop + # Being sure other services are stopped + +Cleanup old stuff + +* Hard Reset + + .. warning:: This will delete all data you created until now. + + .. code-block:: bash + + $ paver reset_hard + # Cleanup folders and old DB Tables + +* Hard Reset + + .. note:: This will restore only GeoServer. + + .. code-block:: bash + + $ rm -Rf geoserver + $ rm -Rf downloaded/*.* + +Revert to default site settings + + You need to revert some customizations of the `my_geonode` ``local_settings``. + In order to do that, edit the ``my_geonode/local_settings.py`` file: + + .. code-block:: bash + + $ vim my_geonode/local_settings.py + + Comment the following pieces + + .. code-block:: python + + ... + # SITEURL = 'http://localhost' + ... + #GEOSERVER_LOCATION = os.getenv( + # 'GEOSERVER_LOCATION', '{}/geoserver/'.format(SITEURL) + #) + + #GEOSERVER_PUBLIC_LOCATION = os.getenv( + # 'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL) + #) + ... + +Being sure folders permissions are correctly set + +.. code-block:: bash + + $ sudo chown -Rf geonode: my_geonode/uploaded/ + $ sudo chown -Rf geonode: my_geonode/static* + +Setup and start the system in DEV mode + +.. code-block:: bash + + $ paver setup + # This command downloads and extract the correct GeoServer version + + $ paver sync + # This command prepares the DB tables and loads initial data + + $ paver start + # This command allows you to start GeoNode in development mode + +GeoNode and GeoServer in Development mode +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The ``paver start`` command allows you to start the server in **development (DEV)** mode. +That means that you will be able to directly do changes to your code and see the results on the browser. + +You need to be careful to the different ``ports`` of the services. In *DEV* mode the services will run on: + +* *GeoNode* port ``8000`` -> ``http://localhost:8000/`` + +* *GeoServer* port ``8080`` -> ``http://localhost:8080/geoserver`` + +In order to test it, move to ``http://localhost:8000/`` - psql -U geonode geonode +.. image:: img/geonode_dev_mode.png + :width: 600px + :alt: GeoNode Dev Mode diff --git a/docs/tutorials/install_and_admin/geonode_install/img/access_geoserver.png b/docs/tutorials/install_and_admin/geonode_install/img/access_geoserver.png index 08833430d55..250aa61f804 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/access_geoserver.png and b/docs/tutorials/install_and_admin/geonode_install/img/access_geoserver.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/add_geonode_user.png b/docs/tutorials/install_and_admin/geonode_install/img/add_geonode_user.png index bd2d48b7bfc..79c0237430f 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/add_geonode_user.png and b/docs/tutorials/install_and_admin/geonode_install/img/add_geonode_user.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/add_superuser.png b/docs/tutorials/install_and_admin/geonode_install/img/add_superuser.png index b1a5c9e7ca5..c20f5644f37 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/add_superuser.png and b/docs/tutorials/install_and_admin/geonode_install/img/add_superuser.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/add_virtualHost.png b/docs/tutorials/install_and_admin/geonode_install/img/add_virtualHost.png index ffc30e43231..b07e6defafe 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/add_virtualHost.png and b/docs/tutorials/install_and_admin/geonode_install/img/add_virtualHost.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/collectstatic.png b/docs/tutorials/install_and_admin/geonode_install/img/collectstatic.png index 8c146f9521f..84539862688 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/collectstatic.png and b/docs/tutorials/install_and_admin/geonode_install/img/collectstatic.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/confirm_Install.png b/docs/tutorials/install_and_admin/geonode_install/img/confirm_Install.png index 0a3137dd385..b5fc913bcfd 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/confirm_Install.png and b/docs/tutorials/install_and_admin/geonode_install/img/confirm_Install.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/finish_Install.png b/docs/tutorials/install_and_admin/geonode_install/img/finish_Install.png index 6fab049049b..488a02c1971 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/finish_Install.png and b/docs/tutorials/install_and_admin/geonode_install/img/finish_Install.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/geonode_dev_mode.png b/docs/tutorials/install_and_admin/geonode_install/img/geonode_dev_mode.png new file mode 100644 index 00000000000..cd6b34f95c2 Binary files /dev/null and b/docs/tutorials/install_and_admin/geonode_install/img/geonode_dev_mode.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/geonode_signin.png b/docs/tutorials/install_and_admin/geonode_install/img/geonode_signin.png index 73bdb022694..4eed9433419 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/geonode_signin.png and b/docs/tutorials/install_and_admin/geonode_install/img/geonode_signin.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/geoserver_admin.png b/docs/tutorials/install_and_admin/geonode_install/img/geoserver_admin.png index cc301329669..32cec05516a 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/geoserver_admin.png and b/docs/tutorials/install_and_admin/geonode_install/img/geoserver_admin.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/geoserver_auth.png b/docs/tutorials/install_and_admin/geonode_install/img/geoserver_auth.png index 41d67064e9d..d4261fdccad 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/geoserver_auth.png and b/docs/tutorials/install_and_admin/geonode_install/img/geoserver_auth.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/install_packages.png b/docs/tutorials/install_and_admin/geonode_install/img/install_packages.png index 83d51c7e234..94bf245a374 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/install_packages.png and b/docs/tutorials/install_and_admin/geonode_install/img/install_packages.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/local_settings.png b/docs/tutorials/install_and_admin/geonode_install/img/local_settings.png index dbd3ce3b3f8..62d70b8ec11 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/local_settings.png and b/docs/tutorials/install_and_admin/geonode_install/img/local_settings.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/login.png b/docs/tutorials/install_and_admin/geonode_install/img/login.png index 9e9c7c54837..7e92f80e59c 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/login.png and b/docs/tutorials/install_and_admin/geonode_install/img/login.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/open_terminal.png b/docs/tutorials/install_and_admin/geonode_install/img/open_terminal.png index 7f7d3dc210c..08d57662ddc 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/open_terminal.png and b/docs/tutorials/install_and_admin/geonode_install/img/open_terminal.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/syncdb.png b/docs/tutorials/install_and_admin/geonode_install/img/syncdb.png index 294d70d3f07..ba83298e6f8 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/syncdb.png and b/docs/tutorials/install_and_admin/geonode_install/img/syncdb.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/test_geonode.png b/docs/tutorials/install_and_admin/geonode_install/img/test_geonode.png index 29cdbb62da0..235f7ad644f 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/test_geonode.png and b/docs/tutorials/install_and_admin/geonode_install/img/test_geonode.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/test_geonode2.png b/docs/tutorials/install_and_admin/geonode_install/img/test_geonode2.png index 7d4276aef17..5b8e2423f5a 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/test_geonode2.png and b/docs/tutorials/install_and_admin/geonode_install/img/test_geonode2.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver.png b/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver.png index 143089f0dc6..2a81b10e1a4 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver.png and b/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver2.png b/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver2.png index 737597c4b79..db20096f050 100644 Binary files a/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver2.png and b/docs/tutorials/install_and_admin/geonode_install/img/test_geoserver2.png differ diff --git a/docs/tutorials/install_and_admin/geonode_install/index.txt b/docs/tutorials/install_and_admin/geonode_install/index.txt index 12e8abcd700..8dc5f99c20f 100644 --- a/docs/tutorials/install_and_admin/geonode_install/index.txt +++ b/docs/tutorials/install_and_admin/geonode_install/index.txt @@ -1,20 +1,17 @@ .. _geonode_install: -============================================= -GeoNode (v\ |release|) installation on Ubuntu -============================================= +=================================================== +GeoNode (v\ |release|) installation on Ubuntu 16.04 +=================================================== This part of the documentation describes the complete setup process for GeoNode -on an Ubuntu 16.04 machine. The end of this section of the documentation also -describes how to automate the installation and configuration of GeoNode using -`Ansible `_. +on an Ubuntu 16.04 machine. .. toctree:: :maxdepth: 2 - install_geonode_application - create_geonode_db - setup_configure_httpd - install_geoserver_application - all_together - using_ansible + install_geonode_application.txt + create_geonode_db.txt + setup_configure_httpd.txt + install_geoserver_application.txt + all_together.txt diff --git a/docs/tutorials/install_and_admin/geonode_install/install_geonode_application.txt b/docs/tutorials/install_and_admin/geonode_install/install_geonode_application.txt index e64cd47fb3a..859554af7f9 100644 --- a/docs/tutorials/install_and_admin/geonode_install/install_geonode_application.txt +++ b/docs/tutorials/install_and_admin/geonode_install/install_geonode_application.txt @@ -19,7 +19,8 @@ password and press `Enter`. :alt: User Login You are now logged in as user 'geo'. On the left side of the screen there -is a panel with shortcuts to common applications, launch a terminal. +is a panel with shortcuts to common applications, launch a the terminal +emulator. .. image:: img/open_terminal.png :width: 600px @@ -31,100 +32,112 @@ Packages Installation First we are going to install all the software packages we are going to need for the GeoNode setup. Among others `Tomcat 8`, `PostgreSQL`, `PostGIS`, `Apache HTTP server` and `Git`. Run the following command to install all the -packages:: - - sudo apt-get install \ - python-virtualenv \ - build-essential \ - openssh-server \ - apache2 \ - gcc \ - gdal-bin \ - gettext \ - git-core \ - libapache2-mod-wsgi \ - libgeos-dev \ - libjpeg-dev \ - libpng12-dev \ - libpq-dev \ - libproj-dev \ - libxml2-dev \ - libxslt1-dev \ - openjdk-8-jre \ - patch \ - postgresql \ - postgis \ - postgresql-9.5-postgis-scripts \ - postgresql-contrib \ - python \ - python-dev \ - python-gdal \ - python-pycurl \ - python-imaging \ - python-pastescript \ - python-psycopg2 \ - python-urlgrabber \ - python-virtualenv \ - tomcat8 \ - unzip \ - zip +packages + +.. code-block:: bash + + $ sudo apt-get update + + $ sudo apt-get install python-virtualenv python-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libjpeg-dev libpq-dev libgdal-dev git default-jdk + $ sudo apt-get install build-essential openssh-server gettext nano vim unzip zip patch git-core postfix + + $ sudo apt-add-repository ppa:webupd8team/java + $ sudo apt-get update + $ sudo apt-get install oracle-java8-installer + + $ sudo apt-add-repository ppa:ubuntugis && sudo apt-get update && sudo apt-get upgrade + $ sudo apt-add-repository ppa:ubuntugis/ppa && sudo apt-get update && sudo apt-get upgrade + $ sudo apt-get install gcc apache2 libapache2-mod-wsgi libgeos-dev libjpeg-dev libpng-dev libpq-dev libproj-dev libxml2-dev libxslt-dev + $ sudo apt-add-repository ppa:ubuntugis/ubuntugis-testing && sudo apt-get update && sudo apt-get upgrade + $ sudo apt-get install gdal-bin libgdal20 libgdal-dev + $ sudo apt-get install python-gdal python-pycurl python-imaging python-pastescript python-psycopg2 python-urlgrabber + $ sudo apt-get install postgresql postgis postgresql-9.5-postgis-scripts postgresql-contrib + $ sudo apt-get install tomcat8 + + $ sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get purge && sudo apt-get clean .. image:: img/install_packages.png :width: 600px :alt: Install Packages -You will be prompted for `geo` user's password (`geo`) and for confirmation twice +.. note:: If you will be prompted for `geo` user's password (`geo`) and for confirmation twice -.. image:: img/confirm_Install.png - :width: 600px - :alt: Confirm Installation + .. image:: img/confirm_Install.png + :width: 600px + :alt: Confirm Installation -The installation process is going to take a few minutes. +.. warning:: The installation process is going to take several minutes and it will need to download packages from Internet. At this point we have all the packages we need on the system. GeoNode Setup ============= +First of all we need to prepare a new Python Virtual Environment: + +.. code-block:: bash + + $ sudo apt install python-pip + $ pip install --upgrade pip + $ pip install --user virtualenv + $ pip install --user virtualenvwrapper + # The commands above will install the Python Venv packages -Let's download GeoNode from the main GeoNode repository on GitHub: + $ export WORKON_HOME=~/Envs + $ mkdir -p $WORKON_HOME + $ source $HOME/.local/bin/virtualenvwrapper.sh + $ printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/Envs' 'source $HOME/.local/bin/virtualenvwrapper.sh' >> ~/.bashrc + $ source ~/.bashrc + # We have now configured the user environment -.. - For the purpose of this training the GeoNode repository has - been downloaded and placed in the `geonode` user `home folder` (/home/geo/geonode). - *Skip* the following command group. + $ mkvirtualenv --no-site-packages geonode + # Through this command we have created a brand new geonode Virual Environment -:: + $ sudo useradd -m geonode + $ sudo usermod -a -G geonode geo + $ sudo chmod -Rf 775 /home/geonode/ + $ sudo su - geo + # The commands above are needed only if geo and geonode users have not been already defined - git clone https://github.com/GeoNode/geonode.git --branch 2.6.x - sudo useradd -m geonode - sudo mv ~/geonode /home/geonode/ +Let's activate the new `geonode` Python Virtual Environment: +.. code-block:: bash + + $ workon geonode -Move into the project folder -:: +Move into the `geonode` home folder - cd /home/geonode/geonode +.. code-block:: bash -And install GeoNode + $ cd /home/geonode + +We are going to install GeoNode as a dependency of a **Customized DJango Project** .. note:: - For the purpose of this training GeoNode python packages has - been downloaded and installed, *Skip* the following command: + A custom project is a DJango application with *ad hoc* configuration and folders, which allows you to + extend the original **GeoNode** code without actually dealing or modifying the main source code. + + This will allow you to easily customize your GeoNode instance, modify the theme, add new functionalities and so on, + and also being able to keep updated with the GeoNode latest source code. + + For more deails please check https://github.com/GeoNode/geonode-project/tree/master -:: +.. code-block:: bash - sudo pip install -e . + $ pip install Django==1.8.18 + $ django-admin.py startproject --template=https://github.com/GeoNode/geonode-project/archive/2.9.x-rev.zip -e py,rst,json,yml my_geonode -The following command will download a GeoServer web archive -that we are going to use in GeoServer setup: +Let's install the GeoNode dependencies and packages into the Python Virtual Environment: -.. note:: - Again, for the purpose of this training the GeoServer web archive has been - downloaded. - *Skip* the following command. +.. code-block:: bash -:: + $ cd my_geonode + $ vim requirements.txt + # Make sure requirements contains reference to geonode master branch + -e git://github.com/GeoNode/geonode.git@master#egg=geonode - sudo paver setup + $ pip install -r requirements.txt + $ pip install -e . + $ pip install pygdal==2.2.1.3 + # The closest to your `gdal-config --version` -In the next section we are going to setup PostgreSQL Databases for GeoNode +In the next section we are going to setup PostgreSQL Databases for GeoNode and finalize the setup diff --git a/docs/tutorials/install_and_admin/geonode_install/install_geoserver_application.txt b/docs/tutorials/install_and_admin/geonode_install/install_geoserver_application.txt index 8c34fb6bc24..6748e441e4d 100644 --- a/docs/tutorials/install_and_admin/geonode_install/install_geoserver_application.txt +++ b/docs/tutorials/install_and_admin/geonode_install/install_geoserver_application.txt @@ -5,27 +5,92 @@ Install GeoServer Application ============================= In this section we are going to setup GeoServer for GeoNode. GeoServer will run inside -`Tomcat` servlet container. +`Tomcat` sevrlet container. Setup GeoServer =============== -You've already installed `Tomcat 8` in the system in the first section of the training. -Before you deploy GeoServer stop the running Tomcat instance::: +#. You've already installed `Tomcat 8` in the system in the first section of the training. Before you deploy GeoServer stop the running Tomcat instance - sudo service tomcat8 stop + .. code-block:: bash -Now copy the downloaded GeoServer archive inside Tomcat's webapps folder:: + $ sudo service tomcat8 stop + +#. Now copy the downloaded GeoServer archive inside Tomcat's webapps folder + + .. code-block:: bash + + $ sudo cp -Rf /home/geonode/my_geonode/geoserver/geoserver/ /var/lib/tomcat8/webapps/ + +#. Move ``GEOSERVER_DATA_DIR`` on an external location + + .. code-block:: bash + + $ sudo mkdir -p /data/geoserver-data + $ sudo mkdir -p /data/geoserver-logs + $ sudo mkdir -p /data/gwc_cache_dir + $ sudo cp -Rf /home/geonode/my_geonode/geoserver/data/* /data/geoserver-data/ + $ sudo chown -Rf tomcat8: /data/geoserver-data/ + $ sudo chown -Rf tomcat8: /data/geoserver-logs/ + $ sudo chown -Rf tomcat8: /data/gwc_cache_dir/ + +#. Set default `Java` settings + + You need to edit the ``/etc/default/tomcat8`` file + + .. code-block:: bash + + $ sudo vim /etc/default/tomcat8 + + Make sure ``JAVA_OPTS`` are configured as follows + + .. code-block:: yaml + + #JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC" + GEOSERVER_DATA_DIR="/data/geoserver-data" + GEOSERVER_LOG_LOCATION="/data/geoserver-logs/geoserver.log" + GEOWEBCACHE_CACHE_DIR="/data/gwc_cache_dir" + GEOFENCE_DIR="$GEOSERVER_DATA_DIR/geofence" + + JAVA_OPTS="-Djava.awt.headless=true -XX:MaxPermSize=512m -XX:PermSize=128m -Xms512m -Xmx2048m -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=true -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -DGEOSERVER_DATA_DIR=$GEOSERVER_DATA_DIR -Dgeofence.dir=$GEOFENCE_DIR -DGEOSERVER_LOG_LOCATION=$GEOSERVER_LOG_LOCATION -DGEOWEBCACHE_CACHE_DIR=$GEOWEBCACHE_CACHE_DIR" + + .. warning:: Double check memory options ``-Xms512m -Xmx2048m`` are compatible with your VM available RAM + +#. Set default `Catalina` settings + + You need to edit the ``/var/lib/tomcat8/conf/catalina.properties`` file + + .. code-block:: bash + + $ sudo vim /var/lib/tomcat8/conf/catalina.properties + + Make sure ``bcprov*.jar`` is skipped at run-time + + .. code-block:: yaml + + tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\ + ... + xom-*.jar,\ + bcprov*.jar + +#. Restart `Tomcat 8` service + + .. code-block:: bash + + $ sudo service tomcat8 restart + + You can follow the start-up logs by running the following shell command - sudo cp /home/geonode/geonode/downloaded/geoserver-2.9.x-oauth2.war /home/geonode/geonode/downloaded/geoserver.war - sudo mv /home/geonode/geonode/downloaded/geoserver.war /var/lib/tomcat8/webapps/ + .. code-block:: bash + $ sudo tail -F -n 300 /var/lib/tomcat8/logs/catalina.out + Test GeoServer =============== Now start Tomcat to deploy GeoServer:: - sudo service tomcat8 start + sudo service tomcat7 start Tomcat will extract GeoServer web archive and start GeoServer. This may take some time @@ -47,70 +112,72 @@ GeoNode authentication integration All we need to do now is to integrate GeoNode authentication so that GeoNode administrator will be able to access and administer GeoServer as well. -Stop GeoServer:: +#. Stop GeoServer - sudo service tomcat8 stop + .. code-block:: bash -And navigate to `/var/lib/tomcat8/webapps/geoserver/WEB-INF/`:: + $ sudo service tomcat8 stop - cd /var/lib/tomcat8/webapps/geoserver/WEB-INF/ +#. Edit ``/data/geoserver-data/security/filter/geonode-oauth2/config.xml`` with a text editor -Edit `web.xml` with a text editor:: + .. code-block:: bash - sudo gedit web.xml + $ sudo gedit /data/geoserver-data/security/filter/geonode-oauth2/config.xml -And add the following::: + And make sure the following values are configured as follows: - - GEONODE_BASE_URL - http://localhost/ - + .. code-block:: xml -.. note:: + http://localhost/o/token/ + http://localhost/o/authorize/ + http://localhost/geoserver + http://localhost/api/o/v4/tokeninfo/ + http://localhost/account/logout/ - If GeoServer is installed on machine that is separate from the one running - GeoNode, change the `GEONODE_BASE_URL` value accordingly +#. Edit ``/data/geoserver-data/security/auth/geonodeAuthProvider/config.xml`` with a text editor -The resulting file should look like this::: + .. code-block:: bash - - - - GeoServer + $ sudo gedit /data/geoserver-data/security/auth/geonodeAuthProvider/config.xml - - GEONODE_BASE_URL - http://localhost/ - + And make sure the following values are configured as follows: - - serviceStrategy - django) + * [b7b367] - fixes #3225: Create Thumbnail should not rely on GeoServer reflector + * [a7af38] Forward port on master #3221: Synchronize keywords both directions now (geoserver <--> django) + + [ Cezary Statkiewicz ] + * [ebdc75] tests update: #3192 + + [ travis ] + * [2ac5ee] Added settings variable to inform geonode-client to request map tiles cross origin + + [ Alessio Fabiani ] + * [4baa31] - fixes #3229 : Being able to send JSON response on Documents upload also + * [c69e2a] - fixes #3231 : Small bug on GeoFence methods + + [ capooti ] + * [d235f1] Fixes #3235 for dev installation + + [ gpetrak ] + * [c53deb] Update to last modifications of GeoNode (v2.6) installation on Ubuntu guide + + [ Alessio Fabiani ] + * [a84be9] - fixes #3233 : OWSLib issue communicating with GeoServer WPS + * [19d9ec] - fixes #3233 + * [bd5c20] - Issue #3227: making setup and requirements versions coherent for flake, pep8 and transifex accordingly to the issue statement (#3240) + * [63c656] - fixes #3243 : Wrong Links on Metadata Editor for Documents + * [e94bc5] - fixes #3248 : Permission ajax_lookup for Groups misleading + * [acfc4c] - fixes #3246 : Update Notification settings to the correct PINAX ones + + [ Cezary Statkiewicz ] + * [612ce7] expose list of ows services #3250 + * [395742] pep8 #3250 + + [ Alessio Fabiani ] + * [3397f5] - fixes #3246 : Update Notification settings to the correct PINAX ones + * [8fbfe2] - fixes #3248 : Permission ajax_lookup for Groups misleading + * [33935a] - fixes #3223 : search won't work anymore using hrefs, unless search is case insensitive + * [978d32] - align with master + * [635358] - Fix Thumbnail URL generation when OL visibility is off + * [840f7c] - Fix django settings imports + * [ee0818] - Fix django settings imports + * [cfefa7] - Correctly filter TopicCategories + * [08e931] - pep8 + * [1e4dc8] - fixes #3223 : search won't work anymore using hrefs, unless search is case insensitive (#3251) + * [576c38] - - fixes #3223 : search won't work anymore using hrefs, unless search ignore cases + * [d4872a] - - fixes #3223 : search won't work anymore using hrefs, unless search ignore cases + * [e6f39f] - - fixes #3223 : search won't work anymore using hrefs, unless search ignore cases + * [cced5b] - - fixes #3223 : search won't work anymore using hrefs, unless search ignore cases + * [d608cd] fixes #3223 + * [472bc9] - Fixes: Thumbnail URL generation when OL visibility is off + * [133f34] - Fix django settings imports + * [7dbfea] - Fix django settings imports + * [f7a14e] - Correctly filter TopicCategories + * [646001] - pep8 + * [b1e1ff] - Improve forms layout: signup and documents md editor + * [97b674] - Improve forms layout: signup and documents md editor + * [7cfa6f] - Display Group (if any) on Resource Info Panel (#3259) + * [30e14d] - fixes #3223 : fix keywords filtering on base_tags also + * [c140c7] - Returns referencing infos on Layers Upload + * [b3f938] - Returns referencing infos on Layers Upload + * [b5a775] bump to version 2.7.0 + + -- Alessio Fabiani Tue, 05 Sep 2017 16:43:18 +0200 + geonode (2.5.15+thefinal0) trusty; urgency=high * [c06f6c] update release version (#2890) @@ -8002,7 +9552,7 @@ geonode (1.2+beta2) precise; urgency=high * Fixed missing links to local layers in map detail * Map composer fixes * More helpful importlayers - + -- Ariel Nunez Wed, 1 Aug 2012 11:44:33 -0500 geonode (1.2+beta1) precise; urgency=high diff --git a/package/debian/control b/package/debian/control index 5c7da08d1f2..1836f726cd2 100644 --- a/package/debian/control +++ b/package/debian/control @@ -10,11 +10,11 @@ Vcs-git: git://github.com/GeoNode/geonode.git Package: geonode Architecture: all -Depends: geoserver-geonode | geoserver, python-virtualenv, python-imaging, python-lxml, python-pyproj, python-shapely, python-nose, python-httplib2, gdal-bin, libgeos-dev, gettext, postgresql-contrib, postgis, libpq-dev, zip, unzip, libjpeg-dev, libpng-dev, libxslt-dev, zlib1g-dev, python-gdal, libproj-dev, python-psycopg2, apache2, libapache2-mod-wsgi, python-dev, python-django (>=1.5.1), python-geonode-agon-ratings, python-django-downloadview, python-bs4, python-geonode-dialogos, python-django-activity-stream, python-django-extensions, python-django-forms-bootstrap, python-django-friendly-tag-loader, python-django-geoexplorer, python-django-jsonfield, python-geonode-notification, python-django-pagination, python-django-taggit, python-geonode-user-accounts, python-geonode-avatar, python-gsconfig, python-owslib, python-pycsw, python-geolinks, python-paver, python-geonode-user-messages, python-geonode-announcements, python-pinax-theme-bootstrap, python-pinax-theme-bootstrap-account, python-django-nose, python-multipartposthandler, python-dateutil, python-django-guardian, python-django-polymorphic, python-django-tastypie, python-django-modeltranslation, python-django-mptt, python-django-autocomplete-light, python-django-leaflet, python-gsimporter, python-geonode-arcrest, python-django-bootstrap3-datetimepicker, python-celery, python-django-celery, python-awesome-slugify, python-pip, python-dj-database-url, language-pack-en, python-django-treebeard, python-django-storages, python-django-oauth-toolkit, ${misc:Depends}, ${python:Depends} +Depends: geoserver-geonode | geoserver, python-virtualenv, python-pillow, python-lxml, python-psycopg2, python-amqp, python-anyjson, python-pyyaml, python-bs4, python-billiard, python-pyproj, python-shapely, python-nose, python-httplib2, gdal-bin, libgeos-dev, gettext, postgresql-contrib, postgis, libpq-dev, zip, unzip, libjpeg-dev, libpng-dev, libxslt-dev, zlib1g-dev, python-gdal, libproj-dev, apache2, libapache2-mod-wsgi, python-dev, python-django (>=1.5.1), python-unidecode, python-paver, python-django-nose, python-gsconfig, python-gn-gsimporter, python-owslib, python-pycsw, python-chardet, python-decorator, python-six, python-diff-match-patch, python-django-pagination, python-django-extensions, python-django-jsonfield, python-django-jsonfield-compat, python-django-leaflet, python-django-taggit, python-django-treebeard, python-django-mptt, python-django-guardian, python-django-suit, python-django-tastypie, python-dj-database-url, python-pinax-notifications, python-pinax-theme-bootstrap, python-django-bootstrap-form, python-django-forms-bootstrap, python-django-friendly-tag-loader, python-django-activity-stream, python-django-geoexplorer, python-django-appconf, python-django-autocomplete-light, python-django-autofixture, python-django-autoslug, python-django-geonode-client, python-django-braces, python-django-modeltranslation, python-geonode-user-messages, python-geonode-avatar, python-geonode-announcements, python-geonode-agon-ratings, python-geonode-user-accounts, python-geonode-arcrest, python-geonode-dialogos, python-django-downloadview, python-geonode-notification, python-geolinks, python-multipartposthandler, python-dateutil, python-django-polymorphic, python-django-bootstrap3-datetimepicker, language-pack-en, python-django-storages, python-celery, python-awesome-slugify, python-pip, python-django-oauth-toolkit, python-oauthlib, python-django-floppyforms, python-django-invitations, python-et-xmlfile, python-unicodecsv, python-urllib3, python-vine, python-django-cors-headers, python-django-multi-email-field, python-psutil, python-user-agents, python-xmljson, python-kombu, python-odfpy, ${misc:Depends}, ${python:Depends} Recommends: python-gisdata, transifex-client -Description: Allows the creation, sharing, and collaborative use of geospatial data. +Description: Allows the creation, sharing, and collaborative use of geospatial data. At its core, the GeoNode has a stack based on GeoServer, pycsw, - Django, and GeoExt that provides a platform for sophisticated - web browser spatial visualization and analysis. Atop this stack, + Django, and GeoExt that provides a platform for sophisticated + web browser spatial visualization and analysis. Atop this stack, the project has built a map composer and viewer, tools for analysis, and reporting tools. diff --git a/package/debian/postrm b/package/debian/postrm index 0adf2809721..86f5209225c 100644 --- a/package/debian/postrm +++ b/package/debian/postrm @@ -17,7 +17,6 @@ case "$1" in rm -rf /usr/share/geonode/patch* rm -rf /usr/bin/geonode rm -rf /usr/share/geoserver - rm /etc/tomcat8/Catalina/localhost/geoserver.xml a2ensite 000-default.conf diff --git a/package/geoserver/debian/changelog b/package/geoserver/debian/changelog index 8f91ab3143b..5a5a5d3a71d 100644 --- a/package/geoserver/debian/changelog +++ b/package/geoserver/debian/changelog @@ -1,3 +1,15 @@ +geoserver-geonode (2.12.1) xenial; urgency=high + + * Updated GeoServer 12.x packages on testing + + -- Alessio Fabiani Mon, 15 Jan 2018 10:26:16 +0200 + +geoserver-geonode (2.12.0) xenial; urgency=high + + * Updated to GeoServer 12.x + + -- Alessio Fabiani Mon, 15 Jan 2018 10:26:16 +0200 + geoserver-geonode (2.10.0) xenial; urgency=high * Updated to GeoServer 10.x diff --git a/package/install.sh b/package/install.sh index 3affd83f099..9ecab7c9e4b 100755 --- a/package/install.sh +++ b/package/install.sh @@ -83,6 +83,7 @@ function setup_django_once() { } function setup_django_every_time() { + pip install --upgrade pip --quiet pip install $GEONODE_SHARE/GeoNode-*.zip --no-dependencies --quiet geonodedir=`python -c "import geonode;import os;print os.path.dirname(geonode.__file__)"` @@ -92,11 +93,19 @@ function setup_django_every_time() { mkdir -p $GEONODE_LOG ln -sf /var/log/apache2/error.log $GEONODE_LOG/apache.log - export DJANGO_SETTINGS_MODULE=geonode.settings + export DJANGO_SETTINGS_MODULE=geonode.local_settings - django-admin migrate account --settings=geonode.settings + # django-admin migrate account --settings=geonode.settings + geonode makemigrations --merge --verbosity 0 + geonode makemigrations --verbosity 0 + # geonode migrate auth --verbosity 0 + # geonode migrate sites --verbosity 0 + # geonode migrate people --verbosity 0 geonode migrate --verbosity 0 + geonode loaddata $geonodedir/people/fixtures/sample_admin.json + geonode loaddata $geonodedir/base/fixtures/default_oauth_apps.json geonode loaddata $geonodedir/base/fixtures/initial_data.json + geonode set_all_layers_alternate --verbosity 0 geonode collectstatic --noinput --verbosity 0 # Create an empty uploads dir @@ -146,6 +155,7 @@ function setup_geoserver() { paver setup popd mv ../downloaded/geoserver.war $TOMCAT_WEBAPPS + $TOMCAT_SERVICE restart } function postinstall() { diff --git a/package/support/geonode.admin b/package/support/geonode.admin index dc59fd1e1c0..2e58273585e 100644 --- a/package/support/geonode.admin +++ b/package/support/geonode.admin @@ -1,20 +1,18 @@ -[ - { - "pk": 9999, - "model": "people.Profile", - "fields": { - "username": "geonode", - "first_name": "", - "last_name": "", - "is_active": true, - "is_superuser": true, - "is_staff": true, - "last_login": "2011-03-29 23:32:19", - "groups": [], - "user_permissions": [], - "password": "!", - "email": "", - "date_joined": "2011-03-29 23:32:19" - } - } -] +[{ + "fields": { + "date_joined": "2011-06-09 15:15:27", + "email": "ad@m.in", + "first_name": "", + "groups": [], + "is_active": true, + "is_staff": true, + "is_superuser": true, + "last_login": "2011-06-09 15:45:34", + "last_name": "", + "password": "sha1$a1ddf$1e14be2baa49df74672c93fa283ba549f56254b7", + "user_permissions": [], + "username": "admin" + }, + "model": "people.Profile", + "pk": 1000 +}] diff --git a/package/support/geonode.apache b/package/support/geonode.apache index 014510080f8..379155f3d7d 100644 --- a/package/support/geonode.apache +++ b/package/support/geonode.apache @@ -1,8 +1,12 @@ WSGIDaemonProcess geonode user=www-data threads=15 processes=2 + Servername localhost ServerAdmin webmaster@localhost + LimitRequestFieldSize 32760 + LimitRequestLine 32760 + ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined @@ -31,6 +35,46 @@ WSGIDaemonProcess geonode user=www-data threads=15 processes=2 Deny from all + + Order allow,deny + Options Indexes FollowSymLinks + Allow from all + Require all granted + IndexOptions FancyIndexing + + + + Order allow,deny + Options Indexes FollowSymLinks + Allow from all + Require all granted + IndexOptions FancyIndexing + + + + Order allow,deny + Options Indexes FollowSymLinks + Allow from all + Require all granted + IndexOptions FancyIndexing + + + + Order allow,deny + Options Indexes FollowSymLinks + Allow from all + Require all granted + IndexOptions FancyIndexing + + + + Order allow,deny + Options Indexes FollowSymLinks + Allow from all + Require all granted + IndexOptions FancyIndexing + + Order allow,deny Allow from all diff --git a/package/support/geonode.local_settings b/package/support/geonode.local_settings index f6b786f88b4..da37c46160a 100644 --- a/package/support/geonode.local_settings +++ b/package/support/geonode.local_settings @@ -1,19 +1,27 @@ # -*- coding: utf-8 -*- import os +import re +import sys +from urlparse import urlparse + import geonode +from geonode.settings import * # Setting debug to true makes Django serve static media and # present pretty error pages. DEBUG = TEMPLATE_DEBUG = False # Set to True to load non-minified versions of (static) client dependencies -# Requires to set-up Node and tools that are required for static development +# Requires to set-up Node and tools that are required for static development # otherwise it will raise errors for the missing non-minified dependencies DEBUG_STATIC = False SITENAME = 'GeoNode' SITEURL = 'http://localhost/' +ALLOWED_HOSTS = [urlparse(SITEURL).hostname] if os.getenv('ALLOWED_HOSTS') is None \ + else re.split(r' *[,|:|;] *', os.getenv('ALLOWED_HOSTS')) + DATABASE_ENGINE = 'postgresql_psycopg2' DATABASE_NAME = 'geonode' DATABASE_USER = 'geonode' @@ -40,31 +48,70 @@ DATABASES = { } } -GEOSERVER_URL = SITEURL + 'geoserver/' +GEOSERVER_LOCATION = os.getenv( + 'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/' +) + +GEOSERVER_PUBLIC_LOCATION = os.getenv( + 'GEOSERVER_PUBLIC_LOCATION', '{}geoserver/'.format(SITEURL) +) + +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' : 'http://localhost:8080/geoserver/', - 'PUBLIC_LOCATION' : GEOSERVER_URL, - 'USER' : 'admin', - 'PASSWORD' : 'geoserver', - 'MAPFISH_PRINT_ENABLED' : True, - 'PRINT_NG_ENABLED' : True, - 'GEONODE_SECURITY_ENABLED' : True, - 'GEOGIG_ENABLED' : False, - 'WMST_ENABLED' : False, + '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' : True, + 'WPS_ENABLED': True, 'LOG_FILE':'/usr/share/geoserver/data/logs/geoserver.log', - # Set to name of database in DATABASES dictionary to enable + # Set to dictionary identifier of database containing spatial data in DATABASES dictionary to enable 'DATASTORE': 'datastore', - 'LOGIN_ENDPOINT': 'j_spring_oauth2_geonode_login', - 'LOGOUT_ENDPOINT': 'j_spring_oauth2_geonode_logout', + 'PG_GEOGIG': False, + 'TIMEOUT': 10 # number of seconds to allow for HTTP requests } } +# If you want to enable Mosaics use the following configuration +UPLOADER = { + 'BACKEND': 'geonode.rest', + # 'BACKEND': 'geonode.importer', + 'OPTIONS': { + 'TIME_ENABLED': False, + 'MOSAIC_ENABLED': False, + 'GEOGIG_ENABLED': False, + }, + 'SUPPORTED_CRS': [ + 'EPSG:4326', + 'EPSG:3785', + 'EPSG:3857', + 'EPSG:900913', + 'EPSG:32647', + 'EPSG:32736' + ] +} + LANGUAGE_CODE = 'en' MEDIA_ROOT = '/var/www/geonode/uploaded' @@ -85,9 +132,57 @@ CATALOGUE = { } } -# A Google Maps API key is needed for the 3D Google Earth view of maps -# See http://code.google.com/apis/maps/signup.html -GOOGLE_API_KEY = '' +# 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_ROOT = os.path.dirname(geonode.__file__) @@ -108,13 +203,123 @@ STATICFILES_DIRS = [ #ACCOUNT_EMAIL_CONFIRMATION_EMAIL = False #ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = False -# Allowed values for the preview library are 'geoext' and 'leaflet'. -#LAYER_PREVIEW_LIBRARY = 'geoext' +# GeoNode javascript client configuration + +# default map projection +# Note: If set to EPSG:4326, then only EPSG:4326 basemaps will work. +DEFAULT_MAP_CRS = "EPSG:900913" + +# 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 +LAYER_PREVIEW_LIBRARY = 'geoext' + +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', '') +BING_API_KEY = os.environ.get('BING_API_KEY', None) +GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY', '') + +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", + "title": "UNESCO", + "args": ["UNESCO", "http://en.unesco.org/tiles/${z}/${x}/${y}.png"], + "wrapDateLine": True, + "name": "background", + "attribution": "© UNESCO", + "visibility": False, + "fixed": True, + "group":"background" +}, { + "source": {"ptype": "gxp_olsource"}, + "type": "OpenLayers.Layer.XYZ", + "title": "UNESCO GEODATA", + "args": ["UNESCO GEODATA", "http://en.unesco.org/tiles/geodata/${z}/${x}/${y}.png"], + "name": "background", + "attribution": "© UNESCO", + "visibility": False, + "wrapDateLine": True, + "fixed": True, + "group":"background" +}, { + "source": {"ptype": "gxp_olsource"}, + "type": "OpenLayers.Layer.XYZ", + "title": "Humanitarian OpenStreetMap", + "args": ["Humanitarian OpenStreetMap", "http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png"], + "name": "background", + "attribution": "© OpenStreetMap, Tiles courtesy of Humanitarian OpenStreetMap Team", + "visibility": False, + "wrapDateLine": True, + "fixed": True, + "group":"background" +}, { + "source": {"ptype": "gxp_olsource"}, + "type": "OpenLayers.Layer.XYZ", + "title": "MapBox Satellite Streets", + "args": ["MapBox Satellite Streets", "http://api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles/${z}/${x}/${y}?access_token="+MAPBOX_ACCESS_TOKEN], + "name": "background", + "attribution": "© Mapbox © OpenStreetMap Improve this map", + "visibility": False, + "wrapDateLine": True, + "fixed": True, + "group":"background" +}, { + "source": {"ptype": "gxp_olsource"}, + "type": "OpenLayers.Layer.XYZ", + "title": "MapBox Streets", + "args": ["MapBox Streets", "http://api.mapbox.com/styles/v1/mapbox/streets-v9/tiles/${z}/${x}/${y}?access_token="+MAPBOX_ACCESS_TOKEN], + "name": "background", + "attribution": "© Mapbox © OpenStreetMap Improve this map", + "visibility": False, + "wrapDateLine": True, + "fixed": True, + "group":"background" +}, { + "source": {"ptype": "gxp_osmsource"}, + "type": "OpenLayers.Layer.OSM", + "title": "OpenStreetMap", + "name": "mapnik", + "attribution": "© OpenStreetMap contributors", + "visibility": True, + "wrapDateLine": 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) + # Uncomment the following to receive emails whenever there are errors in GeoNode # or to be notified of new user requests when ACCOUNT_APPROVAL_REQUIRED has been set. #ADMINS = ( -# ('John', 'john@example.com'), +# ('John', 'john@example.com'), # ) # Uncomment the following to use a Gmail account as the email backend @@ -124,5 +329,29 @@ STATICFILES_DIRS = [ #EMAIL_HOST_PASSWORD = 'yourpassword' #EMAIL_PORT = 587 +# Additional settings +CORS_ORIGIN_ALLOW_ALL = True + +GEOIP_PATH = "/usr/local/share/GeoIP" + +MONITORING_ENABLED = False +# add following lines to your local settings to enable monitoring +if MONITORING_ENABLED: + MIDDLEWARE_CLASSES += ('geonode.contrib.monitoring.middleware.MonitoringMiddleware',) + MONITORING_CONFIG = None + MONITORING_SERVICE_NAME = 'local-geonode' + +# 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 diff --git a/package/support/geonode.updateip b/package/support/geonode.updateip index fa0990ea5de..c58c135d93c 100644 --- a/package/support/geonode.updateip +++ b/package/support/geonode.updateip @@ -68,49 +68,49 @@ else fi # if ALLOWED_HOSTS already exists ... -if grep -q "^[ ]*ALLOWED_HOSTS[ ]*=" "$GEONODE_ETC/local_settings.py" -then - if [ $IS_REPLACE -eq 1 ] - then - echo "Replacing ALLOWED_HOSTS in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' - sed -i "s/^\([ ]*ALLOWED_HOSTS[ ]*=\).*/\1 [ 'localhost', '$NEWIP', ]/g" "$GEONODE_ETC/local_settings.py" - echo "done." - else - echo "Adding $NEWIP to ALLOWED_HOSTS in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' - items="$(grep "^[ ]*ALLOWED_HOSTS[ ]*=" "$GEONODE_ETC/local_settings.py" | \ - sed 's/^[ ]*ALLOWED_HOSTS[ ]*=[ ]*\[//g;s/\][ ]*$//g')" - already_found=0 - oldifs="$IFS" - IFS=',' - for item in $items - do - item_cls="$(echo "$item" | sed "s/^[ ]*['\"]//g;s/['\"][ ]*$//g")" - if [ "$item_cls" = "$NEWIP" ] - then - already_found=1 - break - fi - done - IFS="$oldifs" - if [ $already_found -eq 0 ] - then - if echo "$items" | grep -q ',[ ]*$' - then - items="${items}'$NEWIP', " - else - items="${items}, '$NEWIP', " - fi - sed -i "s/^\([ ]*ALLOWED_HOSTS[ ]*=\).*/\1 [ $items ]/g" "$GEONODE_ETC/local_settings.py" - echo "done." - else - echo "'$NEWIP' already found in ALLOWED_HOSTS list." - fi - fi -else - echo "Adding ALLOWED_HOSTS with in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' - echo "ALLOWED_HOSTS=['localhost', '$NEWIP', ]" >> $GEONODE_ETC/local_settings.py - echo "done." -fi +# if grep -q "^[ ]*ALLOWED_HOSTS[ ]*=" "$GEONODE_ETC/local_settings.py" +# then +# if [ $IS_REPLACE -eq 1 ] +# then +# echo "Replacing ALLOWED_HOSTS in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' +# sed -i "s/^\([ ]*ALLOWED_HOSTS[ ]*=\).*/\1 [ 'localhost', '$NEWIP', ]/g" "$GEONODE_ETC/local_settings.py" +# echo "done." +# else +# echo "Adding $NEWIP to ALLOWED_HOSTS in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' +# items="$(grep "^[ ]*ALLOWED_HOSTS[ ]*=" "$GEONODE_ETC/local_settings.py" | \ +# sed 's/^[ ]*ALLOWED_HOSTS[ ]*=[ ]*\[//g;s/\][ ]*$//g')" +# already_found=0 +# oldifs="$IFS" +# IFS=',' +# for item in $items +# do +# item_cls="$(echo "$item" | sed "s/^[ ]*['\"]//g;s/['\"][ ]*$//g")" +# if [ "$item_cls" = "$NEWIP" ] +# then +# already_found=1 +# break +# fi +# done +# IFS="$oldifs" +# if [ $already_found -eq 0 ] +# then +# if echo "$items" | grep -q ',[ ]*$' +# then +# items="${items}'$NEWIP', " +# else +# items="${items}, '$NEWIP', " +# fi +# sed -i "s/^\([ ]*ALLOWED_HOSTS[ ]*=\).*/\1 [ $items ]/g" "$GEONODE_ETC/local_settings.py" +# echo "done." +# else +# echo "'$NEWIP' already found in ALLOWED_HOSTS list." +# fi +# fi +# else +# echo "Adding ALLOWED_HOSTS with in $GEONODE_ETC/local_settings.py ... " | tr -d '\n' +# echo "ALLOWED_HOSTS=['localhost', '$NEWIP', ]" >> $GEONODE_ETC/local_settings.py +# echo "done." +# fi # silence the warnings from executing geonode command or they will pollute the commands output @@ -131,11 +131,18 @@ client_secret=`echo $oauth_keys | cut -d \, -f 2` oauth_config="$GEOSERVER_DATA_DIR/security/filter/geonode-oauth2/config.xml" sed -i "s|.*|$client_id|g" $oauth_config sed -i "s|.*|$client_secret|g" $oauth_config -sed -i "s/localhost:8000/localhost/g" $oauth_config sed -i "s|.*|http://$NEWIP/o/authorize/|g" $oauth_config +sed -i "s|.*|http://$NEWIP/geoserver/|g" $oauth_config sed -i "s|.*|http://$NEWIP/account/logout/|g" $oauth_config -sed -i "s|localhost:8080/geoserver|$NEWIP/geoserver/|g" $oauth_config -sed -i "s|localhost:8000|localhost|g" "$GEOSERVER_DATA_DIR/security/role/geonode REST role service/config.xml" + +sed -i "s/localhost:8000/$NEWIP/g" $oauth_config +sed -i "s/localhost:8080/$NEWIP/g" $oauth_config + +sed -i "s|.*|http://$NEWIP|g" "$GEOSERVER_DATA_DIR/security/role/geonode REST role service/config.xml" +sed -i "s/localhost:8000/$NEWIP/g" "$GEOSERVER_DATA_DIR/security/role/geonode REST role service/config.xml" + +sed -i "s|.*|http://$NEWIP/geoserver|g" "$GEOSERVER_DATA_DIR/global.xml" +sed -i "s/localhost:8080/$NEWIP/g" "$GEOSERVER_DATA_DIR/global.xml" # Restart apache server $APACHE_SERVICE restart diff --git a/pavement.py b/pavement.py index 208b6be8645..d2958428db0 100644 --- a/pavement.py +++ b/pavement.py @@ -352,6 +352,7 @@ def sync(options): sh("python manage.py loaddata sample_admin.json") sh("python manage.py loaddata geonode/base/fixtures/default_oauth_apps.json") sh("python manage.py loaddata geonode/base/fixtures/initial_data.json") + sh("python manage.py set_all_layers_alternate") @task @@ -810,6 +811,7 @@ def deb(options): # Workaround for git-dch bug # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594580 + sh('rm -rf %s/.git' % (os.path.realpath('package'))) sh('ln -s %s %s' % (os.path.realpath('.git'), os.path.realpath('package'))) with pushd('package'): @@ -817,12 +819,14 @@ def deb(options): # Install requirements # sh('sudo apt-get -y install debhelper devscripts git-buildpackage') - sh(('git-dch --spawn-editor=snapshot --git-author --new-version=%s' - ' --id-length=6 --ignore-branch --release' % (simple_version))) + # sh(('git-dch --spawn-editor=snapshot --git-author --new-version=%s' + # ' --id-length=6 --ignore-branch --release' % (simple_version))) # In case you publish from Ubuntu Xenial (git-dch is removed from upstream) # use the following line instead: # sh(('gbp dch --spawn-editor=snapshot --git-author --new-version=%s' # ' --id-length=6 --ignore-branch --release' % (simple_version))) + sh(('gbp dch --force-distribution --spawn-editor=snapshot --git-author --new-version=%s' + ' --id-length=6 --ignore-branch --release' % (simple_version))) deb_changelog = path('debian') / 'changelog' for line in fileinput.input([deb_changelog], inplace=True): @@ -859,16 +863,17 @@ def publish(): call_task('deb', options={ 'key': key, 'ppa': 'geonode/testing', + # 'ppa': 'geonode/unstable', }) version, simple_version = versions() sh('git add package/debian/changelog') sh('git commit -m "Updated changelog for version %s"' % version) - sh('git tag %s' % version) + sh('git tag -f %s' % version) sh('git push origin %s' % version) - sh('git tag debian/%s' % simple_version) + sh('git tag -f debian/%s' % simple_version) sh('git push origin debian/%s' % simple_version) - sh('git push origin master') + # sh('git push origin master') sh('python setup.py sdist upload -r pypi') @@ -961,12 +966,14 @@ def waitfor(url, timeout=300): def _copytree(src, dst, symlinks=False, ignore=None): + if not os.path.exists(dst): + os.makedirs(dst) for item in os.listdir(src): s = os.path.join(src, item) d = os.path.join(dst, item) if os.path.isdir(s): shutil.copytree(s, d, symlinks, ignore) - else: + elif os.path.isfile(s): shutil.copy2(s, d) diff --git a/publish.sh b/publish.sh new file mode 100755 index 00000000000..392c90253da --- /dev/null +++ b/publish.sh @@ -0,0 +1,5 @@ +#!/bin/bash +source ~/Envs/geonode/bin/activate +pushd $(dirname $0) +DJANGO_SETTINGS_MODULE=geonode.settings paver publish +exit 0 diff --git a/requirements.txt b/requirements.txt index babfa2553a6..f20dce962af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,7 +26,7 @@ django-autoslug==1.9.3 django-bootstrap-form==3.3 django-bootstrap3-datetimepicker==2.2.3 # django-bootstrap3-datetimepicker-2==2.5.0 -django-braces==1.11.0 +django-braces==1.12.0 # django-celery==3.1.17 django-downloadview==1.8 django-extensions==1.6.1 @@ -34,7 +34,7 @@ django-floppyforms==1.7.0 django-forms-bootstrap==3.1.0 django-friendly-tag-loader==1.2.1 django-geoexplorer==4.0.33 -django-geonode-client==0.0.15 +django-geonode-client==1.0.0 django-guardian==1.4.9 django-haystack==2.6.0 django-import-export==0.5.1 diff --git a/setup.py b/setup.py index 87192f79cc2..2c53f569e1a 100644 --- a/setup.py +++ b/setup.py @@ -43,169 +43,159 @@ packages=find_packages(), include_package_data=True, install_requires=[ - # # The commented name next to the package - # # is the Ubuntu 16.04 package that provides it - # # with version in parenthesis - - # # Apps with official Ubuntu 16.04 packages - - # native dependencies - "Pillow<=3.3.1", # python-imaging (3.1.2) - "lxml<=3.6.2", # python-lxml (3.5.0) - "psycopg2<=2.7.3.1", # python-psycopg2 (2.6.1) - "Django<1.9a0", # python-django (1.8.7) - - # Other - "amqp<=2.2.2", - "anyjson<=0.3.3", - "PyYAML<=3.12", - "beautifulsoup4<=4.4.1", # python-bs4 (4.4.1) - "billiard<=3.5.0.3", - "MultipartPostHandler<=0.1.0", # python-multipartposthandler (0.1.0) - "httplib2<=0.10.3", # python-httplib2 (0.9.1, 0.9.2 in our ppa) - "transifex-client<=0.12.4", # transifex-client (0.11.1) - "Paver<=1.2.4", # python-paver (1.2.4) - "Unidecode<=0.4.19", - "django-nose<=1.4.5", # python-django-nose (1.4.3) - "nose<=1.3.7", # python-nose (1.3.7) - "awesome-slugify<=1.6.5", - "django-floppyforms<=1.7.0", - "certifi<=2017.7.27.1", - "chardet<=3.0.4", - "decorator<=4.1.2", - "celery>4.0a0c,<=4.1.0", # python-celery (3.1.20) - # "django-celery==3.1.17", # python-django-celery (3.1.17) - "certifi<=2017.7.27.1", - "autoflake<=0.7", - "flake8<=2.5.4", # python-flake8 (2.5.4) - "pyflakes<=1.6.0", - "pep8<=1.7.0", # python-pep8 (1.7.0) - "boto<=2.38.0", # python-boto (2.38.0) - "six<1.11.0", # https://github.com/benjaminp/six/issues/210 - "diff-match-patch<=20121119", - - # Django Apps - # python-django-pagination (1.0.7) - "django-pagination>=1.0.5,<=1.0.7", - # python-django-extensions (1.5.9) - "django-extensions>=1.2.5,<=1.6.1", - # python-django-jsonfield (0.9.15, 1.0.1 in our ppa) - "django-jsonfield<=1.0.1", - "django-jsonfield-compat<=0.4.4", - "django-leaflet<=0.22.0", - "django-taggit<=0.22.1", # python-django-taggit (0.18.0) - "django-mptt<=0.8.7", # django-mptt (0.8.0, 0.8.6 in our ppa) - "django-treebeard<=4.1.2", # django-treebeard (4.0) - "django-guardian<=1.4.9", # django-guardian (1.4.1) - "django-downloadview<=1.8", # python-django-downloadview (1.8) - "django-polymorphic<=1.3", # python-django-polymorphic (0.8.1) FIXME - "django-reversion<=2.0.10", - "django-suit<=0.2.15", - # python-django-tastypie (0.12.0, 0.12.2 in our ppa) - "django-tastypie<=0.14.0", - "django-invitations==1.9.1", - # python-django-oauth-toolkit (0.10.0) - "django-oauth-toolkit>=0.10.0,<1.0", - "oauthlib<=2.0.2", - - # geopython dependencies - "pyproj>=1.9.5,<=1.9.5.1", # python-pyproj (1.9.5) - "OWSLib>=0.10.3,<=0.15.0", # python-owslib (0.10.3) FIXME - "pycsw>=1.10.1,<=2.0.3", # python-pycsw (1.10.1, 2.0.0 in ppa) FIXME - "%s" % shapely_dep, # python-shapely (1.5.13) - - - # # Apps with packages provided in GeoNode's PPA on Launchpad. - - # Django Apps - "awesome-slugify<=1.6.5", - "dj-database-url<=0.4.2", - "Pinax<=0.9a2", - # pinax-comments==0.1.1 - "pinax-notifications<=4.0.0", - "pinax-theme-bootstrap<=8.0.1", - "django-bootstrap-form<=3.3", - "django-forms-bootstrap<=3.1.0", - "django-friendly-tag-loader<=1.2.1", - "django-activity-stream<=0.6.4", - "django-appconf<=1.0.2", - "django-autocomplete-light>=2.3.3,<3.0a0", - "django-autofixture<=0.12.1", - "django-autoslug<=1.9.3", - "django-braces<=1.11.0", - "django-geonode-client<=0.0.15", - # python-django-modeltranslation (0.11 Debian) - "django-modeltranslation>=0.11,<=0.12.1", - "django-import-export<=0.5.1", - "django-utils<=0.0.2", - - # GeoNode org maintained apps. - "django-geoexplorer>=4.0.0,<5.0", - "geonode-user-messages<=0.1.11", # (0.1.3 in ppa) FIXME - "geonode-avatar<=2.1.6", # (2.1.5 in ppa) FIXME - "geonode-announcements<=1.0.8", - "geonode-agon-ratings<=0.3.5", # (0.3.1 in ppa) FIXME - "geonode-user-accounts==1.0.15", - "geonode-arcrest>=10.0", - "geonode-dialogos>=0.5", - "gsconfig<2.0.0", # (1.0.3 in ppa) FIXME - "gn-gsimporter<2.0.0", # (0.1 in ppa) FIXME - "gisdata>=0.5.4", - - # haystack/elasticsearch, uncomment to use - "django-haystack<=2.6.0", # missing from ppa FIXME - "elasticsearch<=2.4.0", - "pyelasticsearch<=0.6.1", - - # datetimepicker widget - "django-bootstrap3-datetimepicker<=2.2.3", - - # AWS S3 dependencies - "django-storages<=1.6.5", - - # Contribs - "et-xmlfile<=1.0.1", - "unicodecsv<=0.14.1", - "urllib3<=1.22", - "vine<=1.1.4", - "xlrd<=1.1.0", - "xlwt<=1.3.0", - "xmltodict<=0.9.2", - "funcsigs<=1.0.2", - "geolinks<=0.2.0", - "idna<=2.6", - "ipaddress<=1.0.18", - "jdcal<=1.3", - "kombu<=4.1.0", - "mccabe<=0.4.0", - "mock<=2.0.0", - "numpy<=1.13.1", - "odfpy<=1.3.5", - "openpyxl<=2.4.8", - "pbr<=3.1.1", - "python-dateutil<=2.6.1", - "python-gnupg<=0.4.1", - "python-mimeparse<=1.6.0", - "pytz<=2017.2", - "regex<=2016.7.21", - "requests<=2.18.4", - "simplejson<=3.11.1", - "tablib<=0.12.1", - - # tests - "coverage<=4.4.1", - "factory-boy<=2.9.2", - "Faker<=0.8.4", - # "WeasyPrint", - "user-agents", - "xmljson", - "psutil", - "django-cors-headers", - "django-multi-email-field", - "pytest", - "pytest-bdd<=2.5.0", # latest requires six>=1.11.0 - "pytest-splinter", - "pytest-django", + # # The commented name next to the package + # # is the Ubuntu 16.04 package that provides it + # # with version in parenthesis + + # # Apps with official Ubuntu 16.04 packages + + # native dependencies + "Pillow<=3.3.1", # python-imaging (3.1.2) - python-pillow (3.3.1 in our ppa) + "lxml<=3.6.2", # python-lxml (3.6.2 in our ppa) + "psycopg2<=2.7.3.1", # python-psycopg2 (2.7.3.1 in our ppa) + "Django<1.9a0", # python-django (1.8.18 in our ppa) + + # Other + "amqp<=2.2.2", # (python-amqp 2.2.2 in our ppa) + "anyjson<=0.3.3", # (python-anyjson 0.3.3 in our ppa) + "PyYAML<=3.12", # (python-pyyaml 3.12 in out ppa) + "beautifulsoup4<=4.4.1", # python-bs4 (4.4.1) + "billiard<=3.5.0.3", # (python-billiard 3.5.0.3 in our ppa) + "MultipartPostHandler<=0.1.0", # python-multipartposthandler (0.1.0) + "httplib2<=0.10.3", # python-httplib2 (0.10.3 in our ppa) + "transifex-client<=0.12.4", # transifex-client (0.11.1) + "Paver<=1.2.4", # python-paver (1.2.4) + "Unidecode<=0.4.19", # python-unidecode (0.04.19) + "django-nose<=1.4.5", # python-django-nose (1.4.5 in out ppa) + "nose<=1.3.7", # python-nose (1.3.7) + "awesome-slugify<=1.6.5", # python-awesome-slugify (1.6.5) + "django-floppyforms<=1.7.0", # python-django-floppyforms (1.6.0 in our ppa) + "chardet<=3.0.4", # python-chardet (3.0.4 in our ppa) + "decorator<=4.1.2", # python-decorator (4.1.2 in our ppa) + "celery>4.0a0c,<=4.1.0", # python-celery (4.1.0) + "certifi<=2017.7.27.1", # depends on python-elasticsearch + "autoflake<=0.7", + "flake8<=2.5.4", # python-flake8 (2.5.4) + "pyflakes<=1.6.0", + "pep8<=1.7.0", # python-pep8 (1.7.0) + "boto<=2.38.0", # python-boto (2.38.0) + "six<1.11.0", # https://github.com/benjaminp/six/issues/210 (1.10.0 in ppa) TODO + "diff-match-patch<=20121119", # (20121119 in ppa) TODO + + # Django Apps + "django-pagination>=1.0.5,<=1.0.7", # python-django-pagination (1.0.7) + "django-extensions>=1.2.5,<=1.6.1", # python-django-extensions (1.5.9) TODO + "django-jsonfield<=1.0.1", # python-django-jsonfield (0.9.15, 1.0.1 in our ppa) + "django-jsonfield-compat<=0.4.4", # python-django-jsonfield-compat (0.4.4 in our ppa) + "django-leaflet<=0.22.0", # python-django-leaflet (0.19.0 in our ppa) TODO + "django-taggit<=0.22.1", # python-django-taggit (0.18.0) + "django-mptt<=0.8.7", # django-mptt (0.8.0, 0.8.6 in our ppa) FIXME + "django-treebeard<=4.1.2", # django-treebeard (4.0) FIXME + "django-guardian<=1.4.9", # django-guardian (1.4.1) FIXME + "django-downloadview<=1.8", # python-django-downloadview (1.8) + "django-polymorphic<=1.3", # python-django-polymorphic (1.3) + "django-reversion<=2.0.10", # python-django-reversion (1.10.0) FIXME + "django-suit<=0.2.15", # python-django-suit (0.2.15 in our ppa) + "django-tastypie<=0.14.0", # python-django-tastypie (0.12.0, 0.12.2, 0.13.3 in our ppa) FIXME + "django-invitations==1.9.1", # python-django-invitations (1.9.1 in our ppa) + "django-oauth-toolkit>=0.10.0,<1.0", # python-django-oauth-toolkit (0.12.0 in our ppa) + "oauthlib<=2.0.2", # python-oauthlib (2.0.2 in our ppa) + + # geopython dependencies + "pyproj>=1.9.5,<=1.9.5.1", # python-pyproj (1.9.5.1) + "OWSLib>=0.10.3,<=0.15.0", # python-owslib (0.15.0 in our ppa) + "pycsw>=1.10.1,<=2.0.3", # python-pycsw (1.10.1, 2.0.0, 2.0.3 in our ppa) + "%s" % shapely_dep, # python-shapely (1.5.13) + + # # Apps with packages provided in GeoNode's PPA on Launchpad. + + # Django Apps + "dj-database-url<=0.4.2", # , python-dj-database-url (0.4.1 in ppa) + "Pinax<=0.9a2", # python-pinax (0.9a2 in our ppa) + # pinax-comments==0.1.1 + "pinax-notifications<=4.0.0", # (4.0.0 in ppa) + "pinax-theme-bootstrap<=8.0.1", # python-pinax-theme-bootstrap (8.0.1 in our ppa) + "django-bootstrap-form<=3.3", # python-django-bootstrap-form (3.3 in our ppa) + "django-forms-bootstrap<=3.1.0", # python-django-forms-bootstrap (3.1.0 in our ppa) + "django-friendly-tag-loader<=1.2.1", # python-django-friendly-tag-loader (1.2.1 in our ppa) + "django-activity-stream<=0.6.4", # python-django-activity-stream (0.6.3 in ppa) FIXME + "django-appconf<=1.0.2", # (1.0.2 in ppa) + "django-autocomplete-light>=2.3.3,<3.0a0", # (2.3.3.1 in ppa) + "django-autofixture<=0.12.1", # python-django-autofixture (0.12.1 in our ppa) + "django-autoslug<=1.9.3", # python-django-autoslug (1.9.3 in our ppa) + "django-braces<=1.12.0", # pytnon-django-braces (1.12.0 in our ppa) + "django-geonode-client<=1.0.0", # python-django-geonode-client (1.0.0 in our ppa) + "django-modeltranslation>=0.11,<=0.12.1", # python-django-modeltranslation (0.12 Debian) + "django-import-export<=0.5.1", # missing from ppa FIXME + "django-utils<=0.0.2", # missing from ppa FIXME + + # GeoNode org maintained apps. + "django-geoexplorer>=4.0.0,<5.0", # python-django-geoexplorer (4.0.37 in our ppa) + "geonode-user-messages<=0.1.11", # python-geonode-user-messages (0.1.11 in our ppa) + "geonode-avatar<=2.1.6", # python-geonode-avatar (2.1.6 in our ppa) + "geonode-announcements<=1.0.9", # python-geonode-announcements (1.0.9 in our ppa) + "geonode-agon-ratings<=0.3.5", # python-geonode-agon-ratings (0.3.5 in our ppa) + "geonode-user-accounts==1.0.15", # python-geonode-user-accounts (1.0.15 in our ppa) + "geonode-arcrest>=10.0", # python-geonode-arcrest (10.2 in our ppa) + "geonode-dialogos>=0.5", # python-geonode-dialogos (0.7 in our ppa) + "gsconfig<2.0.0", # python-gsconfig (1.0.8 in our ppa) + "gn-gsimporter<2.0.0", # python-gn-gsimporter (1.0.2 in our ppa) + "gisdata>=0.5.4", # python-gisdata (0.5.4 in our ppa) + + # haystack/elasticsearch, uncomment to use + "django-haystack<=2.6.0", # (2.4.1 in ppa) FIXME + "elasticsearch<=2.4.0", # (2.4.0 in ppa) + "pyelasticsearch<=0.6.1", + + # datetimepicker widget + "django-bootstrap3-datetimepicker<=2.2.3", # (2.2.3 in ppa) + + # AWS S3 dependencies + "django-storages<=1.6.5", # python-django-storages (1.6.5 in our ppa) + + # Contribs + "et-xmlfile<=1.0.1", # python-et-xmlfile (1.0.1 in our ppa) + "unicodecsv<=0.14.1", # python-unicodecsv (0.14.1 in our ppa) + "urllib3<=1.22", + "vine<=1.1.4", # (1.1.4 in our ppa) + "xlrd<=1.1.0", # (0.9.4 in ppa) FIXME + "xlwt<=1.3.0", # (0.7.5 in ppa) FIXME + "xmltodict<=0.9.2", # (0.9.2 in ppa) + "funcsigs<=1.0.2", # (0.4 in ppa) FIXME + "geolinks<=0.2.0", # python-geolinks (0.2.0 in ppa) + "idna<=2.6", # (2.0 in ppa) FIXME + "ipaddress<=1.0.18", # (1.0.16 in ppa) FIXME + "jdcal<=1.3", # (1.0 in ppa) FIXME + "kombu<=4.1.0", # python-kombu (4.1.0 in our ppa) + "mccabe<=0.4.0", # (0.2.1 in ppa) FIXME + "mock<=2.0.0", # (1.3.0 in ppa) FIXME + "numpy<=1.13.1", # (1.11.0 in ppa) FIXME + "odfpy<=1.3.5", # python-odfpy (1.3.6 in our ppa) + "openpyxl<=2.4.8", # (2.3.0 in ppa) FIXME + "pbr<=3.1.1", # (1.8.0 in ppa) FIXME + "python-dateutil<=2.6.1", # (2.4.2 in ppa) FIXME + "python-gnupg<=0.4.1", # (0.3.8 in ppa) FIXME + "python-mimeparse<=1.6.0", # (0.1.4 in ppa) FIXME + "pytz<=2017.2", # python-pytz (2017.3 in our ppa) + "regex<=2016.7.21", # (0.1.20160110 in ppa) + "requests<=2.18.4", + "simplejson<=3.11.1", # (3.8.1 in ppa) FIXME + "tablib<=0.12.1", # (0.9.11 in ppa) FIXME + + "psutil", # (3.4.2 in ppa) FIXME + "django-cors-headers", # python-django-cors-headers (2.1.0 in our ppa) + "django-multi-email-field", # python-django-multi-email-field (0.5.1 in our ppa) + # "WeasyPrint", + "user-agents", # python-user-agents (1.1.0 in our ppa) + "xmljson", # python-xmljson (0.1.9 in our ppa) + + # tests + "coverage<=4.4.1", + "factory-boy<=2.9.2", + "Faker<=0.8.4", + "pytest", + "pytest-bdd<=2.5.0", # latest requires six>=1.11.0 + "pytest-splinter", ], zip_safe=False )