From c069f3588fff4b0842118669ad4bf2fc141c3229 Mon Sep 17 00:00:00 2001 From: Admire Nyakudya Date: Mon, 24 Apr 2023 14:36:07 +0200 Subject: [PATCH 1/5] fix #10963 --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 9007e68237e..b70dbf7ac2e 100755 --- a/tasks.py +++ b/tasks.py @@ -355,7 +355,7 @@ def prepare(ctx): new_ext_ip = os.environ["SITEURL"] client_id = os.environ["OAUTH2_CLIENT_ID"] client_secret = os.environ["OAUTH2_CLIENT_SECRET"] - oauth_config = "/geoserver_data/data/security/filter/geonode-oauth2/config.xml" + oauth_config = f"{os.environ['GEOSERVER_DATA_DIR']}/security/filter/geonode-oauth2/config.xml" ctx.run(f'sed -i "s|.*|{client_id}|g" {oauth_config}', pty=True) ctx.run( f'sed -i "s|.*|{client_secret}|g" {oauth_config}', From 172ca54a82a614f743dc88cf12111806c04878d1 Mon Sep 17 00:00:00 2001 From: Admire Nyakudya Date: Sat, 29 Apr 2023 07:41:00 +0200 Subject: [PATCH 2/5] add geoserver data dir path in env files --- .env | 1 + .env_dev | 1 + .env_local | 1 + .env_test | 1 + 4 files changed, 4 insertions(+) diff --git a/.env b/.env index 96b166bf2fb..ef4e432d1d2 100644 --- a/.env +++ b/.env @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ GEOSERVER_LOCATION=http://geoserver:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=30 OGC_REQUEST_MAX_RETRIES=1 diff --git a/.env_dev b/.env_dev index 937d630ad4d..fbcf4c466f1 100644 --- a/.env_dev +++ b/.env_dev @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=60 OGC_REQUEST_MAX_RETRIES=0 diff --git a/.env_local b/.env_local index 4bec5dc60bc..96281142cd8 100644 --- a/.env_local +++ b/.env_local @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=30 OGC_REQUEST_MAX_RETRIES=1 diff --git a/.env_test b/.env_test index 78eebee94cb..083acd2c221 100644 --- a/.env_test +++ b/.env_test @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ GEOSERVER_LOCATION=http://geoserver:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=5 OGC_REQUEST_MAX_RETRIES=0 From efb08e674e40eb9861275962fff3b31b12921cab Mon Sep 17 00:00:00 2001 From: Admire Nyakudya Date: Mon, 24 Apr 2023 14:36:07 +0200 Subject: [PATCH 3/5] fix #10963 --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 9007e68237e..b70dbf7ac2e 100755 --- a/tasks.py +++ b/tasks.py @@ -355,7 +355,7 @@ def prepare(ctx): new_ext_ip = os.environ["SITEURL"] client_id = os.environ["OAUTH2_CLIENT_ID"] client_secret = os.environ["OAUTH2_CLIENT_SECRET"] - oauth_config = "/geoserver_data/data/security/filter/geonode-oauth2/config.xml" + oauth_config = f"{os.environ['GEOSERVER_DATA_DIR']}/security/filter/geonode-oauth2/config.xml" ctx.run(f'sed -i "s|.*|{client_id}|g" {oauth_config}', pty=True) ctx.run( f'sed -i "s|.*|{client_secret}|g" {oauth_config}', From eb1c4007b18113174fc43628a0c44b6dc92ce577 Mon Sep 17 00:00:00 2001 From: Admire Nyakudya Date: Sat, 29 Apr 2023 07:41:00 +0200 Subject: [PATCH 4/5] add geoserver data dir path in env files --- .env | 1 + .env_dev | 1 + .env_local | 1 + .env_test | 1 + 4 files changed, 4 insertions(+) diff --git a/.env b/.env index 96b166bf2fb..ef4e432d1d2 100644 --- a/.env +++ b/.env @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ GEOSERVER_LOCATION=http://geoserver:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=30 OGC_REQUEST_MAX_RETRIES=1 diff --git a/.env_dev b/.env_dev index 937d630ad4d..fbcf4c466f1 100644 --- a/.env_dev +++ b/.env_dev @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=60 OGC_REQUEST_MAX_RETRIES=0 diff --git a/.env_local b/.env_local index 4bec5dc60bc..96281142cd8 100644 --- a/.env_local +++ b/.env_local @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_LOCATION=http://localhost:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=30 OGC_REQUEST_MAX_RETRIES=1 diff --git a/.env_test b/.env_test index 78eebee94cb..083acd2c221 100644 --- a/.env_test +++ b/.env_test @@ -92,6 +92,7 @@ GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ GEOSERVER_LOCATION=http://geoserver:8080/geoserver/ GEOSERVER_ADMIN_USER=admin GEOSERVER_ADMIN_PASSWORD=geoserver +GEOSERVER_DATA_DIR=/geoserver_data/data OGC_REQUEST_TIMEOUT=5 OGC_REQUEST_MAX_RETRIES=0 From 32b17fb27a15b378d25d50bf30b79641759fa4f6 Mon Sep 17 00:00:00 2001 From: mazano Date: Sun, 2 Jul 2023 13:44:17 +0200 Subject: [PATCH 5/5] address comment in PR --- docker-compose-geoserver-server.yml | 4 ++-- docker-compose-test.yml | 8 ++++---- docker-compose.yml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker-compose-geoserver-server.yml b/docker-compose-geoserver-server.yml index 10785a5794a..af19a202a93 100644 --- a/docker-compose-geoserver-server.yml +++ b/docker-compose-geoserver-server.yml @@ -10,7 +10,7 @@ services: org.geonode.instance.name: geonode command: /bin/true volumes: - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} geoserver: image: geonode/geoserver:2.23.0 @@ -24,7 +24,7 @@ services: depends_on: - data-dir-conf volumes: - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} env_file: - .env ports: diff --git a/docker-compose-test.yml b/docker-compose-test.yml index de398f099a7..c1e1d4add91 100644 --- a/docker-compose-test.yml +++ b/docker-compose-test.yml @@ -10,7 +10,7 @@ x-common-django: volumes: # - '.:/usr/src/geonode' - statics:/mnt/volumes/statics - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} - backup-restore:/backup_restore - data:/data - tmp:/tmp @@ -101,7 +101,7 @@ services: - .env_test volumes: - statics:/mnt/volumes/statics - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} - backup-restore:/backup_restore - data:/data - tmp:/tmp @@ -117,10 +117,10 @@ services: container_name: gsconf4${COMPOSE_PROJECT_NAME} entrypoint: sleep infinity volumes: - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} restart: on-failure healthcheck: - test: "ls -A '/geoserver_data/data' | wc -l" + test: "ls -A '${GEOSERVER_DATA_DIR}' | wc -l" # PostGIS database. db: diff --git a/docker-compose.yml b/docker-compose.yml index a4fc63d9b88..98826441fb6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ x-common-django: volumes: # - '.:/usr/src/geonode' - statics:/mnt/volumes/statics - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} - backup-restore:/backup_restore - data:/data - tmp:/tmp @@ -101,7 +101,7 @@ services: - .env volumes: - statics:/mnt/volumes/statics - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} - backup-restore:/backup_restore - data:/data - tmp:/tmp @@ -117,10 +117,10 @@ services: container_name: gsconf4${COMPOSE_PROJECT_NAME} entrypoint: sleep infinity volumes: - - geoserver-data-dir:/geoserver_data/data + - geoserver-data-dir:${GEOSERVER_DATA_DIR} restart: on-failure healthcheck: - test: "ls -A '/geoserver_data/data' | wc -l" + test: "ls -A '${GEOSERVER_DATA_DIR}' | wc -l" # PostGIS database. db: