Make KanBoard SPOC-compatible
This commit is contained in:
parent
8f27ee6afe
commit
d8d9f5431e
@ -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"
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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/config.php >${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 <kanboard_conf/config.php | install -o 108080 -g 108080 -m 640 /dev/stdin ${KANBOARD_CONF}/config.php
|
||||
|
||||
# Populate database
|
||||
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'))")
|
||||
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
|
||||
spoc-container stop kanboard-postgres
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -ev
|
||||
|
||||
# Remove persistent data
|
||||
rm -rf ${VOLUME_DIR}/kanboard
|
||||
rm -rf "${VOLUME_DIR}/kanboard"
|
||||
|
||||
# Unregister application
|
||||
vmmgr unregister-app kanboard
|
||||
|
Loading…
Reference in New Issue
Block a user