From d8d9f5431eeec312ca86ba4124e5c36b7709924a Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 17 Mar 2020 16:49:00 +0100 Subject: [PATCH] Make KanBoard SPOC-compatible --- lxc-apps/kanboard/app | 6 +++--- lxc-apps/kanboard/image | 10 +++++----- lxc-apps/kanboard/install.sh | 27 ++++++++++----------------- lxc-apps/kanboard/uninstall.sh | 2 +- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/lxc-apps/kanboard/app b/lxc-apps/kanboard/app index ee82fd6..3645b30 100644 --- a/lxc-apps/kanboard/app +++ b/lxc-apps/kanboard/app @@ -1,5 +1,5 @@ { - "version": "1.2.13-200207", + "version": "1.2.13-200313", "meta": { "title": "KanBoard", "desc-cs": "Kanban řízení projektů", @@ -8,7 +8,7 @@ }, "containers": { "kanboard": { - "image": "kanboard_1.2.13-200207", + "image": "kanboard_1.2.13-200313", "depends": [ "kanboard-postgres" ], @@ -18,7 +18,7 @@ } }, "kanboard-postgres": { - "image": "postgres_12.1.0-200207", + "image": "postgres_12.2.0-200313", "mounts": { "kanboard/postgres_data": "var/lib/postgresql" } diff --git a/lxc-apps/kanboard/image b/lxc-apps/kanboard/image index c5ab458..1b2927e 100644 --- a/lxc-apps/kanboard/image +++ b/lxc-apps/kanboard/image @@ -1,5 +1,5 @@ -IMAGE kanboard_1.2.13-200207 -FROM alpine3.11-php7.3_7.3.14-200207 +IMAGE kanboard_1.2.13-200313 +FROM alpine3.11-php7.3_7.3.15-200313 RUN EOF # Install runtime dependencies @@ -11,7 +11,7 @@ RUN EOF # Download KanBoard wget https://github.com/kanboard/kanboard/archive/v1.2.13.zip -O /srv/kanboard.zip unzip /srv/kanboard.zip -d /srv - mv /srv/kanboard-1.2.13 /srv/kanboard + mv /srv/kanboard-* /srv/kanboard # Install plugins git clone --depth=1 https://github.com/BlueTeck/kanboard_plugin_overwrite_translation /srv/kanboard/plugins/Overwrite_translation @@ -30,8 +30,8 @@ RUN EOF git clone --depth=1 https://github.com/xavividal/kanboard-plugin-relationgraph /srv/kanboard/plugins/Relationgraph # Create OS user - addgroup -S kanboard - adduser -S -h /srv/kanboard -s /bin/false -g kanboard -G kanboard kanboard + addgroup -S -g 8080 kanboard + adduser -S -u 8080 -h /srv/kanboard -s /bin/false -g kanboard -G kanboard kanboard # Cleanup apk --no-cache del .deps diff --git a/lxc-apps/kanboard/install.sh b/lxc-apps/kanboard/install.sh index aa59d58..c0bff63 100755 --- a/lxc-apps/kanboard/install.sh +++ b/lxc-apps/kanboard/install.sh @@ -1,28 +1,24 @@ #!/bin/sh set -ev -# Prepare variables -POSTGRES_DATA_DIR=${VOLUMES_DIR}/kanboard/postgres_data -KANBOARD_DATA_DIR=${VOLUMES_DIR}/kanboard/kanboard_data -KANBOARD_CONF_DIR=${VOLUMES_DIR}/kanboard/kanboard_conf -POSTGRES_NSUID=100070 -POSTGRES_NSGID=100070 -KANBOARD_NSUID=100102 -KANBOARD_NSGID=100102 +# Volumes +POSTGRES_DATA="${VOLUMES_DIR}/kanboard/postgres_data" +KANBOARD_CONF="${VOLUMES_DIR}/kanboard/kanboard_conf" +KANBOARD_DATA="${VOLUMES_DIR}/kanboard/kanboard_data" # Create Postgres instance -install -d -o ${POSTGRES_NSUID} -g ${POSTGRES_NSGID} -m 700 ${POSTGRES_DATA_DIR} +install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} spoc-container exec kanboard-postgres -- initdb -D /var/lib/postgresql # Configure Postgres -cp postgres_data/postgresql.conf ${POSTGRES_DATA_DIR}/postgresql.conf -cp postgres_data/pg_hba.conf ${POSTGRES_DATA_DIR}/pg_hba.conf +install -o 105432 -g 105432 -m 600 postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf +install -o 105432 -g 105432 -m 600 postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf # Configure Kanboard export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') -mkdir -p ${KANBOARD_CONF_DIR} ${KANBOARD_DATA_DIR} -envsubst ${KANBOARD_CONF_DIR}/config.php -chown -R ${KANBOARD_NSUID}:${KANBOARD_NSGID} ${KANBOARD_CONF_DIR} ${KANBOARD_DATA_DIR} +install -o 108080 -g 108080 -m 750 -d ${KANBOARD_CONF} +install -o 108080 -g 108080 -m 750 -d ${KANBOARD_DATA} +envsubst