Merge pull request #6 from mjanez/feature/postgres-15
Feature/postgres 15
This commit is contained in:
commit
d7eb8faea9
59
.env
59
.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. <a href="https://www.idee.es/">IDEE</a>, bajo <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.'
|
||||
|
||||
# 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
|
77
.env.example
77
.env.example
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
name: Build CKAN Docker
|
||||
name: Build CKAN Docker auxiliary images
|
||||
|
||||
on:
|
||||
# Trigger the workflow on push or pull request,
|
||||
|
@ -37,12 +37,3 @@ jobs:
|
|||
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
|
||||
|
|
@ -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
|
|
@ -7,3 +7,4 @@ _service-provider/*
|
|||
_solr/schema.xml
|
||||
_src/*
|
||||
local/*
|
||||
.vscode
|
267
README.md
267
README.md
|
@ -1,62 +1,171 @@
|
|||
# Docker Compose setup for CKAN
|
||||
<h1 align="center">CKAN Docker Compose - Open Data & GIS</h1>
|
||||
<p align="center">
|
||||
<a href="https://github.com/OpenDataGIS/ckan"><img src="https://img.shields.io/badge/Docker%20CKAN-2.9.8-brightgreen" alt="CKAN Versions"></a>
|
||||
|
||||
|
||||
* [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)
|
||||
<p align="center">
|
||||
<a href="#overview">Overview</a> •
|
||||
<a href="#ckan-docker-roadmap">Branch roadmap</a> •
|
||||
<a href="#environment-docker">Environment: docker</a> •
|
||||
<a href="#install-build-and-run-ckan-plus-dependencies">Install CKAN</a> •
|
||||
<a href="#ckan-images">CKAN images</a> •
|
||||
<a href="#extending-the-base-images">Extending guide</a> •
|
||||
<a href="#applying-patches">Applying patches</a> •
|
||||
<a href="#ckan-docker-addons">Addons</a>
|
||||
</p>
|
||||
|
||||
**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**:<br>
|
||||
>This is a **custom installation of Docker Compose** with specific extensions for spatial data and [GeoDCAT-AP](https://github.com/SEMICeu/GeoDCAT-AP)/[INSPIRE](https://github.com/INSPIRE-MIF/technical-guidelines) metadata [profiles](https://en.wikipedia.org/wiki/Geospatial_metadata). For official installations, please have a look: [CKAN documentation: Installation](https://docs.ckan.org/en/latest/maintaining/installing/index.html).
|
||||
|
||||
The CKAN images used are from the official CKAN [ckan-docker](https://github.com/ckan/ckan-docker-base) repo
|
||||
Available components:
|
||||
* CKAN custom image based on the official CKAN repo [ckan-docker-spatial](https://github.com/mjanez/ckan-docker-spatial)[^1]
|
||||
|
||||
The non-CKAN images are as follows:
|
||||
|
||||
* DataPusher: CKAN's [pre-configured DataPusher image](https://github.com/ckan/ckan-base/tree/main/datapusher).
|
||||
* PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume.
|
||||
* Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). Index data is stored in a named volume.
|
||||
* Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). The index data is stored in a named volume and has a spatial schema. [^2]
|
||||
* Redis: standard Redis image
|
||||
* NGINX: latest stable nginx image that includes SSL and Non-SSL endpoints
|
||||
|
||||
| Repository | Type | Docker tag | Size | Notes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| PostgreSQL 15.2 | base image | [`postgres/postgres:15-alpine`](https://hub.docker.com/layers/library/postgres/15-alpine/images/sha256-53a02ecbe9d18ff6476e6651c34811da39f054424c725fc15d2b480fc3fab877?context=explore) | 89.74 MB | Custom Dockerfile: [`postgresql/Dockerfile`](/postgresql/Dockerfile) |
|
||||
| Solr 8.11.1 | base image | [`ckan/ckan-solr:2.9-solr8-spatial`](https://registry.hub.docker.com/layers/ckan/ckan-solr/2.9-solr8-spatial/images/sha256-b5ee4979891c7dd1f10d2ac2cbdd4d80ff656879edb0f0493616be7b4cf8bc3a?context=explore) | 331.1 MB | - |
|
||||
| Redis 6.2.11 | base image | [`redis/redis:6`](https://hub.docker.com/layers/library/redis/6/images/sha256-e10c69dc5f9b27c47874060962fdaa26ec0df592205d6d21402945267081b434?context=explore) | 39.32 MB | - |
|
||||
| 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 | Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) |
|
||||
|
||||
|
||||
The site is configured using environment variables that you can set in the `.env` file.
|
||||
|
||||
## 2. Installing Docker
|
||||
|
||||
Install Docker by following the following instructions: [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
|
||||
### ckan-docker roadmap
|
||||
Information about extensions installed in the `main` image. More info described in the [Extending the base images](#extending-the-base-images)
|
||||
|
||||
>**Note**<br>
|
||||
> Switch branches to see the `roadmap` for other projects: [ckan-docker/branches](https://github.com/mjanez/ckan-docker/branches)
|
||||
|
||||
|
||||
| **Element** | **Description** | **version** | **Status** | **DEV**[^3] | **PRO**[^4] | **Remarks** |
|
||||
|-------------|-----------------------------------------------------------------------------------------|-------------|------------------------------|---------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Core | [CKAN](https://github.com/mjanez/ckan-docker) | 2.9.8 | Completed | ✔️ | ✔️ | Stable installation for version 2.9.8 (Production & Dev images) via Docker Compose based on [official images](https://github.com/ckan/ckan-docker-base)). Initial configuration, basic customisation and operation guide. |
|
||||
| Core + | [Datastore](https://github.com/mjanez/ckan-docker) | 2.9.8 | Completed | ✔️ | ✔️ | Stable installation (Production & Dev images) via Docker Compose. |
|
||||
| Core + | [~~Datapusher~~](https://github.com/mjanez/ckan-docker) | 0.0.19 | Deprecated | ❌ | ❌ | Updated to [xloader](https://github.com/ckan/ckanext-xloader), an express Loader - quickly load data into DataStore. |
|
||||
| Extension | [ckanext-xloader](https://github.com/ckan/ckanext-xloader) | 0.12.2 | Completed | ✔️ | ✔️ | Stable installation, a replacement for DataPusher because it offers ten times the speed and more robustness |
|
||||
| Extension | [ckanext-harvest](https://github.com/ckan/ckanext-harvest) | 1.5.1 | Completed | ✔️ | ✔️ | Stable installation, necessary for the implementation of the Collector ([ogc_ckan](#recollector-ckan)) |
|
||||
| Extension | [ckanext-geoview](https://github.com/ckan/ckanext-geoview) | 0.0.20 | Completed | ✔️ | ✔️ | Stable installation. |
|
||||
| Extension | [ckanext-spatial](https://github.com/ckan/ckanext-spatial) | 2.0.0 | Completed | ✔️ | ✔️ | Stable installation, necessary for the implementation of the Collector ([ogc_ckan](#recollector-ckan)) |
|
||||
| Extension | [ckanext-dcat](https://github.com/mjanez/ckanext-dcat) | 1.2.0 | Completed | ✔️ | ✔️ | Stable installation, include DCAT-AP 2.1 profile compatible with GeoDCAT-AP. |
|
||||
| Extension | [ckanext-scheming](https://github.com/mjanez/ckanext-scheming) | 3.0.0 | WIP | ✔️ | ✔️ | Stable installation. Customised ckanext schema[^5] based on the [Spanish Metadata Core](https://datos.gob.es/es/doc-tags/nti-risp) with the aim of completing the minimum metadata elements included in the current datasets in accordance with [GeoDCAT-AP](https://semiceu.github.io/GeoDCAT-AP/releases/) and [INSPIRE](https://inspire.ec.europa.eu/about-inspire). |
|
||||
| Extension | [ckanext-resourcedictionary](https://github.com/OpenDataGIS/ckanext-resourcedictionary) | main | Completed | ✔️ | ✔️ | Stable installation. This extension extends the default CKAN Data Dictionary functionality by adding possibility to create data dictionary before actual data is uploaded to datastore. |
|
||||
| Extension | [ckanext-pages](https://github.com/ckan/ckanext-pages) | 0.5.1 | Completed | ✔️ | ✔️ | Stable installation. This extension gives you an easy way to add simple pages to CKAN. |
|
||||
| Extension | [ckanext-pdfview](https://github.com/ckan/ckanext-pdfview) | 0.0.8 | Completed | ✔️ | ✔️ | Stable installation. This extension provides a view plugin for PDF files using an html object tag. |
|
||||
| Software | [docker-pycsw](https://github.com/mjanez/ckan-pycsw) | main | Ready to use standalone version | ✔️ | ❌ | Stable installation. PyCSW Endpoint of Open Data Portal with docker compose config. Harvest the CKAN catalogue in a CSW endpoint based on existing spatial datasets in the open data portal. |
|
||||
|
||||
|
||||
## Environment: docker
|
||||
### docker compose *vs* docker-compose
|
||||
All Docker Compose commands in this README will use the V2 version of Compose ie: `docker compose`. The older version (V1) used the `docker-compose` command. Please see [Docker Compose](https://docs.docker.com/compose/compose-v2/) for
|
||||
more information.
|
||||
|
||||
### Upgrade docker-engine
|
||||
To upgrade Docker Engine, first run sudo `apt-get update`, then follow the [installation instructions](https://docs.docker.com/engine/install/debian/#install-using-the-repository), choosing the new version you want to install.
|
||||
|
||||
To verify a successful Docker installation, run `docker run hello-world` and `docker version`. These commands should output
|
||||
versions for client and server.
|
||||
|
||||
## 3. docker compose *vs* docker-compose
|
||||
### Docker. Basic commands
|
||||
#### Linux post-install steps
|
||||
[These optional post-installation procedures](https://docs.docker.com/engine/install/linux-postinstall/) shows you how to configure your Linux host machine to work better with Docker. For example, managing docker with [a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
|
||||
|
||||
All Docker Compose commands in this README will use the V2 version of Compose ie: `docker compose`. The older version (V1)
|
||||
used the `docker-compose` command. Please see [Docker Compose](https://docs.docker.com/compose/compose-v2/) for
|
||||
more information.
|
||||
#### Configure Docker to start on boot
|
||||
```bash
|
||||
sudo systemctl enable docker
|
||||
|
||||
## 4. Install (build and run) CKAN plus dependencies
|
||||
# To disable this behavior, use disable instead.
|
||||
sudo systemctl disable docker
|
||||
```
|
||||
|
||||
#### Base mode
|
||||
#### Clear all Docker unused objects (images, containers, networks, local volumes)
|
||||
```bash
|
||||
docker system prune # Clear all
|
||||
|
||||
docker image prune # Clear unused images
|
||||
docker container prune # Clear unused containers
|
||||
docker volume prune # Clear unused volumes
|
||||
docker network prune # Clear unused networks
|
||||
```
|
||||
|
||||
### Docker Compose. Basic commands
|
||||
More info about Docker Compose commands at [docker compose reference](https://docs.docker.com/compose/reference/).
|
||||
|
||||
```bash
|
||||
# Basic. All containers or specific container: <container>
|
||||
## Starts existing containers for a service.
|
||||
docker compose start <container>
|
||||
|
||||
## Restarts existing containers/container for a service.
|
||||
docker compose restart <container>
|
||||
|
||||
## Stops running containers without removing them.
|
||||
docker compose stop <container>
|
||||
|
||||
## Pauses running containers of a service.
|
||||
docker compose pause <container>
|
||||
|
||||
## Unpauses paused containers of a service.
|
||||
docker compose unpause <container>
|
||||
|
||||
# Display the logs of a container. Is it possible to retrieve only the last n seconds or other
|
||||
docker logs [--since 60s] <container> -f
|
||||
|
||||
## Lists containers.
|
||||
docker compose ps
|
||||
|
||||
## Remove all docker compose project
|
||||
docker compose rm <container>
|
||||
|
||||
|
||||
# Build.
|
||||
## Builds, (re)creates, starts, and attaches to containers for a service.
|
||||
docker compose [-f <docker compose-file>] up
|
||||
|
||||
## Build & up all the containers.
|
||||
docker compose [-f <docker compose-file>] up -d --build
|
||||
|
||||
## To avoid using a cache of the previous build while creating a new image.
|
||||
docker compose [-f <docker compose-file>] build --no-cache
|
||||
|
||||
## Build a project with a specific Docker Compose prefix.
|
||||
docker compose [-f <docker compose-file>] -p <my_project> up -d --build
|
||||
|
||||
|
||||
# Down
|
||||
# Stops containers and removes containers, networks, volumes, and images created by up.
|
||||
docker compose [-p <my_project>] down
|
||||
```
|
||||
|
||||
## Install (build and run) CKAN plus dependencies
|
||||
### Base mode
|
||||
Use this if you are a maintainer and will not be making code changes to CKAN or to CKAN extensions
|
||||
|
||||
Copy the included `.env.example` and rename it to `.env`. Modify it depending on your own needs.
|
||||
|
||||
Please note that when accessing CKAN directly (via a browser) ie: not going through 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**:<br>
|
||||
> Please note that when accessing CKAN directly (via a browser) ie: not going through 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`
|
||||
|
||||
Using the default values on the `.env.example` 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**:<br>
|
||||
> Using the default values on the `.env.example` 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.
|
||||
|
||||
Clone project
|
||||
```shell
|
||||
cd /path/to/my/project
|
||||
git clone https://github.com/mjanez/ckan-docker.git
|
||||
```
|
||||
|
||||
To build the images:
|
||||
|
||||
|
@ -70,6 +179,9 @@ This will start up the containers in the current window. By default the containe
|
|||
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
|
||||
window for something else.
|
||||
|
||||
>**Note**<br>
|
||||
> Or `docker compose up --build` to build & up the containers.
|
||||
|
||||
At the end of the container start sequence there should be 6 containers running
|
||||
|
||||
![Screenshot 2022-12-12 at 10 36 21 am](https://user-images.githubusercontent.com/54408245/207012236-f9571baa-4d99-4ffe-bd93-30b11c4829e0.png)
|
||||
|
@ -77,11 +189,10 @@ At the end of the container start sequence there should be 6 containers running
|
|||
After this step, CKAN should be running at `CKAN_SITE_URL`.
|
||||
|
||||
|
||||
#### Development mode
|
||||
|
||||
### Development mode
|
||||
Use this mode if you are making code changes to CKAN and either creating new extensions or making code changes to existing extensions. This mode also uses the `.env` file for config options.
|
||||
|
||||
To develop local extensions use the `docker-compose.dev.yml` file:
|
||||
To develop local extensions use the `docker compose.dev.yml` file:
|
||||
|
||||
To build the images:
|
||||
|
||||
|
@ -94,24 +205,26 @@ To start the containers:
|
|||
See [CKAN Images](#ckan-images) for more details of what happens when using development mode.
|
||||
|
||||
|
||||
|
||||
##### Create an extension
|
||||
|
||||
#### Create an extension
|
||||
You can use the ckan [extension](https://docs.ckan.org/en/latest/extensions/tutorial.html#creating-a-new-extension) instructions to create a CKAN extension, only executing the command inside the CKAN container and setting the mounted `src/` folder as output:
|
||||
|
||||
docker compose -f docker-compose.dev.yml exec ckan-dev /bin/sh -c "ckan generate extension --output-dir /srv/app/src_extensions"
|
||||
docker compose -f docker compose.dev.yml exec ckan-dev /bin/sh -c "ckan generate extension --output-dir /srv/app/src_extensions"
|
||||
|
||||
![Screenshot 2023-02-22 at 1 45 55 pm](https://user-images.githubusercontent.com/54408245/220623568-b4e074c7-6d07-4d27-ae29-35ce70961463.png)
|
||||
|CONTAINER ID |IMAGE |COMMAND|CREATED|STATUS|PORTS|NAMES|
|
||||
|------------|----------------------------------|--------------------|-------|-------|------|-----|
|
||||
|0217537f717e|ckan-docker-nginx |/docker-entrypoint.…|6 minutes ago |Up 4 minutes|81/tcp,0.0.0.0:81->80/tcp, 0.0.0.0:8443->443/tcp|nginx |
|
||||
|7b06ab2e060a|ghcr.io/mjanez/ckan-spatial:master|/srv/app/start_ckan…|6 minutes ago |Up 5 minutes (healthy)|0.0.0.0:5000->5000/tcp|ckan | |
|
||||
|1b8d9789c29a|redis:6 |docker-entrypoint.s…|6 minutes ago |Up 5 minutes (healthy)|6379/tcp |redis | |
|
||||
|7f162741254d|ckan/ckan-solr:2.9-solr8-spatial |docker-entrypoint.s…|6 minutes ago |Up 5 minutes (healthy)|8983/tcp |solr | |
|
||||
|2cdd25cea0de|ckan-docker-db |docker-entrypoint.s…|6 minutes ago |Up 5 minutes (healthy)|5432/tcp |db | |
|
||||
|
||||
|
||||
The new extension files and directories are created in the `/srv/app/src_extensions/` folder in the running container. They will also exist in the local src/ directory as local `/src` directory is mounted as `/srv/app/src_extensions/` on the ckan container. You might need to change the owner of its folder to have the appropiate permissions.
|
||||
|
||||
|
||||
## 5. CKAN images
|
||||
## CKAN images
|
||||
![ckan images](https://user-images.githubusercontent.com/54408245/207079416-a01235af-2dea-4425-b6fd-f8c3687dd993.png)
|
||||
|
||||
|
||||
|
||||
The Docker image config files used to build your CKAN project are located in the `ckan/` folder. There are two Docker files:
|
||||
|
||||
* `Dockerfile`: this is based on `ckan/ckan-base:<version>`, a base image located in the DockerHub repository, that has CKAN installed along with all its dependencies, properly configured and running on [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) (production setup)
|
||||
|
@ -122,21 +235,20 @@ The Docker image config files used to build your CKAN project are located in the
|
|||
* Make sure to add the local plugins to the `CKAN__PLUGINS` env var in the `.env` file.
|
||||
|
||||
|
||||
## 6. Extending the base images
|
||||
|
||||
## CKAN images enhancement
|
||||
### Extending the base images
|
||||
You can modify the docker files to build your own customized image tailored to your project, installing any extensions and extra requirements needed. For example here is where you would update to use a different CKAN base image ie: `ckan/ckan-base:<new version>`
|
||||
|
||||
To perform extra initialization steps you can add scripts to your custom images and copy them to the `/docker-entrypoint.d` folder (The folder should be created for you when you build the image). Any `*.sh` and `*.py` file in that folder will be executed just after the main initialization script ([`prerun.py`](https://github.com/ckan/ckan-docker-base/blob/main/ckan-2.9/base/setup/prerun.py)) is executed and just before the web server and supervisor processes are started.
|
||||
|
||||
For instance, consider the following custom image:
|
||||
|
||||
```
|
||||
```bash
|
||||
ckan
|
||||
├── docker-entrypoint.d
|
||||
│ └── setup_validation.sh
|
||||
├── Dockerfile
|
||||
└── Dockerfile.dev
|
||||
|
||||
```
|
||||
|
||||
We want to install an extension like [ckanext-validation](https://github.com/frictionlessdata/ckanext-validation) that needs to create database tables on startup time. We create a `setup_validation.sh` script in a `docker-entrypoint.d` folder with the necessary commands:
|
||||
|
@ -151,7 +263,7 @@ ckan -c /srv/app/ckan.ini validation init-db
|
|||
And then in our `Dockerfile.dev` file we install the extension and copy the initialization scripts:
|
||||
|
||||
```Dockerfile
|
||||
FROM ckan/ckan-base:2.9.7-dev
|
||||
FROM ckan/ckan-base:2.9.8-dev
|
||||
|
||||
RUN pip install -e git+https://github.com/frictionlessdata/ckanext-validation.git#egg=ckanext-validation && \
|
||||
pip install -r https://raw.githubusercontent.com/frictionlessdata/ckanext-validation/master/requirements.txt
|
||||
|
@ -161,8 +273,8 @@ COPY docker-entrypoint.d/* /docker-entrypoint.d/
|
|||
|
||||
NB: There are a number of extension examples commented out in the Dockerfile.dev file
|
||||
|
||||
## 7. Applying patches
|
||||
|
||||
### Applying patches
|
||||
When building your project specific CKAN images (the ones defined in the `ckan/` folder), you can apply patches
|
||||
to CKAN core or any of the built extensions. To do so create a folder inside `ckan/patches` with the name of the
|
||||
package to patch (ie `ckan` or `ckanext-??`). Inside you can place patch files that will be applied when building
|
||||
|
@ -170,7 +282,7 @@ the images. The patches will be applied in alphabetical order, so you can prefix
|
|||
|
||||
For instance, check the following example image folder:
|
||||
|
||||
```
|
||||
```bash
|
||||
ckan
|
||||
├── patches
|
||||
│ ├── ckan
|
||||
|
@ -185,9 +297,37 @@ ckan
|
|||
|
||||
```
|
||||
|
||||
## 8. pdb
|
||||
>**Note**:<br>
|
||||
> Git diff is a command to output the changes between two sources inside the Git repository. The data sources can be two different branches, commits, files, etc.
|
||||
> * Show changes between working directory and staging area:
|
||||
> `git diff > [file.patch]`
|
||||
> * Shows any changes between the staging area and the repository:
|
||||
> `git diff --staged [file]`
|
||||
|
||||
Add these lines to the `ckan-dev` service in the docker-compose.dev.yml file
|
||||
|
||||
## ckan-docker addons
|
||||
### VSCode dev containers
|
||||
The [Visual Studio Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) extension is a powerful tool that enables developers to use a container as a complete development environment. With this extension, developers can open any folder inside a container and take advantage of the full range of features provided by Visual Studio Code. To do this, developers create a `devcontainer.json `file in their project that specifies how to access or create a development container with a predefined tool and runtime stack. This allows developers to work in an isolated environment, ensuring that the development environment is consistent across team members and that project dependencies are easy to manage.
|
||||
|
||||
![Developing inside a Container](https://code.visualstudio.com/assets/docs/devcontainers/containers/architecture-containers.png)
|
||||
|
||||
1. Install [VSCode](https://code.visualstudio.com/).
|
||||
|
||||
1. Install the[ Remote Development extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) for VSCode.
|
||||
|
||||
3. In your project directory, create a file named `devcontainer.json.` This file will contain the configuration for your `dev container`.
|
||||
|
||||
4. In the `devcontainer.json` file, specify the Docker image that you want to use for your `dev container`.
|
||||
|
||||
5. Specify any additional configuration settings for your `dev container`, such as environment variables, ports to expose, and startup commands.
|
||||
|
||||
6. Open your project in a `dev container` by using the Remote Development extension in VSCode. You can do this by clicking the `Open Folder in Container` button in the command palette or by opening the folder using the `Remote-Containers: Open Folder in Container` command. Also you can attach to an active container `Attach to Running Container`.
|
||||
|
||||
7. VSCode will start a new container based on the configuration settings in your `devcontainer.json` file. Once the container is started, you can work on your project just like you would on your local machine.
|
||||
|
||||
|
||||
### pdb
|
||||
Add these lines to the `ckan-dev` service in the docker compose.dev.yml file
|
||||
|
||||
![pdb](https://user-images.githubusercontent.com/54408245/179964232-9e98a451-5fe9-4842-ba9b-751bcc627730.png)
|
||||
|
||||
|
@ -195,21 +335,20 @@ Debug with pdb (example) - Interact with `docker attach $(docker container ls -q
|
|||
|
||||
command: `python -m pdb /usr/lib/ckan/venv/bin/ckan --config /srv/app/ckan.ini run --host 0.0.0.0 --passthrough-errors`
|
||||
|
||||
## 9. Datastore and datapusher
|
||||
|
||||
The Datastore database and user is created as part of the entrypoint scripts for the db container. There is also a Datapusher container
|
||||
running the latest version of Datapusher.
|
||||
### Datastore and datapusher
|
||||
The Datastore database and user is created as part of the entrypoint scripts for the db container. There is also a Datapusher container running the latest version of Datapusher.
|
||||
|
||||
## 10. NGINX
|
||||
|
||||
### NGINX
|
||||
The base Docker Compose configuration uses an NGINX image as the front-end (ie: reverse proxy). It includes HTTPS running on port number 8443 and an HTTP port (81). A "self-signed" SSL certificate is generated beforehand and the server certificate and key files are included. The NGINX `server_name` directive and the `CN` field in the SSL certificate have been both set to 'localhost'. This should obviously not be used for production.
|
||||
|
||||
Creating the SSL cert and key files as follows:
|
||||
`openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=DE/ST=Berlin/L=Berlin/O=None/CN=localhost" -keyout ckan-local.key -out ckan-local.crt`
|
||||
The `ckan-local.*` files will then need to be moved into the nginx/setup/ directory
|
||||
|
||||
## 11. envvars
|
||||
|
||||
### envvars
|
||||
The ckanext-envvars extension is used in the CKAN Docker base repo to build the base images.
|
||||
This extension checks for environmental variables conforming to an expected format and updates the corresponding CKAN config settings with its value.
|
||||
|
||||
|
@ -227,3 +366,19 @@ For example:
|
|||
These parameters can be added to the `.env` file
|
||||
|
||||
For more information please see [ckanext-envvars](https://github.com/okfn/ckanext-envvars)
|
||||
|
||||
|
||||
### ckan-pycsw
|
||||
[ckan-pycsw](https://github.com/mjanez/ckan-pycsw) is a docker compose environment (based on [pycsw](https://github.com/geopython/pycsw)) for development and testing with CKAN Open Data portals.[^5]
|
||||
|
||||
Available components:
|
||||
* **pycsw**: The pycsw app. An [OARec](https://ogcapi.ogc.org/records) and [OGC CSW](https://opengeospatial.org/standards/cat) server implementation written in Python.
|
||||
* **ckan2pycsw**: Software to achieve interoperability with the open data portals based on CKAN. To do this, ckan2pycsw reads data from an instance using the CKAN API, generates ISO-19115/ISO-19139 metadata using [pygeometa](https://geopython.github.io/pygeometa/), or a custom schema that is based on a customized CKAN schema, and populates a [pycsw](https://pycsw.org/) instance that exposes the metadata using CSW and OAI-PMH.
|
||||
|
||||
|
||||
[^1]: Official CKAN repo: https://github.com/ckan/ckan-docker-base
|
||||
[^2]: Contains fields needed for the [ckanext-spatial geo search](https://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html)
|
||||
[^3]: Development environment.
|
||||
[^4]: Production environment.
|
||||
[^5]: [ckan_geodcatap](https://github.com/mjanez/ckanext-scheming/blob/036b8c6503059e0d42b0eba180d5bd39205c64a3/ckanext/scheming/ckan_geodcatap.yaml), more info: https://github.com/mjanez/ckanext-scheming/pull/1
|
||||
[^6]: A fork of [COATNor/coat2pycsw](https://github.com/COATnor/coat2pycsw) that has been extended to meet the needs of harvesting GeoDCAT-AP metadata according to INSPIRE ISO19139.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
FROM ckan/ckan-base:ckan-2.10.0
|
||||
#FROM ckan/ckan-base:dev-v2.10
|
||||
FROM ghcr.io/mjanez/ckan-base-spatial:master
|
||||
|
||||
# Set up environment variables
|
||||
ENV APP_DIR=/srv/app
|
||||
|
@ -10,3 +9,60 @@ RUN echo ${TZ} > /etc/timezone
|
|||
RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
|
||||
cp /usr/share/zoneinfo/${TZ} /etc/localtime ;\
|
||||
fi ;
|
||||
|
||||
# Extensions
|
||||
### XLoader - v0.12.2 ###
|
||||
RUN pip3 install -e 'git+https://github.com/ckan/ckanext-xloader.git@0.12.2#egg=ckanext-xloader' && \
|
||||
pip3 install -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \
|
||||
pip3 install -U requests[security]
|
||||
|
||||
### Harvester - v1.5.1 ###
|
||||
RUN echo "ckan/ckanext-harvest" && \
|
||||
pip3 install -e 'git+https://github.com/ckan/ckanext-harvest.git@v1.5.1#egg=ckanext-harvest' && \
|
||||
pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt
|
||||
|
||||
### Geoview - v0.0.20 ###
|
||||
RUN echo "ckan/ckanext-geoview" && \
|
||||
pip3 install -e 'git+https://github.com/ckan/ckanext-geoview.git@v0.0.20#egg=ckanext-geoview'
|
||||
|
||||
### Spatial - v2.0.0 ###
|
||||
RUN echo "ckan/ckanext-spatial" && \
|
||||
pip3 install -e 'git+https://github.com/ckan/ckanext-spatial.git@v2.0.0#egg=ckanext-spatial' && \
|
||||
pip3 install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/bae9290395b252ee8e40056256fa694569d1d78b/requirements.txt
|
||||
|
||||
### DCAT - master (GeoDCAT-AP extended version) ###
|
||||
RUN echo "mjanez/ckanext-dcat (GeoDCAT-AP extended version)" && \
|
||||
pip3 install -e git+https://github.com/mjanez/ckanext-dcat.git#egg=ckanext-dcat && \
|
||||
pip3 install -r https://raw.githubusercontent.com/mjanez/ckanext-dcat/master/requirements.txt
|
||||
|
||||
### Scheming - master (GeoDCAT-AP extended version) ###
|
||||
RUN echo "mjanez/ckanext-scheming (GeoDCAT-AP extended version)" && \
|
||||
pip3 install -e git+https://github.com/mjanez/ckanext-scheming.git#egg=ckanext-scheming
|
||||
|
||||
### Resource dictionary (Fix version) - main ###
|
||||
RUN echo "mjanez/ckanext-resourcedictionary" && \
|
||||
pip3 install -e 'git+https://github.com/mjanez/ckanext-resourcedictionary.git#egg=ckanext-resourcedictionary'
|
||||
|
||||
### Pages - v0.5.1 ###
|
||||
RUN echo "ckan/ckanext-pages" && \
|
||||
pip3 install -e git+https://github.com/ckan/ckanext-pages.git@v0.5.1#egg=ckanext-pages
|
||||
|
||||
### PDFView - v0.0.8 ###
|
||||
RUN echo "ckan/ckanext-pdfview" && \
|
||||
pip3 install -e git+https://github.com/ckan/ckanext-pdfview.git@0.0.8#egg=ckanext-pdfview
|
||||
|
||||
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
|
||||
COPY docker-entrypoint.d/* /docker-entrypoint.d/
|
||||
|
||||
# Apply any patches needed to CKAN core
|
||||
COPY patches ${APP_DIR}/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
|
||||
|
||||
CMD ["/srv/app/start_ckan.sh"]
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
FROM ckan/ckan-base:ckan-2.10.0-dev
|
||||
|
||||
FROM ghcr.io/mjanez/ckan-base-spatial:master
|
||||
|
||||
# Set up environment variables
|
||||
ENV APP_DIR=/srv/app
|
||||
|
@ -21,32 +20,37 @@ RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
|
|||
#
|
||||
# For instance:
|
||||
#
|
||||
### XLoader ###
|
||||
###TODO: XLoader ###
|
||||
# RUN pip3 install -e 'git+https://github.com/ckan/ckanext-xloader.git@master#egg=ckanext-xloader' && \
|
||||
# pip3 install -r ${APP_DIR}/src/ckanext-xloader/requirements.txt && \
|
||||
# pip3 install -U requests[security]
|
||||
|
||||
### Harvester ###
|
||||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-harvest.git@master#egg=ckanext-harvest' && \
|
||||
# pip3 install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt
|
||||
# will also require gather_consumer and fetch_consumer processes running (please see https://github.com/ckan/ckanext-harvest)
|
||||
###TODO: ckanext-visualize
|
||||
#https://github.com/keitaroinc/ckanext-visualize
|
||||
|
||||
### Scheming ###
|
||||
#RUN pip3 install -e 'git+https://github.com/ckan/ckanext-scheming.git@master#egg=ckanext-scheming'
|
||||
###TODO datapreview error
|
||||
# 2023-03-19 12:54:42,311 WARNI [ckan.lib.datapreview] Plugin for view t could not be found
|
||||
# 2023-03-19 12:54:42,313 WARNI [ckan.lib.datapreview] Plugin for view e could not be found
|
||||
# 2023-03-19 12:54:42,314 WARNI [ckan.lib.datapreview] Plugin for view x could not be found
|
||||
# 2023-03-19 12:54:42,315 WARNI [ckan.lib.datapreview] Plugin for view t could not be found
|
||||
# https://github.com/ckan/ckan/search?q=datapreview&type=issues
|
||||
|
||||
### Pages ###
|
||||
#RUN pip3 install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages
|
||||
|
||||
### DCAT ###
|
||||
#RUN pip3 install -e git+https://github.com/ckan/ckanext-dcat.git@v0.0.6#egg=ckanext-dcat && \
|
||||
# pip3 install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v0.0.6/requirements.txt
|
||||
# ###TODO: SPARQL Interface - Adapt to Py3###
|
||||
# RUN echo "mjanez/sparql (Fixed version)" && \
|
||||
# pip3 install -e git+https://github.com/mjanez/ckanext-sparql.git#egg=ckanext-sparql && \
|
||||
# pip3 install -r ${APP_DIR}/src/ckanext-sparql/requirements.txt && \
|
||||
# # update CKAN config with ckanext-sparql parameters
|
||||
# ckan config-tool ${CKAN_INI} "ckanext.sparql.endpoint_url=''" && \
|
||||
# ckan config-tool ${CKAN_INI} "ckanext.sparql.hide_endpoint_url=''"
|
||||
|
||||
# Clone the extension(s) your are writing for your own project in the `src` folder
|
||||
# to get them mounted in this image at runtime
|
||||
|
||||
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
|
||||
COPY docker-entrypoint.d/* /docker-entrypoint.d/
|
||||
|
||||
# Apply any patches needed to CKAN core or any of the built extensions (not the
|
||||
# runtime mounted ones)
|
||||
|
||||
COPY patches ${APP_DIR}/patches
|
||||
|
||||
RUN for d in $APP_DIR/patches/*; do \
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Add ckanext-dcat settings to the CKAN config file
|
||||
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.rdf.profiles = $CKANEXT__DCAT__RDF_PROFILES"
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
#TODO: Correct views.
|
||||
|
||||
# Add CKAN Resource views to the CKAN config file
|
||||
echo "Loading resource views in the CKAN config file"
|
||||
ckan config-tool $CKAN_INI \
|
||||
"ckan.views.default_views = $CKAN__VIEWS__DEFAULT_VIEWS" \
|
||||
"ckan.preview.json_formats = $CKAN__PREVIEW__JSON_FORMATS" \
|
||||
"ckan.preview.xml_formats = $CKAN__PREVIEW__XML_FORMATS" \
|
||||
"ckan.preview.text_formats = $CKAN__PREVIEW__TEXT_FORMATS" \
|
||||
"ckan.preview.loadable = $CKAN__PREVIEW__LOADABLE"
|
||||
|
||||
# Add CKAN Resource geoviews to the CKAN config file
|
||||
echo "Loading geoviews in the CKAN config file"
|
||||
ckan config-tool $CKAN_INI \
|
||||
"ckanext.geoview.ol_viewer.formats = $CKANEXT__GEOVIEW__OL_VIEWER__FORMATS" \
|
||||
"ckanext.geoview.shp_viewer.srid = $CKANEXT__GEOVIEW__SHP_VIEWER__SRID" \
|
||||
"ckanext.geoview.shp_viewer.encoding = $CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING" \
|
||||
"ckanext.geoview.geojson.max_file_size = $CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE"
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Update ckanext-scheming settings defined in the env var
|
||||
echo "Loading ckanext-scheming settings into ckan.ini"
|
||||
ckan config-tool $CKAN_INI \
|
||||
"scheming.dataset_schemas=$SCHEMA_CKANEXT_SCHEMING_DATASET_SCHEMA" \
|
||||
"scheming.group_schemas=$SCHEMA_CKANEXT_SCHEMING_GROUP_SCHEMAS" \
|
||||
"scheming.organization_schemas=$SCHEMA_CKANEXT_SCHEMING_ORGANIZATION_SCHEMAS" \
|
||||
"scheming.presets=$SCHEMA_CKANEXT_SCHEMING_PRESETS"
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Add ckanext.xloader.api_token to the CKAN config file
|
||||
echo "Loading ckanext-xloader settings in the CKAN config file"
|
||||
ckan config-tool $CKAN_INI \
|
||||
"ckanext.xloader.api_token = xxx" \
|
||||
"ckanext.xloader.jobs_db.uri = $CKANEXT__XLOADER__JOBS__DB_URI"
|
||||
|
||||
# Create ckanext-xloader API_TOKEN
|
||||
echo "Set up ckanext.xloader.api_token in the CKAN config file"
|
||||
ckan config-tool $CKAN_INI "ckanext.xloader.api_token = $(ckan -c $CKAN_INI user token add ckan_admin xloader | tail -n 1 | tr -d '\t')"
|
||||
|
||||
#TODO: Setup worker background
|
||||
#echo "Set up CKAN jobs worker"
|
||||
#ckan -c $CKAN_INI jobs worker default
|
|
@ -0,0 +1,14 @@
|
|||
--- /ckan/templates/package/read_base.html
|
||||
+++ /ckan/templates/package/read_base.html
|
||||
@@ -23,6 +23,12 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block secondary_content %}
|
||||
+ {{ super() }}
|
||||
+
|
||||
+ {% set dataset_extent = pkg.spatial %}
|
||||
+ {% if dataset_extent %}
|
||||
+ {% snippet "spatial/snippets/dataset_map_sidebar.html", extent=dataset_extent %}
|
||||
+ {% endif %}
|
||||
|
||||
{% block secondary_help_content %}{% endblock %}
|
|
@ -0,0 +1,10 @@
|
|||
--- /ckan/templates/package/search.html
|
||||
+++ /ckan/templates/package/search.html
|
||||
@@ -70,6 +70,7 @@
|
||||
|
||||
|
||||
{% block secondary_content %}
|
||||
+{% snippet "spatial/snippets/spatial_query.html", default_extent="[[26.78,-19.21], [44.08, 5.66]]" %}
|
||||
<div class="filters">
|
||||
<div>
|
||||
{% for facet in facet_titles %}
|
|
@ -1,5 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Set up the Secret key used by Beaker and Flask
|
||||
# This can be overriden using a CKAN___BEAKER__SESSION__SECRET env var
|
||||
if grep -E "beaker.session.secret ?= ?$" ckan.ini
|
||||
then
|
||||
echo "Setting beaker.session.secret in ini file"
|
||||
ckan config-tool $CKAN_INI "beaker.session.secret=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')"
|
||||
JWT_SECRET=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())')
|
||||
ckan config-tool $CKAN_INI "api_token.jwt.encode.secret=${JWT_SECRET}"
|
||||
ckan config-tool $CKAN_INI "api_token.jwt.decode.secret=${JWT_SECRET}"
|
||||
fi
|
||||
|
||||
# Run the prerun script to init CKAN and create the default admin user
|
||||
sudo -u ckan -EH python3 prerun.py
|
||||
|
||||
|
|
|
@ -32,13 +32,6 @@ services:
|
|||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
|
||||
|
||||
datapusher:
|
||||
container_name: ${DATAPUSHER_CONTAINER_NAME}
|
||||
image: ckan/ckan-base-datapusher:${DATAPUSHER_VERSION}
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"]
|
||||
|
||||
db:
|
||||
container_name: ${POSTGRESQL_CONTAINER_NAME}
|
||||
build:
|
||||
|
|
|
@ -26,6 +26,7 @@ services:
|
|||
dockerfile: Dockerfile
|
||||
args:
|
||||
- TZ=${TZ}
|
||||
image: ghcr.io/mjanez/ckan-spatial:master
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
|
@ -43,13 +44,6 @@ services:
|
|||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
|
||||
|
||||
datapusher:
|
||||
container_name: ${DATAPUSHER_CONTAINER_NAME}
|
||||
image: ckan/ckan-base-datapusher:${DATAPUSHER_VERSION}
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"]
|
||||
|
||||
db:
|
||||
container_name: ${POSTGRESQL_CONTAINER_NAME}
|
||||
build:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM postgres:12-alpine
|
||||
FROM postgres:15-alpine
|
||||
|
||||
# Allow connections; we don't map out any ports so only linked docker containers can connect
|
||||
RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
# Container names
|
||||
NGINX_CONTAINER_NAME=nginx
|
||||
REDIS_CONTAINER_NAME=redis
|
||||
POSTGRESQL_CONTAINER_NAME=db
|
||||
SOLR_CONTAINER_NAME=solr
|
||||
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.9.8
|
||||
CKAN_SITE_ID=default
|
||||
CKAN_SITE_URL=http://localhost: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
|
||||
## 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-spatial
|
||||
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
|
||||
|
||||
# NGINX
|
||||
NGINX_PORT=80
|
||||
NGINX_SSLPORT=443
|
||||
|
||||
# Extensions
|
||||
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. <a href="https://www.idee.es/">IDEE</a>, bajo <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.'
|
||||
|
||||
# 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
|
|
@ -0,0 +1,288 @@
|
|||
#
|
||||
# CKAN - Pylons configuration
|
||||
#
|
||||
# These are some of the configuration options available for your CKAN
|
||||
# instance. Check the documentation in 'doc/configuration.rst' or at the
|
||||
# following URL for a description of what they do and the full list of
|
||||
# available options:
|
||||
#
|
||||
# http://docs.ckan.org/en/latest/maintaining/configuration.html
|
||||
#
|
||||
# The %(here)s variable will be replaced with the parent directory of this file
|
||||
#
|
||||
|
||||
[DEFAULT]
|
||||
|
||||
# WARNING: *THIS SETTING MUST BE SET TO FALSE ON A PUBLIC ENVIRONMENT*
|
||||
# With debug mode enabled, a visitor to your site could execute malicious commands.
|
||||
debug = false
|
||||
|
||||
[app:main]
|
||||
use = egg:ckan
|
||||
|
||||
## Development settings
|
||||
ckan.devserver.host = localhost
|
||||
ckan.devserver.port = 5000
|
||||
|
||||
|
||||
## Session settings
|
||||
cache_dir = /tmp/%(ckan.site_id)s/
|
||||
beaker.session.key = ckan
|
||||
|
||||
# This is the secret token that the beaker library uses to hash the cookie sent
|
||||
# to the client. `ckan generate config` generates a unique value for this each
|
||||
# time it generates a config file.
|
||||
beaker.session.secret = acZN6lm5UYE_8A6uEYGIBx0KL
|
||||
|
||||
# `ckan generate config` generates a unique value for this each time it generates
|
||||
# a config file.
|
||||
app_instance_uuid = 32ceaae1-9cfa-4d31-ab19-9baf339d2bdd
|
||||
|
||||
# repoze.who config
|
||||
who.config_file = %(here)s/who.ini
|
||||
who.log_level = warning
|
||||
who.log_file = %(cache_dir)s/who_log.ini
|
||||
# Session timeout (user logged out after period of inactivity, in seconds).
|
||||
# Inactive by default, so the session doesn't expire.
|
||||
# who.timeout = 86400
|
||||
|
||||
## Database Settings
|
||||
sqlalchemy.url = postgresql://ckan:ckan@localhost/ckan_default
|
||||
|
||||
ckan.datastore.write_url = postgresql://ckan:ckan@localhost/datastore_default
|
||||
ckan.datastore.read_url = postgresql://datastore_ro:datastore@localhost/datastore_default
|
||||
|
||||
# PostgreSQL' full-text search parameters
|
||||
ckan.datastore.default_fts_lang = english
|
||||
ckan.datastore.default_fts_index_method = gist
|
||||
|
||||
## Site Settings
|
||||
ckan.site_url = http://localhost:5000/
|
||||
#ckan.root_path = /catalog/{{LANG}}
|
||||
#ckan.use_pylons_response_cleanup_middleware = true
|
||||
|
||||
# Default timeout for Requests
|
||||
#ckan.requests.timeout = 10
|
||||
|
||||
## Authorization Settings
|
||||
ckan.auth.anon_create_dataset = false
|
||||
ckan.auth.create_unowned_dataset = false
|
||||
ckan.auth.create_dataset_if_not_in_organization = false
|
||||
ckan.auth.user_create_groups = false
|
||||
ckan.auth.user_create_organizations = false
|
||||
ckan.auth.user_delete_groups = true
|
||||
ckan.auth.user_delete_organizations = true
|
||||
ckan.auth.create_user_via_api = false
|
||||
ckan.auth.create_user_via_web = false
|
||||
ckan.auth.roles_that_cascade_to_sub_groups = admin
|
||||
ckan.auth.public_user_details = true
|
||||
ckan.auth.public_activity_stream_detail = true
|
||||
ckan.auth.allow_dataset_collaborators = false
|
||||
ckan.auth.create_default_api_keys = false
|
||||
|
||||
## API Token Settings
|
||||
api_token.nbytes = 60
|
||||
api_token.jwt.encode.secret = string:acZN6lm5UYE_8A6uEYGIBx0KL
|
||||
api_token.jwt.decode.secret = string:acZN6lm5UYE_8A6uEYGIBx0KL
|
||||
api_token.jwt.algorithm = HS256
|
||||
|
||||
## API Token: expire_api_token plugin
|
||||
expire_api_token.default_lifetime = 3600
|
||||
|
||||
## Search Settings
|
||||
|
||||
ckan.site_id = default
|
||||
#solr_url = http://127.0.0.1:8983/solr
|
||||
|
||||
|
||||
## Redis Settings
|
||||
|
||||
# URL to your Redis instance, including the database to be used.
|
||||
#ckan.redis.url = redis://localhost:6379/0
|
||||
|
||||
|
||||
## CORS Settings
|
||||
|
||||
# If cors.origin_allow_all is true, all origins are allowed.
|
||||
# If false, the cors.origin_whitelist is used.
|
||||
# ckan.cors.origin_allow_all = true
|
||||
# cors.origin_whitelist is a space separated list of allowed domains.
|
||||
# ckan.cors.origin_whitelist = http://example1.com http://example2.com
|
||||
|
||||
|
||||
## Plugins Settings
|
||||
|
||||
# Note: Add ``datastore`` to enable the CKAN DataStore
|
||||
# Add ``datapusher`` to enable DataPusher
|
||||
# Add ``resource_proxy`` to enable resorce proxying and get around the
|
||||
# same origin policy
|
||||
ckan.plugins = stats text_view image_view recline_view resourcedictionary datastore datapusher 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
|
||||
|
||||
|
||||
## ckanext-scheming
|
||||
# module-path:file to schemas being used
|
||||
scheming.dataset_schemas = ckanext.scheming:ckan_geodcatap.yaml
|
||||
|
||||
# For group and organization schemas (replace myplugin with your custom plugin)
|
||||
scheming.group_schemas = ckanext.scheming:ckan_group_geodcatap.json
|
||||
scheming.organization_schemas = ckanext.scheming:ckan_org_geodcatap.json
|
||||
|
||||
# Preset files may be included as well. The default preset setting is:
|
||||
scheming.presets = ckanext.scheming:presets.json
|
||||
|
||||
|
||||
## ckanext-dcat
|
||||
ckanext.dcat.base_uri = http://localhost:5000
|
||||
ckanext.dcat.rdf.profiles = euro_dcat_ap_2 euro_dcat_ap
|
||||
|
||||
## ckanext-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.idee.es/">IDEE</a>, bajo <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.
|
||||
|
||||
# ckanext-harvest
|
||||
ckan.harvest.mq.type = redis
|
||||
ckan.harvest.mq.hostname = redis
|
||||
|
||||
# Define which views should be created by default
|
||||
# (plugins must be loaded in ckan.plugins)
|
||||
ckan.views.default_views = image_view text_view recline_view harvest ckan_harvester wmts_view geojson_view geo_view shp_view pdf_view
|
||||
ckanext.geoview.ol_viewer.formats = wms wfs geojson gml kml
|
||||
ckanext.geoview.shp_viewer.srid = 3857
|
||||
ckanext.geoview.shp_viewer.encoding = UTF-8
|
||||
ckanext.geoview.geojson.max_file_size = 100000000
|
||||
|
||||
# Customize which text formats the text_view plugin will show
|
||||
ckan.preview.json_formats = json jsonld
|
||||
ckan.preview.xml_formats = xml rdf rdf+xml owl+xml atom rss turtle ttl n3
|
||||
ckan.preview.text_formats = text plain text/plain text/turtle
|
||||
|
||||
# Customize which image formats the image_view plugin will show
|
||||
#ckan.preview.image_formats = png jpeg jpg gif
|
||||
|
||||
## Front-End Settings
|
||||
|
||||
ckan.site_title = CKAN
|
||||
ckan.site_logo = /base/images/ckan-logo.png
|
||||
ckan.site_description =
|
||||
ckan.favicon = /base/images/ckan.ico
|
||||
ckan.gravatar_default = identicon
|
||||
ckan.preview.direct = png jpg gif
|
||||
ckan.preview.loadable = html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json
|
||||
ckan.display_timezone = server
|
||||
|
||||
# package_hide_extras = for_search_index_only
|
||||
#package_edit_return_url = http://another.frontend/dataset/<NAME>
|
||||
#package_new_return_url = http://another.frontend/dataset/<NAME>
|
||||
#ckan.recaptcha.publickey =
|
||||
#ckan.recaptcha.privatekey =
|
||||
#licenses_group_url = http://licenses.opendefinition.org/licenses/groups/ckan.json
|
||||
# ckan.template_footer_end =
|
||||
|
||||
|
||||
## Internationalisation Settings
|
||||
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
|
||||
ckan.locales_offered =
|
||||
ckan.locales_filtered_out = en_GB
|
||||
|
||||
## Feeds Settings
|
||||
|
||||
ckan.feeds.authority_name =
|
||||
ckan.feeds.date =
|
||||
ckan.feeds.author_name =
|
||||
ckan.feeds.author_link =
|
||||
|
||||
## Storage Settings
|
||||
|
||||
#ckan.storage_path = /var/lib/ckan
|
||||
#ckan.max_resource_size = 10
|
||||
#ckan.max_image_size = 2
|
||||
|
||||
## Webassets Settings
|
||||
#ckan.webassets.use_x_sendfile = false
|
||||
#ckan.webassets.path = /var/lib/ckan/webassets
|
||||
|
||||
|
||||
## Datapusher settings
|
||||
|
||||
# Make sure you have set up the DataStore
|
||||
ckan.datapusher.api_token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJ6ODViRDNEc1BRLUFGNHVqVEJTM2p4SmNGREJnY2kxRlFrV2I5aDhWNUNNZ09BMGZ5ZDZzUnFxRWQzMTk4OGlFY1h3Wndkcjc5ZFRZNy1JZyIsImlhdCI6MTY2OTE5Mzg3MX0.sfbkYDI_n_syYhBO3kt3NRZpzE5no6ey8M6E5jWMCGE
|
||||
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
ckan.datapusher.url = http://127.0.0.1:8800/
|
||||
ckan.datapusher.callback_url_base = http://127.0.0.1:8800/
|
||||
#ckan.datapusher.assume_task_stale_after = 3600
|
||||
|
||||
# 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 = 1000
|
||||
|
||||
## Activity Streams Settings
|
||||
|
||||
#ckan.activity_streams_enabled = true
|
||||
#ckan.activity_list_limit = 31
|
||||
#ckan.activity_streams_email_notifications = true
|
||||
#ckan.email_notifications_since = 2 days
|
||||
ckan.hide_activity_from_users = %(ckan.site_id)s
|
||||
|
||||
|
||||
## Email settings
|
||||
|
||||
#email_to = errors@example.com
|
||||
#error_email_from = ckan-errors@example.com
|
||||
#smtp.server = localhost
|
||||
#smtp.starttls = False
|
||||
#smtp.user = username@example.com
|
||||
#smtp.password = your_password
|
||||
#smtp.mail_from =
|
||||
#smtp.reply_to =
|
||||
|
||||
## Background Job Settings
|
||||
ckan.jobs.timeout = 180
|
||||
|
||||
## Logging configuration
|
||||
[loggers]
|
||||
keys = root, ckan, ckanext, werkzeug
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARNING
|
||||
handlers = console
|
||||
|
||||
[logger_werkzeug]
|
||||
level = WARNING
|
||||
handlers = console
|
||||
qualname = werkzeug
|
||||
propagate = 0
|
||||
|
||||
[logger_ckan]
|
||||
level = INFO
|
||||
handlers = console
|
||||
qualname = ckan
|
||||
propagate = 0
|
||||
|
||||
[logger_ckanext]
|
||||
level = DEBUG
|
||||
handlers = console
|
||||
qualname = ckanext
|
||||
propagate = 0
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
|
Loading…
Reference in New Issue