diff --git a/.env.example b/.env.example index 08c86cc2..eafd94b5 100644 --- a/.env.example +++ b/.env.example @@ -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. CNIG, bajo CC BY 4.0.' +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 Stamen Design (CC BY 3.0). Data by OpenStreetMap (CC BY SA)' # ckanext-geoview CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 @@ -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" diff --git a/ckan-pycsw/Dockerfile b/ckan-pycsw/Dockerfile index 92f473a7..4fa1f0e9 100644 --- a/ckan-pycsw/Dockerfile +++ b/ckan-pycsw/Dockerfile @@ -1,5 +1,6 @@ # Base image FROM ghcr.io/mjanez/ckan-pycsw:main AS base +LABEL maintainer="mnl.janez@gmail.com" # ckan-pycsw envvars ENV APP_DIR=/app @@ -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"] \ No newline at end of file diff --git a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh index ab65e4a4..9e24c2e2 100644 --- a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh +++ b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh @@ -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 diff --git a/ckan-pycsw/pycsw/conf/pycsw.conf.template b/ckan-pycsw/pycsw/conf/pycsw.conf.template index 607c3f3d..87826a3e 100644 --- a/ckan-pycsw/pycsw/conf/pycsw.conf.template +++ b/ckan-pycsw/pycsw/conf/pycsw.conf.template @@ -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 diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 70ccd9a9..66e9b08b 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -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 && \ @@ -35,7 +35,7 @@ RUN echo ${TZ} > /etc/timezone && \ pip3 install -e git+https://github.com/ckan/ckanext-spatial.git@v2.0.0#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/ckanext-scheming.git@release-3.0.0#egg=ckanext-scheming && \ @@ -46,8 +46,8 @@ RUN echo ${TZ} > /etc/timezone && \ echo "ckan/ckanext-pdfview" && \ pip3 install -e git+https://github.com/ckan/ckanext-pdfview.git@0.0.8#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/ diff --git a/ckan/docker-entrypoint.d/03_setup_dcat.sh b/ckan/docker-entrypoint.d/03_setup_dcat.sh index 9c8f5ae4..2a1efb9a 100644 --- a/ckan/docker-entrypoint.d/03_setup_dcat.sh +++ b/ckan/docker-entrypoint.d/03_setup_dcat.sh @@ -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" \ No newline at end of file diff --git a/ckan/req_fixes/ckanext-spatial_requirements.txt b/ckan/req_fixes/ckanext-spatial_requirements.txt index 49be23ef..0c15f3c0 100644 --- a/ckan/req_fixes/ckanext-spatial_requirements.txt +++ b/ckan/req_fixes/ckanext-spatial_requirements.txt @@ -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 diff --git a/samples/.env.apache.example b/samples/.env.apache.example index 0e1fea1e..95c59e29 100644 --- a/samples/.env.apache.example +++ b/samples/.env.apache.example @@ -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. CNIG, bajo CC BY 4.0.' +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 Stamen Design (CC BY 3.0). Data by OpenStreetMap (CC BY SA)' # ckanext-geoview CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 @@ -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" diff --git a/samples/.env.localhost b/samples/.env.localhost index 66e12950..5b70930e 100644 --- a/samples/.env.localhost +++ b/samples/.env.localhost @@ -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. CNIG, bajo CC BY 4.0.' +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 Stamen Design (CC BY 3.0). Data by OpenStreetMap (CC BY SA)' # ckanext-geoview CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 @@ -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" diff --git a/samples/.env.nginx.example b/samples/.env.nginx.example index 9356fc02..d124b5df 100644 --- a/samples/.env.nginx.example +++ b/samples/.env.nginx.example @@ -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. CNIG, bajo CC BY 4.0.' +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 Stamen Design (CC BY 3.0). Data by OpenStreetMap (CC BY SA)' # ckanext-geoview CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 @@ -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" diff --git a/samples/custom/.env.es.example b/samples/custom/.env.es.example index ed517bfa..8e3f271a 100644 --- a/samples/custom/.env.es.example +++ b/samples/custom/.env.es.example @@ -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. CNIG, bajo CC BY 4.0.' +CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION='SCNE, bajo CC BY 4.0' # ckanext-geoview CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 @@ -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"