24 lines
918 B
Bash
Executable File
24 lines
918 B
Bash
Executable File
#!/bin/sh
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
|
|
|
# Build Docker container
|
|
docker build -t openmapkit ${SOURCE_DIR}
|
|
|
|
# Configure OpenMapKit
|
|
export OMK_ADMIN_USER="admin"
|
|
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
|
mkdir -p /srv/openmapkit/conf /srv/openmapkit/data/deployments /srv/openmapkit/data/forms /srv/openmapkit/data/submissions
|
|
chown -R 8007:8007 /srv/openmapkit/data
|
|
envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js
|
|
|
|
# Configure OpenMapKit service
|
|
cp ${SOURCE_DIR}/etc/init.d/openmapkit /etc/init.d/openmapkit
|
|
rc-update add openmapkit
|
|
service openmapkit start
|
|
|
|
# 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}"
|