From b843de1946be969ad7f377348572ef2aba135b4b Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:49:05 +0000 Subject: [PATCH 1/2] Apply patches to the ckan Dockerfile --- ckan/Dockerfile | 19 +++++++++++++------ ckan/Dockerfile.ghcr | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 770ae47..a84f69f 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -67,12 +67,19 @@ COPY setup/who.ini ./ COPY patches patches RUN for d in $APP_DIR/patches/*; do \ - if [ -d $d ]; then \ - for f in `ls $d/*.patch | sort -g`; do \ - cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`" && patch -p1 < "$f"; \ - done; \ - fi; \ - done + if [ -d $d ]; then \ + for f in `ls $d/*.patch | sort -g`; do \ + cd $SRC_DIR/`basename "$d"` && \ + if patch -R --dry-run -p1 < "$f"; then \ + echo "$0: Patch $f has already been applied or reversed, skipping..."; \ + else \ + echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \ + sed -i 's/\r$//' "$f" && \ + patch -p1 < "$f" ; \ + fi \ + done ; \ + fi ; \ +done # Workers ## Update start_ckan.sh with custom workers diff --git a/ckan/Dockerfile.ghcr b/ckan/Dockerfile.ghcr index 9ee4604..03dc78a 100644 --- a/ckan/Dockerfile.ghcr +++ b/ckan/Dockerfile.ghcr @@ -32,6 +32,7 @@ RUN for d in $APP_DIR/patches/*; do \ echo "$0: Patch $f has already been applied or reversed, skipping..."; \ else \ echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \ + sed -i 's/\r$//' "$f" && \ patch -p1 < "$f" ; \ fi \ done ; \ From 2967efa0e0ccd67ca459fbe907af52479866070e Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:16:53 +0000 Subject: [PATCH 2/2] CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS added. - Required option to ckan.search.solr_allowed_query_parsers config for spatial search, see: https://github.com/ckan/ckanext-spatial/issues/328 - Update solr backend to solr-spatial-field --- .env.example | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 748fa49..e486723 100644 --- a/.env.example +++ b/.env.example @@ -113,6 +113,8 @@ CKAN__PREVIEW__JSON_FORMATS="json jsonld" CKAN__PREVIEW__XML_FORMATS="xml rdf rdf+xml owl+xml atom rss turtle ttl n3 n-triples" CKAN__PREVIEW__TEXT_FORMATS="text plain text/plain text/turtle csv tsv rss txt json" CKAN__PREVIEW__LOADABLE="html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json arcgis_rest" +# ckanext-spatial: Allow Solr local params: https://github.com/ckan/ckanext-spatial/issues/328 +CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS = field ## Resource Proxy settings ### Preview size limit, default: 1MB @@ -150,8 +152,8 @@ CKANEXT__DCAT__RDF_PROFILES='euro_dcat_ap_2' # The custom endpoint **must** start with a forward slash (`/`) and contain the `{_format}` placeholder. The endpoint is added to the CKAN_SITE_URL and CKAN__ROOT_PATH, example: http://localhost:5000/catalog/catalog.rdf CKANEXT__DCAT__DEFAULT_CATALOG_ENDPOINT='/catalog.{_format}' -# ckanext-spatial (Solr Backend - solr8-spatial) -CKANEXT__SPATIAL__SEARCH_BACKEND=solr-bbox +# ckanext-spatial (Solr Backend - solr9-spatial: https://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#choosing-a-backend-for-the-spatial-search) +CKANEXT__SPATIAL__SEARCH_BACKEND=solr-spatial-field CKAN__SPATIAL__SRID=3857 CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=http://a.tile.openstreetmap.org/{z}/{x}/{y}.png