2017-12-19 20:27:51 +01:00
|
|
|
#!/bin/sh
|
2017-12-12 05:48:36 +01:00
|
|
|
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
|
|
|
|
2017-12-13 17:16:08 +01:00
|
|
|
# Build Docker container
|
|
|
|
docker build -t openmapkit ${SOURCE_DIR}
|
2017-12-12 05:48:36 +01:00
|
|
|
|
|
|
|
# Configure OpenMapKit
|
|
|
|
export OMK_ADMIN_USER="admin"
|
|
|
|
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
2018-03-16 16:09:05 +01:00
|
|
|
mkdir -p /srv/openmapkit/conf /srv/openmapkit/data/deployments /srv/openmapkit/data/forms /srv/openmapkit/data/submissions
|
2017-12-13 17:16:08 +01:00
|
|
|
chown -R 8007:8007 /srv/openmapkit/data
|
2018-01-27 14:27:28 +01:00
|
|
|
envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2017-12-12 05:48:36 +01:00
|
|
|
# Configure OpenMapKit service
|
2017-12-19 20:27:51 +01:00
|
|
|
cp ${SOURCE_DIR}/etc/init.d/openmapkit /etc/init.d/openmapkit
|
2018-02-06 21:54:11 +01:00
|
|
|
rc-update add openmapkit
|
2017-12-19 20:27:51 +01:00
|
|
|
service openmapkit start
|
2017-12-12 05:48:36 +01:00
|
|
|
|
2018-03-25 23:17:58 +02:00
|
|
|
# Add application definition
|
|
|
|
spotter-appmgr add-app openmapkit "https://openmapkit.{host}/" admin "${OMK_ADMIN_PWD}"
|
|
|
|
spotter-appmgr add-app openmapkit-clients -p clienturl "https://openmapkit.{host}"
|
|
|
|
spotter-appmgr add-app geoodk-clients -p clienturl "https://openmapkit.{host}"
|