Over the following section, we will highlight some of the most important environment variables available to configure a customized deployment of a GeoNode instance.
If you deploy a GeoNode instance via a GeoNode project template, there are a few environment variables you need to take into account because they are affected by your git project (repo) name.
Of course, you can override all these by using the default environment variables if you don’t want to follow your GeoNode project naming convention.
Be careful! The env GEOSERVER_ADMIN_PASSWORD is not actually used to change the GeoServer admin password. You need to log in to the GeoServer UI and change it manually!
Work with graphics-based applications in Java without an actual display, keyboard, or mouse.
A typical use case of UI components running in a headless environment could be an image converter app. Though it needs graphics data for image processing, a display is not really necessary. The app could be run on a server and converted files saved or sent over the network to another machine for display.
-Xms2G-Xmx4G
This means that your JVM will be started with Xms amount of memory and can use a maximum of Xmx amount of memory. The above will start a JVM with 2 GB of memory and will allow the process to use up to 4 GB of memory. You need to adjust this value depending on your available RAM.
-DGEOSERVER_CSRF_DISABLED(True)
The GeoServer web admin employs a CSRF (Cross-Site Request Forgery) protection filter that will block any form submissions that don’t appear to originate from GeoServer. This can sometimes cause problems for certain proxy configurations. You can disable the CSRF filter by setting the GEOSERVER_CSRF_DISABLED property to true.
https://docs.geoserver.org/stable/en/user/security/webadmin/csrf.html
Whenever you need to change one or more of the JVM options, you will need to restart the GeoServer Docker container.
# Hard restart of the container: the only way to update the .env variables
docker-composeup-dgeoserver
This command will preserve all the GeoServer configuration and data since the GEOSERVER_DATA_DIR is stored on a Docker static volume.
Nevertheless, any change you have made manually to the container (e.g. added a new plugin to GeoServer or updated some JARs into the WEB-INF/lib library folder) will be lost.
You will need to add the JARs again and restart GeoServer softly
# Soft restart of the container: the .env variables won't be updated
docker-composerestartgeoserver
WMS: Specify, here the SRS List you are going to use. Empty means all the ones supported by GeoServer, but be careful since the GetCapabilities output will become huge.
WMS: Raster Rendering Options allows you to tune up the WMS output for better performance or quality. Best Performance: NearestNeighbour - Best Quality: Bicubic
Warning
Raster Images should always be optimized before being ingested into GeoNode. The general recommendation is to never upload a non-processed GeoTIFF image to GeoNode.
By default GeoWebCache DiskQuota is disabled. That means that the layers cache might potentially grow indefinitely.
GeoWebCache DiskQuota should be always enabled on a production system. In this case, it is enabled, this must be configured to make use of a DB engine like Postgis to store its indexes.
First of all ensure Tile Caching is enabled on all available layers
Note
GeoNode typically automatically does this for you. It is worth it to double-check anyway.
By default GeoFence stores the security rules on an H2 db.
On a production system, this is not really recommended. You will need to update the GeoServer Docker container in order to enable GeoFence to store the rules in the DB Docker Container instead.
To do that, follow the procedure below:
# Enter the GeoServer Docker Container
docker-composeexecgeoserverbash
# Install a suitable editor
aptupdate
aptinstallnano
# Edit the GeoFence DataStore .properties file
nano/geoserver_data/data/geofence/geofence-datasource-ovr.properties
Note
Make sure to provide the same connection parameters specified in the .env file
The list of the GeoFence Security Rules is available in the GeoFence Data Rules section.
Always double-check that the list is accessible and the data rules are there. If it is empty, no layer will be accessible by standard users other than admin.
To re-sync the GeoFence security rules, follow the procedure below:
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `sync_geonode_datasets` management command
./manage.shsync_geonode_datasets--updatepermissions
The following procedure allows you to batch regenerate all Datasets Thumbnails:
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `sync_geonode_datasets` management command
./manage.shsync_geonode_datasets--updatethumbnails
The following procedure allows you to batch regenerate all Datasets BBOXES:
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `sync_geonode_datasets` management command
./manage.shsync_geonode_datasets--updatebbox
Fixup GeoNode Datasets Metadata And Download Links
The following procedure allows you to fix-up broken or incorrect Metadata Links:
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `set_all_layers_metadata` management command
./manage.shset_all_layers_metadata-d
It is also possible to force purging the links before regenerating:
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `set_all_layers_metadata` management command
./manage.shset_all_layers_metadata-d--prune
In this case, you will need to move your instance to another domain, for example from https://my_geonode.geonode.org/ to https://prod_geonode.geonode.org/, follow the procedure below:
Update the .env file by specifying the new name accordingly.
Restart the GeoNode Docker Container.
docker-composeup-dgeonode
Run the following management commands from inside the GeoNode Docker Container.
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `migrate_baseurl` management command
./manage.shmigrate_baseurl--source-address=my_geonode.geonode.org--target-address=prod_geonode.geonode.org
# Run the `set_all_layers_metadata` management command
./manage.shset_all_layers_metadata-d
Uploading huge datasets, or DB tables, to GeoNode from the Web Upload Interface is sometimes not really possible.
The suggested procedure, in such cases, is the following one:
Add the dataset to GeoServer first directly.
You must upload the data into the GeoServer Docker Container Static Volume first and then manually add the layer through the GeoServer Admin GUI.
Once the dataset is correctly configured on GeoServer, run the following management command from inside the GeoNode Docker Container
# Enter the GeoNode Docker Container
docker-composeexecdjangobash
# Run the `updatelayers` management command
./manage.shupdatelayers-w<workspace_name>-f<layer_name>