From 0b5f7be366700d13a19885aaf237c7c3f1c0f0c3 Mon Sep 17 00:00:00 2001 From: red-coracle Date: Tue, 20 Sep 2022 16:51:33 -0400 Subject: [PATCH] Update XSendFilePath when MEDIA_PATH is set When MEDIA_PATH is set to something other than the default, XSendFilePath needs to be updated to match --- koel-entrypoint | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koel-entrypoint b/koel-entrypoint index cf21cd4..4cc2b8c 100755 --- a/koel-entrypoint +++ b/koel-entrypoint @@ -5,6 +5,12 @@ set -e # Change to program root directory. cd /var/www/html +# Set X-SendFile path +if [[ "$MEDIA_PATH" != "/music" ]]; then + echo "Updating XSendFilePath to $MEDIA_PATH" + sed --regexp-extended --in-place "s|XSendFilePath.+$|XSendFilePath $MEDIA_PATH|" /etc/apache2/sites-available/000-default.conf +fi + # Run the next entrypoint in the chain. echo "running docker-php-entrypoint with arguments $@" docker-php-entrypoint $@