mbentley / docker-ums

Docker image for Universal Media Server (UMS)
24 stars 10 forks source link

FOLDER environment variable has no effect #19

Closed ppattard closed 1 year ago

ppattard commented 1 year ago

Hello,

I noticed that setting the FOLDER environment variable has no effect. I debugged quickly the issue and found that the "folders =" line does not seem to exist in the upstream UMS.conf (here: https://github.com/UniversalMediaServer/UniversalMediaServer/blob/main/src/main/external-resources/UMS.conf). Perhaps it has been removed?

As a consequence, the sed command in the entrypoint.sh has no effect and could be replaced by a simple echo, or perhaps even better testing for its presence first.

Can you fix that? I can submit a PR if you prefer.

Thanks.

mbentley commented 1 year ago

I haven't kept up with UMS much lately as I haven't been using it but I just checked and it looks like the option was removed in https://github.com/UniversalMediaServer/UniversalMediaServer/commit/6c77075b9a814a8f07abe49d02192060feb45788#diff-f30448ad35c4c798aa30eabc5b9742316aa3559ed752dde8ef6492d913c63eb6

I am guessing that based on it being removed, the way in which folders are configured must have been changed but I am not sure how exactly.

mbentley commented 1 year ago

According to https://www.universalmediaserver.com/forum/viewtopic.php?t=15490, there should be a shared.conf. Will have to look into that. This seems to say that it doesn't exist by default but could exist if there is a parsed config where it would do the migration for the user apparently: https://github.com/UniversalMediaServer/UniversalMediaServer/blob/bf18357286df879867d04705d198ac5221a3817c/src/main/java/net/pms/configuration/sharedcontent/SharedContentConfiguration.java#L202-L218

Maybe the best way about dealing with this would be to grep the UMS.conf to see if there is a line with folders = defined, if so, it should just run the entrypoint function here, otherwise, it would need to just append folders = ${FOLDER} to the end of the UMS.conf file and it sounds like that would take care of it as the UMS.conf would be parse and the shared.conf would be generated.

ppattard commented 1 year ago

I agree with you and this is pretty much not documented on the UMS website. Now it seems setting "folders" still works. I've drafted this PR before I saw your reply. It works for me for alpine-13. Feel free to accept it or not (in particular if you want a cleaner solution based on the shared.conf you mention).