forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from dbca-wa/develop
Updated project to use ckan config file
- Loading branch information
Showing
16 changed files
with
233 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ pip3 install -r ${SRC_DIR}/ckanext-hierarchy/requirements.txt | |
# Pages | ||
pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-pages | ||
|
||
# PDF View | ||
pip3 install -e git+https://github.com/ckan/[email protected]#egg=ckanext-pdfview | ||
|
||
# Report | ||
pip3 install -e git+http://github.com/ckan/ckanext-report.git@master#egg=ckanext-report | ||
pip3 install -r ${SRC_DIR}/ckanext-report/requirements.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters