2018-04-21 23:10:55 +02:00
|
|
|
#!/bin/sh
|
2018-10-28 16:04:11 +01:00
|
|
|
set -ev
|
2018-04-21 23:10:55 +02:00
|
|
|
|
2020-03-22 10:28:57 +01:00
|
|
|
# Volumes
|
|
|
|
OMK_CONF="${VOLUMES_DIR}/openmapkit/omk_conf"
|
|
|
|
OMK_DATA="${VOLUMES_DIR}/openmapkit/omk_data"
|
2020-06-21 08:32:40 +02:00
|
|
|
OMK_LAYER="${LAYERS_DIR}/openmapkit_0.12.0-200621"
|
2020-03-22 10:28:57 +01:00
|
|
|
|
2018-04-21 23:10:55 +02:00
|
|
|
# Configure OpenMapKit
|
|
|
|
export OPENMAPKIT_ADMIN_USER="admin"
|
2019-06-05 18:55:15 +02:00
|
|
|
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
2020-03-22 10:28:57 +01:00
|
|
|
install -o 108080 -g 108080 -m 750 -d ${OMK_CONF}
|
2020-06-21 17:02:10 +02:00
|
|
|
install -o 108080 -g 108080 -m 640 omk_conf/add-ca-cert.env ${OMK_CONF}/add-ca-cert.env
|
2020-03-22 10:28:57 +01:00
|
|
|
envsubst <omk_conf/settings.js | install -o 108080 -g 108080 -m 640 /dev/stdin ${OMK_CONF}/settings.js
|
2018-10-28 19:50:35 +01:00
|
|
|
|
2019-12-07 15:52:09 +01:00
|
|
|
# Copy existing files into persistent storage
|
2020-03-23 10:10:57 +01:00
|
|
|
cp -rp ${OMK_LAYER}/srv/openmapkit/data ${OMK_DATA}
|
2019-12-07 15:52:09 +01:00
|
|
|
|
2018-11-03 15:53:51 +01:00
|
|
|
# Register application
|
2019-02-26 21:12:41 +01:00
|
|
|
vmmgr register-app openmapkit omk "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"
|