From efac45798f29869af9b1bc5cda9936158f45a638 Mon Sep 17 00:00:00 2001 From: mjanez <96422458+mjanez@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:41:41 +0200 Subject: [PATCH] Improve envvars - Sync vars to avoid errors. --- .env.example | 62 ++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/.env.example b/.env.example index c7095588..b812eae0 100644 --- a/.env.example +++ b/.env.example @@ -5,21 +5,26 @@ APP_DIR=/srv/app # Host Ports CKAN_PORT_HOST=5000 -NGINX_PORT_HOST=81 +# Common proxy server for Apache or NGINX +PROXY_SERVER_PORT_HOST=81 +NGINX_PORT_HOST=${PROXY_SERVER_PORT_HOST} NGINX_SSLPORT_HOST=8443 -APACHE_PORT_HOST=81 +APACHE_PORT_HOST=${PROXY_SERVER_PORT_HOST} PYCSW_PORT_HOST=8000 # Solr SOLR_IMAGE_VERSION=2.9-solr9-spatial SOLR_PORT=8983 -CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan -TEST_CKAN_SOLR_URL=http://solr:${SOLR_PORT}/solr/ckan +SOLR_CKAN_DATABASE=ckan +CKAN_SOLR_URL=http://${SOLR_CONTAINER_NAME}:${SOLR_PORT}/solr/${SOLR_CKAN_DATABASE} +TEST_CKAN_SOLR_URL=http://${SOLR_CONTAINER_NAME}:${SOLR_PORT}/solr/${SOLR_CKAN_DATABASE} # Redis REDIS_VERSION=7-alpine -CKAN_REDIS_URL=redis://redis:6379/1 -TEST_CKAN_REDIS_URL=redis://redis:6379/1 +REDIS_PORT=6379 +REDIS_CKAN_DATABASE=1 +CKAN_REDIS_URL=redis://${REDIS_CONTAINER_NAME}:${REDIS_PORT}/${REDIS_CKAN_DATABASE} +TEST_CKAN_REDIS_URL=redis://${REDIS_CONTAINER_NAME}:${REDIS_PORT}/${REDIS_CKAN_DATABASE} # NGINX NGINX_PORT=80 @@ -32,15 +37,16 @@ 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 `/`. +## 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} PROXY_SERVER_NAME=localhost +PROXY_SERVER_URL=http://${PROXY_SERVER_NAME}:${PROXY_SERVER_PORT_HOST} PROXY_CKAN_LOCATION=/catalog PROXY_PYCSW_LOCATION=/csw # pycsw PYCSW_PORT=8000 -CKAN_URL=http://localhost:81/catalog -PYCSW_URL=http://localhost:81/csw +CKAN_URL=${PROXY_SERVER_URL}/${PROXY_CKAN_LOCATION} +PYCSW_URL=${PROXY_SERVER_URL}/${PROXY_PYCSW_LOCATION} # SCHEMAS: ckan2pycsw/model/dataset.py - Dataset type PYCSW_CKAN_SCHEMA=iso19139_geodcatap PYCSW_OUPUT_SCHEMA=iso19139_inspire @@ -56,21 +62,23 @@ TZ=UTC POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=postgres -POSTGRES_HOST=db +POSTGRES_HOST=${DB_CONTAINER_NAME} CKAN_DB_USER=ckandbuser CKAN_DB_PASSWORD=ckandbpassword CKAN_DB=ckandb DATASTORE_READONLY_USER=datastore_ro DATASTORE_READONLY_PASSWORD=datastore DATASTORE_DB=datastore -CKAN_SQLALCHEMY_URL=postgresql://ckandbuser:ckandbpassword@db/ckandb -CKAN_DATASTORE_WRITE_URL=postgresql://ckandbuser:ckandbpassword@db/datastore -CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore +CKAN_SQLALCHEMY_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${CKAN_DB} +CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_DB} +CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@${POSTGRES_HOST}/${DATASTORE_DB} # Test database connections -TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@db/ckan_test -TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test -TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test +CKAN_TEST_DB=ckan_test +DATASTORE_TEST_DB=datastore_test +TEST_CKAN_SQLALCHEMY_URL=postgres://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${CKAN_TEST_DB} +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 @@ -80,11 +88,11 @@ CKAN_DEV_COMPOSE_SERVICE=ckan-dev ## If use docker-compose.ghcr.yml only "*.*.*" versions available in: https://github.com/mjanez/ckan-docker/pkgs/container/ckan-docker CKAN_VERSION=2.9.11 CKAN_SITE_ID=default -# CKAN_SITE_URL = http:/ or https:/ + PROXY_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 80 -CKAN_SITE_URL=http://localhost:81 -CKAN__ROOT_PATH=/catalog/{{LANG}} +# CKAN_SITE_URL = http:/ or https:/ + PROXY_SERVER_NAME. Optionally the APACHE_HOST_PORT if different from 8095 +CKAN_SITE_URL=${PROXY_SERVER_URL} +CKAN__ROOT_PATH=${PROXY_CKAN_LOCATION}/{{LANG}} CKAN_PORT=5000 -CKAN__FAVICON=/catalog/base/images/ckan.ico +CKAN__FAVICON=${PROXY_CKAN_LOCATION}/base/images/ckan.ico CKAN__SITE_LOGO=/images/default/ckan-logo.png CKAN___BEAKER__SESSION__SECRET=CHANGE_ME # See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings @@ -99,7 +107,7 @@ CKAN_SMTP_SERVER=smtp.corporateict.domain:25 CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user CKAN_SMTP_PASSWORD=pass -CKAN_SMTP_MAIL_FROM=ckan@localhost +CKAN_SMTP_MAIL_FROM=ckan@${PROXY_SERVER_NAME} ## Customize which text formats the text_view plugin will show CKAN__PREVIEW__JSON_FORMATS="json jsonld" # html htm rdf+xml owl+xml xml n3 n-triples turtle plain atom csv tsv rss txt json @@ -132,14 +140,14 @@ CKAN__PLUGINS="envvars stats image_view text_view recline_view webpage_view reso # ckanext-harvest CKAN__HARVEST__MQ__TYPE=redis CKAN__HARVEST__MQ__HOSTNAME=redis -CKAN__HARVEST__MQ__PORT=6379 -CKAN__HARVEST__MQ__REDIS_DB=1 +CKAN__HARVEST__MQ__PORT=${REDIS_PORT} +CKAN__HARVEST__MQ__REDIS_DB=${REDIS_CKAN_DATABASE} # Clean-up mechanism for the harvest log table. The default is 30 days. CKAN__HARVEST__LOG_TIMEFRAME=40 # ckanext-xloader CKANEXT__XLOADER__API_TOKEN=api_token -CKANEXT__XLOADER__JOBS__DB_URI=postgresql://ckandbuser:ckandbpassword@db/ckandb +CKANEXT__XLOADER__JOBS__DB_URI=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@${POSTGRES_HOST}/${CKAN_DB} # ckanext-dcat CKANEXT__DCAT__BASE_URI=${CKAN_URL} @@ -185,8 +193,4 @@ CKANEXT__PAGES__ORGANIZATION=True CKANEXT__PAGES__GROUP=True CKANEXT__PAGES__ABOUT_MENU=False CKANEXT__PAGES__GROUP_MENU=True -CKANEXT__PAGES__ORGANIZATION_MENU=True - -# WIP: ckanext-sparql_interface -CKANEXT__SPARQL__ENDPOINT_URL=https://dbpedia.org/sparql -CKANEXT__SPARQL__HIDE_ENDPOINT_URL=False \ No newline at end of file +CKANEXT__PAGES__ORGANIZATION_MENU=True \ No newline at end of file