2018-08-23 16:48:03 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-01-12 03:47:18 +00:00
|
|
|
SETUP_PARAMS=""
|
|
|
|
|
|
|
|
if [[ -n "${API_KEY:-}" ]]; then
|
2019-01-10 10:35:06 +00:00
|
|
|
export STORJ_POINTER_DB_AUTH_API_KEY="${API_KEY}"
|
2019-01-12 03:47:18 +00:00
|
|
|
export STORJ_AUDIT_API_KEY="${API_KEY}"
|
|
|
|
export STORJ_POINTER_DB_AUTH_API_KEY="${API_KEY}"
|
|
|
|
export STORJ_REPAIRER_API_KEY="${API_KEY}"
|
|
|
|
fi
|
|
|
|
|
2019-02-28 20:12:52 +00:00
|
|
|
if [[ -n "${STORJ_DATABASE:-}" ]]; then
|
2019-01-12 03:47:18 +00:00
|
|
|
export STORJ_POINTER_DB_DATABASE_URL="${STORJ_DATABASE}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -n "${IDENTITY_ADDR:-}" ]]; then
|
|
|
|
export STORJ_SERVER_ADDRESS="${IDENTITY_ADDR}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "${BOOTSTRAP_ADDR:-}" ]]; then
|
|
|
|
export STORJ_KADEMLIA_BOOTSTRAP_ADDR="${BOOTSTRAP_ADDR}"
|
2019-01-10 10:35:06 +00:00
|
|
|
fi
|
|
|
|
|
2018-12-21 16:56:57 +00:00
|
|
|
if [[ ! -f "${CONF_PATH}/config.yaml" ]]; then
|
2019-01-10 14:23:33 +00:00
|
|
|
./satellite setup $SETUP_PARAMS
|
2018-09-07 20:46:08 +01:00
|
|
|
fi
|
|
|
|
|
2018-12-17 16:54:32 +00:00
|
|
|
RUN_PARAMS="${RUN_PARAMS:-} --config-dir ${CONF_PATH}"
|
2018-08-23 16:48:03 +01:00
|
|
|
|
|
|
|
if [[ -n "${BOOTSTRAP_ADDR:-}" ]]; then
|
|
|
|
RUN_PARAMS="${RUN_PARAMS} --kademlia.bootstrap-addr ${BOOTSTRAP_ADDR}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec ./satellite run $RUN_PARAMS "$@"
|