diff --git a/.env b/.env index 9ab75e1e..589c1a26 100644 --- a/.env +++ b/.env @@ -2,10 +2,10 @@ COMPOSE_PROJECT_NAME=kartozageoserver # ############### # Build Arguments # ############### -IMAGE_VERSION=9.0.91-jdk11-temurin-focal -GS_VERSION=2.25.3 +IMAGE_VERSION=9.0.91-jdk17-temurin-focal +GS_VERSION=2.26.0 JAVA_HOME=/opt/java/openjdk -WAR_URL=http://downloads.sourceforge.net/project/geoserver/GeoServer/2.25.3/geoserver-2.25.3-war.zip +WAR_URL=http://downloads.sourceforge.net/project/geoserver/GeoServer/2.26.0/geoserver-2.26.0-war.zip STABLE_PLUGIN_BASE_URL=https://sourceforge.net/projects/geoserver/files/GeoServer GEOSERVER_UID=1000 GEOSERVER_GID=10001 diff --git a/.github/workflows/build-latest.yaml b/.github/workflows/build-latest.yaml index 1c49a93c..a0a33a6c 100644 --- a/.github/workflows/build-latest.yaml +++ b/.github/workflows/build-latest.yaml @@ -69,11 +69,11 @@ jobs: geoserverMajorVersion: - 2 imageVersion: - - image: 9.0.91-jdk11-temurin-focal + - image: 9.0.91-jdk17-temurin-focal javaHome: /opt/java/openjdk geoserverMinorVersion: - - minor: 25 - patch: 3 + - minor: 26 + patch: 0 stablePluginBaseURL: - https://sourceforge.net/projects/geoserver/files/GeoServer steps: diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml index 86bb5fa3..d1c59d78 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/deploy-image.yaml @@ -27,11 +27,11 @@ jobs: geoserverMajorVersion: - 2 imageVersion: - - image: 9.0.91-jdk11-temurin-focal + - image: 9.0.91-jdk17-temurin-focal javaHome: /opt/java/openjdk geoserverMinorVersion: - - minor: 25 - patch: 3 + - minor: 26 + patch: 0 stablePluginBaseURL: # empty because it often changes, so it's better # to use the default one described in the Dockerfile diff --git a/Dockerfile b/Dockerfile index 88b02bef..c58a0ac1 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ ARG JAVA_HOME=/opt/java/openjdk # alpine because it's smaller. FROM --platform=$BUILDPLATFORM python:alpine3.20 AS geoserver-plugin-downloader -ARG GS_VERSION=2.25.3 +ARG GS_VERSION=2.26.0 ARG STABLE_PLUGIN_BASE_URL=https://sourceforge.net/projects/geoserver/files/GeoServer ARG WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${GS_VERSION}/geoserver-${GS_VERSION}-war.zip @@ -49,7 +49,7 @@ RUN /work/plugin_download.sh FROM tomcat:$IMAGE_VERSION AS geoserver-prod LABEL maintainer="Tim Sutton" -ARG GS_VERSION=2.25.3 +ARG GS_VERSION=2.26.0 ARG STABLE_PLUGIN_BASE_URL=https://sourceforge.net/projects/geoserver/files/GeoServer ARG HTTPS_PORT=8443 ARG ACTIVATE_GDAL_PLUGIN=true diff --git a/README.md b/README.md index 34efcfee..fbc79cc9 100755 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ The preferred way (but using the most bandwidth for the initial image) is to get our docker-trusted build like this: ``` shell -VERSION=2.25.3 +VERSION=2.26.0 docker pull kartoza/geoserver:$VERSION ``` **Note** Although the images are tagged and backed by unit tests @@ -100,14 +100,14 @@ See the [dockerhub tomcat](https://hub.docker.com/_/tomcat/) for available tags. ``` -VERSION=2.25.3 +VERSION=2.26.0 IMAGE_VERSION=9.0.91-jdk11-temurin-focal docker build --build-arg IMAGE_VERSION=${IMAGE_VERSION} --build-arg GS_VERSION=${VERSION} -t kartoza/geoserver:${VERSION} . ``` For some recent builds, it is necessary to set the JAVA_PATH as well (e.g. Apache Tomcat/9.0.36) ``` -docker build --build-arg IMAGE_VERSION=9.0.91-jdk11-temurin-focal --build-arg JAVA_HOME=/usr/local/openjdk-11/bin/java --build-arg GS_VERSION=2.25.3 -t kartoza/geoserver:2.25.3 . +docker build --build-arg IMAGE_VERSION=9.0.91-jdk11-temurin-focal --build-arg JAVA_HOME=/usr/local/openjdk-11/bin/java --build-arg GS_VERSION=2.26.0 -t kartoza/geoserver:2.26.0 . ``` **Note:** Please check the [GeoServer documentation](https://docs.geoserver.org/stable/en/user/production/index.html) @@ -195,9 +195,9 @@ will be enabled : [list of default plugins](https://github.com/kartoza/docker-ge #### Activate stable extensions during the contain startup The environment variable `STABLE_EXTENSIONS` is used to activate extensions listed in -[stable_plugins](https://sourceforge.net/projects/geoserver/files/GeoServer/2.25.3/extensions/) +[stable_plugins](https://sourceforge.net/projects/geoserver/files/GeoServer/2.26.0/extensions/) -**Note:** The plugins listed in the url is of the format `geoserver-2.25.3-wps-plugin.zip`, but the env +**Note:** The plugins listed in the url is of the format `geoserver-2.26.0-wps-plugin.zip`, but the env variable expects the env to be of the format `wps-plugin`. Always consult the url to see which plugins are available. The text file [stable_plugins.txt](https://github.com/kartoza/docker-geoserver/blob/master/build_data/stable_plugins.txt) contains a curated list of plugins but might be out of date in some cases. @@ -205,11 +205,11 @@ contains a curated list of plugins but might be out of date in some cases. Example ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -d -p 8600:8080 --name geoserver -e STABLE_EXTENSIONS=charts-plugin,db2-plugin kartoza/geoserver:${VERSION} ``` -You can pass any comma-separated extensions as defined in [stable_plugins](https://sourceforge.net/projects/geoserver/files/GeoServer/2.25.3/extensions/) +You can pass any comma-separated extensions as defined in [stable_plugins](https://sourceforge.net/projects/geoserver/files/GeoServer/2.26.0/extensions/) #### Activate community extensions during contain startup @@ -224,7 +224,7 @@ contains a curated list of community plugins but might be out of date in some ca Example ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -d -p 8600:8080 --name geoserver -e COMMUNITY_EXTENSIONS=gwc-sqlite-plugin,ogr-datastore-plugin kartoza/geoserver:${VERSION} ``` @@ -240,7 +240,7 @@ following the guidelines from [GeoServer develop guidelines](https://docs.geoser The image ships with sample data. This can be used to familiarize yourself with GeoServer. This is not activated by default. You can activate it using the environment variable `boolean SAMPLE_DATA`. ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -d -p 8600:8080 --name geoserver -e SAMPLE_DATA=true kartoza/geoserver:${VERSION} ``` @@ -309,14 +309,14 @@ If you set the environment variable `SSL=true` but do not provide the pem files the container will generate self-signed SSL certificates. ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -it --name geoserver -e PKCS12_PASSWORD=geoserver -e JKS_KEY_PASSWORD=geoserver -e JKS_STORE_PASSWORD=geoserver -e SSL=true -p 8443:8443 -p 8600:8080 kartoza/geoserver:${VERSION} ``` If you already have your perm files (`fullchain.pem` and `privkey.pem`) you can mount the directory containing your keys as: ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -it --name geo -v /etc/certs:/etc/certs -e PKCS12_PASSWORD=geoserver -e JKS_KEY_PASSWORD=geoserver -e JKS_STORE_PASSWORD=geoserver -e SSL=true -p 8443:8443 -p 8600:8080 kartoza/geoserver:${VERSION} ``` @@ -374,7 +374,7 @@ To include Tomcat extras including docs, examples, and the manager web app, set to use a strong password otherwise a randomly generated password is used. ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -it --name geoserver -e TOMCAT_EXTRAS=true -p 8600:8080 kartoza/geoserver:${VERSION} ``` @@ -398,7 +398,7 @@ If you have downloaded extra fonts you can mount the folder to the path path during initialisation. This is useful for styling layers i.e. labeling using specific fonts. ``` -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -v fonts:/opt/fonts -p 8080:8080 -t kartoza/geoserver:${VERSION} ``` @@ -408,7 +408,7 @@ You can use the environment variable `GOOGLE_FONTS_NAMES` to activate fonts defi i.e. ```bash -ie VERSION=2.25.3 +ie VERSION=2.26.0 docker run -e GOOGLE_FONTS_NAMES=actor,akronim -p 8080:8080 -t kartoza/geoserver:${VERSION} ``` diff --git a/clustering/docker-compose.yml b/clustering/docker-compose.yml index 7cb6cf8f..550552dd 100644 --- a/clustering/docker-compose.yml +++ b/clustering/docker-compose.yml @@ -19,7 +19,7 @@ services: healthcheck: test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis" master: - image: kartoza/geoserver:2.25.3 + image: kartoza/geoserver:2.26.0 volumes: - geoserver-cluster-data:/opt/geoserver/data_dir - geoserver-cluster-gwc-data:/opt/geoserver/gwc @@ -54,7 +54,7 @@ services: timeout: 10s retries: 3 node: - image: kartoza/geoserver:2.25.3 + image: kartoza/geoserver:2.26.0 volumes: - geoserver-cluster-data:/opt/geoserver/data_dir - geoserver-cluster-gwc-data:/opt/geoserver/gwc diff --git a/scenario_tests/context/docker-compose.yml b/scenario_tests/context/docker-compose.yml index d9e64813..1d3ec109 100644 --- a/scenario_tests/context/docker-compose.yml +++ b/scenario_tests/context/docker-compose.yml @@ -18,9 +18,8 @@ services: INITIAL_MEMORY: 2G MAXIMUM_MEMORY: 4G GEOSERVER_CONTEXT_ROOT: foobar - CONTAINER_NAME: geoserver CONSOLE_HANDLER_LEVEL: WARNING - TEST_CLASS: test_login.TestGeoServerREST + TEST_CLASS: test_context.TestGeoServerREST healthcheck: test: ["CMD-SHELL", "curl --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null -u $${GEOSERVER_ADMIN_USER}:$${GEOSERVER_ADMIN_PASSWORD} http://localhost:8080/foobar/rest/about/version.xml"] interval: 1m30s diff --git a/scenario_tests/context/test.sh b/scenario_tests/context/test.sh index ef75d783..b20b2f6c 100755 --- a/scenario_tests/context/test.sh +++ b/scenario_tests/context/test.sh @@ -15,7 +15,7 @@ fi #################################### #Test using default created password ##################################### -echo -e "[Unit Test] Running tests using password from env Geoserver password" +echo -e "[Unit Test] Running GEOSERVER_CONTEXT_ROOT tests with GEOSERVER_CONTEXT_ROOT set to foobar" ${VERSION} up -d @@ -31,7 +31,7 @@ services=("geoserver") for service in "${services[@]}"; do # Execute tests - test_url_availability http://localhost:8080/foobar/rest/about/version.xml foobargeoserver + test_url_availability http://localhost:8080/foobar/rest/about/version.xml myawesomegeoserver echo "Execute test for $service" ${VERSION} exec -T "${service}" /bin/bash /tests/test.sh @@ -42,7 +42,7 @@ ${VERSION} down -v #################################### #Test using updated password ##################################### -echo -e "[Unit Test] Running testing using updated password from env Geoserver password" +echo -e "[Unit Test] Running GEOSERVER_CONTEXT_ROOT tests with GEOSERVER_CONTEXT_ROOT set to foobar#geoserver" sed -i 's/foobar/foobar#geoserver/g' docker-compose.yml # Bring the services up again ${VERSION} up -d geoserver diff --git a/scenario_tests/context/tests/test_login.py b/scenario_tests/context/tests/test_context.py similarity index 73% rename from scenario_tests/context/tests/test_login.py rename to scenario_tests/context/tests/test_context.py index f3787953..4ca28cb3 100644 --- a/scenario_tests/context/tests/test_login.py +++ b/scenario_tests/context/tests/test_context.py @@ -10,18 +10,11 @@ def setUp(self): self.geo_context = environ.get('GEOSERVER_CONTEXT_ROOT').replace("#", '/') self.base_url = f'http://localhost:8080/{self.geo_context}' self.login_url = f'{self.base_url}/j_spring_security_check' - self.username = 'admin' - self.container_name = environ['CONTAINER_NAME'] + self.password = environ['GEOSERVER_ADMIN_PASSWORD'] - if self.container_name == 'geoserver': - self.password = environ['GEOSERVER_ADMIN_PASSWORD'] - else: - with open('/opt/geoserver/data_dir/security/pass.txt', 'r') as file: - file_pass = file.read() - self.password = file_pass.replace("\n", "") self.session = requests.Session() login_data = { - 'username': self.username, + 'username': 'admin', 'password': self.password, 'submit': 'Login' } diff --git a/scenario_tests/login/test.sh b/scenario_tests/login/test.sh index 8f5d4ee4..10a6a6e5 100755 --- a/scenario_tests/login/test.sh +++ b/scenario_tests/login/test.sh @@ -26,10 +26,13 @@ for service in "${services[@]}"; do # Execute tests if [[ $service == 'server' ]];then PORT=8082 + PASS=$(docker compose exec server cat /opt/geoserver/data_dir/security/pass.txt) else PORT=8081 + PASS="myawesomegeoserver" fi - test_url_availability http://localhost:$PORT/geoserver/rest/about/version.xml + sleep 30 + test_url_availability http://localhost:$PORT/geoserver/rest/about/version.xml ${PASS} echo "Execute test for $service" ${VERSION} exec -T $service /bin/bash /tests/test.sh @@ -52,6 +55,7 @@ services=("geoserver") for service in "${services[@]}"; do # Execute tests + sleep 30 test_url_availability http://localhost:8081/geoserver/rest/about/version.xml fabulousgeoserver echo "Execute test for $service" ${VERSION} exec -T $service /bin/bash /tests/test.sh diff --git a/scenario_tests/test-env.sh b/scenario_tests/test-env.sh index 71e5337b..e05e85d6 100644 --- a/scenario_tests/test-env.sh +++ b/scenario_tests/test-env.sh @@ -25,14 +25,18 @@ function test_url_availability() { elapsed_time=$((current_time - start_time)) if [ $elapsed_time -ge $timeout ]; then - echo "Timeout reached. Exiting." + echo "Timeout reached. Exiting trying to connect to service endpoint." exit 1 fi - if [[ $(wget -S --spider --user admin --password ${PASS} ${URL} 2>&1 | grep 'HTTP/1.1 200') ]]; then - echo "Rest endpoint ${URL} is available" + + + result=$(wget -S --spider --user admin --password ${PASS} --max-redirect=0 ${URL} 2>&1 | grep "HTTP/1.1 " | tail -n 1 | awk '{print $2}') + + if [[ $result -eq 200 ]]; then + echo "Rest endpoint ${URL} is accessible with the provided credentials" break else - echo "Rest endpoint ${URL} is not available, retrying in 5 seconds" + echo "Access to ${URL}, with credentials username admin and password ${PASS} did not succeed, retrying in 5 seconds" sleep 5 fi done