develop.sh 462 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
#!/bin/bash

set -eu

echo "Ensure to set LDAP_URL"

# ensure local app data
mkdir -p .dev/run/ .dev/data/ .dev/run/dnsmasq/hosts/ .dev/data/keys/

10
# Creating a secret for web sessions
11 12 13 14 15 16 17 18 19
if [ ! -f .dev/data/session.secret ]; then
    dd if=/dev/urandom bs=256 count=1 | base64 > .dev/data/session.secret
fi

# Generate random management token for admin api
dd if=/dev/urandom bs=256 count=1 | base64 > .dev/run/admin-token

echo "Starting server"
exec ./server.js