rsslair/run.bash

27 lines
709 B
Bash
Executable File

#!/usr/bin/env bash
# Set the PORT, NO_SCHEDULER and CRON_SCHEDULE environment variables if not set
# RUST_LOG: The log level for the server
# PORT: The port to run the server on
# NO_SCHEDULER: If set to true, the scheduler will not run
# CRON_SCHEDULE: The cron schedule to run the scheduler on
RUST_LOG=${RUST_LOG:-'info'}
PORT=${PORT:-8080}
REDIS_HOST=${REDIS_HOST:-'redis'}
REDIS_PORT=${REDIS_PORT:-6379}
NO_SCHEDULER=${NO_SCHEDULER:-false}
CRON_SCHEDULE=${CRON_SCHEDULE:-'* 1 * * * *'}
NO_ARG_VALUE_ARGS=""
if [ "$NO_SCHEDULER" = "true" ]; then
NO_ARG_VALUE_ARGS+=(" --no-scheduler")
fi
set -x
export RUST_LOG=$RUST_LOG
exec /app/rsslair --port $PORT --cron "$CRON_SCHEDULE" $NO_ARG_VALUE_ARGS