From 0979cbb2b46f3c0a4e8cb5684812f57c1b9eddb9 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Sun, 19 May 2024 00:45:56 +0200 Subject: [PATCH 1/3] Restore docker-compose.ghcr.apache --- docker-compose.ghcr.apache.yml | 151 +++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 docker-compose.ghcr.apache.yml diff --git a/docker-compose.ghcr.apache.yml b/docker-compose.ghcr.apache.yml new file mode 100644 index 00000000..761d70f1 --- /dev/null +++ b/docker-compose.ghcr.apache.yml @@ -0,0 +1,151 @@ +volumes: + ckan_storage: + ckan_logs: + pg_data: + solr_data: + pip_cache: + site_packages: + + +services: + apache: + build: + context: apache/ + dockerfile: Dockerfile + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + networks: + - webnet + - ckannet + depends_on: + - ckan + ports: + - "0.0.0.0:${APACHE_PORT_HOST}:${APACHE_PORT}" + restart: on-failure:3 + + ckan: + build: + context: ckan/ + dockerfile: Dockerfile.ghcr + args: + - TZ=${TZ} + networks: + - ckannet + - dbnet + - solrnet + - redisnet + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + depends_on: + - db + - solr + - redis + volumes: + - ckan_storage:/var/lib/ckan + - ckan_logs:/var/log + - pip_cache:/root/.cache/pip + - site_packages:/usr/lib/python3.9/site-packages + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:${CKAN_PORT}"] + + pycsw: + build: + context: ckan-pycsw/ + dockerfile: Dockerfile + env_file: + - .env + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "10" + networks: + - webnet + - ckannet + depends_on: + - ckan + 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/ + networks: + - dbnet + 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 + networks: + - solrnet + 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" + networks: + - redisnet + restart: unless-stopped + healthcheck: + test: ["CMD", "redis-cli", "-e", "QUIT"] + +networks: + webnet: + ckannet: + solrnet: + internal: true + dbnet: + internal: true + redisnet: + internal: true From f19de7eb1a41dd210291c0d48b62b10eab200d16 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Sun, 19 May 2024 03:02:21 +0200 Subject: [PATCH 2/3] Add .env docs https://github.com/mjanez/ckan-docker/issues/42 --- README.md | 83 ++++++++++------- doc/info_envfile.md | 213 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 263 insertions(+), 33 deletions(-) create mode 100644 doc/info_envfile.md diff --git a/README.md b/README.md index 1cc8887e..923759d7 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,17 @@ ## 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. + +> [!TIP] +>* Use the **[deploy in 5 minutes](#quick-mode)** to see `ckan-docker` in **5 minutes ⏱**! +>* Or use [Codespaces](https://github.com/features/codespaces) to test `ckan-docker` in your browser: +>
GitHub Codespaces
+ > [!IMPORTANT] >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). ![CKAN Docker Platform](/doc/img/ckan-docker-services.png) - Available components: * CKAN custom multi-stage build with spatial capabilities from [ckan-docker-spatial](https://github.com/mjanez/ckan-docker-spatial)[^1], an image used as a base and built from the official CKAN repo. The following versions of CKAN are available: @@ -99,25 +104,24 @@ Information about extensions installed in the `main` image. More info described 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. +### Install docker-engine +Follow the [installation instructions](https://docs.docker.com/get-docker/) for your environment to install Docker Engine. To verify a successful Docker installation, run `docker run hello-world` and `docker version`. These commands should output versions for client and server. > [!NOTE] > Learn more about [Docker/Docker Compose](#docker-basic-commands) basic commands. -> ## 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. +### Clone and configure +Before starting the deployment, you'll need to set up a `.env` file. This file is crucial as it contains environment variables that the application needs to run properly. These variables include site urls, credentials, API keys, and other configuration details that should not be hard-coded into the application's source code for security reasons. 1. Clone project ```shell cd /path/to/my/project - git clone https://github.com/mjanez/ckan-docker.git + git clone https://github.com/mjanez/ckan-docker.git & cd ckan-docker ``` 2. Copy the `.env.example` template (or use another from [`/samples/`](/samples/)) and modify the resulting `.env` to suit your needs. @@ -126,19 +130,26 @@ Use this if you are a maintainer and will not be making code changes to CKAN or cp .env.example .env ``` - - **NGINX & CKAN/ckan-pycsw endpoints**: Modifiy 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.). + - **NGINX**: Host ports: (`NGINX_PORT_HOST` and `NGINX_SSLPORT_HOST`) + - **Apache HTTP Server**: Host ports: (`APACHE_PORT_HOST`) - - **Apache HTTP Server**: Replace the [`.env`](/.env) with the [`/samples/.env.apache.example`](/samples/.env.apache.example) and modify the variables as needed. + 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. > [!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` + > For more information about the `.env' file, see [.env docs](./doc/info_envfile.md) > [!WARNING] - > Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). All ennvars with `API_TOKEN` are automatically regenerated when CKAN is loaded, no editing is required. + > Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). All envvars with `API_TOKEN` are automatically regenerated when CKAN is loaded, no editing is required. > >**This should be obviously changed before running this setup as a public CKAN instance.** -3. Build the images: +You are now ready to proceed with deployment. + +### Base mode +Use this if you are a maintainer and will not be making code changes to CKAN or to CKAN extensions. + +1. Build the images: ```bash docker compose build ``` @@ -146,7 +157,7 @@ Use this if you are a maintainer and will not be making code changes to CKAN or > [!NOTE] > You can use a [deploy in 5 minutes](#quick-mode) if you just want to test the package. -4. Start the containers: +2. Start the containers: ```bash docker compose up ``` @@ -164,30 +175,30 @@ window for something else. > - [Backup the CKAN Database](#ckan-backups) > - [Configuring a docker compose service to start on boot](#docker-compose-configure-a-docker-compose-service-to-start-on-boot) -At the end of the container start sequence there should be 6 containers running (or 5 if use NGINX Docker Compose file) +At the end of the container start sequence there should be 6 containers running. -After this step, CKAN should be running at {`PROXY_SERVER_NAME`}{`PROXY_CKAN_LOCATION`} and ckan-pycsw at {`PROXY_SERVER_NAME`}{`PROXY_PYCSW_LOCATION`}, i.e: http://localhost/catalog or http://localhost/csw +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 -|CONTAINER ID |IMAGE |COMMAND|CREATED|STATUS|PORTS|NAMES| -|------------|----------------------------------|--------------------|-------|-------|------|-----| -|0217537f717e|ckan-docker-nginx |/docker-entrypoint.…|6 minutes ago |Up 4 minutes|80/tcp,0.0.0.0:80->80/tcp,0.0.0.0:8443->443/tcp | nginx | -|7b06ab2e060a|ckan-docker-ckan|/srv/app/start_ckan…|6 minutes ago |Up 5 minutes (healthy)|0.0.0.0:5000->5000/tcp|ckan | | -|1b8d9789c29a|redis:7-alpine |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|6379/tcp |redis | | -|7f162741254d|ckan/ckan-solr:2.9-solr9-spatial |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|8983/tcp |solr | | -|2cdd25cea0de|ckan-docker-db |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|5432/tcp |db | | -|9cdj25dae6gr|ckan-docker-pycsw |docker-entrypoint.s…|6 minutes ago |Up 4 minutes (healthy)|8000/tcp |pycsw | | +| CONTAINER ID | IMAGE | COMMAND | CREATED | STATUS | PORTS | NAMES | +|----------------|--------------------------------------|----------------------|--------------------|-----------------------------|-------------------------------------------------|------------------------------------------| +| 0217537f717e | ckan-docker-nginx/ckan-docker-apache | /docker-entrypoint.… | 6 minutes ago | Up 4 minutes | 80/tcp,0.0.0.0:80->80/tcp,0.0.0.0:8443->443/tcp | ckan-docker-nginx-1/ckan-docker-apache-1 | +| 7b06ab2e060a | ckan-docker-ckan | /srv/app/start_ckan… | 6 minutes ago | Up 5 minutes (healthy) | 0.0.0.0:5000->5000/tcp | ckan-docker-ckan-1 | +| 1b8d9789c29a | redis:7-alpine | docker-entrypoint.s… | 6 minutes ago | Up 4 minutes (healthy) | 6379/tcp | ckan-docker-redis-1 | +| 7f162741254d | ckan/ckan-solr:2.9-solr9-spatial | docker-entrypoint.s… | 6 minutes ago | Up 4 minutes (healthy) | 8983/tcp | ckan-docker-solr-1 | +| 2cdd25cea0de | ckan-docker-db | docker-entrypoint.s… | 6 minutes ago | Up 4 minutes (healthy) | 5432/tcp | ckan-docker-db-1 | +| 9cdj25dae6gr | ckan-docker-pycsw | docker-entrypoint.s… | 6 minutes ago | Up 4 minutes (healthy) | 8000/tcp | ckan-docker-pycsw-1 | ### Quick mode If you just want to test the package and see the general functionality of the platform, you can use the `ckan-docker` image from the [Github container registry](https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker): ```bash - cp .env.example .env # Edit the envvars in the .env as you like and start the containers. docker compose -f docker-compose.ghcr.yml up -d --build ``` -It will download the pre-built image and deploy all the containers. Remember to use your own domain by changing `localhost` in the `.env` file. +> [!NOTE] +>It will download the pre-built image and deploy all the containers. Remember to use your own domain by changing `localhost` in the `.env` file. ### Development mode @@ -196,15 +207,17 @@ Use this mode if you are making code changes to CKAN and either creating new ext To develop local extensions use the `docker compose.dev.yml` file: To build the images: - + ```bash docker compose -f docker-compose.dev.yml build + ``` To start the containers: - + ```bash docker compose -f docker-compose.dev.yml up + ``` See [CKAN images](#5-ckan-images) for more details of what happens when using development mode. -See [CKAN images](#5-ckan-images) for more details of what happens when using development mode. + #### 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: @@ -311,8 +324,8 @@ RUN pip install -e git+https://github.com/frictionlessdata/ckanext-validation.gi COPY docker-entrypoint.d/* /docker-entrypoint.d/ ``` - -NB: There are a number of extension examples commented out in the Dockerfile.dev file +> [!TIP] +>There are a number of extension examples commented out in the [`Dockerfile.dev`](https://github.com/mjanez/ckan-docker/blob/master/ckan/Dockerfile.dev) file ### Applying patches When building your project specific CKAN images (the ones defined in the `ckan/` folder), you can apply patches @@ -495,13 +508,17 @@ These parameters can be added to the `.env` file For more information please see [ckanext-envvars](https://github.com/okfn/ckanext-envvars) +> [!WARNING] +> When deploying under a proxy, such as in a corporate environment, to avoid errors when resolving urls with container_names/hostnames associated with the container on internal networks, use the `no_proxy' variable, in lower case, with the names of the services/containers, the IP of the Docker network, etc. +> e.g: `no_proxy="127.0.0.1,192.168.192.0/23,172.0.0.0/0,redis,solr,${DB_CONTAINER_NAME}"` + -### Datastore +## Datastore The Datastore database and user is created as part of the entrypoint scripts for the db container. -### xloader -To replacing DataPusher with XLoader check out the wiki page for this: https://github.com/ckan/ckan-docker/wiki/Replacing-DataPusher-with-XLoader +## xloader +This deployment replaces DataPusher with XLoader using Supervisor, more info about other alternatives on the wiki page for this: https://github.com/ckan/ckan-docker/wiki/Replacing-DataPusher-with-XLoader ### ckan-pycsw @@ -615,7 +632,6 @@ If need to use a backup, restore it: ### CKAN. Manage new users - 1. Create a new user from the Docker host, for example to create a new user called `user_example` ```bash @@ -641,6 +657,7 @@ If need to use a backup, restore it: ```bash ckan -c ckan.ini user remove user_example` ``` + ### Docker. Basic commands For more information about Docker and Docker Compose's basic commands and post-installation procedures, see [Docker/Docker Compose Info](./doc/info_docker.md) diff --git a/doc/info_envfile.md b/doc/info_envfile.md new file mode 100644 index 00000000..17328726 --- /dev/null +++ b/doc/info_envfile.md @@ -0,0 +1,213 @@ +# 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. +- `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. +- `PYCSW_PORT_HOST`: The port on which PYCSW 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. +- `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. +- `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_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 database and DataStore. + +- `POSTGRES_USER`: The username 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. +- `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. +- `DATASTORE_READONLY_USER`: The username for the read-only Datastore database. +- `DATASTORE_READONLY_PASSWORD`: The password for the read-only Datastore database. +- `DATASTORE_DB`: The name of the Datastore database. +- `CKAN_SQLALCHEMY_URL`: The SQLAlchemy URL for the CKAN database. +- `CKAN_DATASTORE_WRITE_URL`: The SQLAlchemy URL for writing to the Datastore database. +- `CKAN_DATASTORE_READ_URL`: The SQLAlchemy URL for reading from the Datastore database. + +### Test database connections +This section refers to the test databases used by CKAN during integration and unit testing. + +- `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. + +### Dev settings +This section contains configurations specific to the CKAN development environment. + +- `USE_HTTPS_FOR_DEV`: Whether to use HTTPS for development. +- `CKAN_DEV_COMPOSE_SERVICE`: The Docker Compose service for CKAN development. + +### CKAN core +This section contains configurations related to the core CKAN application. It includes variables for the CKAN version, site ID, site URL, root path, port, favicon, logo, and secrets for the Beaker session and JWT API tokens. + +- `CKAN_VERSION`: The version of CKAN. +- `CKAN_SITE_ID`: The site ID for CKAN. +- `CKAN_SITE_URL`: The URL of the CKAN site. +- `CKAN__ROOT_PATH`: The root path for CKAN. +- `CKAN_PORT`: The port on which CKAN is running. +- `CKAN__FAVICON`: The path to the favicon for CKAN. +- `CKAN__SITE_LOGO`: The path to the logo for CKAN. +- `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. +- `CKAN_SYSADMIN_NAME`: The username for the CKAN sysadmin. +- `CKAN_SYSADMIN_PASSWORD`: The password for the CKAN sysadmin. +- `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_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. +- `CKAN_SMTP_PASSWORD`: The password for the SMTP server. +- `CKAN_SMTP_MAIL_FROM`: The email address for outgoing mail from CKAN. +- `CKAN__PREVIEW__JSON_FORMATS`: The JSON formats that CKAN can preview. +- `CKAN__PREVIEW__XML_FORMATS`: The XML formats that CKAN can preview. +- `CKAN__PREVIEW__TEXT_FORMATS`: The text formats that CKAN can preview. +- `CKAN__PREVIEW__LOADABLE`: The formats that CKAN can load for preview. +- `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. + +### 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. + +- `CKAN__RESOURCE_PROXY__MAX_FILE_SIZE`: The maximum file size for the resource proxy. +- `CKAN__RESOURCE_PROXY__CHUNK_SIZE`: The chunk size for the resource proxy. +- `CKAN__RESOURCE_PROXY__TIMEOUT`: The timeout for the resource proxy. +- `CKAN__VIEWS__DEFAULT_VIEWS`: The default views for CKAN. + +### Localization +This section refers to CKAN's localization settings, which determine the languages available in the user interface. + +- `CKAN__LOCALE_DEFAULT`: The default locale for CKAN. +- `CKAN__LOCALE_ORDER`: The order of locales for CKAN. +- `CKAN__LOCALES_OFFERED`: The locales offered by CKAN. + +### Extensions +This section refers to CKAN extensions, which are software modules that add additional functionality to the core CKAN application. + +- `CKAN__PLUGINS`: The plugins for CKAN. + +### ckanext-harvest +This is a CKAN extension that allows users to harvest dataset metadata from multiple sources. + +- `CKAN__HARVEST__MQ__TYPE`: The type of message queue for the Harvest extension. +- `CKAN__HARVEST__MQ__HOSTNAME`: The hostname for the message queue for the Harvest extension. +- `CKAN__HARVEST__MQ__PORT`: The port for the message queue for the Harvest extension. +- `CKAN__HARVEST__MQ__REDIS_DB`: The Redis database for the message queue for the Harvest extension. +- `CKAN__HARVEST__LOG_TIMEFRAME`: The timeframe for the Harvest log. + +### ckanext-xloader +This is a CKAN extension that allows users to load data into CKAN's data store for faster and more efficient processing. + +- `CKANEXT__XLOADER__API_TOKEN`: The API token for the XLoader extension. +- `CKANEXT__XLOADER__JOBS__DB_URI`: The database URI for the XLoader jobs. + +### ckanext-dcat +This is a CKAN extension that provides support for the DCAT standard, allowing CKAN to expose and consume metadata in this format. + +- `CKANEXT__DCAT__BASE_URI`: The base URI for the DCAT extension. +- `CKANEXT__DCAT__RDF_PROFILES`: The RDF profiles for the DCAT extension. +- `CKANEXT__DCAT__DEFAULT_CATALOG_ENDPOINT`: The default catalog endpoint for the DCAT extension. + +### ckanext-spatial +This is a CKAN extension that provides spatial functionalities, such as geographic search and map user interface. + +- `CKANEXT__SPATIAL__SEARCH_BACKEND`: The search backend for the Spatial extension. +- `CKAN__SPATIAL__SRID`: The SRID for the Spatial extension. +- `CKANEXT__SPATIAL__COMMON_MAP__TYPE`: The type of common map for the Spatial extension. +- `CKANEXT__SPATIAL__COMMON_MAP__CUSTOM__URL`: The URL of the custom common map for the Spatial extension. +- `CKANEXT__SPATIAL__COMMON_MAP__ATTRIBUTION`: The attribution for the common map for the Spatial extension. + +### ckanext-geoview +This is a CKAN extension that allows users to visualize geospatial resources directly in the CKAN interface. + +- `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-schemingdcat +This extension provides a way to configure and customize CKAN's dataset, resource, organization and group schemas. + +- `CKANEXT__SCHEMINGDCAT_GEOMETADATA_BASE_URI`: This is the base URI for the CSW Endpoint for spatial metadata. +- `CKANEXT__SCHEMINGDCAT_DATASET_SCHEMA`: This is the path to the dataset schema file. +- `CKANEXT__SCHEMINGDCAT_GROUP_SCHEMAS`: This is the path to the group schema file. +- `CKANEXT__SCHEMINGDCAT_ORGANIZATION_SCHEMAS`: This is the path to the organization schema file. +- `CKANEXT__SCHEMINGDCAT_PRESETS`: This is the path to the presets file. +- `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-pages +This extension provides a way to add simple internal pages. + +- `CKANEXT__PAGES__ALOW_HTML`: This is a boolean value to enable or disable HTML in pages. +- `CKANEXT__PAGES__ORGANIZATION`: This is a boolean value to enable or disable organization pages. +- `CKANEXT__PAGES__GROUP`: This is a boolean value to enable or disable group pages. +- `CKANEXT__PAGES__ABOUT_MENU`: This is a boolean value to enable or disable the about menu. +- `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 From 176a18a2ef25b38fb9d78fa79e8cf1db174e8067 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Sun, 19 May 2024 03:24:47 +0200 Subject: [PATCH 3/3] Fix notes/tips --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 923759d7..dc8733d6 100644 --- a/README.md +++ b/README.md @@ -135,14 +135,14 @@ Before starting the deployment, you'll need to set up a `.env` file. This file i 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. - > [!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` - > For more information about the `.env' file, see [.env docs](./doc/info_envfile.md) +> [!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` +> For more information about the `.env' file, see [.env docs](./doc/info_envfile.md) - > [!WARNING] - > Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). All envvars with `API_TOKEN` are automatically regenerated when CKAN is loaded, no editing is required. - > - >**This should be obviously changed before running this setup as a public CKAN instance.** +> [!WARNING] +> Using the default values on the `.env` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). All envvars with `API_TOKEN` are automatically regenerated when CKAN is loaded, no editing is required. +> +>**This should be obviously changed before running this setup as a public CKAN instance.** You are now ready to proceed with deployment. @@ -154,8 +154,8 @@ Use this if you are a maintainer and will not be making code changes to CKAN or docker compose build ``` - > [!NOTE] - > You can use a [deploy in 5 minutes](#quick-mode) if you just want to test the package. +> [!NOTE] +> You can use a [deploy in 5 minutes](#quick-mode) if you just want to test the package. 2. Start the containers: ```bash @@ -600,8 +600,8 @@ PostgreSQL offers the command line tools [`pg_dump`](https://www.postgresql.org/ 0 0 * * * /path/to/your/script/ckan_backup_custom.sh ``` - > [!NOTE] - > Replace `/path/to/your/script` with the actual path to the `ckan_backup_custom.sh` script. +> [!NOTE] +> Replace `/path/to/your/script` with the actual path to the `ckan_backup_custom.sh` script. 8. Save and close the file.