20 lines
674 B
Bash
Executable File
20 lines
674 B
Bash
Executable File
#!/bin/sh
|
|
set -ev
|
|
|
|
# Volumes
|
|
OMK_CONF="${VOLUMES_DIR}/openmapkit/omk_conf"
|
|
OMK_DATA="${VOLUMES_DIR}/openmapkit/omk_data"
|
|
OMK_LAYER="${LAYERS_DIR}/openmapkit_0.12.0-200403"
|
|
|
|
# Configure OpenMapKit
|
|
export OPENMAPKIT_ADMIN_USER="admin"
|
|
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
|
|
install -o 108080 -g 108080 -m 750 -d ${OMK_CONF}
|
|
envsubst <omk_conf/settings.js | install -o 108080 -g 108080 -m 640 /dev/stdin ${OMK_CONF}/settings.js
|
|
|
|
# Copy existing files into persistent storage
|
|
cp -rp ${OMK_LAYER}/srv/openmapkit/data ${OMK_DATA}
|
|
|
|
# Register application
|
|
vmmgr register-app openmapkit omk "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"
|