2018-04-21 23:10:55 +02:00
|
|
|
#!/bin/sh
|
2018-07-15 21:55:35 +02:00
|
|
|
set -e
|
2018-04-21 23:10:55 +02:00
|
|
|
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
|
|
|
|
|
|
|
# Build Docker container
|
|
|
|
docker build -t openmapkit ${SOURCE_DIR}
|
|
|
|
cp ${SOURCE_DIR}/etc/init.d/openmapkit /etc/init.d/openmapkit
|
|
|
|
rc-update -u
|
|
|
|
|
|
|
|
# Configure OpenMapKit
|
|
|
|
export OPENMAPKIT_ADMIN_USER="admin"
|
|
|
|
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
|
|
|
mkdir -p /srv/openmapkit/conf /srv/openmapkit/data
|
|
|
|
chown -R 8007:8007 /srv/openmapkit/data
|
|
|
|
docker run --rm -v /srv/openmapkit/data:/mnt/data openmapkit cp -rp /srv/openmapkit/data/. /mnt/data
|
|
|
|
envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js
|
|
|
|
spotter-appmgr update-login openmapkit "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"
|