develop.sh 766 Bytes
Newer Older
1 2 3 4 5 6
#!/bin/bash

set -eu

echo "Ensure to set LDAP_URL"

7 8 9 10 11
echo "If using the ldaptestserver from npm, then simply export the following variables:"

echo "export CLOUDRON_LDAP_USERS_BASE_DN=ou=users,dc=example"
echo "export CLOUDRON_LDAP_URL=ldap://localhost:3002"

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

15
# Creating a secret for web sessions
16 17 18 19 20 21 22
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

23 24 25 26
if [ ! -f .dev/data/openvpn.conf ]; then
    cp openvpn.conf.template .dev/data/openvpn.conf
fi

27 28
echo "Starting server"
exec ./server.js