Spotter-VM/lxc-apps/openmapkit/install.sh

14 lines
536 B
Bash
Executable File

#!/bin/sh
set -ev
# Configure OpenMapKit
export OPENMAPKIT_ADMIN_USER="admin"
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
mkdir -p /srv/openmapkit/omk_conf /srv/openmapkit/omk_data
chown -R 108080:108080 /srv/openmapkit/omk_data
lxc-execute openmapkit -- tar -cC /srv/openmapkit/data . | tar -xC /srv/openmapkit/omk_data
envsubst <omk_conf/settings.js >/srv/openmapkit/omk_conf/settings.js
# Register application
vmmgr register-app openmapkit omk "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"