From 0a15bea8f84a1989e73ebd2dcd5b1b8099267dfc Mon Sep 17 00:00:00 2001 From: awang Date: Fri, 8 Dec 2023 16:17:28 +0700 Subject: [PATCH 1/8] [BIO-6387] enabled dbca extension and add custom resource formats --- .env.dbca | 5 ++++- src/dbca_install_extensions.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.dbca b/.env.dbca index 10d77393..915b3c82 100644 --- a/.env.dbca +++ b/.env.dbca @@ -74,7 +74,7 @@ NGINX_PORT=80 NGINX_SSLPORT=443 # Extensions -CKAN__PLUGINS="image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat envvars" +CKAN__PLUGINS="image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat dbca envvars" CKAN__VIEWS__DEFAULT_VIEWS="text_view datatables_view pdf_view" CKAN__HARVEST__MQ__TYPE=redis CKAN__HARVEST__MQ__HOSTNAME=redis @@ -86,3 +86,6 @@ CKAN__HARVEST__MQ__REDIS_DB=1 COMPOSE_PROJECT_NAME=dbca # The docker compose file to use. Options are docker-compose.dev.yml (The default for local development) or docker-compose.prod.yml (To test production builds) DOCKER_COMPOSE=docker-compose.dev.yml + +## Internationalisation Settings +CKAN__RESOURCE_FORMATS=/srv/app/src_extensions/ckanext-dbca/ckanext/dbca/config/resource_formats.json diff --git a/src/dbca_install_extensions.sh b/src/dbca_install_extensions.sh index 3538b477..6bb6711e 100644 --- a/src/dbca_install_extensions.sh +++ b/src/dbca_install_extensions.sh @@ -7,6 +7,8 @@ cd src/ ## Must Have ## +git clone https://github.com/salsadigitalauorg/ckanext-dbca.git + # QA # git clone https://github.com/dbca-wa/ckanext-qa.git # These extensions will be installed by default, but we don't want them From 958a0ca50381aa6ca657e8f204c154c9ad73d4b8 Mon Sep 17 00:00:00 2001 From: awang Date: Sat, 9 Dec 2023 17:14:28 +0700 Subject: [PATCH 2/8] [BIO-6392] enabled scheming dataset and set timezone to Perth --- .env.dbca | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.env.dbca b/.env.dbca index 915b3c82..0abb4f92 100644 --- a/.env.dbca +++ b/.env.dbca @@ -54,7 +54,7 @@ CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user CKAN_SMTP_PASSWORD=pass CKAN_SMTP_MAIL_FROM=ckan@localhost -TZ=UTC +TZ=Australia/Perth # Solr SOLR_IMAGE_VERSION=2.10-solr9 @@ -74,7 +74,7 @@ NGINX_PORT=80 NGINX_SSLPORT=443 # Extensions -CKAN__PLUGINS="image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat dbca envvars" +CKAN__PLUGINS="image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat dbca scheming_datasets envvars" CKAN__VIEWS__DEFAULT_VIEWS="text_view datatables_view pdf_view" CKAN__HARVEST__MQ__TYPE=redis CKAN__HARVEST__MQ__HOSTNAME=redis @@ -87,5 +87,10 @@ COMPOSE_PROJECT_NAME=dbca # The docker compose file to use. Options are docker-compose.dev.yml (The default for local development) or docker-compose.prod.yml (To test production builds) DOCKER_COMPOSE=docker-compose.dev.yml -## Internationalisation Settings +# Internationalisation Settings +CKAN__DISPLAY_TIMEZONE=Australia/Perth CKAN__RESOURCE_FORMATS=/srv/app/src_extensions/ckanext-dbca/ckanext/dbca/config/resource_formats.json + +# Scheming +CKAN___SCHEMING__DATASET_SCHEMAS=ckanext.dbca:dbca_dataset.yaml +CKAN___SCHEMING__PRESETS="ckanext.scheming:presets.json ckanext.dbca:dbca_presets.json" From 2fdefc06d0b9685795eb340e0c498935cf90ef59 Mon Sep 17 00:00:00 2001 From: awang Date: Wed, 13 Dec 2023 18:37:20 +0700 Subject: [PATCH 3/8] [BIO-6392] added cronjob for auto publish and email notification --- ckan/setup/dbca_ckan_cron_jobs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckan/setup/dbca_ckan_cron_jobs b/ckan/setup/dbca_ckan_cron_jobs index a4bec897..3a6bd0e0 100644 --- a/ckan/setup/dbca_ckan_cron_jobs +++ b/ckan/setup/dbca_ckan_cron_jobs @@ -1,3 +1,4 @@ # Crontab for CKAN cron jobs # Example cron job runs the harvester run command every 15 mins -#*/15 * * * * /usr/bin/ckan -c /srv/app/ckan.ini harvester run >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 \ No newline at end of file +#*/15 * * * * /usr/bin/ckan -c /srv/app/ckan.ini harvester run >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 +0 0 * * * /usr/bin/ckan -c /srv/app/ckan.ini dbca scheduled_datasets >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 From bd9c45556e59fdcae54484d4a9c03b5f6fa5290e Mon Sep 17 00:00:00 2001 From: awang Date: Thu, 14 Dec 2023 09:24:53 +0700 Subject: [PATCH 4/8] [BIO-6392] updated repo --- src/dbca_install_extensions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbca_install_extensions.sh b/src/dbca_install_extensions.sh index 6bb6711e..bc6a718e 100644 --- a/src/dbca_install_extensions.sh +++ b/src/dbca_install_extensions.sh @@ -7,7 +7,7 @@ cd src/ ## Must Have ## -git clone https://github.com/salsadigitalauorg/ckanext-dbca.git +git clone https://github.com/dbca-wa/ckanext-dbca.git # QA # git clone https://github.com/dbca-wa/ckanext-qa.git From 90c070a3472a33b6064a1c1b28feb40f59b69df3 Mon Sep 17 00:00:00 2001 From: MarkCalvert <37602611+MarkCalvert@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:59:43 +1300 Subject: [PATCH 5/8] Merge branch 'develop' into feature/BIO-6387-6392 --- .ahoy.yml | 4 +- .env.dbca | 1 - .vscode/launch.json | 19 +++++- ckan/Dockerfile | 14 +++- ckan/Dockerfile.dev | 17 +++-- ckan/config/dbca.ini | 64 +++++++++++++++++++ ckan/config/uwsgi.ini | 16 +++++ ckan/setup/dbca_start_ckan.sh.override | 46 +++++++++++++ .../dbca_start_ckan_development.sh.override | 7 +- docker-compose.dev.yml | 1 + docker-compose.yml | 2 + nginx/Dockerfile | 1 + nginx/setup/default.conf.template | 46 +++++++++++++ 13 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 ckan/config/dbca.ini create mode 100644 ckan/config/uwsgi.ini create mode 100755 ckan/setup/dbca_start_ckan.sh.override create mode 100644 nginx/setup/default.conf.template diff --git a/.ahoy.yml b/.ahoy.yml index c7248f98..7d292e4b 100644 --- a/.ahoy.yml +++ b/.ahoy.yml @@ -74,12 +74,12 @@ commands: logs: usage: Show Docker logs. cmd: | + TAIL=100 if [[ $# -eq 2 ]]; then SERVICE=$1 TAIL=$2 else SERVICE=$1 - TAIL=100 fi; docker compose -f $DOCKER_COMPOSE logs -f --tail=$TAIL $SERVICE @@ -124,7 +124,7 @@ commands: usage: Pipe in a postgres dump file. `ahoy db-import local.dump` cmd: | if [ -e "$@" ] ; then - docker compose -f $DOCKER_COMPOSE exec -T $POSTGRESQL_CONTAINER_NAME sh -c 'pg_restore -U $CKAN_DB_USER -d $CKAN_DB --clean --if-exists -v' < "$@" + docker compose -f $DOCKER_COMPOSE exec -T $POSTGRESQL_CONTAINER_NAME sh -c 'pg_restore -U $CKAN_DB_USER -d $CKAN_DB --clean --if-exists -v --no-owner --no-privileges' < "$@" else echo "Provided sql file" "$@" "does not exist" fi diff --git a/.env.dbca b/.env.dbca index 0abb4f92..98ba8065 100644 --- a/.env.dbca +++ b/.env.dbca @@ -3,7 +3,6 @@ NGINX_CONTAINER_NAME=nginx REDIS_CONTAINER_NAME=redis POSTGRESQL_CONTAINER_NAME=db SOLR_CONTAINER_NAME=solr -DATAPUSHER_CONTAINER_NAME=datapusher CKAN_CONTAINER_NAME=ckan WORKER_CONTAINER_NAME=ckan-worker diff --git a/.vscode/launch.json b/.vscode/launch.json index 8fd14651..9d24adba 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,7 +13,7 @@ "-c continue", "/usr/bin/ckan", "--config", - "/srv/app/ckan.ini", + "/srv/app/config/dbca.ini", "run", "--host", "0.0.0.0", @@ -30,9 +30,24 @@ "-c continue", "/usr/bin/ckan", "--config", - "/srv/app/ckan.ini", + "/srv/app/config/dbca.ini", "jobs", "worker", + "priority" + ], + "justMyCode": true + }, + { + "name": "Python: CKAN CLI Command Run & Debug", + "type": "python", + "request": "launch", + "module": "pdb", + "args": [ + "-c continue", + "/srv/app/config/dbca.ini", + "--config", + "/srv/app/dbca.ini", + "" ], "justMyCode": true } diff --git a/ckan/Dockerfile b/ckan/Dockerfile index f3d0184b..937c3f2a 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -1,4 +1,4 @@ -FROM ckan/ckan-base:2.10.1 +FROM ckan/ckan-base:2.10.3 # Install any extensions needed by your CKAN instance # See Dockerfile.dev for more details and examples @@ -21,3 +21,15 @@ RUN for d in $APP_DIR/patches/*; do \ done ; \ fi ; \ done + +## DBCA specific configuration ## + +# Override the default start_ckan.sh script +COPY setup/dbca_start_ckan.sh.override ${APP_DIR}/start_ckan.sh +RUN chmod +x ${APP_DIR}/start_ckan.sh + +# Copy config files +COPY config/*.ini ${APP_DIR}/config/ + +# Override default CKAN config file to use dbca.ini +ENV CKAN_INI=${APP_DIR}/config/dbca.ini \ No newline at end of file diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index 9a7403db..bb877c04 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM ckan/ckan-dev:2.10.1 +FROM ckan/ckan-dev:2.10.3 # Install any extensions needed by your CKAN instance # - Make sure to add the plugins to CKAN__PLUGINS in the .env file @@ -38,9 +38,6 @@ RUN pip3 install pip --upgrade && \ chmod +x ${APP_DIR}/dbca_requirements.sh && \ ${APP_DIR}/dbca_requirements.sh -COPY setup/dbca_start_ckan_development.sh.override ${APP_DIR}/start_ckan_development.sh -RUN chmod +x ${APP_DIR}/start_ckan_development.sh - # Clone the extension(s) your are writing for your own project in the `src` folder # to get them mounted in this image at runtime @@ -58,3 +55,15 @@ RUN for d in $APP_DIR/patches/*; do \ done ; \ fi ; \ done + +## DBCA specific configuration ## + +# Override the default dbca_start_ckan_development.sh script +COPY setup/dbca_start_ckan_development.sh.override ${APP_DIR}/start_ckan_development.sh +RUN chmod +x ${APP_DIR}/start_ckan_development.sh + +# Copy config files +COPY config/*.ini ${APP_DIR}/config/ + +# Override default CKAN config file to use dbca.ini +ENV CKAN_INI=${APP_DIR}/config/dbca.ini \ No newline at end of file diff --git a/ckan/config/dbca.ini b/ckan/config/dbca.ini new file mode 100644 index 00000000..ecc26b86 --- /dev/null +++ b/ckan/config/dbca.ini @@ -0,0 +1,64 @@ +# +# DBCA configuration +# + +[app:main] + +## General settings ############################################################ +# This will include the config file settings from the default ckan config file +use = config:/srv/app/ckan.ini +ckan.devserver.watch_patterns = /srv/app/ckan.ini + +## Plugins Settings ############################################################ +ckan.plugins = image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat envvars + +## Resource Views Settings ##################################################### +ckan.views.default_views = text_view datatables_view pdf_view + +## Internationalisation Settings ############################################### +ckan.locale_default = en_AU +ckan.display_timezone = Australia/West + +## CKAN Extensions configuration ############################################### + + +## 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 diff --git a/ckan/config/uwsgi.ini b/ckan/config/uwsgi.ini new file mode 100644 index 00000000..b60f71e8 --- /dev/null +++ b/ckan/config/uwsgi.ini @@ -0,0 +1,16 @@ +[uwsgi] + +plugins= http,python +socket=/tmp/uwsgi.sock +wsgi-file=/srv/app/wsgi.py +module=wsgi:application +uid=92 +gid=92 +http=0.0.0.0:5000 +master=enable-threads +lazy-apps=true +processes=5 +disable-logging=true +buffer-size=32768 +vacuum=true +harakiri=50 \ No newline at end of file diff --git a/ckan/setup/dbca_start_ckan.sh.override b/ckan/setup/dbca_start_ckan.sh.override new file mode 100755 index 00000000..174cd06d --- /dev/null +++ b/ckan/setup/dbca_start_ckan.sh.override @@ -0,0 +1,46 @@ +#!/bin/bash + +# Update the default ckan config file +export CKAN_INI=$APP_DIR/ckan.ini + +# Set up the Secret key used by Beaker and Flask +# This can be overriden using a CKAN___BEAKER__SESSION__SECRET env var +if grep -qE "beaker.session.secret ?= ?$" ckan.ini +then + echo "Setting beaker.session.secret in ini file" + ckan config-tool $CKAN_INI "beaker.session.secret=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')" + ckan config-tool $CKAN_INI "WTF_CSRF_SECRET_KEY=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')" + JWT_SECRET=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())') + ckan config-tool $CKAN_INI "api_token.jwt.encode.secret=${JWT_SECRET}" + ckan config-tool $CKAN_INI "api_token.jwt.decode.secret=${JWT_SECRET}" +fi + +# Run the prerun script to init CKAN and create the default admin user +python3 prerun.py + +# Run any startup scripts provided by images extending this one +if [[ -d "/docker-entrypoint.d" ]] +then + for f in /docker-entrypoint.d/*; do + case "$f" in + *.sh) echo "$0: Running init file $f"; bash "$f" ;; + *.py) echo "$0: Running init file $f"; python3 "$f"; echo ;; + *) echo "$0: Ignoring $f (not an sh or py file)" ;; + esac + done +fi + +# Revert back touse DBCA config file +export CKAN_INI=$APP_DIR/config/dbca.ini +# Unset CKAN__PLUGINS to stop the extension envvars overriding the plugins value set in the dbca config file +unset CKAN__PLUGINS + +if [ $? -eq 0 ] +then + # Start supervisord + supervisord --configuration /etc/supervisord.conf & + # Start uwsgi + uwsgi -i $APP_DIR/config/uwsgi.ini +else + echo "[prerun] failed...not starting CKAN." +fi \ No newline at end of file diff --git a/ckan/setup/dbca_start_ckan_development.sh.override b/ckan/setup/dbca_start_ckan_development.sh.override index 2af71a3e..75cce24e 100644 --- a/ckan/setup/dbca_start_ckan_development.sh.override +++ b/ckan/setup/dbca_start_ckan_development.sh.override @@ -42,7 +42,8 @@ if [ ! -f /tmp/container_ready ]; then fi fi done - + # Update the default ckan config file + export CKAN_INI=$APP_DIR/ckan.ini # Set debug to true echo "Enabling debug mode" ckan config-tool $CKAN_INI -s DEFAULT "debug = true" @@ -88,6 +89,10 @@ if [ ! -f /tmp/container_ready ]; then done fi + # Revert back touse DBCA config file + export CKAN_INI=$APP_DIR/config/dbca.ini + # Unset CKAN__PLUGINS to stop the extension envvars overriding the plugins value set in the dbca config file + unset CKAN__PLUGINS # Set the container as ready so the startup scripts are not run again touch /tmp/container_ready fi diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 521a8112..99a3736a 100755 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -31,6 +31,7 @@ services: volumes: - ckan_storage:/var/lib/ckan - ./src:/srv/app/src_extensions + - ./ckan/config:/srv/app/config restart: unless-stopped healthcheck: test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] diff --git a/docker-compose.yml b/docker-compose.yml index 2064ac86..0eaad072 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: networks: - webnet - ckannet + env_file: + - .env depends_on: ckan: condition: service_healthy diff --git a/nginx/Dockerfile b/nginx/Dockerfile index eda7994e..05aeb380 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -9,6 +9,7 @@ RUN apk update --no-cache && \ COPY setup/nginx.conf ${NGINX_DIR}/nginx.conf COPY setup/index.html /usr/share/nginx/html/index.html COPY setup/default.conf ${NGINX_DIR}/conf.d/ +COPY setup/default.conf.template ${NGINX_DIR}/templates/ RUN mkdir -p ${NGINX_DIR}/certs diff --git a/nginx/setup/default.conf.template b/nginx/setup/default.conf.template new file mode 100644 index 00000000..fb23b91a --- /dev/null +++ b/nginx/setup/default.conf.template @@ -0,0 +1,46 @@ +server { + #listen 80; + #listen [::]:80; + listen 443 ssl; + listen [::]:443 ssl; + server_name localhost; + ssl_certificate /etc/nginx/certs/ckan-local.crt; + ssl_certificate_key /etc/nginx/certs/ckan-local.key; + + # TLS 1.2 & 1.3 only + ssl_protocols TLSv1.2 TLSv1.3; + + # Disable weak ciphers + ssl_prefer_server_ciphers on; + ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; + + # SSL sessions + ssl_session_timeout 1d; + # ssl_session_cache dfine in stream and http + ssl_session_tickets off; + + #access_log /var/log/nginx/host.access.log main; + + location / { + proxy_pass http://${CKAN_CONTAINER_NAME:-ckan}:${CKAN_PORT:-5000}/; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + #proxy_cache cache; + proxy_cache_bypass $cookie_auth_tkt; + proxy_no_cache $cookie_auth_tkt; + proxy_cache_valid 30m; + proxy_cache_key $host$scheme$proxy_host$request_uri; + } + + error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /error.html; + + # redirect server error pages to the static page /error.html + # + location = /error.html { + ssi on; + internal; + auth_basic off; + root /usr/share/nginx/html; + } + +} \ No newline at end of file From ebe9b6b30186be0b6501b5cc6fe6aa7e5ec2ab1b Mon Sep 17 00:00:00 2001 From: MarkCalvert <37602611+MarkCalvert@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:00:26 +1300 Subject: [PATCH 6/8] Migrated ckan config from .env.dbca to dbca.ini --- .env.dbca | 14 -------------- ckan/config/dbca.ini | 8 ++++++-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.env.dbca b/.env.dbca index 98ba8065..df09a41c 100644 --- a/.env.dbca +++ b/.env.dbca @@ -73,23 +73,9 @@ NGINX_PORT=80 NGINX_SSLPORT=443 # Extensions -CKAN__PLUGINS="image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat dbca scheming_datasets envvars" -CKAN__VIEWS__DEFAULT_VIEWS="text_view datatables_view pdf_view" -CKAN__HARVEST__MQ__TYPE=redis -CKAN__HARVEST__MQ__HOSTNAME=redis -CKAN__HARVEST__MQ__PORT=6379 -CKAN__HARVEST__MQ__REDIS_DB=1 ## WA DBCA Config ## # Docker compose project name COMPOSE_PROJECT_NAME=dbca # The docker compose file to use. Options are docker-compose.dev.yml (The default for local development) or docker-compose.prod.yml (To test production builds) DOCKER_COMPOSE=docker-compose.dev.yml - -# Internationalisation Settings -CKAN__DISPLAY_TIMEZONE=Australia/Perth -CKAN__RESOURCE_FORMATS=/srv/app/src_extensions/ckanext-dbca/ckanext/dbca/config/resource_formats.json - -# Scheming -CKAN___SCHEMING__DATASET_SCHEMAS=ckanext.dbca:dbca_dataset.yaml -CKAN___SCHEMING__PRESETS="ckanext.scheming:presets.json ckanext.dbca:dbca_presets.json" diff --git a/ckan/config/dbca.ini b/ckan/config/dbca.ini index ecc26b86..7b0d7724 100644 --- a/ckan/config/dbca.ini +++ b/ckan/config/dbca.ini @@ -10,17 +10,21 @@ use = config:/srv/app/ckan.ini ckan.devserver.watch_patterns = /srv/app/ckan.ini ## Plugins Settings ############################################################ -ckan.plugins = image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat envvars +ckan.plugins = image_view text_view datatables_view pdf_view datastore xloader pages showcase hierarchy_display hierarchy_form hierarchy_group_form dcat dbca scheming_datasets envvars ## Resource Views Settings ##################################################### ckan.views.default_views = text_view datatables_view pdf_view ## Internationalisation Settings ############################################### ckan.locale_default = en_AU -ckan.display_timezone = Australia/West +ckan.display_timezone = Australia/Perth +ckan.resource_formats = /srv/app/src_extensions/ckanext-dbca/ckanext/dbca/config/resource_formats.json ## CKAN Extensions configuration ############################################### +# ckanext-scheming +scheming.dataset_schemas = ckanext.dbca:dbca_dataset.yaml +scheming.presets = ckanext.scheming:presets.json ckanext.dbca:dbca_presets.json ## Logging configuration [loggers] From 6e38aba6a0f20a35a774f55718d3ed7dd190cb8f Mon Sep 17 00:00:00 2001 From: MarkCalvert <37602611+MarkCalvert@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:01:01 +1300 Subject: [PATCH 7/8] Updated path to dbca.ini config file --- ckan/setup/dbca_ckan_cron_jobs | 4 ++-- ckan/supervisor/ckan_worker_default.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ckan/setup/dbca_ckan_cron_jobs b/ckan/setup/dbca_ckan_cron_jobs index 3a6bd0e0..442bf281 100644 --- a/ckan/setup/dbca_ckan_cron_jobs +++ b/ckan/setup/dbca_ckan_cron_jobs @@ -1,4 +1,4 @@ # Crontab for CKAN cron jobs # Example cron job runs the harvester run command every 15 mins -#*/15 * * * * /usr/bin/ckan -c /srv/app/ckan.ini harvester run >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 -0 0 * * * /usr/bin/ckan -c /srv/app/ckan.ini dbca scheduled_datasets >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 +#*/15 * * * * /usr/bin/ckan -c /srv/app/config/dbca/ckan.ini harvester run >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 +0 0 * * * /usr/bin/ckan -c /srv/app/config/dbca/ckan.ini dbca scheduled_datasets >> $APP_DIR/logs/ckan-cron-jobs.log 2>&1 diff --git a/ckan/supervisor/ckan_worker_default.conf b/ckan/supervisor/ckan_worker_default.conf index f30bf16d..6d8d7303 100644 --- a/ckan/supervisor/ckan_worker_default.conf +++ b/ckan/supervisor/ckan_worker_default.conf @@ -9,7 +9,7 @@ [program:ckan-worker-default] ; Use the full paths to the virtualenv and your configuration file here. -command=/usr/bin/ckan -c /srv/app/ckan.ini jobs worker +command=/usr/bin/ckan -c /srv/app/config/dbca.ini jobs worker ; User the worker runs as. From 39007d95d837ccdde72cb1b81d00e87e462ee9e7 Mon Sep 17 00:00:00 2001 From: awang Date: Wed, 20 Dec 2023 09:53:57 +0700 Subject: [PATCH 8/8] [BIO-6392] removed presets --- ckan/config/dbca.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/ckan/config/dbca.ini b/ckan/config/dbca.ini index 7b0d7724..0f88a07c 100644 --- a/ckan/config/dbca.ini +++ b/ckan/config/dbca.ini @@ -24,7 +24,6 @@ ckan.resource_formats = /srv/app/src_extensions/ckanext-dbca/ckanext/dbca/config # ckanext-scheming scheming.dataset_schemas = ckanext.dbca:dbca_dataset.yaml -scheming.presets = ckanext.scheming:presets.json ckanext.dbca:dbca_presets.json ## Logging configuration [loggers]