Skip to content

[Backport gs2.28.x] Major improvements (data-dir, python, locations) - #87

Open
etj wants to merge 1 commit into
gs2.28.xfrom
20260817_backport_improvements
Open

[Backport gs2.28.x] Major improvements (data-dir, python, locations)#87
etj wants to merge 1 commit into
gs2.28.xfrom
20260817_backport_improvements

Conversation

@etj

@etj etj commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@etj etj self-assigned this Aug 17, 2026
Copilot AI lite review requested due to automatic review settings August 17, 2026 11:25
@etj
etj requested a review from giohappy August 17, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This backport updates the GeoServer Docker image/runtime to self-initialize its data directory from a bundled zip, switches templating from Jinja2/j2 to envsubst, and replaces the previous Python/invoke-based post-start configuration with shell scripts.

Changes:

  • Bundle and extract a default GeoServer data-dir skeleton at container startup (removing the separate geoserver_data image/service).
  • Replace Python invoke tasks with shell-based configuration (configure_geoserver.sh) and move auth XML rewriting into /usr/local/bin.
  • Update templating flow for GeoFence datasource overrides to use envsubst variables.

Reviewed changes

Copilot reviewed 11 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docker/geoserver/templates/geofence/geofence-datasource-ovr.properties.envsubst Switch GeoFence DB config template placeholders to envsubst-style ${VAR}.
docker/geoserver/tasks.py Remove invoke-based Python configuration task.
docker/geoserver/scripts/set_geoserver_auth.sh Add shell script to rewrite GeoServer auth/filter XML config values from env.
docker/geoserver/scripts/multidump.sh Add debug helper to capture top + repeated jstack dumps.
docker/geoserver/scripts/multidump-alt.sh Add alternative debug helper using kill -3 for thread dumps.
docker/geoserver/scripts/entrypoint.sh Add data-dir initialization/extraction; switch templating to envsubst; call new config script.
docker/geoserver/scripts/configure_geoserver.sh Add shell-based GeoServer admin password initialization + lockfile creation.
docker/geoserver/README.md Update docs to describe runtime data-dir extraction and persistence behavior.
docker/geoserver/files/applicationContext.xml Add Spring context bean configuration override file.
docker/geoserver/Dockerfile Update base image, install required tools, bundle data skeleton zip + scripts, remove Python deps.
docker/geoserver/docker-compose.yml Remove data-dir-conf service dependency now that data-dir is initialized in-container.
docker/geoserver_data/README.rst Remove docs for the deprecated geoserver_data companion image.
docker/geoserver_data/download.sh Remove download helper for deprecated geoserver_data image build.
docker/geoserver_data/Dockerfile Remove deprecated geoserver_data image definition.
docker/geoserver_data/docker-compose.yml Remove deprecated compose file for geoserver_data image.
Suppressed comments (3)

docker/geoserver/scripts/entrypoint.sh:20

  • Unquoted mkdir -p $GEOSERVER_DATA_DIR is subject to word-splitting / glob expansion if the variable ever contains spaces or wildcard characters. Quoting is a low-cost hardening step.

This issue also appears in the following locations of the same file:

  • line 29
  • line 217
    docker/geoserver/scripts/entrypoint.sh:33
  • The current move command includes a .* glob, which expands to . and .. in bash and forces you to ignore errors with || true (masking genuine failures). Use dotglob/nullglob so hidden files are included without trying to move ./.., and let real errors surface.
    docker/geoserver/scripts/entrypoint.sh:225
  • The template rendering loop uses unquoted paths and for f in $(find ...), which breaks on filenames with spaces/newlines and can mis-handle glob expansion. Using arrays for iteration and find -print0 avoids these edge cases and makes the script more robust.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

VOLUME $GEOSERVER_DATA_DIR

ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -Xms512m -Xmx2048m -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=http://geoserver:8080/geoserver/pdf -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
ENV JAVA_OPTS="-Djava.awt.headless=true -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -Xms2048m -Xmx2048m 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=http://geoserver:8080/geoserver/pdf"

echo "Response Code: ${RESPONSE_CODE}"

if [ "$RESPONSE_CODE" -eq 200 ]; then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants