peertube/entrypoint.sh
mirsal 100fb038e3 Untested port of peertube to coop-cloud
missing:

 * live streaming and RTMP proxying with traefik
 * webseed cross-instance redundancy
 * option to use S3-compatible storage
 * testing, there might be silly bugs

Did I mention this is untested?
2021-03-19 16:03:13 +00:00

27 lines
503 B
Bash

#!/usr/bin/env bash
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "PEERTUBE_DB_PASSWORD"
exec /entrypoint.sh "$@"