mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-13 16:18:29 +00:00
Check if configuration file exists
This commit is contained in:
parent
3ad17d54f3
commit
f9891dbeef
@ -20,8 +20,7 @@ RUN addgroup -g 1000 -S invidious && \
|
|||||||
adduser -u 1000 -S invidious -G invidious
|
adduser -u 1000 -S invidious -G invidious
|
||||||
COPY ./assets/ ./assets/
|
COPY ./assets/ ./assets/
|
||||||
COPY --chown=invidious ./config/config.* ./config/
|
COPY --chown=invidious ./config/config.* ./config/
|
||||||
RUN mv -n config/config.example.yml config/config.yml
|
|
||||||
RUN sed -i 's/host: \(127.0.0.1\|localhost\)/host: postgres/' config/config.yml
|
|
||||||
COPY ./config/sql/ ./config/sql/
|
COPY ./config/sql/ ./config/sql/
|
||||||
COPY ./locales/ ./locales/
|
COPY ./locales/ ./locales/
|
||||||
COPY --from=builder /invidious/invidious .
|
COPY --from=builder /invidious/invidious .
|
||||||
|
@ -1,23 +1,29 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Configuring Invidious"
|
CONF_FILE="/invidious/config/config.yml"
|
||||||
|
|
||||||
cat <<EOF > /invidious/config/config.yml
|
if [ -f "$CONF_FILE" ]; then
|
||||||
channel_threads: $INVIDIOUS_CHANNEL_THREADS
|
echo "Existing configuration found. Skipping environment variable based conifg..."
|
||||||
check_tables: $INVIDIOUS_CHECK_TABLES
|
else
|
||||||
feed_threads: $INVIDIOUS_FEED_THREADS
|
echo "Configuring Invidious"
|
||||||
db:
|
|
||||||
user: $POSTGRES_USER
|
cat <<EOF > /invidious/config/config.yml
|
||||||
password: $POSTGRES_PASS
|
channel_threads: $INVIDIOUS_CHANNEL_THREADS
|
||||||
host: $POSTGRES_HOST
|
check_tables: $INVIDIOUS_CHECK_TABLES
|
||||||
port: $POSTGRES_PORT
|
feed_threads: $INVIDIOUS_FEED_THREADS
|
||||||
dbname: $POSTGRES_DB
|
db:
|
||||||
full_refresh: $INVIDIOUS_FULL_REFRESH
|
user: $POSTGRES_USER
|
||||||
https_only: $INVIDIOUS_HTTPS_ONLY
|
password: $POSTGRES_PASS
|
||||||
domain: $INVIDIOUS_DOMAIN
|
host: $POSTGRES_HOST
|
||||||
registration_enabled: $INVIDIOUS_REGISTRATION_ENABLED
|
port: $POSTGRES_PORT
|
||||||
disable_proxy: $INVIDIOUS_DISABLE_PROXY
|
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
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
# kemal is the hardcoded postgres username
|
# kemal is the hardcoded postgres username
|
||||||
for i in /invidious/config/sql/*.sql; do sed -i s/kemal/$POSTGRES_USER/g $i; done
|
for i in /invidious/config/sql/*.sql; do sed -i s/kemal/$POSTGRES_USER/g $i; done
|
||||||
|
Loading…
Reference in New Issue
Block a user