Closed Croq360 closed 3 years ago
@Croq360 I suspect you'll have to Windowsify things a bit with Docker, starting with maybe not using a dot directory.
Are you using the docker run
command or docker-compose?
It might also be a CR/LF issue.
Try these steps:
config.ini
from scratch using Notepad, matching the syntax from the sample filedocker run
command to be -v .:/app/config
volumes:
- .:/app/config
Paying attention to spacing, since it's YAML.
I have a headless Windows box that I'll fire-up and test with here in a few minutes.
Oh goody, finally a reason to install WSL2.
Yeah, it's a CR/LF/newline/whatever issue. Grr.
Run dos2unix
on your config file before you launch the container and you should be fine.
Ok, will give that a try. Running the exe directly and pointing to a config file that's like what was on locast2dvr works fine. I'll use my VS Code editor or notepad++ to save the config that I downloaded and edited with my info and put into .locast2tuner folder. Will report back on that.
Yeah, that makes sense - The EXE is fine reading the ^Ms in the file put there by Windows, but the Docker version is technically running in Linux, so it chokes on them.
Either of those editors should be capable of saving in Unix format and stripping the CRs, so you should be ok. That's all dos2unix
does.
I added a note to the documentation.
So I've tried checking the config.ini file, and it already has Unix end of lines (LF only). I even tried saving with DOS (CR/LF) and then back to Unix (LF) format. No good.
So, now I'm playing around with using WinSW to install it as a service. Whenever I'm running there though, I'm getting the following error: Child process 'locast2tuner (4368)' finished with code 101.
I have to do some more digging around I guess... :)
I changed the backslashes ("\") in the paths to forward slashes ("/") in the XML config for WinSW, and the service is running now.
Wow, interesting - I had the exact issue as you did with "Could not load file syntax" and removing the CRs got rid of it. I did have to massage my docker-compose.yml
file to adjust the volume location, too.
Glad you got it working! Might be worth documenting in README.md
or for @wouterdebie to use for the Windows package.
Yeah, once the service runs for a while and I confirm everything is working okay, I'll share my configuration for the service along with notes/comments. One thing I want to try is to reboot the computer it's running on and make sure everything starts back up as it should.
Great work! Just for my understanding, you are running a Linux Docker image on Windows?
In the case of a windows executable, I'd like to accompany that with making locast2tuner
run as a service.
In my case, I was trying to use the Linux Docker image on Windows (which it should be able to do). I'm pretty sure when I did that with locast2plex, it ran in a Linux container.
Regarding the Windows executable/service, for Windows users, I can put together some documentation on getting locast2tuner executable running as a service using WinSW (https://github.com/winsw/winsw). I'm using it instead of NSSM since I had some issues with NSSM and locast2dvr locking up after a while and being totally unresponsive after a time. I should know in a few days if it looks like WinSW will be the option to go with.
I think I see the problem. When I ran the Windows equivalent for the curl command, "curl -o %USERPROFILE%.locast2tuner\config.ini https://github.com/wouterdebie/locast2tuner/blob/main/assets/config.ini.example", it tacked on a TON of extra HTML tagging. When I look at the example file here, it just has the entries called out (like "username=abc"). When I look at my resulting config.ini file, it's nearly 1200 lines long, with the "config" stuff put into an html table like this:
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip>
<tr>
<td id="L1" class="blob-num js-line-number" data-line-number="1"></td>
<td id="LC1" class="blob-code blob-code-inner js-file-line"># Mandatory configuration</td>
</tr>
<tr>
<td id="L2" class="blob-num js-line-number" data-line-number="2"></td>
<td id="LC2" class="blob-code blob-code-inner js-file-line">username="my_locast@username"</td>
</tr>
<tr>
<td id="L3" class="blob-num js-line-number" data-line-number="3"></td>
<td id="LC3" class="blob-code blob-code-inner js-file-line">password="very_secret_password"</td>
</tr>
<tr>
<td id="L4" class="blob-num js-line-number" data-line-number="4"></td>
<td id="LC4" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L5" class="blob-num js-line-number" data-line-number="5"></td>
<td id="LC5" class="blob-code blob-code-inner js-file-line"># Optional configuration</td>
</tr>
<!-- more table rows -->
</table>
My bad.. the link should have been to the raw file, which I just fixed in commit c7f1d0a.
Awesome, thanks!
Followed the instructions in the README (changing $HOME to the %USERPROFILE% variable which is what it is in Windows). I got it into Docker fine, but when I try to run it, I get the following:
Note that I edited the config.ini that's in my .locast2tuner folder. Maybe it's not using that, based on the error message? Perhaps there's a config.ini somewhere else I need to be editing. Any ideas or tips?