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
|
|
|
|
|
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
|
|
|
|
2019-11-02 20:09:07 +00:00
|
|
|
if [ "${SATELLITE_MIGRATE:-}" = "true" ]; then
|
|
|
|
exec ./satellite run migration $RUN_PARAMS "$@"
|
|
|
|
fi
|
|
|
|
|
2019-10-21 17:16:59 +01:00
|
|
|
if [ "${SATELLITE_API:-}" = "true" ]; then
|
|
|
|
exec ./satellite run api $RUN_PARAMS "$@"
|
|
|
|
fi
|
|
|
|
|
2019-10-29 14:55:57 +00:00
|
|
|
if [ "${SATELLITE_REPAIR:-}" = "true" ]; then
|
|
|
|
exec ./satellite run repair $RUN_PARAMS "$@"
|
|
|
|
fi
|
|
|
|
|
2020-04-02 16:39:13 +01:00
|
|
|
if [ "${SATELLITE_GC:-}" = "true" ]; then
|
|
|
|
exec ./satellite run garbage-collection $RUN_PARAMS "$@"
|
|
|
|
fi
|
|
|
|
|
2018-08-23 16:48:03 +01:00
|
|
|
exec ./satellite run $RUN_PARAMS "$@"
|