From b55a5dfdbd27e749af1a61fa63e08c6faeb1136d Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 16 Mar 2020 19:13:43 +0100 Subject: [PATCH] Use install binary to copy / create CKAN files --- apk/spoc | 2 +- lxc-apps/ckan/install.sh | 43 +++++++++++++++++----------------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/apk/spoc b/apk/spoc index c1e60a4..fc42131 160000 --- a/apk/spoc +++ b/apk/spoc @@ -1 +1 @@ -Subproject commit c1e60a4adf6339c0390e66ab07b63a242442d52a +Subproject commit fc42131bb6acaa9d474930add14f9e7fdf055bf5 diff --git a/lxc-apps/ckan/install.sh b/lxc-apps/ckan/install.sh index 23f0ae6..6bf30e0 100755 --- a/lxc-apps/ckan/install.sh +++ b/lxc-apps/ckan/install.sh @@ -12,14 +12,12 @@ CKAN_CONF="${VOLUMES_DIR}/ckan/ckan_conf" CKAN_DATA="${VOLUMES_DIR}/ckan/ckan_data" # Create Postgres instance -mkdir -p ${POSTGRES_DATA} -chown -R 105432:105432 ${POSTGRES_DATA} -chmod 700 ${POSTGRES_DATA} +install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} spoc-container exec ckan-postgres -- initdb -D /var/lib/postgresql # Configure Postgres -cp postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf -cp postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf +install postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf +install postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf # Create database export CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') @@ -28,41 +26,36 @@ spoc-container start ckan-postgres envsubst ${CKAN_CONF}/ckan.ini -cp ckan_conf/who.ini ${CKAN_CONF}/who.ini -chown -R 100000:100000 ${CKAN_CONF} -chown -R 108080:108080 ${CKAN_DATA} +envsubst