2022-04-29 02:44:57 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script based on the developer readme and allows you to run a test server.
|
|
|
|
|
2022-09-02 06:21:20 +02:00
|
|
|
if [ -z "$KANI_TMP" ]; then
|
|
|
|
KANI_TMP=/tmp/kanidm
|
|
|
|
fi
|
2022-04-29 02:44:57 +02:00
|
|
|
|
|
|
|
CONFIG_FILE="../../examples/insecure_server.toml"
|
|
|
|
|
|
|
|
if [ ! -f "${CONFIG_FILE}" ]; then
|
|
|
|
SCRIPT_DIR="$(dirname -a "$0")"
|
|
|
|
echo "Couldn't find configuration file at ${CONFIG_FILE}, please ensure you're running this script from its base directory (${SCRIPT_DIR})."
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-02 06:21:20 +02:00
|
|
|
if [ ! -f "${KANI_TMP}/chain.pem" ]; then
|
2022-04-29 02:44:57 +02:00
|
|
|
echo "Couldn't find certificate at /tmp/kanidm/chain.pem, quitting"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-09-02 06:21:20 +02:00
|
|
|
if [ ! -f "${KANI_TMP}/key.pem" ]; then
|
2022-04-29 02:44:57 +02:00
|
|
|
echo "Couldn't find key file at /tmp/kanidm/key.pem, quitting"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-05-03 05:24:39 +02:00
|
|
|
COMMAND="server"
|
|
|
|
if [ -n "${1}" ]; then
|
|
|
|
COMMAND=$*
|
|
|
|
fi
|
|
|
|
|
|
|
|
#shellcheck disable=SC2086
|
2022-08-09 05:07:06 +02:00
|
|
|
cargo run --bin kanidmd -- ${COMMAND} -c "${CONFIG_FILE}"
|