OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

Here is the output:

OliveTin Post-Install Healthcheck
Standard Output
Checking your OliveTin installation...
(extended_check=false)


Checking that your selected Channels DVR server (local-server:8089) is reachable by URL:
HTTP Status: 200 indicates success...

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0curl: (6) Could not resolve host: local-server
HTTP Status: 000
Effective URL: http://local-server:8089/


Checking that your selected Channels DVR server's data files (/mnt/local-server-8089) are accessible:
Folders with the names Database, Images, Imports, Logs, Movies, Streaming and TV should be visible...

total 8
drwxr-xr-x 2 root root 4096 Jul 10 18:59 .
drwxr-xr-x 1 root root 4096 Jul 10 19:53 ..


Checking that your selected Channels DVR server's log files (/mnt/local-server-8089_logs) are accessible:
Folders with the names data and latest should be visible...

total 8
drwxr-xr-x 2 root root 4096 Jul 10 18:59 .
drwxr-xr-x 1 root root 4096 Jul 10 19:53 ..


Here's a list of your current OliveTin-related settings:

HOSTNAME=olivetin
CHANNELS_DVR=local-server:8089
CHANNELS_DVR_ALTERNATES=
CHANNELS_CLIENTS=appletv4k-den firestick-bedroom
ALERT_SMTP_SERVER=smtp.gmail.com:587
ALERT_EMAIL_FROM=[Redacted]@gmail.com
ALERT_EMAIL_PASS=[Redacted]
ALERT_EMAIL_TO=[Redacted]@[Redacted]
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
PORTAINER_TOKEN=[Redacted]
PORTAINER_HOST=docker-host


Here's the contents of /etc/resolv.conf from inside the container:

Generated by Docker Engine.

This file can be edited; Docker Engine will not make further changes once it

has been modified.

nameserver 127.0.0.11
search
options ndots:0

Based on host file: '/etc/resolv.conf' (internal resolver)

ExtServers: [192.168.65.7]

Overrides: [search]

Option ndots from: internal


Here's the contents of /etc/hosts from inside the container:

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.3 olivetin
Standard Error

When you say "... I have HOST_DIR set to /data..." what is the root directory for / ? Is it my Windows C: drive, or somewhere in an image or a container?

I'm an old Unix/linux guy, but I can't yet keep straight the multiple virtual environments we have with docker, containers, images, etc.

This value needs to be the one you use to access the CDVR WebUI. Most people use ip:port.

This value needs to be ip (or hostname) you use to access the Portainer WebUI. No port here -- just the ip.

It doesn't look like you have the paths correct to your DVR recordings, or to the directory where the Channels executable is located (which is where the CDVR system log(s) are located. You can use paths relative to WSL installation, if you're familiar with that, or you can use your Windows path(s) if you know those.

What did you set the value of HOST_DIR to in Portainer?

I may have a problem with my portainer installation. My docker desktop shows a portainer_data volume, but I'm not seeing any other signs of a portainer installation.

I can click on the portainer_data volume in docker desktop and open a terminal window, echo $HOST_DIR, response is blank.

How did you install Portainer? Are you using the Portainer Extension in Docker Desktop (not recommended, as it's not a full installation), or did you install it via WSL2 in a Docker Desktop "integrated default distro".

Docker desktop uses WSL2, but will use its own "hidden" distro if you don't install Debian or Ubuntu and enable "Integration" through the Docker Desktop interface. As you suggested, it can be challenging to understand how Windows and a WSL2 Linux distro interact -- it's well worth it imo to spend some time on it though.

  1. I can't remember how I installed portainer. I have a portainer_data volume but no portainer container. Is it possible I inadvertently deleted the container, but the volume remains? If so, how do I proceed from there?

  2. I don't think I used the portainer extension: under "My Extensions" docker desktop is showing "No extensions installed yet"

I agree it is well worth spending the time, that is what I am doing, and I appreciate your help. But I haven't yet got in my mind the concepts of images, containers, and how portainer relates. "image" sounds to me like a disk image so I'm guessing a docker desktop image essentially sets up a WSL virtual machine, and a container runs on that VM, so a container is like an app or maybe an executable?

As an old Unix/linux guy I've been running cygwin on windows for years so I could do linux scripting when I needed to. I've been pulling m3u's from Channels DVR and manipulating them with cygwin. That's been working but I can clearly see the benefits olive tin for Channels. If I can get the docker/portainer/olive tin stuff running smoothly and start looking at olive tin scripts for channels, I should be fine from that point on. I might even have some scripts that could be ported over to olive tin, ha ha.

If you don't see the container in Docker Desktop, and you don't have any extensions installed -- let's install Portainer.

First, go to Docker Desktop Settings, and look at Resources-WSL Integration:

No need to select a distro, as we want to use the default, but make sure Integration is enabled.

Then, using Windows Terminal open a PowerShell tab, and make sure you have Debian or Ubuntu as the default distro:

From there open that default distro in Windows Terminal, and check what's running in Docker:

If Portainer isn't listed, install it:

docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name portainer \
    --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \
    cr.portainer.io/portainer/portainer-ce:latest

I will do this tomorrow, but in the meantime you are totally awesome--thanks.

OK, with your help I've got portainer installed and running, I can access it via my browser using //localhost:9443/#!/home. I was able to find and edit the healthcheck script so that my CDVR server ip is hard coded into the script and I was able to pass (and understand for the most part) the extended healthcheck. THANKS!!

Is there a way (without editing every olive tin script) to set local-server globally so that all of my olive tin scripts know the ip of my localhost CDVR server? If nothing else I suppose I could run a sed on all of the scripts but I can learn more about the environment by asking this question.

There is absolutely no need to edit OliveTin scripts -- they are all setup to use global environment variables established in your OliveTin stack. Also, assuming you want to stay current with updates to OliveTin, your changes will get overwritten.

Did you use the OliveTin Docker Compose from post #1 in this thread in Portainer-Stacks? Did you set your installation-specific values in the Environment variables section of the stack?

Good point about updates overwriting my changes.

I used the script but I've also been through a couple of installs trying to get things working so it is probably better for me to look at the current environment and learn how to change things. Looking at the olivetin environment in docker shows "CHANNELS_DVR=local-server:8089" so I'm guessing I need to edit that to replace "local-server" with my server ip, but I don't know how to make the edit inside the docker olive tin screen. The JSON file looks editable and switching out of JSON view I can select text for each variable but cannot edit it. How/can I edit envt variables for olive tin inside of docker?

All you need to do is stop the stack:

Go into the stack editor:

Modify the environment variables to match your installation:

And, click "Update the stack":

That all went well, thanks!

Right now my Channels DVR folder is on my Windows C: drive at C:\CHANNELS_DVR . I'm guessing my Olive Tin DVR_SHARE and LOGS_SHARE envt variables need to point to C:\CHANNELS_DVR. Right now those are pointing to /mnt/dvr and /mnt/channelsdvr . How do I get DVR_SHARE and LOGS_SHARE to point to Windows C:\CHANNELS_DVR ?

Also, where should my PORTAINER_HOST envt variable point to?

Go through the same process to update your stack, and you can set:

DVR_SHARE=C:\CHANNELS_DVR

To get your LOGS_SHARE value (which is where the CDVR executable resides), you can use the OliveTin Action for generating a filtered log, and search for:

screenshot-htpc6-2024.07.21-15_59_39

This will tell you what path Channels used to startup, and you want that path -- minus the last data part. In other words LOGS_SHARE should be set to this value:

PORTAINER_HOST is the IP address or hostname (if it resolves correctly) of the system where Portainer is running. Sounds like for you, localhost would work, though you could also use the LAN IP address of that system.

You'll also want to generate your PORTAINER_TOKEN, so that you can use Project One-Click. This is done by using the dropdown in the upper right corner of Portainer, next to your username, followed by selecting "My account". Create an Access Token named OliveTin, and use it for your PORTAINER_TOKEN value. Be aware you'll only be able view it once, so store it somewhere secure, for potential future use.

Couldn't update the stack, error is:

failed to deploy a stack: time="2024-07-21T22:47:56Z" level=warning msg="The "DOMAIN" variable is not set. Defaulting to a blank string." time="2024-07-21T22:47:56Z" level=warning msg="The "DOMAIN" variable is not set. Defaulting to a blank string." Network olive_tin_default Creating Network olive_tin_default Created Container olivetin Creating Container static-file-server Creating Error response from daemon: invalid volume specification: 'C:\CHANNELS_DVR:/mnt/192.168.1.135-8089:rw'

You probably need to use a forward slash instead of a backslash, try:

DVR_SHARE=C:/CHANNELS_DVR

I wondered about that and tried both, it didn't matter.

I found that I can get to the correct directory in the terminal via /mnt/c/CHANNELS_DVR. I put this in for the the DVR_SHARE and the LOGS_SHARE variables in portainer. The stack deployed and is running. Healthcheck good. Now for some more testing, can you say which of the olive tin scripts use LOGS_SHARE for my testing?

Are you sure this is correct for LOGS_SHARE? Did you run the "Filtered Log" Action referenced above to get the path for the LOGS_SHARE directory?

As you've discovered, /mnt/c is the the equivilant of C:\, and is actually preferable imo to using C:\ -- but many Windows users prefer the standard WIndows style path approach.

The "E-Mail Log Alerts" Action is a good one to test the LOGS_SHARE path, but this also depends on you having properly established these values:

This requires setting up an "app" password using Gmail or Yahoo mail. It's worth it though, as you can get alerted to anything in your logs you'd like. I have mine set to [DVR] Error, and I just got notified this morning about a failure to tune for a recording -- in plenty of time to set up an alternate recording source. For testing, something like [DVR] would give you a hit pretty quickly.

BTW, I assume you've noticed that the requirements for each one of these values is described in comments in the Docker Compose itself? Also, searching this thread for specific keywords can be quite useful. Don't get me wrong, I'm happy to answer questions, but I'm not always available, and most all of what we're discussing has been covered here before.

These are my Windows env variables ....
image