Fix CKAN install script
This commit is contained in:
parent
9d1e3f2d60
commit
8d42eac029
@ -54,16 +54,16 @@ cp ckan_conf/who.ini /srv/ckan/ckan_conf/who.ini
|
|||||||
chown -R 108080:108080 /srv/ckan/ckan_data
|
chown -R 108080:108080 /srv/ckan/ckan_data
|
||||||
|
|
||||||
# Populate database
|
# Populate database
|
||||||
lxc-execute ckan_ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini
|
lxc-execute 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 -- 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 datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql
|
||||||
|
|
||||||
# Create admin account
|
# Create admin account
|
||||||
export CKAN_ADMIN_USER="admin"
|
export CKAN_ADMIN_USER="admin"
|
||||||
export CKAN_ADMIN_UUID=$(cat /proc/sys/kernel/random/uuid)
|
export CKAN_ADMIN_UUID=$(cat /proc/sys/kernel/random/uuid)
|
||||||
export CKAN_ADMIN_APIKEY=$(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_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"
|
export CKAN_ADMIN_EMAIL="admin@example.com"
|
||||||
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql ckan
|
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql ckan
|
||||||
|
|
||||||
|
@ -16,5 +16,5 @@ RUN EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
USER 5432 5432
|
USER 5432 5432
|
||||||
CMD postgres -D /etc/postgresql
|
CMD postgres -D /var/lib/postgresql
|
||||||
READY pg_isready
|
READY pg_isready
|
||||||
|
Loading…
Reference in New Issue
Block a user