diff --git a/.env b/.env index 377177a..a9734f2 100644 --- a/.env +++ b/.env @@ -3,7 +3,6 @@ NGINX_CONTAINER_NAME=nginx REDIS_CONTAINER_NAME=redis POSTGRESQL_CONTAINER_NAME=db SOLR_CONTAINER_NAME=solr -DATAPUSHER_CONTAINER_NAME=datapusher CKAN_CONTAINER_NAME=ckan WORKER_CONTAINER_NAME=ckan-worker @@ -28,7 +27,7 @@ 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.10.0 +CKAN_VERSION=2.9.8 CKAN_SITE_ID=default CKAN_SITE_URL=https://localhost:8443 CKAN_PORT=5000 @@ -47,9 +46,22 @@ 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="html htm 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" +## 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 text_view recline_view wmts_view geojson_view geo_view shp_view pdf_view" # Solr -SOLR_IMAGE_VERSION=2.9-solr8 +SOLR_IMAGE_VERSION=2.9-solr8-spatial CKAN_SOLR_URL=http://solr:8983/solr/ckan TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan @@ -58,20 +70,45 @@ REDIS_VERSION=6 CKAN_REDIS_URL=redis://redis:6379/1 TEST_CKAN_REDIS_URL=redis://redis:6379/1 -# Datapusher -DATAPUSHER_VERSION=0.0.19 -CKAN_DATAPUSHER_URL=http://datapusher:8800 -CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000 -DATAPUSHER_REWRITE_RESOURCES=True -DATAPUSHER_REWRITE_URL=http://ckan:5000 - # NGINX NGINX_PORT=80 NGINX_SSLPORT=443 # Extensions -CKAN__PLUGINS="envvars image_view text_view recline_view datastore datapusher" +CKAN__PLUGINS="envvars stats text_view image_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" + 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://localhost:5000 +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 \ No newline at end of file diff --git a/.env.example b/.env.example deleted file mode 100644 index f31d1ee..0000000 --- a/.env.example +++ /dev/null @@ -1,77 +0,0 @@ -# Container names -NGINX_CONTAINER_NAME=nginx -REDIS_CONTAINER_NAME=redis -POSTGRESQL_CONTAINER_NAME=db -SOLR_CONTAINER_NAME=solr -DATAPUSHER_CONTAINER_NAME=datapusher -CKAN_CONTAINER_NAME=ckan -WORKER_CONTAINER_NAME=ckan-worker - -# Host Ports -CKAN_PORT_HOST=5000 -NGINX_PORT_HOST=81 -NGINX_SSLPORT_HOST=8443 - -# 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.10.0 -CKAN_SITE_ID=default -CKAN_SITE_URL=http://ckan:5000 -CKAN_PORT=5000 -CKAN_PORT_HOST=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 - -# Solr -SOLR_IMAGE_VERSION=2.9-solr8 -CKAN_SOLR_URL=http://solr:8983/solr/ckan -TEST_CKAN_SOLR_URL=http://solr:8983/solr/ckan - -# Redis -REDIS_VERSION=6 -CKAN_REDIS_URL=redis://redis:6379/1 -TEST_CKAN_REDIS_URL=redis://redis:6379/1 - -# Datapusher -DATAPUSHER_VERSION=0.0.19 -CKAN_DATAPUSHER_URL=http://datapusher:8800 -CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000 -DATAPUSHER_REWRITE_RESOURCES=True -DATAPUSHER_REWRITE_URL=http://ckan:5000 - -# NGINX -NGINX_PORT=80 -NGINX_SSLPORT=443 - -# Extensions -CKAN__PLUGINS="envvars image_view text_view recline_view datastore datapusher" -CKAN__HARVEST__MQ__TYPE=redis -CKAN__HARVEST__MQ__HOSTNAME=redis -CKAN__HARVEST__MQ__PORT=6379 -CKAN__HARVEST__MQ__REDIS_DB=1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23dec98..6edb7d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build CKAN Docker +name: Build CKAN Docker auxiliary images on: # Trigger the workflow on push or pull request, @@ -36,13 +36,4 @@ jobs: context: ./postgresql file: ./postgresql/Dockerfile push: false - tags: kowhai/ckan-docker-postgresql:test-build-only - - - name: CKAN build - uses: docker/build-push-action@v2 - with: - context: ./ckan - file: ./ckan/Dockerfile - push: false - tags: kowhai/ckan-docker-ckan:test-build-only - \ No newline at end of file + tags: kowhai/ckan-docker-postgresql:test-build-only \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..6c6c3a6 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,50 @@ +name: Build & Push CKAN-Spatial Docker image + +on: + # Trigger the workflow after build.yml, + # but only for the master branch + workflow_run: + workflows: ["Build CKAN Docker auxiliary images"] + branches: [master] + types: + - completed + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mjanez/ckan-spatial + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Login to registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: CKAN Build and push + uses: docker/build-push-action@v3 + with: + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + context: ./ckan + file: ./ckan/Dockerfile diff --git a/.gitignore b/.gitignore index 06c7c30..1722a68 100755 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ _service-provider/* _solr/schema.xml _src/* local/* +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 450aada..02ce475 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,171 @@ -# Docker Compose setup for CKAN +
+ -* [Overview](#overview) -* [Installing Docker](#installing-docker) -* [docker compose vs docker-compose](#docker-compose-vs-docker-compose) -* [Install CKAN plus dependencies](#install-ckan-plus-dependencies) -* [Development mode](#development-mode) - * [Create an extension](#create-an-extension) -* [CKAN images](#ckan-images) - * [Extending the base images](#extending-the-base-images) - * [Applying patches](#applying-patches) -* [Debugging with pdb](#pdb) -* [Datastore and Datapusher](#Datastore-and-datapusher) -* [NGINX](#nginx) -* [The ckanext-envvars extension](#envvars) +
+ Overview • + Branch roadmap • + Environment: docker • + Install CKAN • + CKAN images • + Extending guide • + Applying patches • + Addons +
+**Requirements**: +* [Docker](https://docs.docker.com/get-docker/) -## 1. Overview +## Overview +Contains Docker images for the different components of CKAN Cloud and a Docker compose environment (based on [ckan](https://github.com/ckan/ckan)) for development and testing Open Data portals. -This is a set of configuration and setup files to run a CKAN site. +>**Warning**: