diff --git a/Dockerfile b/Dockerfile index 6c740d7..b5aa73c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ COPY ./init.sh /release/usr/bin/alltube COPY ./nginx/ /release/etc/nginx/ FROM ${ALPINE} -RUN apk add --no-cache nginx python3 php-fpm php-json php-mbstring \ +RUN apk add --no-cache nginx ffmpeg python3 php-fpm php-json php-mbstring php-openssl \ php-dom php-gmp php-xml php-intl php-gettext php-simplexml php-tokenizer php-xmlwriter COPY --from=build /release/ / EXPOSE 80 diff --git a/init.sh b/init.sh index 5800d5b..d0660fe 100755 --- a/init.sh +++ b/init.sh @@ -1,7 +1,29 @@ #!/usr/bin/env sh +CONFIG="/var/www/alltube/config/config.yml" + +sed -i "s,^audioBitrate:.*,audioBitrate: 320," "${CONFIG}" +sed -i "s,^youtubedl:.*,youtubedl: /usr/bin/yt-dlp," "${CONFIG}" + if [ -n "$TITLE" ]; then - sed -i "/^appName:/cappName: $TITLE" /var/www/alltube/config/config.yml + echo "Title: ${TITLE}" + sed -i "s,^appName:.*,appName: ${TITLE}," "${CONFIG}" +fi + +if [ "$REMUX" = "TRUE" ] || [ "$REMUX" = "ON" ]; then + echo "Remux enabled" + sed -i "s,^remux:.*,remux: true," "${CONFIG}" +fi + +if [ "$STREAM" = "TRUE" ] || [ "$STREAM" = "ON" ]; then + echo "Stream enabled" + sed -i "s,^stream:.*,stream: true," "${CONFIG}" +fi + +if [ "$CONVERT" = "TRUE" ] || [ "$CONVERT" = "ON" ]; then + echo "Convert enabled" + sed -i "s,^convert:.*,convert: true," "${CONFIG}" + sed -i "s,^convertAdvanced:.*,convertAdvanced: true," "${CONFIG}" fi /usr/sbin/nginx