diff --git a/.env b/.env deleted file mode 100644 index 85d50ae7..00000000 --- a/.env +++ /dev/null @@ -1,147 +0,0 @@ -# Base -APP_DIR=/srv/app - -# Container names -REDIS_CONTAINER_NAME=redis -POSTGRESQL_CONTAINER_NAME=db -SOLR_CONTAINER_NAME=solr -CKAN_CONTAINER_NAME=ckan -WORKER_CONTAINER_NAME=ckan-worker -APACHE_CONTAINER_NAME=apache -PYCSW_CONTAINER_NAME=pycsw - -# Host Ports -CKAN_PORT_HOST=5000 -APACHE_PORT_HOST=80 -PYCSW_PORT_HOST=8000 - -# Solr -SOLR_IMAGE_VERSION=2.9-solr8-spatial -SOLR_PORT=8983 -CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan -TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan - -# Redis -REDIS_VERSION=7-alpine -CKAN_REDIS_URL=redis://redis:6379/1 -TEST_CKAN_REDIS_URL=redis://redis:6379/1 - -# Apache HTTP Server -APACHE_VERSION=2.4-alpine -APACHE_PORT=80 -APACHE_LOG_DIR=/var/log/apache -APACHE_SERVER_NAME=des.iepnb.es -# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. -APACHE_CKAN_LOCATION=/catalogo -APACHE_PYCSW_LOCATION=/csw - -# pycsw -PYCSW_PORT=8000 -CKAN_URL=https://des.iepnb.es/catalogo -PYCSW_URL=https://des.iepnb.es/csw -# SCHEMAS: ckan2pycsw/model/dataset.py - Dataset type -PYCSW_CKAN_SCHEMA=iso19139_geodcatap -PYCSW_OUPUT_SCHEMA=iso19139_inspire - -# CKAN databases -POSTGRES_USER=ckan -POSTGRES_PASSWORD=ckan -DATASTORE_READONLY_USER=datastore_ro -DATASTORE_READONLY_PASSWORD=datastore -POSTGRES_HOST=db -CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan -CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore -CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore - -# Test database connections -TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test -TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test -TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test - -# CKAN core -CKAN_VERSION=2.9.8 -CKAN_SITE_ID=default -# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 -CKAN_SITE_URL=https://des.iepnb.es -CKAN__ROOT_PATH=/catalogo/{{LANG}} -CKAN_PORT=5000 -CKAN___BEAKER__SESSION__SECRET=CHANGE_ME -# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings -CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME -CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME -CKAN_SYSADMIN_NAME=ckan_admin -CKAN_SYSADMIN_PASSWORD=test1234 -CKAN_SYSADMIN_EMAIL=your_email@example.com -CKAN_STORAGE_PATH=/var/lib/ckan -CKAN_SMTP_SERVER=smtp.corporateict.domain:25 -CKAN_SMTP_STARTTLS=True -CKAN_SMTP_USER=user -CKAN_SMTP_PASSWORD=pass -CKAN_SMTP_MAIL_FROM=ckan@localhost -TZ=UTC -## Customize which text formats the text_view plugin will show -CKAN__PREVIEW__JSON_FORMATS="json jsonld" -# html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json -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" - -## Resource Proxy settings -### Preview size limit, default: 1MB -CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 -## Size of chunks to read/write__ -CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 -## Default timeout for fetching proxied items -CKAN__RESOURCE_PROXY__TIMEOUT=10 -CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view" - -# Localization -CKAN__LOCALE_DEFAULT="es" -CKAN__LOCALE_ORDER="es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv" - -# Extensions -CKAN__PLUGINS="envvars stats text_view image_view webpage_view recline_view resourcedictionary datastore xloader harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages iepnb" - -# ckanext-harvest -CKAN__HARVEST__MQ__TYPE=redis -CKAN__HARVEST__MQ__HOSTNAME=redis -CKAN__HARVEST__MQ__PORT=6379 -CKAN__HARVEST__MQ__REDIS_DB=1 - -# ckanext-xloader -CKANEXT__XLOADER__API_TOKEN=api_token -CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan - -# ckanext-dcat -CKANEXT__DCAT__BASE_URI=https://des.iepnb.es/catalogo -CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap" - -# ckanext-scheming: setup_scheming.sh -SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA="ckanext.scheming:ckan_geodcatap.yaml" -SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS="ckanext.scheming:ckan_group_geodcatap.json" -SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS="ckanext.scheming:ckan_org_geodcatap.json" -SCHEMA_CKANEXT_SCHEMING_PRESETS="ckanext.scheming:presets.json" - -# 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. IDEE, bajo CC BY 3.0.' - -# ckanext-geoview -CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 -CKANEXT__GEOVIEW__OL_VIEWER__FORMATS="wms wfs geojson gml kml" -CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857 -CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8 - -#TODO: ckanext-sparql - Not implemented yet -CKANEXT__SPARQL__ENDPOINT_URL=http://dbpedia.org/sparql -CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False - -# ckanext-iepnb -CKANEXT__IEPNB_SERVER=https://des.iepnb.es -CKANEXT__IEPNB_PATH_MENU=/api/menu_items/main -CKANEXT__IEPNB_BREADCRUMBS='[{"title":"Nuestros datos","description":"Nuestros datos","uri":"node/27","alias":"nuestros-datos","external":false,"relative":"/nuestros-datos"},{"title":"Catálogo de datos","description":"Catálogo de datos","uri":"node/47","alias":"catalogo-de-datos","external":false,"relative":"/nuestros-datos/catalogo-de-datos"}]' -CKANEXT__IEPNB_POPULAR_TAGS=3 -CKANEXT__IEPNB_FACET_LIST="theme theme_es dcat_type owner_org res_format publisher_name publisher_type frequency tags tag_uri conforms_to" \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..956fd7b7 --- /dev/null +++ b/.env.example @@ -0,0 +1,294 @@ +# Base +APP_DIR=/srv/app + +# Container names +REDIS_CONTAINER_NAME=redis +POSTGRESQL_CONTAINER_NAME=db +SOLR_CONTAINER_NAME=solr +CKAN_CONTAINER_NAME=ckan +WORKER_CONTAINER_NAME=ckan-worker +APACHE_CONTAINER_NAME=apache +PYCSW_CONTAINER_NAME=pycsw + +# Host Ports +CKAN_PORT_HOST=5000 +APACHE_PORT_HOST=80 +PYCSW_PORT_HOST=8000 + +# Solr +SOLR_IMAGE_VERSION=2.9-solr8-spatial +SOLR_PORT=8983 +CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan +TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan + +# Redis +REDIS_VERSION=7-alpine +CKAN_REDIS_URL=redis://redis:6379/1 +TEST_CKAN_REDIS_URL=redis://redis:6379/1 + +# Apache HTTP Server +APACHE_VERSION=2.4-alpine +APACHE_PORT=80 +APACHE_LOG_DIR=/var/log/apache +APACHE_SERVER_NAME=des.iepnb.es +# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. +APACHE_CKAN_LOCATION=/catalogo +APACHE_PYCSW_LOCATION=/csw + +# pycsw +PYCSW_PORT=8000 +CKAN_URL=https://des.iepnb.es/catalogo +PYCSW_URL=https://des.iepnb.es/csw +# SCHEMAS: ckan2pycsw/model/dataset.py - Dataset type +PYCSW_CKAN_SCHEMA=iso19139_geodcatap +PYCSW_OUPUT_SCHEMA=iso19139_inspire + +# CKAN databases +POSTGRES_USER=ckan +POSTGRES_PASSWORD=ckan +DATASTORE_READONLY_USER=datastore_ro +DATASTORE_READONLY_PASSWORD=datastore +POSTGRES_HOST=db +CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan +CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore +CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore + +# Test database connections +TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test +TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test +TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test + +# CKAN core +CKAN_VERSION=2.9.8 +CKAN_SITE_ID=default +# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 +CKAN_SITE_URL=https://des.iepnb.es +CKAN__ROOT_PATH=/catalogo/{{LANG}} +CKAN_PORT=5000 +CKAN___BEAKER__SESSION__SECRET=CHANGE_ME +# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings +CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME +CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME +CKAN_SYSADMIN_NAME=ckan_admin +CKAN_SYSADMIN_PASSWORD=test1234 +CKAN_SYSADMIN_EMAIL=your_email@example.com +CKAN_STORAGE_PATH=/var/lib/ckan +CKAN_SMTP_SERVER=smtp.corporateict.domain:25 +CKAN_SMTP_STARTTLS=True +CKAN_SMTP_USER=user +CKAN_SMTP_PASSWORD=pass +CKAN_SMTP_MAIL_FROM=ckan@localhost +TZ=UTC +## Customize which text formats the text_view plugin will show +CKAN__PREVIEW__JSON_FORMATS="json jsonld" +# html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json +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" + +## Resource Proxy settings +### Preview size limit, default: 1MB +CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 +## Size of chunks to read/write__ +CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 +## Default timeout for fetching proxied items +CKAN__RESOURCE_PROXY__TIMEOUT=10 +CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view" + +# Localization +CKAN__LOCALE_DEFAULT="es" +CKAN__LOCALE_ORDER="es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv" + +# Extensions +CKAN__PLUGINS="envvars stats text_view image_view webpage_view recline_view resourcedictionary datastore xloader harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages iepnb" + +# ckanext-harvest +CKAN__HARVEST__MQ__TYPE=redis +CKAN__HARVEST__MQ__HOSTNAME=redis +CKAN__HARVEST__MQ__PORT=6379 +CKAN__HARVEST__MQ__REDIS_DB=1 + +# ckanext-xloader +CKANEXT__XLOADER__API_TOKEN=api_token +CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan + +# ckanext-dcat +CKANEXT__DCAT__BASE_URI=https://des.iepnb.es/catalogo +CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap" + +# ckanext-scheming: setup_scheming.sh +SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA="ckanext.scheming:ckan_geodcatap.yaml" +SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS="ckanext.scheming:ckan_group_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS="ckanext.scheming:ckan_org_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_PRESETS="ckanext.scheming:presets.json" + +# 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. IDEE, bajo CC BY 3.0.' + +# ckanext-geoview +CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 +CKANEXT__GEOVIEW__OL_VIEWER__FORMATS="wms wfs geojson gml kml" +CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857 +CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8 + +#TODO: ckanext-sparql - Not implemented yet +CKANEXT__SPARQL__ENDPOINT_URL=http://dbpedia.org/sparql +CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False + +# ckanext-iepnb +CKANEXT__IEPNB_SERVER=https://des.iepnb.es +CKANEXT__IEPNB_PATH_MENU=/api/menu_items/main +CKANEXT__IEPNB_BREADCRUMBS='[{"title":"Nuestros datos","description":"Nuestros datos","uri":"node/27","alias":"nuestros-datos","external":false,"relative":"/nuestros-datos"},{"title":"Catálogo de datos","description":"Catálogo de datos","uri":"node/47","alias":"catalogo-de-datos","external":false,"relative":"/nuestros-datos/catalogo-de-datos"}]' +CKANEXT__IEPNB_POPULAR_TAGS=3 +CKANEXT__IEPNB_FACET_LIST="theme theme_es dcat_type owner_org res_format publisher_name publisher_type frequency tags tag_uri conforms_to" +# Base +APP_DIR=/srv/app + +# Container names +REDIS_CONTAINER_NAME=redis +POSTGRESQL_CONTAINER_NAME=db +SOLR_CONTAINER_NAME=solr +CKAN_CONTAINER_NAME=ckan +WORKER_CONTAINER_NAME=ckan-worker +APACHE_CONTAINER_NAME=apache +PYCSW_CONTAINER_NAME=pycsw + +# Host Ports +CKAN_PORT_HOST=5000 +APACHE_PORT_HOST=80 +PYCSW_PORT_HOST=8000 + +# Solr +SOLR_IMAGE_VERSION=2.9-solr8-spatial +SOLR_PORT=8983 +CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan +TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan + +# Redis +REDIS_VERSION=7-alpine +CKAN_REDIS_URL=redis://redis:6379/1 +TEST_CKAN_REDIS_URL=redis://redis:6379/1 + +# Apache HTTP Server +APACHE_VERSION=2.4-alpine +APACHE_PORT=80 +APACHE_LOG_DIR=/var/log/apache +APACHE_SERVER_NAME=des.iepnb.es +# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. +APACHE_CKAN_LOCATION=/catalogo +APACHE_PYCSW_LOCATION=/csw + +# pycsw +PYCSW_PORT=8000 +CKAN_URL=https://des.iepnb.es/catalogo +PYCSW_URL=https://des.iepnb.es/csw +# SCHEMAS: ckan2pycsw/model/dataset.py - Dataset type +PYCSW_CKAN_SCHEMA=iso19139_geodcatap +PYCSW_OUPUT_SCHEMA=iso19139_inspire + +# CKAN databases +POSTGRES_USER=ckan +POSTGRES_PASSWORD=ckan +DATASTORE_READONLY_USER=datastore_ro +DATASTORE_READONLY_PASSWORD=datastore +POSTGRES_HOST=db +CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan +CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore +CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore + +# Test database connections +TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test +TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test +TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test + +# CKAN core +CKAN_VERSION=2.9.8 +CKAN_SITE_ID=default +# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 +CKAN_SITE_URL=https://des.iepnb.es +CKAN__ROOT_PATH=/catalogo/{{LANG}} +CKAN_PORT=5000 +CKAN___BEAKER__SESSION__SECRET=CHANGE_ME +# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings +CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME +CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME +CKAN_SYSADMIN_NAME=ckan_admin +CKAN_SYSADMIN_PASSWORD=test1234 +CKAN_SYSADMIN_EMAIL=your_email@example.com +CKAN_STORAGE_PATH=/var/lib/ckan +CKAN_SMTP_SERVER=smtp.corporateict.domain:25 +CKAN_SMTP_STARTTLS=True +CKAN_SMTP_USER=user +CKAN_SMTP_PASSWORD=pass +CKAN_SMTP_MAIL_FROM=ckan@localhost +TZ=UTC +## Customize which text formats the text_view plugin will show +CKAN__PREVIEW__JSON_FORMATS="json jsonld" +# html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json +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" + +## Resource Proxy settings +### Preview size limit, default: 1MB +CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 +## Size of chunks to read/write__ +CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 +## Default timeout for fetching proxied items +CKAN__RESOURCE_PROXY__TIMEOUT=10 +CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view" + +# Localization +CKAN__LOCALE_DEFAULT="es" +CKAN__LOCALE_ORDER="es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv" + +# Extensions +CKAN__PLUGINS="envvars stats text_view image_view webpage_view recline_view resourcedictionary datastore xloader harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages iepnb" + +# ckanext-harvest +CKAN__HARVEST__MQ__TYPE=redis +CKAN__HARVEST__MQ__HOSTNAME=redis +CKAN__HARVEST__MQ__PORT=6379 +CKAN__HARVEST__MQ__REDIS_DB=1 + +# ckanext-xloader +CKANEXT__XLOADER__API_TOKEN=api_token +CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan + +# ckanext-dcat +CKANEXT__DCAT__BASE_URI=https://des.iepnb.es/catalogo +CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap" + +# ckanext-scheming: setup_scheming.sh +SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA="ckanext.scheming:ckan_geodcatap.yaml" +SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS="ckanext.scheming:ckan_group_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS="ckanext.scheming:ckan_org_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_PRESETS="ckanext.scheming:presets.json" + +# 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. IDEE, bajo CC BY 3.0.' + +# ckanext-geoview +CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 +CKANEXT__GEOVIEW__OL_VIEWER__FORMATS="wms wfs geojson gml kml" +CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857 +CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8 + +#TODO: ckanext-sparql - Not implemented yet +CKANEXT__SPARQL__ENDPOINT_URL=http://dbpedia.org/sparql +CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False + +# ckanext-iepnb +CKANEXT__IEPNB_SERVER=https://des.iepnb.es +CKANEXT__IEPNB_PATH_MENU=/api/menu_items/main +CKANEXT__IEPNB_BREADCRUMBS='[{"title":"Nuestros datos","description":"Nuestros datos","uri":"node/27","alias":"nuestros-datos","external":false,"relative":"/nuestros-datos"},{"title":"Catálogo de datos","description":"Catálogo de datos","uri":"node/47","alias":"catalogo-de-datos","external":false,"relative":"/nuestros-datos/catalogo-de-datos"}]' +CKANEXT__IEPNB_POPULAR_TAGS=3 +CKANEXT__IEPNB_FACET_LIST="theme theme_es dcat_type owner_org res_format publisher_name publisher_type frequency tags tag_uri conforms_to" \ No newline at end of file diff --git a/.github/workflows/docker-master.yml b/.github/workflows/docker-master.yml index a485753d..7c5db7dd 100644 --- a/.github/workflows/docker-master.yml +++ b/.github/workflows/docker-master.yml @@ -1,4 +1,4 @@ -name: Build & Push ckan-iepnb Docker master image +name: Build & Push ckan-spatial - master on: # Trigger the workflow after build.yml diff --git a/.github/workflows/docker-tags.yml b/.github/workflows/docker-tags.yml index 90103f5c..5d5e4468 100644 --- a/.github/workflows/docker-tags.yml +++ b/.github/workflows/docker-tags.yml @@ -1,4 +1,4 @@ -name: Build & Push ckan-iepnb Docker ckan-*.*.* image +name: Build & Push ckan-spatial - ckan-*.*.* on: push: diff --git a/.gitignore b/.gitignore index 2d7ba928..80fd0ee8 100755 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ local/* .vscode __pycache__ log -metadata \ No newline at end of file +metadata + +# environment +.env \ No newline at end of file diff --git a/README.md b/README.md index e1537dab..11a8816c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ Available components: | CKAN Version | Type | Docker tag | Notes | | --- | --- | --- | --- | -| master | custom image | `ghcr.io/OpenDataGIS/ckan-iepnb:master` | Latest version. | +| 2.9.8 | custom image | `ghcr.io/opendatagis/ckan-iepnb:ckan-2.9.8` | Stable version with CKAN 2.9.8 | +| 2.9.8 | custom image | `ghcr.io/opendatagis/ckan-iepnb:master` | Latest version. | The non-CKAN images are as follows: * PostgreSQL: [Custom image](/postgresql/Dockerfile) based on official PostgreSQL image. Database files are stored in a named volume. @@ -60,7 +61,7 @@ Optional HTTP Endpoint ([`docker-compose.nginx.yml`](/docker-compose.nginx.yml)) | [`docker-compose.nginx.yml`](/docker-compose.nginx.yml) | NGINX 1.22.1 | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 9.74 MB | No routing, only CKAN. Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) | -The site is configured using environment variables that you can set in the `.env` file for an Apache HTTP Server and ckan-pycsw deployment, or replace it with the [`.env.nginx.example`](/samples/.env.nginx.example) for a NGINX and CKAN-only deployment using the Docker Compose file: [`docker-compose.nginx.yml`](/docker-compose.nginx.yml). +The site is configured using environment variables that you can set in the `.env` file for an Apache HTTP Server and ckan-pycsw deployment (default `.env.example`), or replace it with the [`.env.nginx.example`](/samples/.env.nginx.example) for a NGINX and CKAN-only deployment using the Docker Compose file: [`docker-compose.nginx.yml`](/docker-compose.nginx.yml). ### ckan-docker roadmap @@ -174,45 +175,47 @@ docker compose [-p ] down ### Base mode Use this if you are a maintainer and will not be making code changes to CKAN or to CKAN extensions. -Clone project - ```shell - cd /path/to/my/project - git clone https://github.dev/OpenDataGIS/ckan-docker-iepnb.git - ``` +1. Clone project + ```shell + cd /path/to/my/project + git clone https://github.com/OpenDataGIS/ckan-docker-iepnb.git + ``` -Modify [`.env`](/.env) depending on your own needs. +2. Copy the `.env.example` template (or use another from [`/samples/`](/samples/)) and modify the resulting `.env` to suit your needs. + ```shell + cp .env.example .env + ``` -- **Apache HTTP Server & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `APACHE_SERVER_NAME`, `APACHE_CKAN_LOCATION`, `APACHE_PYCSW_LOCATION`, etc.). + - **Apache HTTP Server & CKAN/ckan-pycsw endpoints**: Modifiy the variables about the site URL or locations (`CKAN_SITE_URL` `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `APACHE_SERVER_NAME`, `APACHE_CKAN_LOCATION`, `APACHE_PYCSW_LOCATION`, etc.). -- **NGINX only CKAN**: Replace the [`.env`](/.env) with the [`.env.nginx.example`](/samples/.env.nginx.example) and modify the variables as needed. + - **NGINX only CKAN**: Replace the [`.env`](/.env) with the [`/samples/.env.nginx.example`](/samples/.env.nginx.example) and modify the variables as needed. ->**Note**:
-> Please note that when accessing CKAN directly (via a browser) ie: not going through Apache/NGINX you will need to make sure you have "ckan" set up to be an alias to localhost in the local hosts file. Either that or you will need to change the `.env` entry for `CKAN_SITE_URL` + >**Note**:
+ > Please note that when accessing CKAN directly (via a browser) ie: not going through Apache/NGINX you will need to make sure you have "ckan" set up to be an alias to localhost in the local hosts file. Either that or you will need to change the `.env` entry for `CKAN_SITE_URL` ->**Warning**:
-> Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD`(`ckan_admin` and `test1234` by default). **This should be obviously changed before running this setup as a public CKAN instance.** + >**Warning**:
+ > Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD`(`ckan_admin` and `test1234` by default). **This should be obviously changed before running this setup as a public CKAN instance.** -To build the images: - ```bash - docker compose build - ``` - >**Note**
- > NGINX CKAN without ckan-pycsw and Apache: - >```bash - >docker compose -f docker-compose.nginx.yml build - >``` +3. Build the images: + ```bash + docker compose build + ``` + >**Note**
+ > NGINX CKAN without ckan-pycsw and Apache: + >```bash + >docker compose -f docker-compose.nginx.yml build + >``` +4. Start the containers: + ```bash + docker compose up + ``` -To start the containers: - ```bash - docker compose up - ``` - - >**Note**
- > NGINX CKAN without ckan-pycsw and Apache: - >```bash - >docker compose -f docker-compose.nginx.yml up - >``` + >**Note**
+ > NGINX CKAN without ckan-pycsw and Apache: + >```bash + >docker compose -f docker-compose.nginx.yml up + >``` This will start up the containers in the current window. By default the containers will log direct to this window with each container using a different colour. You could also use the -d "detach mode" option ie: `docker compose up -d` if you wished to use the current @@ -249,6 +252,8 @@ To have Docker Compose run automatically when you reboot a machine, you can foll After=docker.service [Service] + User=docker + Group=docker Type=oneshot RemainAfterExit=yes WorkingDirectory=/path/to/project/ckan-docker/ @@ -260,7 +265,7 @@ To have Docker Compose run automatically when you reboot a machine, you can foll WantedBy=multi-user.target ``` -2. Replace `/path/to/project/ckan-docker/` with the path where your project's `docker-compose.yml` file is located and and check the path to the docker compose binary on execution and stop: `/bin/docker`. +2. Replace `/path/to/project/ckan-docker/` with the path where your project's `docker-compose.yml` file is located and and check the path to the docker compose binary on execution and stop: `/bin/docker`. Also change the `User` / `Group` to execute the service. 3. Load the systemd service file with the following command: ```bash diff --git a/samples/.env.example b/samples/.env.example index 9d1d12d6..956fd7b7 100644 --- a/samples/.env.example +++ b/samples/.env.example @@ -60,10 +60,158 @@ TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_te # CKAN core CKAN_VERSION=2.9.8 +CKAN_SITE_ID=default +# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 +CKAN_SITE_URL=https://des.iepnb.es +CKAN__ROOT_PATH=/catalogo/{{LANG}} CKAN_PORT=5000 +CKAN___BEAKER__SESSION__SECRET=CHANGE_ME +# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings +CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME +CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME +CKAN_SYSADMIN_NAME=ckan_admin +CKAN_SYSADMIN_PASSWORD=test1234 +CKAN_SYSADMIN_EMAIL=your_email@example.com +CKAN_STORAGE_PATH=/var/lib/ckan +CKAN_SMTP_SERVER=smtp.corporateict.domain:25 +CKAN_SMTP_STARTTLS=True +CKAN_SMTP_USER=user +CKAN_SMTP_PASSWORD=pass +CKAN_SMTP_MAIL_FROM=ckan@localhost +TZ=UTC +## Customize which text formats the text_view plugin will show +CKAN__PREVIEW__JSON_FORMATS="json jsonld" +# html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json +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" + +## Resource Proxy settings +### Preview size limit, default: 1MB +CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 +## Size of chunks to read/write__ +CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 +## Default timeout for fetching proxied items +CKAN__RESOURCE_PROXY__TIMEOUT=10 +CKAN__VIEWS__DEFAULT_VIEWS="image_view webpage_view text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view" + +# Localization +CKAN__LOCALE_DEFAULT="es" +CKAN__LOCALE_ORDER="es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv" + +# Extensions +CKAN__PLUGINS="envvars stats text_view image_view webpage_view recline_view resourcedictionary datastore xloader harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages iepnb" + +# ckanext-harvest +CKAN__HARVEST__MQ__TYPE=redis +CKAN__HARVEST__MQ__HOSTNAME=redis +CKAN__HARVEST__MQ__PORT=6379 +CKAN__HARVEST__MQ__REDIS_DB=1 + +# ckanext-xloader +CKANEXT__XLOADER__API_TOKEN=api_token +CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckan:ckan@db/ckan + +# ckanext-dcat +CKANEXT__DCAT__BASE_URI=https://des.iepnb.es/catalogo +CKANEXT__DCAT__RDF_PROFILES="euro_dcat_ap_2 euro_dcat_ap" + +# ckanext-scheming: setup_scheming.sh +SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA="ckanext.scheming:ckan_geodcatap.yaml" +SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS="ckanext.scheming:ckan_group_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS="ckanext.scheming:ckan_org_geodcatap.json" +SCHEMA_CKANEXT_SCHEMING_PRESETS="ckanext.scheming:presets.json" + +# 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. IDEE, bajo CC BY 3.0.' + +# ckanext-geoview +CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE=100000000 +CKANEXT__GEOVIEW__OL_VIEWER__FORMATS="wms wfs geojson gml kml" +CKANEXT__GEOVIEW__SHP_VIEWER__SRID=3857 +CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8 + +#TODO: ckanext-sparql - Not implemented yet +CKANEXT__SPARQL__ENDPOINT_URL=http://dbpedia.org/sparql +CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False + +# ckanext-iepnb +CKANEXT__IEPNB_SERVER=https://des.iepnb.es +CKANEXT__IEPNB_PATH_MENU=/api/menu_items/main +CKANEXT__IEPNB_BREADCRUMBS='[{"title":"Nuestros datos","description":"Nuestros datos","uri":"node/27","alias":"nuestros-datos","external":false,"relative":"/nuestros-datos"},{"title":"Catálogo de datos","description":"Catálogo de datos","uri":"node/47","alias":"catalogo-de-datos","external":false,"relative":"/nuestros-datos/catalogo-de-datos"}]' +CKANEXT__IEPNB_POPULAR_TAGS=3 +CKANEXT__IEPNB_FACET_LIST="theme theme_es dcat_type owner_org res_format publisher_name publisher_type frequency tags tag_uri conforms_to" +# Base +APP_DIR=/srv/app + +# Container names +REDIS_CONTAINER_NAME=redis +POSTGRESQL_CONTAINER_NAME=db +SOLR_CONTAINER_NAME=solr +CKAN_CONTAINER_NAME=ckan +WORKER_CONTAINER_NAME=ckan-worker +APACHE_CONTAINER_NAME=apache +PYCSW_CONTAINER_NAME=pycsw + +# Host Ports +CKAN_PORT_HOST=5000 +APACHE_PORT_HOST=80 +PYCSW_PORT_HOST=8000 + +# Solr +SOLR_IMAGE_VERSION=2.9-solr8-spatial +SOLR_PORT=8983 +CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan +TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan + +# Redis +REDIS_VERSION=7-alpine +CKAN_REDIS_URL=redis://redis:6379/1 +TEST_CKAN_REDIS_URL=redis://redis:6379/1 + +# Apache HTTP Server +APACHE_VERSION=2.4-alpine +APACHE_PORT=80 +APACHE_LOG_DIR=/var/log/apache +APACHE_SERVER_NAME=des.iepnb.es +# Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. +APACHE_CKAN_LOCATION=/catalogo +APACHE_PYCSW_LOCATION=/csw + +# pycsw +PYCSW_PORT=8000 +CKAN_URL=https://des.iepnb.es/catalogo +PYCSW_URL=https://des.iepnb.es/csw +# SCHEMAS: ckan2pycsw/model/dataset.py - Dataset type +PYCSW_CKAN_SCHEMA=iso19139_geodcatap +PYCSW_OUPUT_SCHEMA=iso19139_inspire + +# CKAN databases +POSTGRES_USER=ckan +POSTGRES_PASSWORD=ckan +DATASTORE_READONLY_USER=datastore_ro +DATASTORE_READONLY_PASSWORD=datastore +POSTGRES_HOST=db +CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan +CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore +CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore + +# Test database connections +TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test +TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test +TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test + +# CKAN core +CKAN_VERSION=2.9.8 CKAN_SITE_ID=default +# CKAN_SITE_URL = http:/ or https:/ + APACHE_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 CKAN_SITE_URL=https://des.iepnb.es CKAN__ROOT_PATH=/catalogo/{{LANG}} +CKAN_PORT=5000 CKAN___BEAKER__SESSION__SECRET=CHANGE_ME # See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME