Make KanBoard SPOC-compatible

This commit is contained in:
Disassembler 2020-03-17 16:49:00 +01:00
parent 8f27ee6afe
commit d8d9f5431e
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
4 changed files with 19 additions and 26 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.2.13-200207", "version": "1.2.13-200313",
"meta": { "meta": {
"title": "KanBoard", "title": "KanBoard",
"desc-cs": "Kanban řízení projektů", "desc-cs": "Kanban řízení projektů",
@ -8,7 +8,7 @@
}, },
"containers": { "containers": {
"kanboard": { "kanboard": {
"image": "kanboard_1.2.13-200207", "image": "kanboard_1.2.13-200313",
"depends": [ "depends": [
"kanboard-postgres" "kanboard-postgres"
], ],
@ -18,7 +18,7 @@
} }
}, },
"kanboard-postgres": { "kanboard-postgres": {
"image": "postgres_12.1.0-200207", "image": "postgres_12.2.0-200313",
"mounts": { "mounts": {
"kanboard/postgres_data": "var/lib/postgresql" "kanboard/postgres_data": "var/lib/postgresql"
} }

View File

@ -1,5 +1,5 @@
IMAGE kanboard_1.2.13-200207 IMAGE kanboard_1.2.13-200313
FROM alpine3.11-php7.3_7.3.14-200207 FROM alpine3.11-php7.3_7.3.15-200313
RUN EOF RUN EOF
# Install runtime dependencies # Install runtime dependencies
@ -11,7 +11,7 @@ RUN EOF
# Download KanBoard # Download KanBoard
wget https://github.com/kanboard/kanboard/archive/v1.2.13.zip -O /srv/kanboard.zip wget https://github.com/kanboard/kanboard/archive/v1.2.13.zip -O /srv/kanboard.zip
unzip /srv/kanboard.zip -d /srv unzip /srv/kanboard.zip -d /srv
mv /srv/kanboard-1.2.13 /srv/kanboard mv /srv/kanboard-* /srv/kanboard
# Install plugins # Install plugins
git clone --depth=1 https://github.com/BlueTeck/kanboard_plugin_overwrite_translation /srv/kanboard/plugins/Overwrite_translation 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 git clone --depth=1 https://github.com/xavividal/kanboard-plugin-relationgraph /srv/kanboard/plugins/Relationgraph
# Create OS user # Create OS user
addgroup -S kanboard addgroup -S -g 8080 kanboard
adduser -S -h /srv/kanboard -s /bin/false -g kanboard -G kanboard kanboard adduser -S -u 8080 -h /srv/kanboard -s /bin/false -g kanboard -G kanboard kanboard
# Cleanup # Cleanup
apk --no-cache del .deps apk --no-cache del .deps

View File

@ -1,28 +1,24 @@
#!/bin/sh #!/bin/sh
set -ev set -ev
# Prepare variables # Volumes
POSTGRES_DATA_DIR=${VOLUMES_DIR}/kanboard/postgres_data POSTGRES_DATA="${VOLUMES_DIR}/kanboard/postgres_data"
KANBOARD_DATA_DIR=${VOLUMES_DIR}/kanboard/kanboard_data KANBOARD_CONF="${VOLUMES_DIR}/kanboard/kanboard_conf"
KANBOARD_CONF_DIR=${VOLUMES_DIR}/kanboard/kanboard_conf KANBOARD_DATA="${VOLUMES_DIR}/kanboard/kanboard_data"
POSTGRES_NSUID=100070
POSTGRES_NSGID=100070
KANBOARD_NSUID=100102
KANBOARD_NSGID=100102
# Create Postgres instance # 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 spoc-container exec kanboard-postgres -- initdb -D /var/lib/postgresql
# Configure Postgres # Configure Postgres
cp postgres_data/postgresql.conf ${POSTGRES_DATA_DIR}/postgresql.conf install -o 105432 -g 105432 -m 600 postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf
cp postgres_data/pg_hba.conf ${POSTGRES_DATA_DIR}/pg_hba.conf install -o 105432 -g 105432 -m 600 postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf
# Configure Kanboard # Configure Kanboard
export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
mkdir -p ${KANBOARD_CONF_DIR} ${KANBOARD_DATA_DIR} install -o 108080 -g 108080 -m 750 -d ${KANBOARD_CONF}
envsubst <kanboard_conf/config.php >${KANBOARD_CONF_DIR}/config.php install -o 108080 -g 108080 -m 750 -d ${KANBOARD_DATA}
chown -R ${KANBOARD_NSUID}:${KANBOARD_NSGID} ${KANBOARD_CONF_DIR} ${KANBOARD_DATA_DIR} envsubst <kanboard_conf/config.php | install -o 108080 -g 108080 -m 640 /dev/stdin ${KANBOARD_CONF}/config.php
# Populate database # Populate database
spoc-container start kanboard-postgres spoc-container start kanboard-postgres
@ -35,9 +31,6 @@ export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))") export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))")
envsubst <adminpwd.sql | spoc-container exec kanboard-postgres -- psql kanboard envsubst <adminpwd.sql | spoc-container exec kanboard-postgres -- psql kanboard
# Install config update script
cp update-conf.sh ${VOLUMES_DIR}/kanboard/update-conf.sh
# Stop services required for setup # Stop services required for setup
spoc-container stop kanboard-postgres spoc-container stop kanboard-postgres

View File

@ -2,7 +2,7 @@
set -ev set -ev
# Remove persistent data # Remove persistent data
rm -rf ${VOLUME_DIR}/kanboard rm -rf "${VOLUME_DIR}/kanboard"
# Unregister application # Unregister application
vmmgr unregister-app kanboard vmmgr unregister-app kanboard