Make SeedDMS SPOC-compatible
This commit is contained in:
parent
746713eb9f
commit
e0e49ec31a
27
lxc-apps/seeddms/app
Normal file
27
lxc-apps/seeddms/app
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"version": "5.1.15-200313",
|
||||||
|
"meta": {
|
||||||
|
"title": "SeedDMS",
|
||||||
|
"desc-cs": "Archiv dokumentace",
|
||||||
|
"desc-en": "Document management system",
|
||||||
|
"license": "GPL"
|
||||||
|
},
|
||||||
|
"containers": {
|
||||||
|
"seeddms": {
|
||||||
|
"image": "seeddms_5.1.15-200313",
|
||||||
|
"depends": [
|
||||||
|
"seeddms-postgres"
|
||||||
|
],
|
||||||
|
"mounts": {
|
||||||
|
"seeddms/seeddms_conf": "srv/seeddms/conf",
|
||||||
|
"seeddms/seeddms_data": "srv/seeddms/data"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"seeddms-postgres": {
|
||||||
|
"image": "postgres_12.2.0-200313",
|
||||||
|
"mounts": {
|
||||||
|
"seeddms/postgres_data": "var/lib/postgresql"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
IMAGE seeddms_5.1.9-190620
|
IMAGE seeddms_5.1.15-200313
|
||||||
FROM alpine3.9-php7.2_7.2.19-190620
|
FROM alpine3.11-php7.3_7.3.15-200313
|
||||||
|
|
||||||
RUN EOF
|
RUN EOF
|
||||||
# Install runtime dependencies
|
# Install runtime dependencies
|
||||||
@ -14,18 +14,16 @@ RUN EOF
|
|||||||
apk --no-cache add wget
|
apk --no-cache add wget
|
||||||
|
|
||||||
# Install SeedDMS
|
# Install SeedDMS
|
||||||
wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.9/seeddms-quickstart-5.1.9.tar.gz/download -O /srv/seeddms.tgz
|
wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.15/seeddms-quickstart-5.1.15.tar.gz/download -O - | tar xzf - -C /srv
|
||||||
tar xzf /srv/seeddms.tgz -C /srv
|
mv /srv/seeddms* /srv/seeddms
|
||||||
mv /srv/seeddms51x /srv/seeddms
|
|
||||||
rm -f /srv/seeddms.tgz
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
COPY lxc
|
COPY image.d
|
||||||
|
|
||||||
RUN EOF
|
RUN EOF
|
||||||
# Patch Previewers
|
# Patch Previewers
|
||||||
cd /srv/seeddms
|
cd /srv/seeddms
|
||||||
patch -p0 <previewers.patch
|
#TODO: patch -p0 <previewers.patch
|
||||||
rm previewers.patch
|
rm previewers.patch
|
||||||
|
|
||||||
# Create OS user
|
# Create OS user
|
@ -1,40 +1,40 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
|
# Volumes
|
||||||
|
POSTGRES_DATA="${VOLUMES_DIR}/seeddms/postgres_data"
|
||||||
|
SEEDDMS_DATA="${VOLUMES_DIR}/seeddms/seeddms_data"
|
||||||
|
SEEDDMS_CONF="${VOLUMES_DIR}/seeddms/seeddms_conf"
|
||||||
|
SEEDDMS_LAYER="${LAYERS_DIR}/seeddms_5.1.15-200313"
|
||||||
|
|
||||||
# Create Postgres instance
|
# Create Postgres instance
|
||||||
mkdir -p /srv/seeddms/postgres_data
|
install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA}
|
||||||
chown -R 105432:105432 /srv/seeddms/postgres_data
|
spoc-container exec seeddms-postgres -- initdb -D /var/lib/postgresql
|
||||||
chmod 700 /srv/seeddms/postgres_data
|
|
||||||
lxc-execute -n seeddms-postgres -- initdb -D /var/lib/postgresql
|
|
||||||
|
|
||||||
# Configure Postgres
|
# Configure Postgres
|
||||||
cp postgres_data/postgresql.conf /srv/seeddms/postgres_data/postgresql.conf
|
install -o 105432 -g 105432 -m 600 postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf
|
||||||
cp postgres_data/pg_hba.conf /srv/seeddms/postgres_data/pg_hba.conf
|
install -o 105432 -g 105432 -m 600 postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf
|
||||||
|
|
||||||
# Copy existing files into persistent storage
|
# Copy existing files into persistent storage
|
||||||
lxchelper extract seeddms /srv/seeddms/conf /srv/seeddms/seeddms_conf
|
cp -rp ${SEEDDMS_LAYER}/srv/seeddms/conf ${SEEDDMS_CONF}
|
||||||
lxchelper extract seeddms /srv/seeddms/data /srv/seeddms/seeddms_data
|
cp -rp ${SEEDDMS_LAYER}/srv/seeddms/data ${SEEDDMS_DATA}
|
||||||
|
|
||||||
# Populate database
|
# Populate database
|
||||||
export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
|
export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
|
||||||
service lxc-seeddms-postgres start
|
spoc-container start seeddms-postgres
|
||||||
envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 seeddms-postgres -- psql
|
envsubst <createdb.sql | spoc-container exec seeddms-postgres -- psql
|
||||||
lxc-execute seeddms -- cat /srv/seeddms/create_tables-postgres.sql | lxc-attach seeddms-postgres -- sh -c "PGPASSWORD=${SEEDDMS_PWD} psql seeddms seeddms"
|
cat ${SEEDDMS_LAYER}/srv/seeddms/create_tables-postgres.sql | spoc-container exec seeddms-postgres -- sh -c "PGPASSWORD=${SEEDDMS_PWD} psql seeddms seeddms"
|
||||||
cat custom.sql | lxc-attach -u 5432 -g 5432 seeddms-postgres -- psql seeddms
|
cat custom.sql | spoc-container exec seeddms-postgres -- psql seeddms
|
||||||
|
|
||||||
# Configure SeedDMS
|
# Configure SeedDMS
|
||||||
envsubst <seeddms_conf/settings.xml >/srv/seeddms/seeddms_conf/settings.xml
|
envsubst <seeddms_conf/settings.xml | install -o 108080 -g 108080 -m 640 /dev/stdin ${SEEDDMS_CONF}/settings.xml
|
||||||
export SEEDDMS_ADMIN_USER=admin
|
export SEEDDMS_ADMIN_USER=admin
|
||||||
export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
||||||
export SEEDDMS_ADMIN_EMAIL=admin@example.com
|
export SEEDDMS_ADMIN_EMAIL=admin@example.com
|
||||||
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 seeddms-postgres -- psql seeddms
|
envsubst <adminpwd.sql | spoc-container exec seeddms-postgres -- psql seeddms
|
||||||
chown -R 108080:108080 /srv/seeddms/seeddms_conf
|
|
||||||
|
|
||||||
# Install config update script
|
|
||||||
cp update-conf.sh /srv/seeddms/update-conf.sh
|
|
||||||
|
|
||||||
# Stop services required for setup
|
# Stop services required for setup
|
||||||
service lxc-seeddms-postgres stop
|
spoc-container stop seeddms-postgres
|
||||||
|
|
||||||
# Register application
|
# Register application
|
||||||
vmmgr register-app seeddms dms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
|
vmmgr register-app seeddms dms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "5.1.9-190620",
|
|
||||||
"meta": {
|
|
||||||
"title": "SeedDMS",
|
|
||||||
"desc-cs": "Archiv dokumentace",
|
|
||||||
"desc-en": "Document management system",
|
|
||||||
"license": "GPL"
|
|
||||||
},
|
|
||||||
"containers": {
|
|
||||||
"seeddms": {
|
|
||||||
"image": "seeddms_5.1.9-190620",
|
|
||||||
"depends": [
|
|
||||||
"seeddms-postgres"
|
|
||||||
],
|
|
||||||
"mounts": [
|
|
||||||
["DIR", "/srv/seeddms/seeddms_conf", "/srv/seeddms/conf"],
|
|
||||||
["DIR", "/srv/seeddms/seeddms_data", "/srv/seeddms/data"]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"seeddms-postgres": {
|
|
||||||
"image": "postgres_11.3.0-190620",
|
|
||||||
"mounts": [
|
|
||||||
["DIR", "/srv/seeddms/postgres_data", "/var/lib/postgresql"]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,7 +2,7 @@
|
|||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
# Remove persistent data
|
# Remove persistent data
|
||||||
rm -rf /srv/seeddms
|
rm -rf "${VOLUMES_DIR}/seeddms"
|
||||||
|
|
||||||
# Unregister application
|
# Unregister application
|
||||||
vmmgr unregister-app seeddms
|
vmmgr unregister-app seeddms
|
||||||
|
Loading…
Reference in New Issue
Block a user