Fix CKAN install script

This commit is contained in:
Disassembler 2019-09-24 19:15:40 +02:00
parent 9d1e3f2d60
commit 8d42eac029
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 5 additions and 5 deletions

View File

@ -54,16 +54,16 @@ cp ckan_conf/who.ini /srv/ckan/ckan_conf/who.ini
chown -R 108080:108080 /srv/ckan/ckan_data
# Populate database
lxc-execute ckan_ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini
lxc-execute ckan_ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
lxc-execute ckan_ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql
lxc-execute ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini
lxc-execute ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
lxc-execute ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql
# Create admin account
export CKAN_ADMIN_USER="admin"
export CKAN_ADMIN_UUID=$(cat /proc/sys/kernel/random/uuid)
export CKAN_ADMIN_APIKEY=$(cat /proc/sys/kernel/random/uuid)
export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export CKAN_ADMIN_HASH=$(lxc-execute ckan_ckan -- python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')")
export CKAN_ADMIN_HASH=$(lxc-execute ckan -- python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')")
export CKAN_ADMIN_EMAIL="admin@example.com"
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql ckan

View File

@ -16,5 +16,5 @@ RUN EOF
EOF
USER 5432 5432
CMD postgres -D /etc/postgresql
CMD postgres -D /var/lib/postgresql
READY pg_isready