invidious/docker/startup
2021-04-29 11:51:31 -04:00

32 lines
896 B
Bash

#!/bin/sh
CONF_FILE="/invidious/config/config.yml"
if [ -f "$CONF_FILE" ]; then
echo "Existing configuration found. Skipping environment variable based conifg..."
else
echo "Configuring Invidious"
cat <<EOF > /invidious/config/config.yml
channel_threads: $INVIDIOUS_CHANNEL_THREADS
check_tables: $INVIDIOUS_CHECK_TABLES
feed_threads: $INVIDIOUS_FEED_THREADS
db:
user: $POSTGRES_USER
password: $POSTGRES_PASS
host: $POSTGRES_HOST
port: $POSTGRES_PORT
dbname: $POSTGRES_DB
full_refresh: $INVIDIOUS_FULL_REFRESH
https_only: $INVIDIOUS_HTTPS_ONLY
domain: $INVIDIOUS_DOMAIN
registration_enabled: $INVIDIOUS_REGISTRATION_ENABLED
disable_proxy: $INVIDIOUS_DISABLE_PROXY
EOF
fi
# kemal is the hardcoded postgres username
for i in /invidious/config/sql/*.sql; do sed -i s/kemal/$POSTGRES_USER/g $i; done
echo "Starting Invidious"
exec /invidious/invidious