Skip to content

Commit 60116e2

Browse files
authored
Geoserver: update to latest version 2.22.2 to get vulnerability fix (#307)
Geoserver: update to latest version 2.22.2 to get vulnerability fix For vulnerability in `jt-jiffle` < 1.1.22, see https://nvd.nist.gov/vuln/detail/CVE-2022-24816, and GHSA-v92f-jx6p-73rx. Changed to use the CORS (Cross-Origin Resource Sharing) default config from the image instead of our own. Both are quite similar so if we can use the default config, future upgrade will be simpler. New Geoserver version will have `jt-jiffle` 1.1.24. The old one had version 1.1.20. ``` $ docker run -it --rm --entrypoint bash pavics/geoserver:2.22.2-kartoza-build20230226-r5-allow-change-context-root-and-fix-missing-stable-plugins _ __ _ ____ _ ____ ____ | |/ /__ _ _ __| |_ ___ ______ _ | _ \ ___ ___| | _____ _ __ / ___| ___ ___/ ___| ___ _ ____ _____ _ __ | ' // _` | '__| __/ _ \_ / _` | | | | |/ _ \ / __| |/ / _ \ '__| | | _ / _ \/ _ \___ \ / _ \ '__\ \ / / _ \ '__| | . \ (_| | | | || (_) / / (_| | | |_| | (_) | (__| < __/ | | |_| | __/ (_) |__) | __/ | \ V / __/ | |_|\_\__,_|_| \__\___/___\__,_| |____/ \___/ \___|_|\_\___|_| \____|\___|\___/____/ \___|_| \_/ \___|_| root@c3787dccea2d:/geoserver# find / -iname '**jt-jiffle**' /usr/local/tomcat/webapps/geoserver/WEB-INF/lib/jt-jiffle-language-1.1.24.jar /usr/local/tomcat/webapps/geoserver/WEB-INF/lib/jt-jiffle-op-1.1.24.jar root@c3787dccea2d:/geoserver# ``` Used our own custom build image because the original kartoza image is missing 2 plugins that we use, see kartoza/docker-geoserver#508 and to avoid excessively slow startup due to kartoza/docker-geoserver#515. CORS config difference: ```diff --- web.xml.old 2023-03-22 16:10:20.000000000 -0400 +++ web.xml.new 2023-03-22 16:10:06.000000000 -0400 <filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> <init-param> - <param-name>cors.allowed.methods</param-name> - <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value> - </init-param> - <init-param> <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.headers</param-name> - <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization,Authentication</param-value> + <param-value>Content-Type,X-Requested-With,accept,Access-Control-Request-Method,Access-Control-Request-Headers,If-Modified-Since,Range,Origin,Authorization</param-value> + </init-param> + <init-param> + <param-name>cors.exposed.headers</param-name> + <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> </init-param> </filter> ``` Missing `cors.allowed.methods`, new `cors.exposed.headers`. For `cors.allowed.headers`, missing `Authentication`, new `If-Modified-Since,Range`. Hopefully everything still works with the new CORS config and future upgrade will be simpler. The new version is able to start now. Syncing production data to vm VM to test for upgrade problem. Last upgrade there was some problem with the existing data. I highly suggest all organizations to test with their existing data before going live. Tested with the following notebooks, hopefully CORS changes are effectively tested there: * https://github.com/Ouranosinc/pavics-sdi/blob/f4aecf64889f0c8503ea67b59b6558ae18407cf6/docs/source/notebooks/WFS_example.ipynb * https://github.com/Ouranosinc/pavics-sdi/blob/f4aecf64889f0c8503ea67b59b6558ae18407cf6/docs/source/notebooks/regridding.ipynb * https://github.com/bird-house/finch/blob/877312d325d4de5c3efcb4f1f75fbe5cd22660d6/docs/source/notebooks/subset.ipynb * https://github.com/Ouranosinc/raven/blob/0be6d77d71bcaf4546de97b13bafc6724068a73d/docs/source/notebooks/01_Getting_watershed_boundaries.ipynb with `RAVEN_GEO_URL` pointing to another Geoserver (also from this PR) to test CORS (Cross-Origin Resource Sharing) ## Other changes - Raven: allow to customize the Geoserver it will use Useful to test the local Geoserver or to have your own Geoserver with your own data. Default to PAVICS Geoserver. Set `RAVEN_GEO_URL` in `env.local` to something like `https://host/geoserver/`. - env.local.example: change default Geoserver admin user from 'admin' to 'admingeo' This only impacts new deployment when `env.local.example` is instanciated to `env.local`. This is to avoid confusion with the admin user of Magpie, which is also 'admin'.
2 parents 3d123a9 + fb12718 commit 60116e2

File tree

13 files changed

+127
-74
lines changed

13 files changed

+127
-74
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.24.1
2+
current_version = 1.25.0
33
commit = True
44
tag = False
55
tag_name = {new_version}
@@ -30,11 +30,11 @@ search = {current_version}
3030
replace = {new_version}
3131

3232
[bumpversion:file:RELEASE.txt]
33-
search = {current_version} 2023-03-27T16:12:50Z
33+
search = {current_version} 2023-04-01T03:45:16Z
3434
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}
3535

3636
[bumpversion:part:releaseTime]
37-
values = 2023-03-27T16:12:50Z
37+
values = 2023-04-01T03:45:16Z
3838

3939
[bumpversion:file(version):birdhouse/config/canarie-api/docker_configuration.py.template]
4040
search = 'version': '{current_version}'

CHANGES.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,94 @@
1616

1717
[//]: # (list changes here, using '-' for each new entry, remove this when items are added)
1818

19+
[1.25.0](https://github.com/bird-house/birdhouse-deploy/tree/1.25.0) (2023-04-01)
20+
------------------------------------------------------------------------------------------------------------------
21+
22+
## Fixes
23+
- Geoserver: update to latest version 2.22.2 to get vulnerability fix
24+
25+
For vulnerability in `jt-jiffle` < 1.1.22, see
26+
https://nvd.nist.gov/vuln/detail/CVE-2022-24816, and
27+
https://github.com/geosolutions-it/jai-ext/security/advisories/GHSA-v92f-jx6p-73rx.
28+
29+
Changed to use the CORS (Cross-Origin Resource Sharing) default config from
30+
the image instead of our own. Both are quite similar so if we can use the
31+
default config, future upgrade will be simpler.
32+
33+
New Geoserver version will have `jt-jiffle` 1.1.24. The old one had version 1.1.20.
34+
```
35+
$ docker run -it --rm --entrypoint bash pavics/geoserver:2.22.2-kartoza-build20230226-r5-allow-change-context-root-and-fix-missing-stable-plugins
36+
37+
| |/ /__ _ _ __| |_ ___ ______ _ | _ \ ___ ___| | _____ _ __ / ___| ___ ___/ ___| ___ _ ____ _____ _ __
38+
| ' // _` | '__| __/ _ \_ / _` | | | | |/ _ \ / __| |/ / _ \ '__| | | _ / _ \/ _ \___ \ / _ \ '__\ \ / / _ \ '__|
39+
| . \ (_| | | | || (_) / / (_| | | |_| | (_) | (__| < __/ | | |_| | __/ (_) |__) | __/ | \ V / __/ |
40+
|_|\_\__,_|_| \__\___/___\__,_| |____/ \___/ \___|_|\_\___|_| \____|\___|\___/____/ \___|_| \_/ \___|_|
41+
42+
root@c3787dccea2d:/geoserver# find / -iname '**jt-jiffle**'
43+
/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/jt-jiffle-language-1.1.24.jar
44+
/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/jt-jiffle-op-1.1.24.jar
45+
root@c3787dccea2d:/geoserver#
46+
```
47+
48+
Used our own custom build image because the original kartoza image is missing 2 plugins that we use, see https://github.com/kartoza/docker-geoserver/issues/508 and to avoid excessively slow startup due to https://github.com/kartoza/docker-geoserver/issues/515.
49+
50+
CORS config difference:
51+
```diff
52+
--- web.xml.old 2023-03-22 16:10:20.000000000 -0400
53+
+++ web.xml.new 2023-03-22 16:10:06.000000000 -0400
54+
55+
<filter>
56+
<filter-name>CorsFilter</filter-name>
57+
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
58+
<init-param>
59+
- <param-name>cors.allowed.methods</param-name>
60+
- <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
61+
- </init-param>
62+
- <init-param>
63+
<param-name>cors.allowed.origins</param-name>
64+
<param-value>*</param-value>
65+
</init-param>
66+
<init-param>
67+
<param-name>cors.allowed.headers</param-name>
68+
- <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization,Authentication</param-value>
69+
+ <param-value>Content-Type,X-Requested-With,accept,Access-Control-Request-Method,Access-Control-Request-Headers,If-Modified-Since,Range,Origin,Authorization</param-value>
70+
+ </init-param>
71+
+ <init-param>
72+
+ <param-name>cors.exposed.headers</param-name>
73+
+ <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
74+
</init-param>
75+
</filter>
76+
```
77+
Missing `cors.allowed.methods`, new `cors.exposed.headers`.
78+
79+
For `cors.allowed.headers`, missing `Authentication`, new `If-Modified-Since,Range`.
80+
81+
Hopefully everything still works with the new CORS config and future upgrade will be simpler.
82+
83+
Tested with the following notebooks, hopefully CORS changes are effectively tested there:
84+
* https://github.com/Ouranosinc/pavics-sdi/blob/f4aecf64889f0c8503ea67b59b6558ae18407cf6/docs/source/notebooks/WFS_example.ipynb
85+
* https://github.com/Ouranosinc/pavics-sdi/blob/f4aecf64889f0c8503ea67b59b6558ae18407cf6/docs/source/notebooks/regridding.ipynb
86+
* https://github.com/bird-house/finch/blob/877312d325d4de5c3efcb4f1f75fbe5cd22660d6/docs/source/notebooks/subset.ipynb
87+
* https://github.com/Ouranosinc/raven/blob/0be6d77d71bcaf4546de97b13bafc6724068a73d/docs/source/notebooks/01_Getting_watershed_boundaries.ipynb
88+
with `RAVEN_GEO_URL` pointing to another Geoserver (also from this PR) to
89+
test CORS (Cross-Origin Resource Sharing)
90+
91+
## Changes
92+
- Raven: allow to customize the Geoserver it will use
93+
94+
Useful to test the local Geoserver or to have your own Geoserver with your
95+
own data. Default to PAVICS Geoserver.
96+
97+
Set `RAVEN_GEO_URL` in `env.local` to something like `https://host/geoserver/`.
98+
99+
- env.local.example: change default Geoserver admin user from 'admin' to 'admingeo'
100+
101+
This only impacts new deployment when `env.local.example` is instanciated
102+
to `env.local`.
103+
104+
This is to avoid confusion with the admin user of Magpie, which is also 'admin'.
105+
106+
19107
[1.24.1](https://github.com/bird-house/birdhouse-deploy/tree/1.24.1) (2023-03-27)
20108
------------------------------------------------------------------------------------------------------------------
21109

@@ -32,7 +120,9 @@
32120
[1.24.0](https://github.com/bird-house/birdhouse-deploy/tree/1.24.0) (2023-03-22)
33121
------------------------------------------------------------------------------------------------------------------
34122
## Fixes
35-
- The default stack was not configurable. This meant that if someone wanted to deploy a
123+
- Make all components pluggable
124+
125+
The default stack was not configurable. This meant that if someone wanted to deploy a
36126
subset of the default stack there was no good way of configuring birdhouse-deploy to run
37127
this subset only.
38128

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generic variables
22
override SHELL := bash
33
override APP_NAME := birdhouse-deploy
4-
override APP_VERSION := 1.24.1
4+
override APP_VERSION := 1.25.0
55

66
# utility to remove comments after value of an option variable
77
override clean_opt = $(shell echo "$(1)" | $(_SED) -r -e "s/[ '$'\t'']+$$//g")

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ for a full-fledged production platform.
1414
* - releases
1515
- | |latest-version| |commits-since|
1616

17-
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.24.1.svg
17+
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/1.25.0.svg
1818
:alt: Commits since latest release
19-
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.24.1...master
19+
:target: https://github.com/bird-house/birdhouse-deploy/compare/1.25.0...master
2020

21-
.. |latest-version| image:: https://img.shields.io/badge/tag-1.24.1-blue.svg?style=flat
21+
.. |latest-version| image:: https://img.shields.io/badge/tag-1.25.0-blue.svg?style=flat
2222
:alt: Latest Tag
23-
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.24.1
23+
:target: https://github.com/bird-house/birdhouse-deploy/tree/1.25.0
2424

2525
.. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest
2626
:alt: ReadTheDocs Build Status (latest version)

RELEASE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.1 2023-03-27T16:12:50Z
1+
1.25.0 2023-04-01T03:45:16Z

birdhouse/config/canarie-api/docker_configuration.py.template

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ SERVICES = {
1717
'info': {
1818
'name': 'Node',
1919
'synopsis': 'Nodes are data, compute and index endpoints accessed through the PAVICS platform or external clients. The Node service is the backend that allows: data storage, harvesting, indexation and discovery of local and federated data; authentication and authorization; server registration and management. Node service is therefore composed of several other services.',
20-
'version': '1.24.1',
21-
'releaseTime': '2023-03-27T16:12:50Z',
20+
'version': '1.25.0',
21+
'releaseTime': '2023-04-01T03:45:16Z',
2222
'institution': 'Ouranos',
2323
'researchSubject': 'Climatology',
2424
'supportEmail': '${SUPPORT_EMAIL}',
@@ -47,8 +47,8 @@ PLATFORMS = {
4747
'info': {
4848
'name': 'PAVICS',
4949
'synopsis': 'The PAVICS (Power Analytics for Visualization of Climate Science) platform is a collection of climate analysis services served through Open Geospatial Consortium (OGC) protocols. These services include data access, processing and visualization. Both data and algorithms can be accessed either programmatically, through OGC-compliant clients such as QGIS or ArcGIS, or a custom web interface.',
50-
'version': '1.24.1',
51-
'releaseTime': '2023-03-27T16:12:50Z',
50+
'version': '1.25.0',
51+
'releaseTime': '2023-04-01T03:45:16Z',
5252
'institution': 'Ouranos',
5353
'researchSubject': 'Climatology',
5454
'supportEmail': '${SUPPORT_EMAIL}',

birdhouse/config/geoserver/default.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
# Cache kartoza/geoserver docker build on pavics org since their tags are
88
# "moving" tags, meaning not reproducible behavior !
99
# See https://github.com/kartoza/docker-geoserver/issues/232#issuecomment-808754831
10-
export GEOSERVER_IMAGE="pavics/geoserver:2.19.0-kartoza-build20210329-r2-with-snakeyaml"
10+
export GEOSERVER_IMAGE="pavics/geoserver:2.22.2-kartoza-build20230226-r7-allow-change-context-root-and-fix-missing-stable-plugins-and-avoid-chown-datadir"
1111

1212
export GEOSERVER_ADMIN_USER="admin"
1313

1414
# # Install the stable plugin specified in
1515
# https://github.com/kartoza/docker-geoserver/blob/master/build_data/stable_plugins.txt
16-
export GEOSERVER_STABLE_EXTENSIONS="grib-plugin,netcdf-plugin,netcdf-out-plugin"
16+
export GEOSERVER_STABLE_EXTENSIONS="grib-plugin,netcdf-plugin,netcdf-out-plugin,csw-iso-plugin,metadata-plugin"
1717

1818
# Install the community edition plugins specified in
1919
# https://github.com/kartoza/docker-geoserver/blob/master/build_data/community_plugins.txt
20-
export GEOSERVER_COMMUNITY_EXTENSIONS="csw-iso-plugin,geopkg-plugin,metadata-plugin"
20+
export GEOSERVER_COMMUNITY_EXTENSIONS="geopkg-plugin"
2121

2222
# Must use single-quote for delayed eval.
2323
export GEOSERVER_DATA_DIR='${DATA_PERSIST_ROOT}/geoserver'

birdhouse/config/geoserver/docker-compose-extra.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,22 @@ services:
1414
ports:
1515
- "8087:8080"
1616
environment:
17-
# for custom entrypoint
18-
PAVICS_FQDN_PUBLIC: ${PAVICS_FQDN_PUBLIC}
1917
STABLE_EXTENSIONS: ${GEOSERVER_STABLE_EXTENSIONS}
2018
COMMUNITY_EXTENSIONS: ${GEOSERVER_COMMUNITY_EXTENSIONS}
2119
GEOSERVER_ADMIN_USER: ${GEOSERVER_ADMIN_USER}
2220
GEOSERVER_ADMIN_PASSWORD: ${GEOSERVER_ADMIN_PASSWORD}
2321
# fix "WARNING: Illegal reflective access by org.geotools.image.ImageWorker" in `docker logs geoserver`
2422
JAVA_OPTS: --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED
2523
MAXIMUM_MEMORY: 8G
24+
# https://github.com/kartoza/docker-geoserver#proxy-base-url
25+
HTTP_PROXY_NAME: ${PAVICS_FQDN_PUBLIC}
26+
HTTP_SCHEME: https
2627
volumes:
2728
# run deployment/fix-geoserver-data-dir-perm on existing
2829
# GEOSERVER_DATA_DIR to match user geoserveruser inside docker image
2930
- ${GEOSERVER_DATA_DIR}:/opt/geoserver/data_dir
30-
- ./config/geoserver/entrypointwrapper:/entrypointwrapper:ro
3131
links:
3232
- postgis
33-
entrypoint: /entrypointwrapper
3433
restart: always
3534
logging: *default-logging
3635
healthcheck:

birdhouse/config/geoserver/entrypointwrapper

Lines changed: 0 additions & 50 deletions
This file was deleted.

birdhouse/config/raven/default.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# The Geoserver that Raven will connect to.
2+
# Same default value as
3+
# https://github.com/CSHS-CWRA/RavenPy/blob/2e56041b605e83ab28ffdc5d817e645481dcc5fc/ravenpy/utilities/geoserver.py#L51
4+
# This is the production Geoserver that is always available with appropriate data.
5+
# For site that want to run your own Geoserver with your own data, please
6+
# override this variable with your own Geoserver instance.
7+
# Ex: RAVEN_GEO_URL="https://${PAVICS_FQDN}/geoserver/"
8+
export RAVEN_GEO_URL="https://pavics.ouranos.ca/geoserver/"
19

210
# When canarie-api is monitoring twitcher, at least one WPS service protected by twitcher
311
# needs to be available. This sets this component as the service used to monitor twitcher.

0 commit comments

Comments
 (0)