Update README and samples folder

This commit is contained in:
mjanez 2023-03-17 12:03:42 +00:00 committed by GitHub
parent fdf4d82064
commit b7d90a82c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 314 additions and 14 deletions

View File

@ -13,13 +13,9 @@
<a href="#applying-patches">Applying patches</a> <a href="#applying-patches">Applying patches</a>
<a href="#ckan-docker-addons">Addons</a> <a href="#ckan-docker-addons">Addons</a>
</p> </p>
[](#ckan-images)
**Requirements**: **Requirements**:
* Linux 64 bit system * [Docker](https://docs.docker.com/get-docker/)
>**Note**<br>
> Tested successfully on **Debian GNU/Linux 11 (bullseye)**
## Overview ## Overview
Contains Docker images for the different components of CKAN Cloud and a Docker compose environment (based on [ckan](https://github.com/ckan/ckan)) for development and testing Open Data portals. 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.
@ -266,16 +262,34 @@ ckan
``` ```
>**Note**: >**Note**:<br>
> Git diff is a command to output the changes between two sources inside the Git repository. The data sources can be two different branches, commits, files, etc. > Git diff is a command to output the changes between two sources inside the Git repository. The data sources can be two different branches, commits, files, etc.
> * Show changes between working directory and staging area > * Show changes between working directory and staging area:
> `git diff > mypatch.patch` > `git diff > [file.patch]`
> * > * Shows any changes between the staging area and the repository:
> `git diff --staged [file]`
## ckan-docker addons ## ckan-docker addons
### VSCode dev containers ### VSCode dev containers
TODO: Info The [Visual Studio Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) extension is a powerful tool that enables developers to use a container as a complete development environment. With this extension, developers can open any folder inside a container and take advantage of the full range of features provided by Visual Studio Code. To do this, developers create a `devcontainer.json `file in their project that specifies how to access or create a development container with a predefined tool and runtime stack. This allows developers to work in an isolated environment, ensuring that the development environment is consistent across team members and that project dependencies are easy to manage.
![Developing inside a Container](https://code.visualstudio.com/assets/docs/devcontainers/containers/architecture-containers.png)
1. Install [VSCode](https://code.visualstudio.com/).
1. Install the[ Remote Development extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) for VSCode.
3. In your project directory, create a file named `devcontainer.json.` This file will contain the configuration for your `dev container`.
4. In the `devcontainer.json` file, specify the Docker image that you want to use for your `dev container`.
5. Specify any additional configuration settings for your `dev container`, such as environment variables, ports to expose, and startup commands.
6. Open your project in a `dev container` by using the Remote Development extension in VSCode. You can do this by clicking the `Open Folder in Container` button in the command palette or by opening the folder using the `Remote-Containers: Open Folder in Container` command. Also you can attach to an active container `Attach to Running Container`.
7. VSCode will start a new container based on the configuration settings in your `devcontainer.json` file. Once the container is started, you can work on your project just like you would on your local machine.
### pdb ### pdb
Add these lines to the `ckan-dev` service in the docker compose.dev.yml file Add these lines to the `ckan-dev` service in the docker compose.dev.yml file
@ -320,13 +334,11 @@ For more information please see [ckanext-envvars](https://github.com/okfn/ckanex
### ckan-pycsw ### ckan-pycsw
[ckan-pycsw](https://github.com/mjanez/ckan-pycsw) is a docker compose environment (based on pycsw) for development and testing with CKAN Open Data portals.[^4] [ckan-pycsw](https://github.com/mjanez/ckan-pycsw) is a docker compose environment (based on [pycsw](https://github.com/geopython/pycsw)) for development and testing with CKAN Open Data portals.[^4]
Docker compose environment (based on [pycsw](https://github.com/geopython/pycsw)) for development and testing with CKAN Open Data portals.
Available components: Available components:
* **pycsw**: The pycsw app. An [OARec](https://ogcapi.ogc.org/records) and [OGC CSW](https://opengeospatial.org/standards/cat) server implementation written in Python. * **pycsw**: The pycsw app. An [OARec](https://ogcapi.ogc.org/records) and [OGC CSW](https://opengeospatial.org/standards/cat) server implementation written in Python.
* **ckan2pycsw**: Software to achieve interoperability with the open data portals based on CKAN. To do this, ckan2pycsw reads data from an instance using the CKAN API, generates ISO-19115/ISO-19139 metadata using [pygeometa](https://geopython.github.io/pygeometa/), and populates a [pycsw](https://pycsw.org/) instance that exposes the metadata using CSW and OAI-PMH. * **ckan2pycsw**: Software to achieve interoperability with the open data portals based on CKAN. To do this, ckan2pycsw reads data from an instance using the CKAN API, generates ISO-19115/ISO-19139 metadata using [pygeometa](https://geopython.github.io/pygeometa/), or a custom schema that is based on a customized CKAN schema, and populates a [pycsw](https://pycsw.org/) instance that exposes the metadata using CSW and OAI-PMH.
[^1]: Development environment. [^1]: Development environment.

288
samples/ckan.ini.example Normal file
View File

@ -0,0 +1,288 @@
#
# CKAN - Pylons configuration
#
# These are some of the configuration options available for your CKAN
# instance. Check the documentation in 'doc/configuration.rst' or at the
# following URL for a description of what they do and the full list of
# available options:
#
# http://docs.ckan.org/en/latest/maintaining/configuration.html
#
# The %(here)s variable will be replaced with the parent directory of this file
#
[DEFAULT]
# WARNING: *THIS SETTING MUST BE SET TO FALSE ON A PUBLIC ENVIRONMENT*
# With debug mode enabled, a visitor to your site could execute malicious commands.
debug = false
[app:main]
use = egg:ckan
## Development settings
ckan.devserver.host = localhost
ckan.devserver.port = 5000
## Session settings
cache_dir = /tmp/%(ckan.site_id)s/
beaker.session.key = ckan
# This is the secret token that the beaker library uses to hash the cookie sent
# to the client. `ckan generate config` generates a unique value for this each
# time it generates a config file.
beaker.session.secret = acZN6lm5UYE_8A6uEYGIBx0KL
# `ckan generate config` generates a unique value for this each time it generates
# a config file.
app_instance_uuid = 32ceaae1-9cfa-4d31-ab19-9baf339d2bdd
# repoze.who config
who.config_file = %(here)s/who.ini
who.log_level = warning
who.log_file = %(cache_dir)s/who_log.ini
# Session timeout (user logged out after period of inactivity, in seconds).
# Inactive by default, so the session doesn't expire.
# who.timeout = 86400
## Database Settings
sqlalchemy.url = postgresql://ckan:ckan@localhost/ckan_default
ckan.datastore.write_url = postgresql://ckan:ckan@localhost/datastore_default
ckan.datastore.read_url = postgresql://datastore_ro:datastore@localhost/datastore_default
# PostgreSQL' full-text search parameters
ckan.datastore.default_fts_lang = english
ckan.datastore.default_fts_index_method = gist
## Site Settings
ckan.site_url = http://localhost:5000/
#ckan.root_path = /catalog/{{LANG}}
#ckan.use_pylons_response_cleanup_middleware = true
# Default timeout for Requests
#ckan.requests.timeout = 10
## Authorization Settings
ckan.auth.anon_create_dataset = false
ckan.auth.create_unowned_dataset = false
ckan.auth.create_dataset_if_not_in_organization = false
ckan.auth.user_create_groups = false
ckan.auth.user_create_organizations = false
ckan.auth.user_delete_groups = true
ckan.auth.user_delete_organizations = true
ckan.auth.create_user_via_api = false
ckan.auth.create_user_via_web = false
ckan.auth.roles_that_cascade_to_sub_groups = admin
ckan.auth.public_user_details = true
ckan.auth.public_activity_stream_detail = true
ckan.auth.allow_dataset_collaborators = false
ckan.auth.create_default_api_keys = false
## API Token Settings
api_token.nbytes = 60
api_token.jwt.encode.secret = string:acZN6lm5UYE_8A6uEYGIBx0KL
api_token.jwt.decode.secret = string:acZN6lm5UYE_8A6uEYGIBx0KL
api_token.jwt.algorithm = HS256
## API Token: expire_api_token plugin
expire_api_token.default_lifetime = 3600
## Search Settings
ckan.site_id = default
#solr_url = http://127.0.0.1:8983/solr
## Redis Settings
# URL to your Redis instance, including the database to be used.
#ckan.redis.url = redis://localhost:6379/0
## CORS Settings
# If cors.origin_allow_all is true, all origins are allowed.
# If false, the cors.origin_whitelist is used.
# ckan.cors.origin_allow_all = true
# cors.origin_whitelist is a space separated list of allowed domains.
# ckan.cors.origin_whitelist = http://example1.com http://example2.com
## Plugins Settings
# Note: Add ``datastore`` to enable the CKAN DataStore
# Add ``datapusher`` to enable DataPusher
# Add ``resource_proxy`` to enable resorce proxying and get around the
# same origin policy
ckan.plugins = stats text_view image_view recline_view resourcedictionary datastore datapusher harvest ckan_harvester spatial_metadata spatial_query spatial_harvest_metadata_api csw_harvester waf_harvester doc_harvester resource_proxy geo_view geojson_view wmts_view shp_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface scheming_datasets scheming_groups scheming_organizations pdf_view pages
## ckanext-scheming
# module-path:file to schemas being used
scheming.dataset_schemas = ckanext.scheming:ckan_geodcatap.yaml
# For group and organization schemas (replace myplugin with your custom plugin)
scheming.group_schemas = ckanext.scheming:ckan_group_geodcatap.json
scheming.organization_schemas = ckanext.scheming:ckan_org_geodcatap.json
# Preset files may be included as well. The default preset setting is:
scheming.presets = ckanext.scheming:presets.json
## ckanext-dcat
ckanext.dcat.base_uri = http://localhost:5000
ckanext.dcat.rdf.profiles = euro_dcat_ap_2 euro_dcat_ap
## ckanext-spatial
ckanext.spatial.search_backend = solr-bbox
ckan.spatial.srid = 3857
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url = https://rts.larioja.org/mapa-base/rioja/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = Servicios de Teselas. <a href="https://www.idee.es/">IDEE</a>, bajo <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.
# ckanext-harvest
ckan.harvest.mq.type = redis
ckan.harvest.mq.hostname = redis
# Define which views should be created by default
# (plugins must be loaded in ckan.plugins)
ckan.views.default_views = image_view text_view recline_view harvest ckan_harvester wmts_view geojson_view geo_view shp_view pdf_view
ckanext.geoview.geojson.max_file_size = 100000000
ckanext.geoview.ol_viewer.formats = wms wfs geojson gml kml
ckanext.geoview.shp_viewer.srid = 3857
ckanext.geoview.shp_viewer.encoding = UTF-8
# Customize which text formats the text_view plugin will show
ckan.preview.json_formats = json jsonld
ckan.preview.xml_formats = xml rdf rdf+xml owl+xml atom rss turtle ttl n3
ckan.preview.text_formats = text plain text/plain text/turtle
# Customize which image formats the image_view plugin will show
#ckan.preview.image_formats = png jpeg jpg gif
## Front-End Settings
ckan.site_title = CKAN
ckan.site_logo = /base/images/ckan-logo.png
ckan.site_description =
ckan.favicon = /base/images/ckan.ico
ckan.gravatar_default = identicon
ckan.preview.direct = png jpg gif
ckan.preview.loadable = html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json
ckan.display_timezone = server
# package_hide_extras = for_search_index_only
#package_edit_return_url = http://another.frontend/dataset/<NAME>
#package_new_return_url = http://another.frontend/dataset/<NAME>
#ckan.recaptcha.publickey =
#ckan.recaptcha.privatekey =
#licenses_group_url = http://licenses.opendefinition.org/licenses/groups/ckan.json
# ckan.template_footer_end =
## Internationalisation Settings
ckan.locale_default = es
ckan.locale_order = es en pt_BR ja it cs_CZ ca fr el sv sr sr@latin no sk fi ru de pl nl bg ko_KR hu sa sl lv
ckan.locales_offered =
ckan.locales_filtered_out = en_GB
## Feeds Settings
ckan.feeds.authority_name =
ckan.feeds.date =
ckan.feeds.author_name =
ckan.feeds.author_link =
## Storage Settings
#ckan.storage_path = /var/lib/ckan
#ckan.max_resource_size = 10
#ckan.max_image_size = 2
## Webassets Settings
#ckan.webassets.use_x_sendfile = false
#ckan.webassets.path = /var/lib/ckan/webassets
## Datapusher settings
# Make sure you have set up the DataStore
ckan.datapusher.api_token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJ6ODViRDNEc1BRLUFGNHVqVEJTM2p4SmNGREJnY2kxRlFrV2I5aDhWNUNNZ09BMGZ5ZDZzUnFxRWQzMTk4OGlFY1h3Wndkcjc5ZFRZNy1JZyIsImlhdCI6MTY2OTE5Mzg3MX0.sfbkYDI_n_syYhBO3kt3NRZpzE5no6ey8M6E5jWMCGE
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
ckan.datapusher.url = http://127.0.0.1:8800/
ckan.datapusher.callback_url_base = http://127.0.0.1:8800/
#ckan.datapusher.assume_task_stale_after = 3600
# Resource Proxy settings
# Preview size limit, default: 1MB
ckan.resource_proxy.max_file_size = 50048576
# Size of chunks to read/write.
ckan.resource_proxy.chunk_size = 4096
# Default timeout for fetching proxied items
ckan.resource_proxy.timeout = 1000
## Activity Streams Settings
#ckan.activity_streams_enabled = true
#ckan.activity_list_limit = 31
#ckan.activity_streams_email_notifications = true
#ckan.email_notifications_since = 2 days
ckan.hide_activity_from_users = %(ckan.site_id)s
## Email settings
#email_to = errors@example.com
#error_email_from = ckan-errors@example.com
#smtp.server = localhost
#smtp.starttls = False
#smtp.user = username@example.com
#smtp.password = your_password
#smtp.mail_from =
#smtp.reply_to =
## Background Job Settings
ckan.jobs.timeout = 180
## Logging configuration
[loggers]
keys = root, ckan, ckanext, werkzeug
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARNING
handlers = console
[logger_werkzeug]
level = WARNING
handlers = console
qualname = werkzeug
propagate = 0
[logger_ckan]
level = INFO
handlers = console
qualname = ckan
propagate = 0
[logger_ckanext]
level = DEBUG
handlers = console
qualname = ckanext
propagate = 0
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s