Skip to content

Commit

Permalink
Merge pull request #79 from mjanez/ckan-2.9.9
Browse files Browse the repository at this point in the history
Fix pycsw and update plugins
  • Loading branch information
mjanez committed Sep 25, 2023
2 parents 29e58c5 + e5447ef commit 9b103cf
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 29 deletions.
13 changes: 8 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,18 @@ CKANEXT__XLOADER__API_TOKEN=api_token
CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan

# ckanext-dcat
CKANEXT__DCAT__BASE_URI=http://localhost:81/catalog
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
CKANEXT__DCAT__BASE_URI=${CKAN_URL}
# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat
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
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.ign.es/web/qsm-cnig">CNIG</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>.'
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Map tiles by <a href="http://stamen.com">Stamen Design</a> (<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>). Data by <a href="http://openstreetmap.org">OpenStreetMap</a> (<a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>)'

# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
Expand All @@ -154,7 +157,7 @@ CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8

# ckanext-scheming_dcat
## CSW Endpoint for spatial metadata
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=http://localhost:81/csw
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=${PYCSW_URL}
## Scheming: setup_scheming.sh
CKANEXT__SCHEMING_DCAT_DATASET_SCHEMA="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_dataset.yaml"
CKANEXT__SCHEMING_DCAT_GROUP_SCHEMAS="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_group.json"
Expand Down
3 changes: 1 addition & 2 deletions ckan-pycsw/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Base image
FROM ghcr.io/mjanez/ckan-pycsw:main AS base
LABEL maintainer="[email protected]"

# ckan-pycsw envvars
ENV APP_DIR=/app
Expand All @@ -19,6 +20,4 @@ WORKDIR ${APP_DIR}
# Update files if needed
COPY pycsw/conf/pycsw.conf.template docker-entrypoint.d/entrypoint.sh ./

USER $USERNAME

ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
2 changes: 2 additions & 0 deletions ckan-pycsw/docker-entrypoint.d/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -xeuo pipefail

envsubst < pycsw.conf.template > pycsw.conf

#TODO: -Xfrozen_modules=off from: https://bugs.python.org/issue1666807
/wait-for --timeout "$TIMEOUT" "$CKAN_URL" -- pdm run python3 -Xfrozen_modules=off ckan2pycsw/ckan2pycsw.py

Expand Down
2 changes: 1 addition & 1 deletion ckan-pycsw/pycsw/conf/pycsw.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ database=sqlite:///${PWD}/cite.db
table=records
#filter=type='http://purl.org/dc/dcmitype/Dataset'

#[metadata:inspire]
[metadata:inspire]
enabled=true
languages_supported=eng,spa
default_language=eng
Expand Down
10 changes: 5 additions & 5 deletions ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ COPY req_fixes ${APP_DIR}/req_fixes
### Harvester - v1.5.1 ###
### Geoview - v0.0.20 ###
### Spatial - v2.0.0 ### fixed requirements.txt
### DCAT - v1.1.0-geodcatap (GeoDCAT-AP extended version) ###
### DCAT - v1.2.0-geodcatap (GeoDCAT-AP/NTI-RISP extended version) ###
### Scheming - release-3.0.0 ###
### Resource dictionary - v1.0.1 ###
### Pages - v0.5.2 ###
### PDFView - 0.0.8 ###
### Scheming DCAT - v1.2.0 (GeoDCAT-AP extended version) ###
### Scheming DCAT - v2.0.0 (GeoDCAT-AP/NTI-RISP extended version) ###
### SPARQL Interface - 2.0.1 ###
RUN echo ${TZ} > /etc/timezone && \
if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then cp /usr/share/zoneinfo/${TZ} /etc/localtime ; fi && \
Expand All @@ -35,7 +35,7 @@ RUN echo ${TZ} > /etc/timezone && \
pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-spatial && \
pip3 install -r ${APP_DIR}/req_fixes/ckanext-spatial_requirements.txt && \
echo "mjanez/ckanext-dcat (GeoDCAT-AP extended version)" && \
pip3 install -e git+https://github.com/mjanez/ckanext-dcat.git@v1.1.0-geodcatap#egg=ckanext-dcat && \
pip3 install -e git+https://github.com/mjanez/ckanext-dcat.git@v1.2.0-geodcatap#egg=ckanext-dcat && \
pip3 install -r ${APP_DIR}/src/ckanext-dcat/requirements.txt && \
echo "ckan/ckanext-scheming" && \
pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-scheming && \
Expand All @@ -46,8 +46,8 @@ RUN echo ${TZ} > /etc/timezone && \
echo "ckan/ckanext-pdfview" && \
pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-pdfview && \
echo "mjanez/ckanext-scheming_dcat" && \
pip3 install -e git+https://github.com/mjanez/ckanext-scheming_dcat.git@v1.2.0#egg=ckanext_scheming_dcat && \
pip3 install -r https://raw.githubusercontent.com/mjanez/ckanext-scheming_dcat/v1.2.0/requirements.txt
pip3 install -e git+https://github.com/mjanez/ckanext-scheming_dcat.git@v2.0.0#egg=ckanext_scheming_dcat && \
pip3 install -r https://raw.githubusercontent.com/mjanez/ckanext-scheming_dcat/v2.0.0/requirements.txt

# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
COPY docker-entrypoint.d/* /docker-entrypoint.d/
Expand Down
1 change: 1 addition & 0 deletions ckan/docker-entrypoint.d/03_setup_dcat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
echo "Loading ckanext-dcat settings in the CKAN config file"
ckan config-tool $CKAN_INI \
"ckanext.dcat.base_uri = $CKANEXT__DCAT__BASE_URI" \
"ckanext.dcat.catalog_endpoint = $CKANEXT__DCAT__DEFAULT_CATALOG_ENDPOINT" \
"ckanext.dcat.rdf.profiles = $CKANEXT__DCAT__RDF_PROFILES"
4 changes: 2 additions & 2 deletions ckan/req_fixes/ckanext-spatial_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pyparsing>=2.1.10
requests>=1.1.0
six

# requirements pyproj tempfix: https://github.com/pyproj4/pyproj/issues/1321
# requirements pyproj fix: https://github.com/pyproj4/pyproj/issues/1321
pyproj==2.6.1; python_version < '3.9'
pyproj @ git+https://github.com/pyproj4/pyproj.git@main; python_version >= '3.9'
pyproj==3.6.1; python_version >= '3.9'

Shapely==2.0.1
OWSLib==0.28.1
Expand Down
11 changes: 7 additions & 4 deletions samples/.env.apache.example
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,17 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan

# ckanext-dcat
CKANEXT__DCAT__BASE_URI=http://localhost:81/catalog
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat
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
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.ign.es/web/qsm-cnig">CNIG</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>.'
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Map tiles by <a href="http://stamen.com">Stamen Design</a> (<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>). Data by <a href="http://openstreetmap.org">OpenStreetMap</a> (<a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>)'

# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
Expand All @@ -146,7 +149,7 @@ CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8

# ckanext-scheming_dcat
## CSW Endpoint for spatial metadata
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=http://localhost:81/csw
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=${PYCSW_URL}
## Scheming: setup_scheming.sh
CKANEXT__SCHEMING_DCAT_DATASET_SCHEMA="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_dataset.yaml"
CKANEXT__SCHEMING_DCAT_GROUP_SCHEMAS="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_group.json"
Expand Down
11 changes: 7 additions & 4 deletions samples/.env.localhost
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,17 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan

# ckanext-dcat
CKANEXT__DCAT__BASE_URI=http://localhost:81/catalog
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat
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
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.ign.es/web/qsm-cnig">CNIG</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>.'
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Map tiles by <a href="http://stamen.com">Stamen Design</a> (<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>). Data by <a href="http://openstreetmap.org">OpenStreetMap</a> (<a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>)'

# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
Expand All @@ -154,7 +157,7 @@ CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8

# ckanext-scheming_dcat
## CSW Endpoint for spatial metadata
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=http://localhost:81/csw
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=${PYCSW_URL}
## Scheming: setup_scheming.sh
CKANEXT__SCHEMING_DCAT_DATASET_SCHEMA="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_dataset.yaml"
CKANEXT__SCHEMING_DCAT_GROUP_SCHEMAS="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_group.json"
Expand Down
11 changes: 7 additions & 4 deletions samples/.env.nginx.example
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,17 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan

# ckanext-dcat
CKANEXT__DCAT__BASE_URI=http://localhost:81/catalog
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat
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
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.ign.es/web/qsm-cnig">CNIG</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>.'
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Map tiles by <a href="http://stamen.com">Stamen Design</a> (<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>). Data by <a href="http://openstreetmap.org">OpenStreetMap</a> (<a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>)'

# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
Expand All @@ -146,7 +149,7 @@ CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8

# ckanext-scheming_dcat
## CSW Endpoint for spatial metadata
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=http://localhost:81/csw
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=${PYCSW_URL}
## Scheming: setup_scheming.sh
CKANEXT__SCHEMING_DCAT_DATASET_SCHEMA="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_dataset.yaml"
CKANEXT__SCHEMING_DCAT_GROUP_SCHEMAS="ckanext.scheming_dcat:schemas/geodcatap/geodcatap_group.json"
Expand Down
9 changes: 7 additions & 2 deletions samples/custom/.env.es.example
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,17 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan

# ckanext-dcat
CKANEXT__DCAT__BASE_URI=http://localhost:81/catalog
CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap"
# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat
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
CKAN__SPATIAL__SRID=3857
CKANEXT__SPATIAL__COMMON_MAP__TYPE=custom
CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL=https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='Servicios de Teselas. <a href="https://www.ign.es/web/qsm-cnig">CNIG</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>.'
CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='<a href="https://www.scne.es/">SCNE</a>, bajo <a href="http://creativecommons.org/licenses/by/4.0">CC BY 4.0</a>'

# ckanext-geoview
CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000
Expand All @@ -153,6 +156,8 @@ CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857
CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8

# ckanext-scheming_dcat
## CSW Endpoint for spatial metadata
CKANEXT__SCHEMING_DCAT_GEOMETADATA_BASE_URI=${PYCSW_URL}
## Scheming: setup_scheming.sh
CKANEXT__SCHEMING_DCAT_DATASET_SCHEMA="ckanext.scheming_dcat:schemas/geodcatap_es/geodcatap_es_dataset.yaml"
CKANEXT__SCHEMING_DCAT_GROUP_SCHEMAS="ckanext.scheming_dcat:schemas/geodcatap_es/geodcatap_es_group.json"
Expand Down

0 comments on commit 9b103cf

Please sign in to comment.