From 9778bb023d8a26fbfcf38f46586364102765f10b Mon Sep 17 00:00:00 2001 From: Giovanni Fulco Date: Wed, 29 Nov 2023 18:41:40 +0100 Subject: [PATCH] [Feature] Support webserverdocumentroot #346 (#347) --- Dockerfile | 2 ++ README.md | 1 + app/bin/run-upmpdcli.sh | 7 +++++++ app/conf/upmpdcli.conf | 2 +- doc/change-history.md | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 843e787..ed440ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -190,6 +190,8 @@ ENV LOG_LEVEL "" ENV DUMP_ADDITIONAL_RADIO_LIST "" +ENV WEBSERVER_DOCUMENT_ROOT "" + ENV STARTUP_DELAY_SEC 0 VOLUME /uprcl/confdir diff --git a/README.md b/README.md index e736386..2bdac9e 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,7 @@ HRA_LANG|Your HRA account language LOG_ENABLE|Set to `yes` to enable. If enabled, the logfile is `/log/upmpdcli.log`. Otherwise, umpdcli will log to stderr. LOG_LEVEL|Defaults to `2` DUMP_ADDITIONAL_RADIO_LIST|Dumps the additional radio file when set to `yes` +WEBSERVER_DOCUMENT_ROOT|Directory from which the internal HTTP server will directly serve files (e.g. icons), disabled by default STARTUP_DELAY_SEC|Delay before starting the application, defaults to `0`. This can be useful if your container is set up to start automatically, so that you can resolve race conditions with mpd and with squeezelite if all those services run on the same audio device. I experienced issues with my Asus Tinkerboard, while the Raspberry Pi has never really needed this. Your mileage may vary. Feel free to report your personal experience. ### Volumes diff --git a/app/bin/run-upmpdcli.sh b/app/bin/run-upmpdcli.sh index 51d4e9d..65fc17f 100644 --- a/app/bin/run-upmpdcli.sh +++ b/app/bin/run-upmpdcli.sh @@ -290,6 +290,13 @@ if [[ -n "${CHECK_CONTENT_FORMAT}" ]]; then set_parameter $CONFIG_FILE CHECK_CONTENT_FORMAT "$check_content_format_value" "checkcontentformat" fi +echo "WEBSERVER_DOCUMENT_ROOT=[${WEBSERVER_DOCUMENT_ROOT}]" +if [[ -n "${WEBSERVER_DOCUMENT_ROOT}" ]]; then + echo "Setting webserverdocumentroot to [$WEBSERVER_DOCUMENT_ROOT]" + sed -i 's/\#webserverdocumentroot/webserverdocumentroot/g' $CONFIG_FILE; + sed -i 's+WEBSERVER_DOCUMENT_ROOT+'"$WEBSERVER_DOCUMENT_ROOT"'+g' $CONFIG_FILE +fi + MEDIA_SERVER_ENABLED=0 if [[ "${UPRCL_ENABLE^^}" == "YES" || "${RADIO_BROWSER_ENABLE^^}" == "YES" || diff --git a/app/conf/upmpdcli.conf b/app/conf/upmpdcli.conf index b5283bc..3fa24f8 100644 --- a/app/conf/upmpdcli.conf +++ b/app/conf/upmpdcli.conf @@ -119,4 +119,4 @@ upradiostitle = Upmpdcli Radio List # Radio Paradise #radio-paradiseuser = radioparadise #mother-earth-radiouser = motherearthradio - +#webserverdocumentroot = WEBSERVER_DOCUMENT_ROOT diff --git a/doc/change-history.md b/doc/change-history.md index f230f73..5fc888e 100644 --- a/doc/change-history.md +++ b/doc/change-history.md @@ -2,6 +2,7 @@ Change Date|Major Changes ---|--- +2023-11-29|Add support for webserverdocumentroot (see issue [#346](https://github.com/GioF71/upmpdcli-docker/issues/346)) 2023-11-25|Support enabling internet radios in subsonic (see issue [#344](https://github.com/GioF71/upmpdcli-docker/issues/344)) 2023-11-25|Update to Upmpdcli version 1.8.6 (see issue [#340](https://github.com/GioF71/upmpdcli-docker/issues/340)) 2023-11-17|Support for subsonic server side scrobbling (see issue [#337](https://github.com/GioF71/upmpdcli-docker/issues/337))