diff --git a/.env.example b/.env.example index 4e5c49d89..26baca8a2 100644 --- a/.env.example +++ b/.env.example @@ -3,18 +3,32 @@ APP_DIR=/srv/app # Sets Docker Compose project name to avoid resource conflicts between projects. Defaults to the folder name "ckan-docker" if not set. #COMPOSE_PROJECT_NAME=ckan-docker-mytheme +# Dev settings +USE_HTTPS_FOR_DEV=False +CKAN_DEV_COMPOSE_SERVICE=ckan-dev +## ckan-pycsw unverified mode (True/False). SSL certificate from host will download if SSL_UNVERIFIED_MODE=True, to avoid SSL error when certificate was self-signed. +SSL_UNVERIFIED_MODE=False + # Host Ports CKAN_PORT_HOST=5000 +PYCSW_PORT_HOST=8000 # Common proxy server for Apache or NGINX. -# Change all the PROXY_SERVER_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) -PROXY_SERVER_BASE_PORT_HOST=81 +# Change all the PROXY_SERVER_URL_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) +PROXY_SERVER_HTTP_PORT_HOST=81 PROXY_SERVER_HTTPS_PORT_HOST=8443 -# Server port for the proxy server. Better using the SSL port for production, in DEV or if using balancer: PROXY_SERVER_PORT_HOST=PROXY_SERVER_BASE_PORT_HOST -PROXY_SERVER_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -NGINX_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} +# Ports for NGINX (matches HTTP/HTTPS ports) +NGINX_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} NGINX_SSLPORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -APACHE_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} -PYCSW_PORT_HOST=8000 +# Port for Apache +APACHE_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} + +# Server port for the proxy server and CKAN urls. Better using the SSL port. +# (If needed for Development Mode) uncomment the following line: +# PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} +# (If needed for Development Mode) And comment the following line: +PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} +# URL protocol. Change to http if you dont use SSL +PROXY_SERVER_PROTOCOL=https # Solr SOLR_IMAGE_VERSION=2.9-solr9-spatial @@ -41,11 +55,9 @@ APACHE_PORT=80 APACHE_LOG_DIR=/var/log/apache #NGINX/APACHE -## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_PORT_HOST} +## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_URL_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_URL_PORT_HOST} PROXY_SERVER_NAME=localhost -# URL protocol. Change to https if you use SSL -PROXY_SERVER_PROTOCOL=http -PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_PORT_HOST} +PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_URL_PORT_HOST} PROXY_CKAN_LOCATION=/catalog PROXY_PYCSW_LOCATION=/csw @@ -86,10 +98,6 @@ TEST_CKAN_SQLALCHEMY_URL=postgres://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGR TEST_CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} TEST_CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} -# Dev settings -USE_HTTPS_FOR_DEV=false -CKAN_DEV_COMPOSE_SERVICE=ckan-dev - # CKAN core ## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker CKAN_VERSION=2.10.5 @@ -102,7 +110,8 @@ CKAN__SITE_LOGO=${PROXY_CKAN_LOCATION}/images/default/ckan-logo.png # CKAN site info CKAN__SITE_TITLE="CKAN Open Data" CKAN__SITE_DESCRIPTION="ckan-docker *spatial Open Data portal" -CKAN__SITE_INTRO_TEXT="[![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) is a ready-to-use development environment for [CKAN](https://github.com/ckan/ckan), the world’s leading open-source data portal platform." +# Using [#en#], [#es#], etc. to define the language of the text as needed. +CKAN__SITE_INTRO_TEXT="[#en#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) is a ready-to-use development environment for [CKAN](https://github.com/ckan/ckan), the world’s leading open-source data portal platform.[#es#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) es un entorno de desarrollo listo para usar para [CKAN](https://github.com/ckan/ckan), la plataforma de portales de datos de código abierto líder en el mundo." CKAN__SITE_ABOUT=${CKAN__SITE_INTRO_TEXT} # Custom licenses that are aligned with DCAT-AP (Also works with DEV Mode) LICENSES_GROUP_URL=file://${APP_DIR}/src/ckanext-schemingdcat/ckanext/schemingdcat/public/static/licenses.json @@ -112,7 +121,7 @@ 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_SYSADMIN_EMAIL=your_emai@${PROXY_SERVER_NAME} CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log # SMTP settings diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 151179a97..08b8f2be7 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -46,10 +46,10 @@ jobs: - name: Extract tag version from branch name id: extract_tag_version run: | - if [ "${{ github.head_ref }}" = "master" ]; then + if [ "${{ env.BRANCH }}" = "master" ]; then echo "VERSION=master" >> $GITHUB_ENV else - echo "VERSION=$(echo ${{ github.head_ref }} | sed 's/^ckan-//')" >> $GITHUB_ENV + echo "VERSION=$(echo ${{ env.BRANCH }} | sed 's/^ckan-//')" >> $GITHUB_ENV fi - name: Extract Docker metadata diff --git a/.github/workflows/docker-manual.yml b/.github/workflows/docker-manual.yml index 590558382..c13de5288 100644 --- a/.github/workflows/docker-manual.yml +++ b/.github/workflows/docker-manual.yml @@ -36,10 +36,10 @@ jobs: - name: Extract tag version from branch name id: extract_tag_version run: | - if [ "${{ github.head_ref }}" = "master" ]; then + if [ "${{ env.BRANCH }}" = "master" ]; then echo "VERSION=master" >> $GITHUB_ENV else - echo "VERSION=$(echo ${{ github.head_ref }} | sed 's/^ckan-//')" >> $GITHUB_ENV + echo "VERSION=$(echo ${{ env.BRANCH }} | sed 's/^ckan-//')" >> $GITHUB_ENV fi - name: Extract Docker metadata diff --git a/.gitignore b/.gitignore index 609b30484..ca11b0909 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ index.html.* !.env.example !.env.codespaces !.env.es.example -!.env.localhost +!.env.dev.example samples/api/* # docker compose files diff --git a/README.md b/README.md index 58b583eb6..b1e4eab29 100644 --- a/README.md +++ b/README.md @@ -49,24 +49,24 @@ Available components: 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. -* Solr: [Custom image](/solr/Dockerfile.spatial) based on official CKAN [pre-configured Solr image](https://github.com/ckan/ckan-solr). The index data is stored in a named volume and has a custom spatial schema upgrades. [^2] +* Solr: [Custom image](/solr/Dockerfile.spatial) based on official CKAN [pre-configured Solr image](https://github.com/mjanez/ckan-solr). The index data is stored in a named volume and has a custom spatial schema upgrades. [^2] * Redis: Standard Redis image * NGINX: Latest stable nginx image that includes SSL and Non-SSL endpoints. * ckan-pycsw: [Custom image](/ckan-pycsw/Dockerfile) based on [pycsw CKAN harvester ISO19139](https://github.com/mjanez/ckan-pycsw) for INSPIRE Metadata CSW Endpoint. -Optional HTTP Endpoint ([`docker-compose.apache.yml`](/docker-compose.apache.yml)): -* `docker-compose.apache.yml`: +Optional HTTP Endpoint ([`samples/docker-compose/`](/samples/docker-compose/)): +* [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) & [`docker-compose.dev.apache.yml`](/samples/docker-compose/docker-compose.dev.apache.yml): * Apache HTTP Server: [Custom image](/apache/Dockerfile) based on official latest stable httpd image. Configured to serve multiple routes for the [ckan-pycsw](#ckan-pycsw) CSW endpoint (`{CKAN_SITE_URL}/csw`) and CKAN (`{CKAN_SITE_URL}/catalog`). Only HTTP. | Compose files | Repository | Type | Docker tag | Size | Notes | | --- | --- | --- | --- | --- | --- | -| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | CKAN 2.10.5 | custom image | [`mjanez/ckan-docker:ckan-2.10.5`](https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker) | 800 MB | Custom Dockerfile: [`ckan/Dockerfile`](/ckan/Dockerfile) | -| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | PostgreSQL 15 | 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) | -| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | Solr 9 | custom image | [`ckan/ckan-solr:2.9-solr9-spatial`](https://registry.hub.docker.com/layers/ckan/ckan-solr/2.9-solr9-spatial/images/sha256-b5ee4979891c7dd1f10d2ac2cbdd4d80ff656879edb0f0493616be7b4cf8bc3a?context=explore) | 331.1 MB | CKAN's [pre-configured spatial Solr image](https://github.com/ckan/ckan-solr). | -| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/docker-compose.apache.yml) | Redis 7 | base image | [`redis/redis:7-alpine`](https://hub.docker.com/layers/library/redis/7-alpine/images/sha256-98f4ea44e912d0941d29015a4e2448151b94411109c896b5627d94d79306eea7?context=explore) | 11.82 MB | - | -| [`docker-compose.yml`](/docker-compose.yml) | Apache HTTP Server 2.4 | custom image | [`httpd/httpd:2.4`](https://hub.docker.com/layers/library/httpd/2.4/images/sha256-f34e8e25ee18da020633ef0b2bf7516d8cfdad5c5c4b0595d36e5cd78a098101?context=explore) | 54.47 MB | Custom Dockerfile: [`apache/Dockerfile`](/apache/Dockerfile) | -| [`docker-compose.yml`](/docker-compose.yml)| pycsw CKAN harvester ISO19139 | custom image | [`mjanez/ckan-pycsw:latest`](https://github.com/mjanez/ckan-pycsw/pkgs/container/ckan-pycsw) | 175 MB | Custom Dockerfile: [`ckan-pycsw/Dockerfile`](/ckan-pycsw/Dockerfile) | -| [`docker-compose.apache.yml`](/docker-compose.apache.yml) | NGINX stable | 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) | +| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) | CKAN 2.10.5 | custom image | [`mjanez/ckan-docker:ckan-2.10.5`](https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker) | 1.27 GB | Custom Dockerfile: [`ckan/Dockerfile`](/ckan/Dockerfile) | +| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) | PostgreSQL 15 | base image | [`postgres/postgres:15-alpine`](https://hub.docker.com/layers/library/postgres/15-alpine/images/sha256-53a02ecbe9d18ff6476e6651c34811da39f054424c725fc15d2b480fc3fab877?context=explore) | 243 MB | Custom Dockerfile: [`postgresql/Dockerfile`](/postgresql/Dockerfile) | +| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) | Solr 9 | custom image | [`ckan/ckan-solr:2.9-solr9-spatial`](https://registry.hub.docker.com/layers/ckan/ckan-solr/2.9-solr9-spatial/images/sha256-b5ee4979891c7dd1f10d2ac2cbdd4d80ff656879edb0f0493616be7b4cf8bc3a?context=explore) | 584 MB | CKAN's [pre-configured spatial Solr image](https://github.com/ckan/ckan-solr). | +| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) | Redis 7 | base image | [`redis/redis:7-alpine`](https://hub.docker.com/layers/library/redis/7-alpine/images/sha256-98f4ea44e912d0941d29015a4e2448151b94411109c896b5627d94d79306eea7?context=explore) | 41.2 MB | - | +| [`docker-compose.yml`](/docker-compose.yml) | NGINX stable | base image | [`nginx:stable-alpine`](https://hub.docker.com/layers/library/nginx/stable-alpine/images/sha256-ff2a5d557ca22fa93669f5e70cfbeefda32b98f8fd3d33b38028c582d700f93a?context=explore) | 43.2 MB | Custom Dockerfile: [`nginx/Dockerfile`](/nginx/Dockerfile) | +| [`docker-compose.yml`](/docker-compose.yml) / [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml)| pycsw CKAN harvester ISO19139 | custom image | [`mjanez/ckan-pycsw:latest`](https://github.com/mjanez/ckan-pycsw/pkgs/container/ckan-pycsw) | 418 MB | Custom Dockerfile: [`ckan-pycsw/Dockerfile`](/ckan-pycsw/Dockerfile) | +| [`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml) | Apache HTTP Server 2.4 | custom image | [`httpd/httpd:2.4`](https://hub.docker.com/layers/library/httpd/2.4/images/sha256-f34e8e25ee18da020633ef0b2bf7516d8cfdad5c5c4b0595d36e5cd78a098101?context=explore) | 62.9 MB | Custom Dockerfile: [`apache/Dockerfile`](/apache/Dockerfile) | The site is configured using environment variables that you can set in the `.env` file for an NGINX and ckan-pycsw deployment (default `.env.example`), or replace it with the [`.env.apache.example`](/samples/.env.apache.example) for a Apache HTTP Server deployment using the Docker Compose file: [`docker-compose.apache.yml`](/docker-compose.apache.yml). @@ -129,10 +129,15 @@ Before starting the deployment, you'll need to set up a `.env` file. This file i cp .env.example .env ``` - - **NGINX**: Host ports: (`NGINX_PORT_HOST` and `NGINX_SSLPORT_HOST`) - - **Apache HTTP Server**: Host ports: (`APACHE_PORT_HOST`) + Adjust the `HTTP`/`HTTPS` ports as necessary: + ```ini + # Common proxy server for Apache or NGINX. + PROXY_SERVER_HTTP_PORT_HOST=81 + PROXY_SERVER_HTTPS_PORT_HOST=8443 + ``` - Then modify the variables about the site URL or locations (`CKAN_SITE_URL`, `CKAN_URL`, `PYCSW_URL`, `CKANEXT__DCAT__BASE_URI`, `PROXY_SERVER_NAME`, `PROXY_CKAN_LOCATION`, `PROXY_PYCSW_LOCATION`, etc.) using the port hosts above. + Next, modify the variables related to the site URL or locations if needed. If you don't require `PROXY_SERVER_URL_PORT_HOST` (e.g., if it's set to `80`) or you're using a domain without the NGINX deployment service, edit the `PROXY_SERVER_URL`, remove `:${PROXY_SERVER_URL_PORT_HOST}` or set it to your desired domain. + https://github.com/mjanez/ckan-docker/blob/39763db25c96da0b6255abb2b90cdad52765c68a/.env.example#L43-L50 > [!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` @@ -167,7 +172,7 @@ window for something else. > [!NOTE] > * Or `docker compose up --build` to build & up the containers. -> * Or `docker compose -f docker-compose.apache.yml up -d --build` to use the Apache HTTP Server version. +> * Or `docker compose -f ./samples/docker-compose/docker-compose.apache.yml up -d --build` to use the Apache HTTP Server version. > [!NOTE] > Learn more about configuring this ckan docker: @@ -176,7 +181,9 @@ window for something else. At the end of the container start sequence there should be 6 containers running. -After this step, CKAN should be running at `http://{PROXY_SERVER_NAME}/{PROXY_CKAN_LOCATION}` and ckan-pycsw at `http://{PROXY_SERVER_NAME}/{PROXY_PYCSW_LOCATION}`, i.e: http://localhost/catalog or http://localhost/csw +After this step, CKAN should be running at `https://${PROXY_SERVER_URL}${PROXY_CKAN_LOCATION}` and ckan-pycsw at `https://{PROXY_SERVER_URL}/{PROXY_PYCSW_LOCATION}`, i.e: +- https://localhost:8443/catalog or https://localhost:8443/csw +- http://localhost:81/catalog or http://localhost:81/csw | CONTAINER ID | IMAGE | COMMAND | CREATED | STATUS | PORTS | NAMES | |----------------|--------------------------------------|----------------------|--------------------|-----------------------------|-------------------------------------------------|------------------------------------------| @@ -201,7 +208,7 @@ If you just want to test the package and see the general functionality of the pl ### 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. +Select this mode when making modifications to CKAN code, either by developing new extensions or updating existing ones. This mode uses the `.env` configuration file to manage configuration options. For an example configuration, see [`samples/.env.dev.example`](/samples/.env.dev.example). To develop local extensions use the `docker compose.dev.yml` file: @@ -251,7 +258,9 @@ The new extension files and directories are created in the `/srv/app/src_extensi Sometimes is useful to run your local development instance under HTTPS, for instance if you are using authentication extensions like [ckanext-saml2auth](https://github.com/keitaroinc/ckanext-saml2auth). To enable it, set the following in your `.env` file: ```ini - USE_HTTPS_FOR_DEV=true + USE_HTTPS_FOR_DEV=True + ## ckan-pycsw unverified mode (True/False). SSL certificate from host will download if SSL_UNVERIFIED_MODE=True, to avoid SSL error when certificate was self-signed. + SSL_UNVERIFIED_MODE=True ``` and update the site URL setting: @@ -471,7 +480,7 @@ The `ckan-local.*` files will then need to be moved into the nginx/setup/ direct #### Apache HTTP Server -The Docker Compose configuration ([`docker-compose.apache.yml`](/docker-compose.apache.yml)) uses an httpd image as the front-end. It has two routes for the ckan (default location: `/catalog`) and ckan-pycsw (default location: `/csw`) services. +The Docker Compose configuration ([`docker-compose.apache.yml`](/samples/docker-compose/docker-compose.apache.yml)) uses an httpd image as the front-end. It has two routes for the ckan (default location: `/catalog`) and ckan-pycsw (default location: `/csw`) services. The proxy locations, ports and other Apache Web Server options can be modified in the `.env` file: ```ini diff --git a/ckan-pycsw/Dockerfile b/ckan-pycsw/Dockerfile index 4052ed4dc..c37c99d0b 100644 --- a/ckan-pycsw/Dockerfile +++ b/ckan-pycsw/Dockerfile @@ -14,27 +14,7 @@ ENV DEV_MODE=False ENV TIMEOUT=300 ENV PYCSW_CRON_DAYS_INTERVAL=2 ENV PYCSW_CRON_HOUR_START=4 - -# PYCSW Catalog configuration -ENV CSW_IDENTIFICATION_TITLE="Sample Geospatial Catalogue" \ - CSW_IDENTIFICATION_ABSTRACT="OGC CSW server powered by pycsw" \ - CSW_PROVIDER_NAME="ckan-docker development team" \ - CSW_PROVIDER_URL="https://github.com/mjanez/ckan-docker" \ - CSW_CONTACT_NAME="ckan-docker development team" \ - CSW_CONTACT_POSITION="Site Administrator" \ - CSW_CONTACT_ADDRESS="ckan-docker development team" \ - CSW_CONTACT_CITY="Madrid" \ - CSW_CONTACT_STATE_OR_PROVINCE="Madrid" \ - CSW_CONTACT_POSTAL_CODE="28001" \ - CSW_CONTACT_COUNTRY="Spain" \ - CSW_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} \ - CSW_CONTACT_URL=${CKAN_URL} \ - CSW_INSPIRE_DATE="2024-01-01" \ - CSW_INSPIRE_GEMET_KEYWORDS="Utility and governmental services" \ - CSW_INSPIRE_CONFORMITY="notEvaluated" \ - CSW_INSPIRE_CONTACT_NAME=${CSW_CONTACT_NAME} \ - CSW_INSPIRE_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} \ - CSW_INSPIRE_TEMP_EXTENT="2024-01-01/2024-12-31" +ENV SSL_UNVERIFIED_MODE=False WORKDIR ${APP_DIR} diff --git a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh index 9e24c2e20..b55273be0 100644 --- a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh +++ b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh @@ -4,7 +4,27 @@ set -xeuo pipefail envsubst < pycsw.conf.template > pycsw.conf -#TODO: -Xfrozen_modules=off from: https://bugs.python.org/issue1666807 -/wait-for --timeout "$TIMEOUT" "$CKAN_URL" -- pdm run python3 -Xfrozen_modules=off ckan2pycsw/ckan2pycsw.py +# TODO: -Xfrozen_modules=off from: https://bugs.python.org/issue1666807 + +# Check if SSL_UNVERIFIED_MODE is enabled +if [ "${SSL_UNVERIFIED_MODE:-false}" = "true" ] || [ "${SSL_UNVERIFIED_MODE:-false}" = "True" ]; then + export REQUESTS_CA_BUNDLE="" + export CURL_CA_BUNDLE="" + SSL_FLAGS="--insecure" # Add SSL ignore flag + echo "[INSECURE] SSL_UNVERIFIED_MODE is enabled. SSL certificate verification is disabled." +else + SSL_FLAGS="" +fi + +# Use curl directly instead of wait-for if necessary +echo 'Waiting for $CKAN_URL to become available...' +until curl $SSL_FLAGS --output /dev/null --silent --head --fail "$CKAN_URL"; do + printf '.' + sleep 30 +done +echo 'CKAN is available.' + +# Ejecutar el comando Python +pdm run python3 -Xfrozen_modules=off ckan2pycsw/ckan2pycsw.py exec "$@" diff --git a/doc/info_envfile.md b/doc/info_envfile.md index 2fb1867cc..37c0178d7 100644 --- a/doc/info_envfile.md +++ b/doc/info_envfile.md @@ -11,16 +11,93 @@ Basic configurations such as the location of the application. Ports on which various services are running. - `CKAN_PORT_HOST`: The port on which CKAN is running. +- `PYCSW_PORT_HOST`: The port on which PYCSW is running. +- `PROXY_SERVER_HTTP_PORT_HOST`: The HTTP port for the proxy server. +- `PROXY_SERVER_HTTPS_PORT_HOST`: The HTTPS port for the proxy server. - `NGINX_PORT_HOST`: The port on which NGINX is running. - `NGINX_SSLPORT_HOST`: The port on which NGINX is running with SSL. - `APACHE_PORT_HOST`: The port on which Apache is running. + +### Solr +Solr is a highly reliable, scalable, and fault-tolerant full-text search engine. CKAN uses it for indexing and searching data. + +- `SOLR_IMAGE_VERSION`: The version of the Solr image. +- `SOLR_PORT`: The port on which Solr is running. +- `SOLR_CKAN_DATABASE`: The CKAN database for Solr. +- `CKAN_SOLR_URL`: The URL of the Solr instance used by CKAN. +- `TEST_CKAN_SOLR_URL`: The URL of the Solr instance used by CKAN for testing. + +### Redis +Redis is an in-memory data structure store, used as a database, cache, and message broker. CKAN uses it for tasks such as session management and job queueing. + +- `REDIS_VERSION`: The version of Redis. +- `REDIS_PORT`: The port on which Redis is running. +- `REDIS_CKAN_DATABASE`: The CKAN database for Redis. +- `CKAN_REDIS_URL`: The URL of the Redis instance used by CKAN. +- `TEST_CKAN_REDIS_URL`: The URL of the Redis instance used by CKAN for testing. + +### NGINX +NGINX is a high-performance web server and reverse proxy. In the context of CKAN, it is used to serve static content and as a reverse proxy to improve performance and scalability. [**Default reverse proxy**] + +- `NGINX_PORT`: The port on which NGINX is running. +- `NGINX_SSLPORT`: The port on which NGINX is running with SSL. +- `NGINX_LOG_DIR`: The directory where NGINX logs are stored. + +### Apache HTTP Server +Apache is an open-source web server. It can be used by CKAN to serve its web application. [**Alternative reverse proxy/Development reserve proxy**] + +- `APACHE_VERSION`: The version of Apache. +- `APACHE_PORT`: The port on which Apache is running. +- `APACHE_LOG_DIR`: The directory where Apache logs are stored. + +### NGINX/APACHE +This section refers to the proxy server configuration, which can be either NGINX or Apache. The proxy server is used to route requests to the correct CKAN application. + +- `PROXY_SERVER_NAME`: The server name for the proxy. +- `PROXY_SERVER_PROTOCOL`: The protocol for the proxy server. +- `PROXY_SERVER_URL`: The URL of the proxy server. +- `PROXY_CKAN_LOCATION`: The location of the CKAN proxy. +- `PROXY_PYCSW_LOCATION`: The location of the PYCSW proxy. + +### pycsw +pycsw is a catalogue server for spatial metadata. CKAN uses it to expose spatial and geospatial metadata using web standards by using [`ckan-pycsw`](https://github.com/mjanez/ckan-pycsw). + +- `PYCSW_PORT`: The port on which PYCSW is running. +- `CKAN_URL`: The URL of the CKAN instance. +- `PYCSW_URL`: The URL of the PYCSW instance. +- `PYCSW_CKAN_SCHEMA`: The schema used by PYCSW for CKAN. +- `PYCSW_OUPUT_SCHEMA`: The output schema used by PYCSW. +- `PYCSW_CRON_DAYS_INTERVAL`: The number of days between each scheduler job for PYCSW. +- `PYCSW_CRON_HOUR_START`: The hour of the day when the scheduler job for PYCSW starts. +- `TZ`: The timezone. + +### CKAN databases +This section refers to the databases used by CKAN, which are typically PostgreSQL for the main# Environment variables +## Overview +This file is a template for environment variables needed by the application. It's not used by the application directly, but serves as a guide for creating a `.env` file, which is used. Here's a breakdown of the variables: + +### Base +Basic configurations such as the location of the application. + +- `APP_DIR`: The directory where the application is located. + +### Host Ports +Ports on which various services are running. + +- `CKAN_PORT_HOST`: The port on which CKAN is running. - `PYCSW_PORT_HOST`: The port on which PYCSW is running. +- `PROXY_SERVER_HTTP_PORT_HOST`: The HTTP port for the proxy server. +- `PROXY_SERVER_HTTPS_PORT_HOST`: The HTTPS port for the proxy server. +- `NGINX_PORT_HOST`: The port on which NGINX is running. +- `NGINX_SSLPORT_HOST`: The port on which NGINX is running with SSL. +- `APACHE_PORT_HOST`: The port on which Apache is running. ### Solr Solr is a highly reliable, scalable, and fault-tolerant full-text search engine. CKAN uses it for indexing and searching data. - `SOLR_IMAGE_VERSION`: The version of the Solr image. - `SOLR_PORT`: The port on which Solr is running. +- `SOLR_CKAN_DATABASE`: The CKAN database for Solr. - `CKAN_SOLR_URL`: The URL of the Solr instance used by CKAN. - `TEST_CKAN_SOLR_URL`: The URL of the Solr instance used by CKAN for testing. @@ -28,6 +105,8 @@ Solr is a highly reliable, scalable, and fault-tolerant full-text search engine. Redis is an in-memory data structure store, used as a database, cache, and message broker. CKAN uses it for tasks such as session management and job queueing. - `REDIS_VERSION`: The version of Redis. +- `REDIS_PORT`: The port on which Redis is running. +- `REDIS_CKAN_DATABASE`: The CKAN database for Redis. - `CKAN_REDIS_URL`: The URL of the Redis instance used by CKAN. - `TEST_CKAN_REDIS_URL`: The URL of the Redis instance used by CKAN for testing. @@ -49,11 +128,13 @@ Apache is an open-source web server. It can be used by CKAN to serve its web app This section refers to the proxy server configuration, which can be either NGINX or Apache. The proxy server is used to route requests to the correct CKAN application. - `PROXY_SERVER_NAME`: The server name for the proxy. +- `PROXY_SERVER_PROTOCOL`: The protocol for the proxy server. +- `PROXY_SERVER_URL`: The URL of the proxy server. - `PROXY_CKAN_LOCATION`: The location of the CKAN proxy. - `PROXY_PYCSW_LOCATION`: The location of the PYCSW proxy. ### pycsw -pycsw is a catalogue server for spatial metadata. CKAN uses it to expose spatial and geospatial metadata using web standards by using [`ckan-pycsw](https://github.com/mjanez/ckan-pycsw)`. +pycsw is a catalogue server for spatial metadata. CKAN uses it to expose spatial and geospatial metadata using web standards by using [`ckan-pycsw`](https://github.com/mjanez/ckan-pycsw). - `PYCSW_PORT`: The port on which PYCSW is running. - `CKAN_URL`: The URL of the CKAN instance. @@ -68,9 +149,9 @@ pycsw is a catalogue server for spatial metadata. CKAN uses it to expose spatial This section refers to the databases used by CKAN, which are typically PostgreSQL for the main database and DataStore. - `POSTGRES_USER`: The username for the Postgres database. -- `POSTGRES_PASSWORD`: The password for the Postgres database. +- `POSTGRES_PASSWORD` The password for the Postgres database. - `POSTGRES_DB`: The name of the Postgres database. -- `POSTGRES_HOST`: The host of the Postgres database. +- [`POSTGRES_HOST`: The host of the Postgres database. - `CKAN_DB_USER`: The username for the CKAN database. - `CKAN_DB_PASSWORD`: The password for the CKAN database. - `CKAN_DB`: The name of the CKAN database. @@ -84,6 +165,8 @@ This section refers to the databases used by CKAN, which are typically PostgreSQ ### Test database connections This section refers to the test databases used by CKAN during integration and unit testing. +- `CKAN_TEST_DB`: The name of the CKAN test database. +- `DATASTORE_TEST_DB`: The name of the Datastore test database. - `TEST_CKAN_SQLALCHEMY_URL`: The SQLAlchemy URL for the CKAN test database. - `TEST_CKAN_DATASTORE_WRITE_URL`: The SQLAlchemy URL for writing to the Datastore test database. - `TEST_CKAN_DATASTORE_READ_URL`: The SQLAlchemy URL for reading from the Datastore test database. @@ -103,6 +186,11 @@ This section contains configurations related to the core CKAN application. It in - `CKAN__ROOT_PATH`: The root path for CKAN. - `CKAN__FAVICON`: The path to the favicon for CKAN. - `CKAN__SITE_LOGO`: The path to the logo for CKAN. +- `CKAN__SITE_TITLE`: The title of the CKAN site. +- `CKAN__SITE_DESCRIPTION`: The description of the CKAN site. +- `CKAN__SITE_INTRO_TEXT`: The intro text for the CKAN site. +- `CKAN__SITE_ABOUT`: The about text for the CKAN site. +- `LICENSES_GROUP_URL`: The URL for custom licenses. - `CKAN___BEAKER__SESSION__SECRET`: The secret for the Beaker session. - `CKAN___API_TOKEN__JWT__ENCODE__SECRET`: The secret for encoding JWT API tokens. - `CKAN___API_TOKEN__JWT__DECODE__SECRET`: The secret for decoding JWT API tokens. @@ -111,6 +199,7 @@ This section contains configurations related to the core CKAN application. It in - `CKAN_SYSADMIN_EMAIL`: The email for the CKAN sysadmin. - `CKAN_STORAGE_PATH`: The path where CKAN data is stored. - `CKAN_LOGS_PATH`: The path where CKAN logs are stored. +- `CKAN__SMTP_ENABLED`: Whether SMTP is enabled. - `CKAN_SMTP_SERVER`: The SMTP server for CKAN. - `CKAN_SMTP_STARTTLS`: Whether to use STARTTLS for the SMTP server. - `CKAN_SMTP_USER`: The username for the SMTP server. @@ -123,6 +212,10 @@ This section contains configurations related to the core CKAN application. It in - `CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS`: The query parsers allowed by Solr. - `CKAN__CORS__ORIGIN_ALLOW_ALL`: Whether to allow all origins for CORS. - `CKAN__CORS__ORIGIN_WHITELIST`: The whitelist of origins for CORS. +- `CKAN__AUTH__ALLOW_DATASET_COLLABORATORS`: Whether to allow dataset collaborators. +- `CKAN__AUTH__ALLOW_ADMIN_COLLABORATORS`: Whether to allow admin collaborators. +- `SEARCH__FACETS__DEFAULT`: The default number of facets shown in search results. +- `CKAN__DATASTORE__SQLSEARCH__ENABLED`: Whether the DataStore SQL search backend is enabled. ### Resource Proxy settings This section refers to the configuration of CKAN's resource proxy, which is used to fetch and display resources from external sites. @@ -180,7 +273,7 @@ This is a CKAN extension that allows users to visualize geospatial resources dir - `CKANEXT__GEOVIEW__GEOJSON__MAX_FILE_SIZE`: The maximum file size for GeoJSON in the GeoView extension. - `CKANEXT__GEOVIEW__OL_VIEWER__FORMATS`: The formats for the OpenLayers viewer in the GeoView extension. - `CKANEXT__GEOVIEW__SHP_VIEWER__SRID`: The SRID for the Shapefile viewer in the GeoView extension. -- `CKANEXT__GEO +- `CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING`: The encoding for the Shapefile viewer in the GeoView extension. ### ckanext-schemingdcat This extension provides a way to configure and customize CKAN's dataset, resource, organization and group schemas. @@ -193,6 +286,14 @@ This extension provides a way to configure and customize CKAN's dataset, resourc - `CKANEXT__SCHEMINGDCAT_FACET_LIST`: This is a list of facets for the dataset. - `CKANEXT__SCHEMINGDCAT_ORGANIZATION_CUSTOM_FACETS`: This is a boolean value to enable or disable custom facets for organizations. - `CKANEXT__SCHEMINGDCAT_GROUP_CUSTOM_FACETS`: This is a boolean value to enable or disable custom facets for groups. +- `CKANEXT__SCHEMINGDCAT_DEFAULT_PACKAGE_ITEM_ICON`: The default icon for package items. +- `CKANEXT__SCHEMINGDCAT_DEFAULT_PACKAGE_ITEM_SHOW_SPATIAL`: Whether to show spatial information for package items. +- `CKANEXT__SCHEMINGDCAT_SHOW_METADATA_TEMPLATES_TOOLBAR`: Whether to show the metadata templates toolbar. +- `CKANEXT__METADATA_TEMPLATES_SEARCH_IDENTIFIER`: The search identifier for metadata templates. +- `CKANEXT__SCHEMINGDCAT_ENDPOINTS_YAML`: The path to the endpoints YAML file. +- `CKANEXT__SCHEMINGDCAT__SOCIAL_GITHUB`: The GitHub URL for the schemingdcat extension. +- `CKANEXT__SCHEMINGDCAT__SOCIAL_X`: The X (formerly Twitter) URL for the schemingdcat extension. +- `CKANEXT__SCHEMINGDCAT__SOCIAL_LINKEDIN`: The LinkedIn URL for the schemingdcat extension. ### ckanext-pages This extension provides a way to add simple internal pages. @@ -204,8 +305,25 @@ This extension provides a way to add simple internal pages. - `CKANEXT__PAGES__GROUP_MENU`: This is a boolean value to enable or disable the group menu. - `CKANEXT__PAGES__ORGANIZATION_MENU`: This is a boolean value to enable or disable the organization menu. -### ckanext-sparql_interface (Work in Progress) -This extension provides a way to interact with a SPARQL endpoint. - -- `CKANEXT__SPARQL__ENDPOINT_URL`: This is the URL of the SPARQL endpoint. -- `CKANEXT__SPARQL__HIDE_ENDPOINT_URL`: This is a boolean value to enable or disable the visibility of the SPARQL endpoint URL. \ No newline at end of file +### ckan-pycsw +This extension provides a way to interact with a CSW endpoint. + +- `CSW_IDENTIFICATION_TITLE`: The title for the CSW identification. +- `CSW_IDENTIFICATION_ABSTRACT`: The abstract for the CSW identification. +- `CSW_PROVIDER_NAME`: The name of the CSW provider. +- `CSW_PROVIDER_URL`: The URL of the CSW provider. +- `CSW_CONTACT_NAME`: The contact name for the CSW provider. +- `CSW_CONTACT_POSITION`: The contact position for the CSW provider. +- `CSW_CONTACT_ADDRESS`: The contact address for the CSW provider. +- `CSW_CONTACT_CITY`: The contact city for the CSW provider. +- `CSW_CONTACT_STATE_OR_PROVINCE`: The contact state or province for the CSW provider. +- `CSW_CONTACT_POSTAL_CODE`: The contact postal code for the CSW provider. +- `CSW_CONTACT_COUNTRY`: The contact country for the CSW provider. +- `CSW_CONTACT_EMAIL`: The contact email for the CSW provider. +- `CSW_CONTACT_URL`: The contact URL for the CSW provider. +- `CSW_INSPIRE_DATE`: The date of the last update of the metadata. +- `CSW_INSPIRE_GEMET_KEYWORDS`: The keywords for the CSW INSPIRE. +- `CSW_INSPIRE_CONFORMITY`: The level of INSPIRE conformance for spatial data sets and services. +- `CSW_INSPIRE_CONTACT_NAME`: The contact name for the CSW INSPIRE. +- `CSW_INSPIRE_CONTACT_EMAIL`: The contact email for the CSW INSPIRE. +- `CSW_INSPIRE_TEMP_EXTENT`: The temporal extent of the service. \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 1e6bf87f3..f7bcba6b4 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -9,19 +9,25 @@ volumes: services: - apache: + nginx: build: - context: apache/ + context: nginx/ dockerfile: Dockerfile env_file: - .env environment: - CKAN_COMPOSE_SERVICE=${CKAN_DEV_COMPOSE_SERVICE} - PROXY_CKAN_PROXY_PASS=http://${CKAN_DEV_COMPOSE_SERVICE}:5000 + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" depends_on: - ${CKAN_DEV_COMPOSE_SERVICE} ports: - - "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}" + - "0.0.0.0:${NGINX_PORT_HOST}:${NGINX_PORT}" + - "0.0.0.0:${NGINX_SSLPORT_HOST}:${NGINX_SSLPORT}" restart: on-failure:3 ckan-dev: @@ -60,6 +66,8 @@ services: dockerfile: Dockerfile env_file: - .env + environment: + - SSL_UNVERIFIED_MODE=True logging: driver: "json-file" options: diff --git a/samples/.env.codespaces b/samples/.env.codespaces index 116a3877c..dbf58ffff 100644 --- a/samples/.env.codespaces +++ b/samples/.env.codespaces @@ -1,23 +1,37 @@ +### CODESPACES ENVIRONMENT EXAMPLE ### # Base APP_DIR=/srv/app # Sets Docker Compose project name to avoid resource conflicts between projects. Defaults to the folder name "ckan-docker" if not set. #COMPOSE_PROJECT_NAME=ckan-docker-mytheme +# Dev settings +USE_HTTPS_FOR_DEV=False +CKAN_DEV_COMPOSE_SERVICE=ckan-dev +## ckan-pycsw unverified mode (True/False). SSL certificate from host will download if SSL_UNVERIFIED_MODE=True, to avoid SSL error when certificate was self-signed. +SSL_UNVERIFIED_MODE=False # Github Codespaces avoid errors with the CSRF token. WTF_CSRF_ENABLED=False # Host Ports CKAN_PORT_HOST=5000 +PYCSW_PORT_HOST=8000 # Common proxy server for Apache or NGINX. -# Change all the PROXY_SERVER_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) -PROXY_SERVER_BASE_PORT_HOST=81 +# Change all the PROXY_SERVER_URL_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) +PROXY_SERVER_HTTP_PORT_HOST=81 PROXY_SERVER_HTTPS_PORT_HOST=8443 -# Server port for the proxy server. Better using the SSL port for production, in DEV or if using balancer: PROXY_SERVER_PORT_HOST=PROXY_SERVER_BASE_PORT_HOST -PROXY_SERVER_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -NGINX_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} +# Ports for NGINX (matches HTTP/HTTPS ports) +NGINX_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} NGINX_SSLPORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -APACHE_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} -PYCSW_PORT_HOST=8000 +# Port for Apache +APACHE_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} + +# Server port for the proxy server and CKAN urls. Better using the SSL port. +# (If needed for Development Mode) uncomment the following line: +# PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} +# (If needed for Development Mode) And comment the following line: +PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} +# URL protocol. Change to http if you dont use SSL +PROXY_SERVER_PROTOCOL=https # Solr SOLR_IMAGE_VERSION=2.9-solr9-spatial @@ -44,11 +58,9 @@ APACHE_PORT=80 APACHE_LOG_DIR=/var/log/apache #NGINX/APACHE -## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_PORT_HOST (e.g. is 81), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_PORT_HOST} +## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_URL_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_URL_PORT_HOST} PROXY_SERVER_NAME=localhost -# URL protocol. Change to https if you use SSL -PROXY_SERVER_PROTOCOL=https -PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME} +PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_URL_PORT_HOST} PROXY_CKAN_LOCATION=/catalog PROXY_PYCSW_LOCATION=/csw @@ -89,10 +101,6 @@ TEST_CKAN_SQLALCHEMY_URL=postgres://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGR TEST_CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} TEST_CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} -# Dev settings -USE_HTTPS_FOR_DEV=false -CKAN_DEV_COMPOSE_SERVICE=ckan-dev - # CKAN core ## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker CKAN_VERSION=2.10.5 @@ -101,11 +109,13 @@ CKAN_SITE_ID=default CKAN_SITE_URL=${PROXY_SERVER_URL} CKAN__ROOT_PATH=${PROXY_CKAN_LOCATION}/{{LANG}} CKAN__FAVICON=${PROXY_CKAN_LOCATION}/base/images/ckan.ico -CKAN__SITE_LOGO=/images/default/ckan-logo.png +CKAN__SITE_LOGO=${PROXY_CKAN_LOCATION}/images/default/ckan-logo.png # CKAN site info -CKAN__SITE_INTRO_TEXT="" -CKAN__SITE_DESCRIPTION="" -CKAN__SITE_ABOUT="" +CKAN__SITE_TITLE="CKAN Open Data" +CKAN__SITE_DESCRIPTION="ckan-docker *spatial Open Data portal" +# Using [#en#], [#es#], etc. to define the language of the text as needed. +CKAN__SITE_INTRO_TEXT="[#en#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) is a ready-to-use development environment for [CKAN](https://github.com/ckan/ckan), the world’s leading open-source data portal platform.[#es#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) es un entorno de desarrollo listo para usar para [CKAN](https://github.com/ckan/ckan), la plataforma de portales de datos de código abierto líder en el mundo." +CKAN__SITE_ABOUT=${CKAN__SITE_INTRO_TEXT} # Custom licenses that are aligned with DCAT-AP (Also works with DEV Mode) LICENSES_GROUP_URL=file://${APP_DIR}/src/ckanext-schemingdcat/ckanext/schemingdcat/public/static/licenses.json CKAN___BEAKER__SESSION__SECRET=CHANGE_ME @@ -117,6 +127,8 @@ CKAN_SYSADMIN_PASSWORD=test1234 CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log +# SMTP settings +CKAN__SMTP_ENABLED=False CKAN_SMTP_SERVER=smtp.corporateict.domain:25 CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user @@ -126,7 +138,7 @@ CKAN_SMTP_MAIL_FROM=ckan@${PROXY_SERVER_NAME} 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__TEXT_FORMATS="text plain text/plain text/turtle rss txt" CKAN__PREVIEW__LOADABLE="html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json arcgis_rest" # ckanext-spatial: Allow Solr local params: https://github.com/ckan/ckanext-spatial/issues/328 CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS=field @@ -148,7 +160,7 @@ CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 ## Default timeout for fetching proxied items CKAN__RESOURCE_PROXY__TIMEOUT=10 -CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view text_view datatables_view wmts_view geojson_view geo_view shp_view pdf_view" +CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view datatables_view text_view wmts_view geojson_view geo_view shp_view pdf_view" # Localization CKAN__LOCALE_DEFAULT="en" @@ -156,7 +168,7 @@ CKAN__LOCALE_ORDER="en es pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru CKAN__LOCALES_OFFERED="en es 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="stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" +CKAN__PLUGINS="activity stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" # ckanext-harvest CKAN__HARVEST__MQ__TYPE=redis @@ -193,7 +205,7 @@ CKANEXT__GEOVIEW__SHP_VIEWER__ENCODING=UTF-8 ## CSW Endpoint for spatial metadata CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI=${PYCSW_URL} ## Scheming: setup_scheming.sh -CKANEXT__SCHEMINGDCAT_DATASET_SCHEMA="ckanext.schemingdcat:schemas/geodcat_ap/eu_geodcat_ap_full.yaml ckanext.schemingdcat:schemas/resources/dcat_document.yaml" +CKANEXT__SCHEMINGDCAT_DATASET_SCHEMA="ckanext.schemingdcat:schemas/geodcat_ap/eu_geodcat_ap_full.yaml" CKANEXT__SCHEMINGDCAT_GROUP_SCHEMAS="ckanext.schemingdcat:schemas/geodcat_ap/eu_geodcat_ap_group.json" CKANEXT__SCHEMINGDCAT_ORGANIZATION_SCHEMAS="ckanext.schemingdcat:schemas/geodcat_ap/eu_geodcat_ap_org.json" CKANEXT__SCHEMINGDCAT_PRESETS="ckanext.schemingdcat:schemas/default_presets.json ckanext.fluent:presets.json" @@ -206,6 +218,9 @@ CKANEXT__SCHEMINGDCAT_DEFAULT_PACKAGE_ITEM_SHOW_SPATIAL=True CKANEXT__SCHEMINGDCAT_SHOW_METADATA_TEMPLATES_TOOLBAR=False CKANEXT__METADATA_TEMPLATES_SEARCH_IDENTIFIER="schemingdcat_xls-template" CKANEXT__SCHEMINGDCAT_ENDPOINTS_YAML="endpoints.yaml" +CKANEXT__SCHEMINGDCAT__SOCIAL_GITHUB="https://github.com/mjanez/ckanext-schemingdcat" +CKANEXT__SCHEMINGDCAT__SOCIAL_X="https://x.com/ckanproject" +CKANEXT__SCHEMINGDCAT__SOCIAL_LINKEDIN="https://www.linkedin.com/company/ckanproject" # ckanext-pages CKANEXT__PAGES__ALOW_HTML=False @@ -213,4 +228,29 @@ CKANEXT__PAGES__ORGANIZATION=True CKANEXT__PAGES__GROUP=True CKANEXT__PAGES__ABOUT_MENU=False CKANEXT__PAGES__GROUP_MENU=True -CKANEXT__PAGES__ORGANIZATION_MENU=True \ No newline at end of file +CKANEXT__PAGES__ORGANIZATION_MENU=True + +# ckan-pycsw +CSW_IDENTIFICATION_TITLE="Sample Geospatial Catalogue" +CSW_IDENTIFICATION_ABSTRACT="OGC CSW server powered by pycsw" +CSW_PROVIDER_NAME="ckan-docker development team" +CSW_PROVIDER_URL="https://github.com/mjanez/ckan-docker" +CSW_CONTACT_NAME="ckan-docker development team" +CSW_CONTACT_POSITION="Site Administrator" +CSW_CONTACT_ADDRESS="ckan-docker development team" +CSW_CONTACT_CITY="Madrid" +CSW_CONTACT_STATE_OR_PROVINCE="Madrid" +CSW_CONTACT_POSTAL_CODE="28001" +CSW_CONTACT_COUNTRY="Spain" +CSW_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +CSW_CONTACT_URL=${CKAN_URL} +## Date of the last update of the metadata. ISO 8601 format): YYYY-MM-DD +CSW_INSPIRE_DATE="2024-01-01" +## Keywords separated by commas based on the GEMET Thesaurus keywordValue: https://inspire.ec.europa.eu/schemas/common/1.0/enums/enum_eng.xsd +CSW_INSPIRE_GEMET_KEYWORDS="Utility and governmental services" +# The level of INSPIRE conformance for spatial data sets and services (conformant, notConformant, notEvaluated) +CSW_INSPIRE_CONFORMITY="notEvaluated" +CSW_INSPIRE_CONTACT_NAME=${CSW_CONTACT_NAME} +CSW_INSPIRE_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +# Temporal extent of the service (in ISO 8601 format). Either a single date (i.e. YYYY-MM-DD), or an extent (i.e. YYYY-MM-DD/YYYY-MM-DD) +CSW_INSPIRE_TEMP_EXTENT="2024-01-01" diff --git a/samples/.env.localhost b/samples/.env.dev.example similarity index 65% rename from samples/.env.localhost rename to samples/.env.dev.example index 8120d9f22..a0abd13fc 100644 --- a/samples/.env.localhost +++ b/samples/.env.dev.example @@ -1,20 +1,35 @@ +### DEV ENVIRONMENT EXAMPLE ### # Base APP_DIR=/srv/app # Sets Docker Compose project name to avoid resource conflicts between projects. Defaults to the folder name "ckan-docker" if not set. #COMPOSE_PROJECT_NAME=ckan-docker-mytheme +# Dev settings +USE_HTTPS_FOR_DEV=True +CKAN_DEV_COMPOSE_SERVICE=ckan-dev +## ckan-pycsw unverified mode (True/False). SSL certificate from host will download if SSL_UNVERIFIED_MODE=True, to avoid SSL error when certificate was self-signed. +SSL_UNVERIFIED_MODE=True + # Host Ports CKAN_PORT_HOST=5000 +PYCSW_PORT_HOST=8000 # Common proxy server for Apache or NGINX. -# Change all the PROXY_SERVER_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) -PROXY_SERVER_BASE_PORT_HOST=81 +# Change all the PROXY_SERVER_URL_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) +PROXY_SERVER_HTTP_PORT_HOST=81 PROXY_SERVER_HTTPS_PORT_HOST=8443 -# Server port for the proxy server. Better using the SSL port for production, in DEV or if using balancer: PROXY_SERVER_PORT_HOST=PROXY_SERVER_BASE_PORT_HOST -PROXY_SERVER_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -NGINX_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} +# Ports for NGINX (matches HTTP/HTTPS ports) +NGINX_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} NGINX_SSLPORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -APACHE_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} -PYCSW_PORT_HOST=8000 +# Port for Apache +APACHE_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} + +# Server port for the proxy server and CKAN urls. Better using the SSL port. +# (If needed for Development Mode) uncomment the following line: +# PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} +# (If needed for Development Mode) And comment the following line: +PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} +# URL protocol. Change to http if you dont use SSL +PROXY_SERVER_PROTOCOL=https # Solr SOLR_IMAGE_VERSION=2.9-solr9-spatial @@ -41,11 +56,9 @@ APACHE_PORT=80 APACHE_LOG_DIR=/var/log/apache #NGINX/APACHE -## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_PORT_HOST} +## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_URL_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_URL_PORT_HOST} PROXY_SERVER_NAME=localhost -# URL protocol. Change to https if you use SSL -PROXY_SERVER_PROTOCOL=http -PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_PORT_HOST} +PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_URL_PORT_HOST} PROXY_CKAN_LOCATION=/catalog PROXY_PYCSW_LOCATION=/csw @@ -86,10 +99,6 @@ TEST_CKAN_SQLALCHEMY_URL=postgres://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGR TEST_CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} TEST_CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} -# Dev settings -USE_HTTPS_FOR_DEV=false -CKAN_DEV_COMPOSE_SERVICE=ckan-dev - # CKAN core ## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker CKAN_VERSION=2.10.5 @@ -98,11 +107,13 @@ CKAN_SITE_ID=default CKAN_SITE_URL=${PROXY_SERVER_URL} CKAN__ROOT_PATH=${PROXY_CKAN_LOCATION}/{{LANG}} CKAN__FAVICON=${PROXY_CKAN_LOCATION}/base/images/ckan.ico -CKAN__SITE_LOGO=/images/default/ckan-logo.png +CKAN__SITE_LOGO=${PROXY_CKAN_LOCATION}/images/default/ckan-logo.png # CKAN site info -CKAN__SITE_INTRO_TEXT="" -CKAN__SITE_DESCRIPTION="" -CKAN__SITE_ABOUT="" +CKAN__SITE_TITLE="CKAN Open Data" +CKAN__SITE_DESCRIPTION="ckan-docker *spatial Open Data portal" +# Using [#en#], [#es#], etc. to define the language of the text as needed. +CKAN__SITE_INTRO_TEXT="[#en#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) is a ready-to-use development environment for [CKAN](https://github.com/ckan/ckan), the world’s leading open-source data portal platform.[#es#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) es un entorno de desarrollo listo para usar para [CKAN](https://github.com/ckan/ckan), la plataforma de portales de datos de código abierto líder en el mundo." +CKAN__SITE_ABOUT=${CKAN__SITE_INTRO_TEXT} # Custom licenses that are aligned with DCAT-AP (Also works with DEV Mode) LICENSES_GROUP_URL=file://${APP_DIR}/src/ckanext-schemingdcat/ckanext/schemingdcat/public/static/licenses.json CKAN___BEAKER__SESSION__SECRET=CHANGE_ME @@ -114,6 +125,8 @@ CKAN_SYSADMIN_PASSWORD=test1234 CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log +# SMTP settings +CKAN__SMTP_ENABLED=False CKAN_SMTP_SERVER=smtp.corporateict.domain:25 CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user @@ -123,7 +136,7 @@ CKAN_SMTP_MAIL_FROM=ckan@${PROXY_SERVER_NAME} 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__TEXT_FORMATS="text plain text/plain text/turtle rss txt" CKAN__PREVIEW__LOADABLE="html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json arcgis_rest" # ckanext-spatial: Allow Solr local params: https://github.com/ckan/ckanext-spatial/issues/328 CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS=field @@ -145,7 +158,7 @@ CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 ## Default timeout for fetching proxied items CKAN__RESOURCE_PROXY__TIMEOUT=10 -CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view text_view datatables_view wmts_view geojson_view geo_view shp_view pdf_view" +CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view datatables_view text_view wmts_view geojson_view geo_view shp_view pdf_view" # Localization CKAN__LOCALE_DEFAULT="en" @@ -153,7 +166,7 @@ CKAN__LOCALE_ORDER="en es pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru CKAN__LOCALES_OFFERED="en es 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="stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" +CKAN__PLUGINS="activity stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" # ckanext-harvest CKAN__HARVEST__MQ__TYPE=redis @@ -168,8 +181,8 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@ # ckanext-dcat CKANEXT__DCAT__BASE_URI=${CKAN_URL} -# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat -CKANEXT__DCAT__RDF_PROFILES='euro_dcat_ap_2' +# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=eu_dcat_ap_2,es_dcat +CKANEXT__DCAT__RDF_PROFILES='eu_dcat_ap_2 eu_dcat_ap_scheming' # The custom endpoint **must** start with a forward slash (`/`) and contain the `{_format}` placeholder. The endpoint is added to the CKAN_SITE_URL and CKAN__ROOT_PATH, example: http://localhost:5000/catalog/catalog.rdf CKANEXT__DCAT__DEFAULT_CATALOG_ENDPOINT='/catalog.{_format}' @@ -203,6 +216,9 @@ CKANEXT__SCHEMINGDCAT_DEFAULT_PACKAGE_ITEM_SHOW_SPATIAL=True CKANEXT__SCHEMINGDCAT_SHOW_METADATA_TEMPLATES_TOOLBAR=False CKANEXT__METADATA_TEMPLATES_SEARCH_IDENTIFIER="schemingdcat_xls-template" CKANEXT__SCHEMINGDCAT_ENDPOINTS_YAML="endpoints.yaml" +CKANEXT__SCHEMINGDCAT__SOCIAL_GITHUB="https://github.com/mjanez/ckanext-schemingdcat" +CKANEXT__SCHEMINGDCAT__SOCIAL_X="https://x.com/ckanproject" +CKANEXT__SCHEMINGDCAT__SOCIAL_LINKEDIN="https://www.linkedin.com/company/ckanproject" # ckanext-pages CKANEXT__PAGES__ALOW_HTML=False @@ -210,4 +226,29 @@ CKANEXT__PAGES__ORGANIZATION=True CKANEXT__PAGES__GROUP=True CKANEXT__PAGES__ABOUT_MENU=False CKANEXT__PAGES__GROUP_MENU=True -CKANEXT__PAGES__ORGANIZATION_MENU=True \ No newline at end of file +CKANEXT__PAGES__ORGANIZATION_MENU=True + +# ckan-pycsw +CSW_IDENTIFICATION_TITLE="Sample Geospatial Catalogue" +CSW_IDENTIFICATION_ABSTRACT="OGC CSW server powered by pycsw" +CSW_PROVIDER_NAME="ckan-docker development team" +CSW_PROVIDER_URL="https://github.com/mjanez/ckan-docker" +CSW_CONTACT_NAME="ckan-docker development team" +CSW_CONTACT_POSITION="Site Administrator" +CSW_CONTACT_ADDRESS="ckan-docker development team" +CSW_CONTACT_CITY="Madrid" +CSW_CONTACT_STATE_OR_PROVINCE="Madrid" +CSW_CONTACT_POSTAL_CODE="28001" +CSW_CONTACT_COUNTRY="Spain" +CSW_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +CSW_CONTACT_URL=${CKAN_URL} +## Date of the last update of the metadata. ISO 8601 format): YYYY-MM-DD +CSW_INSPIRE_DATE="2024-01-01" +## Keywords separated by commas based on the GEMET Thesaurus keywordValue: https://inspire.ec.europa.eu/schemas/common/1.0/enums/enum_eng.xsd +CSW_INSPIRE_GEMET_KEYWORDS="Utility and governmental services" +# The level of INSPIRE conformance for spatial data sets and services (conformant, notConformant, notEvaluated) +CSW_INSPIRE_CONFORMITY="notEvaluated" +CSW_INSPIRE_CONTACT_NAME=${CSW_CONTACT_NAME} +CSW_INSPIRE_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +# Temporal extent of the service (in ISO 8601 format). Either a single date (i.e. YYYY-MM-DD), or an extent (i.e. YYYY-MM-DD/YYYY-MM-DD) +CSW_INSPIRE_TEMP_EXTENT="2024-01-01" diff --git a/samples/.env.es.example b/samples/.env.es.example index c0d7da114..991dd9b40 100644 --- a/samples/.env.es.example +++ b/samples/.env.es.example @@ -1,20 +1,35 @@ +### PRO (ES) ENVIRONMENT EXAMPLE ### # Base APP_DIR=/srv/app # Sets Docker Compose project name to avoid resource conflicts between projects. Defaults to the folder name "ckan-docker" if not set. #COMPOSE_PROJECT_NAME=ckan-docker-mytheme +# Dev settings +USE_HTTPS_FOR_DEV=False +CKAN_DEV_COMPOSE_SERVICE=ckan-dev +## ckan-pycsw unverified mode (True/False). SSL certificate from host will download if SSL_UNVERIFIED_MODE=True, to avoid SSL error when certificate was self-signed. +SSL_UNVERIFIED_MODE=False + # Host Ports CKAN_PORT_HOST=5000 +PYCSW_PORT_HOST=8000 # Common proxy server for Apache or NGINX. -# Change all the PROXY_SERVER_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) -PROXY_SERVER_BASE_PORT_HOST=81 +# Change all the PROXY_SERVER_URL_PORT_HOST to PROXY_SERVER_HTTPS_PORT_HOST if you can use HTTPS instead of HTTP (Only for NGINX and not development compose) +PROXY_SERVER_HTTP_PORT_HOST=81 PROXY_SERVER_HTTPS_PORT_HOST=8443 -# Server port for the proxy server. Better using the SSL port for production, in DEV or if using balancer: PROXY_SERVER_PORT_HOST=PROXY_SERVER_BASE_PORT_HOST -PROXY_SERVER_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -NGINX_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} +# Ports for NGINX (matches HTTP/HTTPS ports) +NGINX_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} NGINX_SSLPORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} -APACHE_PORT_HOST=${PROXY_SERVER_BASE_PORT_HOST} -PYCSW_PORT_HOST=8000 +# Port for Apache +APACHE_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} + +# Server port for the proxy server and CKAN urls. Better using the SSL port. +# (If needed for Development Mode) uncomment the following line: +# PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTP_PORT_HOST} +# (If needed for Development Mode) And comment the following line: +PROXY_SERVER_URL_PORT_HOST=${PROXY_SERVER_HTTPS_PORT_HOST} +# URL protocol. Change to http if you dont use SSL +PROXY_SERVER_PROTOCOL=https # Solr SOLR_IMAGE_VERSION=2.9-solr9-spatial @@ -41,11 +56,9 @@ APACHE_PORT=80 APACHE_LOG_DIR=/var/log/apache #NGINX/APACHE -## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_PORT_HOST} +## Check CKAN__ROOT_PATH and CKANEXT__DCAT__BASE_URI and CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI. If you don't need to use domain locations, it is better to use the nginx configuration. Leave blank or use the root `/`. If you dont need PROXY_SERVER_URL_PORT_HOST (e.g. is 80), edit the PROXY_SERVER_URL and remove :${PROXY_SERVER_URL_PORT_HOST} PROXY_SERVER_NAME=localhost -# URL protocol. Change to https if you use SSL -PROXY_SERVER_PROTOCOL=http -PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_PORT_HOST} +PROXY_SERVER_URL=${PROXY_SERVER_PROTOCOL}://${PROXY_SERVER_NAME}:${PROXY_SERVER_URL_PORT_HOST} PROXY_CKAN_LOCATION=/catalog PROXY_PYCSW_LOCATION=/csw @@ -86,10 +99,6 @@ TEST_CKAN_SQLALCHEMY_URL=postgres://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGR TEST_CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} TEST_CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_TEST_DB} -# Dev settings -USE_HTTPS_FOR_DEV=false -CKAN_DEV_COMPOSE_SERVICE=ckan-dev - # CKAN core ## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker CKAN_VERSION=2.10.5 @@ -98,11 +107,13 @@ CKAN_SITE_ID=default CKAN_SITE_URL=${PROXY_SERVER_URL} CKAN__ROOT_PATH=${PROXY_CKAN_LOCATION}/{{LANG}} CKAN__FAVICON=${PROXY_CKAN_LOCATION}/base/images/ckan.ico -CKAN__SITE_LOGO=/images/default/ckan-logo.png +CKAN__SITE_LOGO=${PROXY_CKAN_LOCATION}/images/default/ckan-logo.png # CKAN site info -CKAN__SITE_INTRO_TEXT="" -CKAN__SITE_DESCRIPTION="" -CKAN__SITE_ABOUT="" +CKAN__SITE_TITLE="CKAN Open Data" +CKAN__SITE_DESCRIPTION="ckan-docker *spatial Open Data portal" +# Using [#en#], [#es#], etc. to define the language of the text as needed. +CKAN__SITE_INTRO_TEXT="[#en#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) is a ready-to-use development environment for [CKAN](https://github.com/ckan/ckan), the world’s leading open-source data portal platform.[#es#][![ckan-docker-spatial](https://img.shields.io/badge/ckan_docker_spatial-CKAN_${CKAN_VERSION}-brightgreen?style=social&logo=github#center)](https://github.com/mjanez/ckan-docker)\n[`ckan-docker *spatial`](https://github.com/mjanez/ckan-docker) es un entorno de desarrollo listo para usar para [CKAN](https://github.com/ckan/ckan), la plataforma de portales de datos de código abierto líder en el mundo." +CKAN__SITE_ABOUT=${CKAN__SITE_INTRO_TEXT} # Custom licenses that are aligned with DCAT-AP (Also works with DEV Mode) LICENSES_GROUP_URL=file://${APP_DIR}/src/ckanext-schemingdcat/ckanext/schemingdcat/public/static/licenses.json CKAN___BEAKER__SESSION__SECRET=CHANGE_ME @@ -114,6 +125,8 @@ CKAN_SYSADMIN_PASSWORD=test1234 CKAN_SYSADMIN_EMAIL=your_email@example.com CKAN_STORAGE_PATH=/var/lib/ckan CKAN_LOGS_PATH=/var/log +# SMTP settings +CKAN__SMTP_ENABLED=False CKAN_SMTP_SERVER=smtp.corporateict.domain:25 CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user @@ -123,7 +136,7 @@ CKAN_SMTP_MAIL_FROM=ckan@${PROXY_SERVER_NAME} 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__TEXT_FORMATS="text plain text/plain text/turtle rss txt" CKAN__PREVIEW__LOADABLE="html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json arcgis_rest" # ckanext-spatial: Allow Solr local params: https://github.com/ckan/ckanext-spatial/issues/328 CKAN__SEARCH__SOLR_ALLOWED_QUERY_PARSERS=field @@ -145,7 +158,7 @@ CKAN__RESOURCE_PROXY__MAX_FILE_SIZE=50048576 CKAN__RESOURCE_PROXY__CHUNK_SIZE=4096 ## Default timeout for fetching proxied items CKAN__RESOURCE_PROXY__TIMEOUT=10 -CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view text_view datatables_view wmts_view geojson_view geo_view shp_view pdf_view" +CKAN__VIEWS__DEFAULT_VIEWS="image_view video_view audio_view webpage_view datatables_view text_view wmts_view geojson_view geo_view shp_view pdf_view" # Localization CKAN__LOCALE_DEFAULT="es" @@ -153,7 +166,7 @@ CKAN__LOCALE_ORDER="es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru CKAN__LOCALES_OFFERED="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="stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" +CKAN__PLUGINS="activity stats image_view video_view audio_view webpage_view text_view datatables_view resourcedictionary datastore xloader 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 schemingdcat schemingdcat_datasets schemingdcat_groups schemingdcat_organizations schemingdcat_ckan_harvester schemingdcat_xls_harvester harvest pdf_view pages fluent envvars" # ckanext-harvest CKAN__HARVEST__MQ__TYPE=redis @@ -168,8 +181,8 @@ CKANEXT__XLOADER__JOBS__DB_URI=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@ # ckanext-dcat CKANEXT__DCAT__BASE_URI=${CKAN_URL} -# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=euro_dcat_ap,spain_dcat -CKANEXT__DCAT__RDF_PROFILES='euro_dcat_ap_2' +# Default profile(s). Instead of this envvar, it's possible to specify all the profile(s) availables to be used for serialization using the profiles parameter: http://localhost:5000/catalog.xml?profiles=eu_dcat_ap_2,es_dcat +CKANEXT__DCAT__RDF_PROFILES='eu_dcat_ap_2 eu_dcat_ap_scheming' # The custom endpoint **must** start with a forward slash (`/`) and contain the `{_format}` placeholder. The endpoint is added to the CKAN_SITE_URL and CKAN__ROOT_PATH, example: http://localhost:5000/catalog/catalog.rdf CKANEXT__DCAT__DEFAULT_CATALOG_ENDPOINT='/catalog.{_format}' @@ -203,6 +216,9 @@ CKANEXT__SCHEMINGDCAT_DEFAULT_PACKAGE_ITEM_SHOW_SPATIAL=True CKANEXT__SCHEMINGDCAT_SHOW_METADATA_TEMPLATES_TOOLBAR=False CKANEXT__METADATA_TEMPLATES_SEARCH_IDENTIFIER="schemingdcat_xls-template" CKANEXT__SCHEMINGDCAT_ENDPOINTS_YAML="endpoints.yaml" +CKANEXT__SCHEMINGDCAT__SOCIAL_GITHUB="https://github.com/mjanez/ckanext-schemingdcat" +CKANEXT__SCHEMINGDCAT__SOCIAL_X="https://x.com/ckanproject" +CKANEXT__SCHEMINGDCAT__SOCIAL_LINKEDIN="https://www.linkedin.com/company/ckanproject" # ckanext-pages CKANEXT__PAGES__ALOW_HTML=False @@ -210,4 +226,29 @@ CKANEXT__PAGES__ORGANIZATION=True CKANEXT__PAGES__GROUP=True CKANEXT__PAGES__ABOUT_MENU=False CKANEXT__PAGES__GROUP_MENU=True -CKANEXT__PAGES__ORGANIZATION_MENU=True \ No newline at end of file +CKANEXT__PAGES__ORGANIZATION_MENU=True + +# ckan-pycsw +CSW_IDENTIFICATION_TITLE="Sample Geospatial Catalogue" +CSW_IDENTIFICATION_ABSTRACT="OGC CSW server powered by pycsw" +CSW_PROVIDER_NAME="ckan-docker development team" +CSW_PROVIDER_URL="https://github.com/mjanez/ckan-docker" +CSW_CONTACT_NAME="ckan-docker development team" +CSW_CONTACT_POSITION="Site Administrator" +CSW_CONTACT_ADDRESS="ckan-docker development team" +CSW_CONTACT_CITY="Madrid" +CSW_CONTACT_STATE_OR_PROVINCE="Madrid" +CSW_CONTACT_POSTAL_CODE="28001" +CSW_CONTACT_COUNTRY="Spain" +CSW_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +CSW_CONTACT_URL=${CKAN_URL} +## Date of the last update of the metadata. ISO 8601 format): YYYY-MM-DD +CSW_INSPIRE_DATE="2024-01-01" +## Keywords separated by commas based on the GEMET Thesaurus keywordValue: https://inspire.ec.europa.eu/schemas/common/1.0/enums/enum_eng.xsd +CSW_INSPIRE_GEMET_KEYWORDS="Utility and governmental services" +# The level of INSPIRE conformance for spatial data sets and services (conformant, notConformant, notEvaluated) +CSW_INSPIRE_CONFORMITY="notEvaluated" +CSW_INSPIRE_CONTACT_NAME=${CSW_CONTACT_NAME} +CSW_INSPIRE_CONTACT_EMAIL=${CKAN_SYSADMIN_EMAIL} +# Temporal extent of the service (in ISO 8601 format). Either a single date (i.e. YYYY-MM-DD), or an extent (i.e. YYYY-MM-DD/YYYY-MM-DD) +CSW_INSPIRE_TEMP_EXTENT="2024-01-01" diff --git a/docker-compose.apache.yml b/samples/docker-compose/docker-compose.apache.yml similarity index 100% rename from docker-compose.apache.yml rename to samples/docker-compose/docker-compose.apache.yml diff --git a/samples/docker-compose/docker-compose.dev.apache.yml b/samples/docker-compose/docker-compose.dev.apache.yml new file mode 100644 index 000000000..1e6bf87f3 --- /dev/null +++ b/samples/docker-compose/docker-compose.dev.apache.yml @@ -0,0 +1,129 @@ +volumes: + ckan_storage: + ckan_logs: + pg_data: + solr_data: + pip_cache: + site_packages: + vscode_server: + + +services: + apache: + build: + context: apache/ + dockerfile: Dockerfile + env_file: + - .env + environment: + - CKAN_COMPOSE_SERVICE=${CKAN_DEV_COMPOSE_SERVICE} + - PROXY_CKAN_PROXY_PASS=http://${CKAN_DEV_COMPOSE_SERVICE}:5000 + depends_on: + - ${CKAN_DEV_COMPOSE_SERVICE} + ports: + - "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}" + restart: on-failure:3 + + ckan-dev: + build: + context: ckan/ + dockerfile: Dockerfile.dev + args: + - TZ=${TZ} + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + links: + - db + - solr + - redis + ports: + - "0.0.0.0:${CKAN_PORT_HOST}:5000" + volumes: + - ckan_storage:/var/lib/ckan + - ckan_logs:/var/log + - ./src:/srv/app/src_extensions + - pip_cache:/root/.cache/pip + - site_packages:/usr/lib/python3.9/site-packages + - vscode_server:/root/.vscode-server + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] + + pycsw: + build: + context: ckan-pycsw/ + dockerfile: Dockerfile + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + depends_on: + - ${CKAN_DEV_COMPOSE_SERVICE} + ports: + - "0.0.0.0:${PYCSW_PORT_HOST}:${PYCSW_PORT}" + volumes: + - ./log:${APP_DIR}/log + - ./metadata:${APP_DIR}/metadata + restart: on-failure:3 + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${PYCSW_PORT}"] + + db: + build: + context: postgresql/ + environment: + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB + - CKAN_DB_USER + - CKAN_DB_PASSWORD + - CKAN_DB + - DATASTORE_READONLY_USER + - DATASTORE_READONLY_PASSWORD + - DATASTORE_DB + volumes: + - pg_data:/var/lib/postgresql/data + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + restart: unless-stopped + healthcheck: + test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}"] + + solr: + build: + context: solr/ + dockerfile: Dockerfile.spatial + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + volumes: + - solr_data:/var/solr + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${SOLR_PORT}/solr/"] + + redis: + image: redis:${REDIS_VERSION} + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + restart: unless-stopped + healthcheck: + test: ["CMD", "redis-cli", "-e", "QUIT"] \ No newline at end of file diff --git a/docker-compose.ghcr.apache.yml b/samples/docker-compose/docker-compose.ghcr.apache.yml similarity index 100% rename from docker-compose.ghcr.apache.yml rename to samples/docker-compose/docker-compose.ghcr.apache.yml