Skip to content

Instantly share code, notes, and snippets.

@jhinds
Last active May 2, 2018 12:56
Show Gist options
  • Save jhinds/c361076e2e1ae734766310260e4f3cfd to your computer and use it in GitHub Desktop.
Save jhinds/c361076e2e1ae734766310260e4f3cfd to your computer and use it in GitHub Desktop.
{{- define "ckan.ini" -}}
#
# 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 PRODUCTION ENVIRONMENT*
debug = false
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 5000
[app:main]
use = egg:ckan
full_stack = true
cache_dir = /tmp/%(ckan.site_id)s/
beaker.session.key = ckan
ckan.tracking_enabled = true
# This is the secret token that the beaker library uses to hash the cookie sent
# to the client. `paster make-config` generates a unique value for this each
# time it generates a config file.
beaker.session.secret = {{ .Values.configMap.ckanIni.beaker_session_secret }}
# `paster make-config` generates a unique value for this each time it generates
# a config file.
app_instance_uuid = {{ .Values.configMap.ckanIni.app_instance_uuid }}
# 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 = {{ .Values.configMap.ckanIni.sql_alchemy_url }}
{{ if .Values.extensions.datastore }}
ckan.datastore.write_url = {{ .Values.configMap.ckanIni.ckan_datastore_write_url }}
ckan.datastore.read_url = {{ .Values.configMap.ckanIni.ckan_datastore_read_url }}
# PostgreSQL' full-text search parameters
ckan.datastore.default_fts_lang = english
ckan.datastore.default_fts_index_method = gist
{{ end }}
## Site Settings
ckan.site_url = {{ .Values.configMap.ckanIni.ckan_site_url }}
#ckan.use_pylons_response_cleanup_middleware = true
## 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 = false
ckan.auth.user_delete_organizations = false
ckan.auth.create_user_via_api = false
ckan.auth.create_user_via_web = true
ckan.auth.roles_that_cascade_to_sub_groups = admin
## Search Settings
ckan.site_id = {{ .Values.configMap.ckanIni.ckan_site_id }}
solr_url = {{ .Values.configMap.ckanIni.solr_url }}
#ckan.simple_search = 1
## 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 datatables_view webpage_view pdf_view officedocs_view resource_proxy geo_view geojson_view
# viewhelpers c3charts linechart barchart piechart basicgrid dashboard_preview datastore xloader extractor
# harvest ckan_harvester dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface spatial_metadata spatial_query ags_fs_view ags_ms_view
# og_theme contact datajson datarequests featuredviews googleanalytics odata pages showcase cloudstorage
ckan.plugins = |-
{{ include "ckan-extensions" . | b64enc | indent 4 }}
{{ if .Values.extensions.xloader }}
### ckan xloader
# The connection string for the jobs database used by Express Loader. The
# default of an sqlite file is fine for development. For production use a
# Postgresql database.
ckanext.xloader.jobs_db.uri = {{ .Values.configMap.ckanIni.ckanext_xloader_jobs_db_uri }}
# The formats that are accepted. If the value of the resource.format is
# anything else then it won't be 'xloadered' to DataStore (and will therefore
# only be available to users in the form of the original download/link).
# Case insensitive.
# (optional, defaults are listed in plugin.py - DEFAULT_FORMATS).
ckanext.xloader.formats = csv application/csv xls application/vnd.ms-excel
# The maximum size of files to load into DataStore. In bytes. Default is 1 GB.
ckanext.xloader.max_content_length = 1000000000
# The maximum time for the loading of a resource before it is aborted.
# Give an amount in seconds. Default is 60 minutes
ckanext.xloader.job_timeout = 3600
{{ end }}
{{ if .Values.extensions.cloudstorage }}
# settings for the CKAN cloudstorage extension
# https://github.com/TkTech/ckanext-cloudstorage
ckanext.cloudstorage.driver = {{ .Values.configMap.ckanIni.ckanext_cloudstorage_driver }}
ckanext.cloudstorage.container_name = {{ .Values.configMap.ckanIni.ckanext_cloudstorage_container_name }}
ckanext.cloudstorage.driver_options = {"key": "{{ .Values.configMap.ckanIni.aws_access_key_id }}", "secret": "{{ .Values.configMap.ckanIni.aws_secret_access_key }}"}
ckanext.cloudstorage.max_multipart_lifetime = 7
{{ end }}
#opendatacity_theme
# 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 datatables_view pdf_view officedocs_view geojson_view ags_fs_view
ckanext.geoview.ol_viewer.formats = wms wfs kml arcgis_rest gft
ckan.spatial.srid = 4326
ckan.harvest.mq.type = redis
ckan.redis.url = {{ .Values.configMap.ckanIni.redis_url }}
{{ if .Values.extensions.extractor }}
ckanext.extractor.indexed_formats = pdf txt
{{ end }}
# ckanext-agsview
ckanext.ags_view_default_basemap_url = Gray
ckanext.ags_view_proxy = {}
{{ if .Values.extensions.contact }}
# ckanext-contact
ckanext.contact.mail_to = {{ .Values.configMap.ckanIni.ckanext_contact_mail_to }}
ckanext.contact.recipient_name = {{ .Values.configMap.ckanIni.ckanext_contact_recipient_name }}
ckanext.contact.subject = {{ .Values.configMap.ckanIni.ckanext_contact_subject }}
{{ end }}
# ckanext-datajson
ckanext.datajson.contact_name = {{ .Values.configMap.ckanIni.ckanext_datajson_contact_name }}
ckanext.datajson.contact_email = {{ .Values.configMap.ckanIni.ckanext_datajson_contact_email }}
# ckanext-geoview
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url = http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://cartodb.com/attributions">CartoDB</a>
{{ if .Values.extensions.googleanalytics }}
# ckanext-googleanalytics
googleanalytics.id = {{ .Values.configMap.ckanIni.googleanalytics_id }}
googleanalytics.domain = auto
googleanalytics.track_events = true
{{ end }}
# ckanext-pages
ckanext.pages.allow_html = True
ckanext.pages.editor = ckeditor
## Front-End Settings
ckan.site_title = {{ .Values.configMap.ckanIni.ckan_site_title }}
ckan.site_logo = /base/images/ckan-logo.png
ckan.site_description = {{ .Values.configMap.ckanIni.ckan_site_description }}
ckan.favicon = /base/images/opengov-favicon-16x16.png
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.version = 1
#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 = en
ckan.locale_order = en pt_BR ja it cs_CZ ca es 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 = /data/ckan
ckan.max_resource_size = 750
ckan.max_image_size = 5
## Datapusher settings
# Make sure you have set up the DataStore
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/
# Resource Proxy settings
# Preview size limit, default: 1MB
ckan.resource_proxy.max_file_size = 104857600
# Size of chunks to read/write.
ckan.resource_proxy.chunk_size = 4096
## 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 = {{ .Values.configMap.ckanIni.googleanalytics_id }}
#error_email_from = paste@localhost
#smtp.server = localhost
#smtp.starttls = False
#smtp.user = your_username@gmail.com
#smtp.password = your_password
smtp.mail_from = {{ .Values.configMap.ckanIni.email_to }}
## Custom OpenData Settings
ckan.sysadmins = {{ .Values.configMap.ckanIni.smtp_mail_from }}
## Logging configuration
[loggers]
keys = root, ckan, ckanext
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARNING
handlers = console
[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
{{- end -}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment