[Backport gs2.28.x] Major improvements (data-dir, python, locations) - #87
Open
etj wants to merge 1 commit into
Open
[Backport gs2.28.x] Major improvements (data-dir, python, locations)#87etj wants to merge 1 commit into
etj wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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_dataimage/service). - Replace Python
invoketasks 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
envsubstvariables.
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_DIRis 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). Usedotglob/nullglobso 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 andfind -print0avoids 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.