Skip to content

Commit

Permalink
Add support for config file snippet #401 (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored May 10, 2024
1 parent 4a754dc commit 6050038
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,23 @@ Volume|Description
:---|:---
/uprcl/confdir|Uprcl configuration directory
/uprcl/mediadirs|Uprcl media directories
/user/config|Location for additional files. Currently: `additional-radio-list.txt` and `recoll.conf.user` as well as credentials for qobuz on `qobuz.txt`, for hra on `hra.txt`. The credentials file format is the same as a `.env` file. Ensure to include all the settings related the streaming service.
/user/config|Location for additional files. See [User Config Volume](#user-config-volume) for details.
/cache|Runtime information for upmpdcli. Attach a volume to this path in order to maintain consistency across restarts.
/log|Location for the upmpdcli log file. Enabled using `LOG_ENABLE`

#### User Config Volume

FILE|DESCRIPTION
:---|:---
additional-radio-list.txt|Additional Radios
recoll.conf.user|Recoll configuration (used by upcrl)
qobuz.txt|Qobuz Credentials
hra.txt|HRA Credentials, format is like a .env file. Make sure you include all the settings related the streaming service.
upmpdcli-additional.txt|Configuration snippet, will be appended to upmpdcli.conf.

For `qobuz.txt` and `hra.txt`, the format of the file must be like a `.env` file, where all the settings which are related to the service must be listed. Mixed configurations (so part in variables, part in these files) are not supported.
The upmpdcli-additional.txt is a simple list of lines with a `key = value` synthax.

### Custom icon

It is possible to customize the server icon by mounting a local png file to the container file `/usr/share/upmpdcli/icon.png`. Just put a suitable png file in the same directory of the compose file, then, assuming the icon is called `my-icon.png`, you would want to add an entry to the volumes section, similar to this:
Expand Down
8 changes: 8 additions & 0 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ CONFIG_FILE=/tmp/current-upmpdcli.conf
QOBUZ_CREDENTIALS_FILE=/user/config/qobuz.txt
HRA_CREDENTIALS_FILE=/user/config/hra.txt

UPMPDCLI_ADDITIONAL_FILE=/user/config/upmpdcli-additional.txt

declare -A file_dict

source read-file.sh
Expand Down Expand Up @@ -745,6 +747,12 @@ else
fi
sed -i 's\LOG_DIRECTORY\'"$log_directory"'\g' $CONFIG_FILE

if [ -f $UPMPDCLI_ADDITIONAL_FILE ]; then
echo "File [$UPMPDCLI_ADDITIONAL_FILE] is available, appending to [$CONFIG_FILE] ..."
cat $UPMPDCLI_ADDITIONAL_FILE >> $CONFIG_FILE
sed -i -e '$a\' $CONFIG_FILE
echo "Done."
fi

cat $CONFIG_FILE

Expand Down
1 change: 1 addition & 0 deletions doc/change-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Change Date|Major Changes
---|---
2024-05-10|Support for config file snippet (see issue [#401](https://github.com/GioF71/upmpdcli-docker/issues/401))
2024-05-01|Support for `subsonictitle` (see issue [#398](https://github.com/GioF71/upmpdcli-docker/issues/398))
2024-04-24|Update to Upmpdcli version 1.8.10 (see issue [#393](https://github.com/GioF71/upmpdcli-docker/issues/393))
2024-03-27|Fix executable shell files for user mode (see issue [#390](https://github.com/GioF71/upmpdcli-docker/issues/390)))
Expand Down

0 comments on commit 6050038

Please sign in to comment.