Skip to content

Upgrade a GeoNode 4.0 4.1 instance to GeoNode 4.2

Giovanni Allegri edited this page Mar 27, 2024 · 2 revisions

GeoNode 4.2 introduces some changes to the required environmental variable for the Docker services, and a few changes to the Nginx configuration.

Changes to the .env file

Here below the changes between the template .env files are reported. Not all of them are strictly required, but it's better to have them aligned.

Of course, you will have to replace the placeholders with your values where changes are required:

  • {{project_name}}: this placeholder must be replaced with the value you have set for COMPOSE_PROJECT_NAME
  • {siteurl}: this placeholder must be replaced with the value you have set for SITE_URL
  • GEONODE_DATABASE_USER: password of the application DB. By default, it's the same as the project name (COMPOSE_PROJECT_NAME variable)
  • GEONODE_GEODATABASE_USER: password of the data DB. By default, it's the same as the project name (COMPOSE_PROJECT_NAME variable)
diff --git a/.env.sample b/.env.sample
index 3e8f5b9..1c80946 100644
--- a/.env.sample
+++ b/.env.sample
@@ -1,6 +1,4 @@
 COMPOSE_PROJECT_NAME={{project_name}}
-DOCKERHOST=
-DOCKER_HOST_IP=
 # See https://github.com/containers/podman/issues/13889
 # DOCKER_BUILDKIT=0
 DOCKER_ENV=production
@@ -9,11 +7,18 @@ DOCKER_ENV=production
 DOCKER_API_VERSION="1.24"
 BACKUPS_VOLUME_DRIVER=local
 
+GEONODE_BASE_IMAGE_VERSION=4.2.3
+NGINX_BASE_IMAGE_VERSION=1.25.3-v1
+LETSENCRYPT_BASE_IMAGE_VERSION=2.6.0-v1
+GEOSERVER_BASE_IMAGE_VERSION=2.24.2-v1
+GEOSERVER_DATA_BASE_IMAGE_VERSION=2.24.2-v1
+POSTGRES_BASE_IMAGE_VERSION=15.3-v1
+
 C_FORCE_ROOT=1
 FORCE_REINIT=false
 INVOKE_LOG_STDOUT=true
 
-# LANGUAGE_CODE=pt
+# LANGUAGE_CODE=it-it
 # LANGUAGES=(('en-us','English'),('it-it','Italiano'))
 
 DJANGO_SETTINGS_MODULE={{project_name}}.settings
@@ -25,8 +30,10 @@ GEONODE_INSTANCE_NAME=geonode
 POSTGRES_USER=postgres
 POSTGRES_PASSWORD={pgpwd}
 GEONODE_DATABASE={{project_name}}
+GEONODE_DATABASE_USER={{project_name}}
 GEONODE_DATABASE_PASSWORD={dbpwd}
 GEONODE_GEODATABASE={{project_name}}_data
+GEONODE_GEODATABASE_USER={{project_name}}_data
 GEONODE_GEODATABASE_PASSWORD={geodbpwd}
 GEONODE_DATABASE_SCHEMA=public
 GEONODE_GEODATABASE_SCHEMA=public
@@ -43,7 +50,7 @@ ASYNC_SIGNALS=True
 
 SITEURL={siteurl}/
 
-ALLOWED_HOSTS="['django', '*', '{hostname}']"
+ALLOWED_HOSTS="['django', '{hostname}']"
 
 # Data Uploader
 DEFAULT_BACKEND_UPLOADER=geonode.importer
@@ -54,20 +61,13 @@ HAYSTACK_ENGINE_URL=http://elasticsearch:9200/
 HAYSTACK_ENGINE_INDEX_NAME=haystack
 HAYSTACK_SEARCH_RESULTS_PER_PAGE=200
 
-# #################
-# Jenkins
-# CI/CD Server
-# #################
-JENKINS_HTTP_PORT=9080
-JENKINS_HTTPS_PORT=9443
-
 # #################
 # nginx
 # HTTPD Server
 # #################
-GEONODE_LB_HOST_IP={hostname}
-GEONODE_LB_PORT=80
-PUBLIC_PORT={public_port}
+GEONODE_LB_HOST_IP=django
+GEONODE_LB_PORT=8000
+NGINX_BASE_URL={siteurl}
 
 # IP or domain name and port where the server can be reached on HTTPS (leave HOST empty if you want to use HTTP only)
 # port where the server can be reached on HTTPS
@@ -91,9 +91,11 @@ RESOLVER=127.0.0.11
 # #################
 # geoserver
 # #################
-GEOSERVER_WEB_UI_LOCATION={geoserver_ui}/geoserver/
-GEOSERVER_PUBLIC_LOCATION={geoserver_ui}/geoserver/
-GEOSERVER_LOCATION=http://geoserver:8080/geoserver/
+GEOSERVER_LB_HOST_IP=geoserver
+GEOSERVER_LB_PORT=8080
+GEOSERVER_WEB_UI_LOCATION={siteurl}/geoserver/
+GEOSERVER_PUBLIC_LOCATION={siteurl}/geoserver/
+GEOSERVER_LOCATION=http://${GEOSERVER_LB_HOST_IP}:${GEOSERVER_LB_PORT}/geoserver/
 GEOSERVER_ADMIN_USER=admin
 GEOSERVER_ADMIN_PASSWORD={geoserverpwd}
 
@@ -106,7 +108,7 @@ OGC_REQUEST_POOL_CONNECTIONS=10
 # Java Options & Memory
 ENABLE_JSONP=true
 outFormat=text/javascript
-GEOSERVER_JAVA_OPTS=-Djava.awt.headless=true -Xms2G -Xmx4G -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:PerfDataSamplingInterval=500 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UseGCOverheadLimit -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL={geoserver_ui}/geoserver/pdf -DALLOW_ENV_PARAMETRIZATION=true -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3-Unsafe.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine
+GEOSERVER_JAVA_OPTS=-Djava.awt.headless=true -Xms4G -Xmx4G -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:PerfDataSamplingInterval=500 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UseGCOverheadLimit -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGS-SHAPEFILE-CHARSET=UTF-8 -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL={siteurl}/geoserver/pdf -DALLOW_ENV_PARAMETRIZATION=true -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3-Unsafe.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine
 
 # #################
 # Security
@@ -152,6 +154,8 @@ ACCOUNT_EMAIL_REQUIRED=True
 ACCOUNT_APPROVAL_REQUIRED=False
 ACCOUNT_CONFIRM_EMAIL_ON_GET=False
 ACCOUNT_EMAIL_VERIFICATION=none
+ACCOUNT_EMAIL_CONFIRMATION_EMAIL=False
+ACCOUNT_EMAIL_CONFIRMATION_REQUIRED=False
 ACCOUNT_AUTHENTICATION_METHOD=username_email
 AUTO_ASSIGN_REGISTERED_MEMBERS_TO_REGISTERED_MEMBERS_GROUP_NAME=True
 
@@ -170,7 +174,7 @@ TASTYPIE_APIKEY=
 # #################
 DEBUG={debug}
 
-SECRET_KEY="{secret_key}"
+SECRET_KEY='{secret_key}'
 
 STATIC_ROOT=/mnt/volumes/statics/static/
 MEDIA_ROOT=/mnt/volumes/statics/uploaded/
@@ -180,11 +184,15 @@ CACHE_BUSTING_STATIC_ENABLED=False
 
 MEMCACHED_ENABLED=False
 MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
-MEMCACHED_LOCATION=127.0.0.1:11211
+MEMCACHED_LOCATION=memcached:11211
 MEMCACHED_LOCK_EXPIRE=3600
 MEMCACHED_LOCK_TIMEOUT=10
+#
+# Options for memcached binary, e.g. -vvv to log all requests and cache hits
+#
+MEMCACHED_OPTIONS=

Changes to Nginx configuration

Replace the geonode.conf.envsubst file, which in a default Docker setup is located under /var/lib/docker/volumes/{{project_name}}-nginxconfd/_data/sites-enabled, with the updated version:

The major changes in this configuration are

  • Jenkins is not automatically setup by default in GeoNode 4.2
  • Nginx communities with Django over the proxy_pass protocol instead of uwsgi
Clone this wiki locally