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,5 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/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"
|
echo "Configuring Invidious"
|
||||||
|
|
||||||
cat <<EOF > /invidious/config/config.yml
|
cat <<EOF > /invidious/config/config.yml
|
||||||
@ -18,6 +23,7 @@ domain: $INVIDIOUS_DOMAIN
|
|||||||
registration_enabled: $INVIDIOUS_REGISTRATION_ENABLED
|
registration_enabled: $INVIDIOUS_REGISTRATION_ENABLED
|
||||||
disable_proxy: $INVIDIOUS_DISABLE_PROXY
|
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