From 890b4b9b555efd9bad3b3b2936f02a3616addeac Mon Sep 17 00:00:00 2001 From: "G. Allegri" Date: Thu, 11 Jan 2024 10:25:52 +0100 Subject: [PATCH] Upgrade to master project --- .env.sample | 14 +++++++------- README.md | 2 +- create-envfile.py | 2 +- docker-compose.yml | 9 ++++++--- src/entrypoint.sh | 1 - src/tasks.py | 2 -- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.env.sample b/.env.sample index 77fdd3f..73cc0f8 100644 --- a/.env.sample +++ b/.env.sample @@ -7,12 +7,12 @@ DOCKER_ENV=production DOCKER_API_VERSION="1.24" BACKUPS_VOLUME_DRIVER=local -GEONODE_BASE_IMAGE_VERSION=latest -NGINX_BASE_IMAGE_VERSION=latest -LETSENCRYPT_BASE_IMAGE_VERSION=latest -GEOSERVER_BASE_IMAGE_VERSION=latest -GEOSERVER_DATA_BASE_IMAGE_VERSION=latest -POSTGRES_BASE_IMAGE_VERSION=latest +GEONODE_BASE_IMAGE_VERSION=master +NGINX_BASE_IMAGE_VERSION=1.25.3-latest +LETSENCRYPT_BASE_IMAGE_VERSION=2.6.0-latest +GEOSERVER_BASE_IMAGE_VERSION=2.23.3-latest +GEOSERVER_DATA_BASE_IMAGE_VERSION=2.23.3-latest +POSTGRES_BASE_IMAGE_VERSION=15.3-latest C_FORCE_ROOT=1 FORCE_REINIT=false @@ -108,7 +108,7 @@ OGC_REQUEST_POOL_CONNECTIONS=10 # Java Options & Memory ENABLE_JSONP=true outFormat=text/javascript -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={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 diff --git a/README.md b/README.md index 82ada07..5491abc 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ GeoNode template project. Generates a django project with GeoNode support. ```bash GN_VERSION=master - django-admin startproject --template=https://github.com/GeoNode/geonode-project/archive/refs/tags/$GN_VERSION.zip -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name + django-admin startproject --template=https://github.com/GeoNode/geonode-project/archive/refs/heads/$GN_VERSION.zip -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name ``` ```bash diff --git a/create-envfile.py b/create-envfile.py index ad7dcf4..e061201 100644 --- a/create-envfile.py +++ b/create-envfile.py @@ -141,7 +141,7 @@ def _get_vals_to_replace(args): prog="ENV file builder", description="Tool for generate environment file automatically. The information can be passed or via CLI or via JSON file ( --file /path/env.json)", usage="python create-envfile.py localhost -f /path/to/json/file.json", - allow_abbrev=False, + allow_abbrev=False ) parser.add_argument( "--noinput", diff --git a/docker-compose.yml b/docker-compose.yml index 39d7602..4545057 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.9' # Common Django template for GeoNode and Celery services below x-common-django: &default-common-django - image: ${COMPOSE_PROJECT_NAME}_django:latest + image: ${COMPOSE_PROJECT_NAME}/geonode:${GEONODE_BASE_IMAGE_VERSION} restart: unless-stopped env_file: - .env @@ -41,7 +41,6 @@ services: # Celery worker that executes celery tasks created by Django. celery: << : *default-common-django - image: ${COMPOSE_PROJECT_NAME}_django:latest container_name: celery4${COMPOSE_PROJECT_NAME} depends_on: django: @@ -53,6 +52,7 @@ services: # Nginx is serving django static and media files and proxies to django and geonode geonode: + image: ${COMPOSE_PROJECT_NAME}/nginx:${NGINX_BASE_IMAGE_VERSION} build: context: ./docker/nginx dockerfile: Dockerfile @@ -87,6 +87,7 @@ services: # Gets and installs letsencrypt certificates letsencrypt: + image: ${COMPOSE_PROJECT_NAME}/letsencrypt:${LETSENCRYPT_BASE_IMAGE_VERSION} build: context: ./docker/letsencrypt dockerfile: Dockerfile @@ -101,6 +102,7 @@ services: # Geoserver backend geoserver: + image: ${COMPOSE_PROJECT_NAME}/geoserver:${GEOSERVER_BASE_IMAGE_VERSION} build: context: ./docker/geoserver dockerfile: Dockerfile @@ -131,6 +133,7 @@ services: condition: service_healthy data-dir-conf: + image: ${COMPOSE_PROJECT_NAME}/geoserver_data:${GEOSERVER_DATA_BASE_IMAGE_VERSION} build: context: ./docker/geoserver_data dockerfile: Dockerfile @@ -146,7 +149,7 @@ services: # PostGIS database. db: - # use geonode official postgis 15 image + image: ${COMPOSE_PROJECT_NAME}/postgis:${POSTGRES_BASE_IMAGE_VERSION} build: context: ./docker/postgresql dockerfile: Dockerfile diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 8659305..5ba19df 100644 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -53,7 +53,6 @@ else invoke prepare if [ ${FORCE_REINIT} = "true" ] || [ ${FORCE_REINIT} = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then - invoke updategeoip invoke fixtures invoke monitoringfixture invoke initialized diff --git a/src/tasks.py b/src/tasks.py index 55692d6..b94a641 100644 --- a/src/tasks.py +++ b/src/tasks.py @@ -498,7 +498,6 @@ def _docker_host_ip(): ) return ip_list[0] - def _is_valid_ip(ip): try: ipaddress.IPv4Address(ip) @@ -506,7 +505,6 @@ def _is_valid_ip(ip): except Exception as e: return False - def _container_exposed_port(component, instname): port = "80" try: