Files
peertube/entrypoint.sh.tmpl
T

46 lines
1.1 KiB
Cheetah
Raw Normal View History

#!/bin/bash
2021-03-19 16:03:13 +00:00
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
2021-03-19 16:03:13 +00:00
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
2021-05-06 13:00:04 +02:00
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
2025-02-06 14:58:39 -05:00
file_env "PEERTUBE_DB_PASSWORD"
file_env "PEERTUBE_SECRET"
2021-11-30 11:32:30 +01:00
{{ if eq (env "PEERTUBE_SMTP_ENABLED") "1" }}
file_env "PEERTUBE_SMTP_PASSWORD"
{{ end }}
2021-05-06 12:59:25 +02:00
2021-11-30 11:32:30 +01:00
{{ if eq (env "PEERTUBE_LIVE_CHAT_ENABLED") "1" }}
apt -y update && apt install -y prosody && apt -y clean
2022-01-17 14:22:33 +01:00
mkdir -p /run/prosody && chown prosody:prosody /run/prosody
2021-11-30 11:32:30 +01:00
{{ end }}
2021-11-30 11:27:06 +01:00
# Copy the client files over to a named volume
# so that they may be served by nginx directly
cp -ar /app/client/dist /srv/client
2021-05-06 13:32:01 +02:00
# upstream entrypoint
# https://github.com/Chocobozzz/PeerTube/blob/66f77f63437c6774acbd72584a9839a7636ea167/support/docker/production/entrypoint.sh
2021-05-06 13:24:20 +02:00
/usr/local/bin/entrypoint.sh "$@"