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

So, we'll use the new standard OliveTin Docker compose with modifications in each service's volumes section, changing olivetin to olivetin-for-channels:

version: '3.9'
services:
  olivetin: # This docker-compose requires little or no editing. Set the Environment variables section of Portainer.
    # GitHub home for this project: https://github.com/bnhf/OliveTin.
    # Docker container home for this project with setup instructions: https://hub.docker.com/repository/docker/bnhf/olivetin.
    image: bnhf/olivetin:${TAG} # Add the tag like latest or test to the environment variables below.
    container_name: olivetin
    hostname: olivetin
    dns_search: ${DOMAIN} # For Tailscale users using Magic DNS, add your Tailnet (tailxxxxx.ts.net) to use hostnames for remote nodes, otherwise use your local domain name.
    ports:
      - ${HOST_PORT}:1337
    environment:
      - CHANNELS_DVR=${CHANNELS_DVR_HOST}:${CHANNELS_DVR_PORT} # Add your Channels DVR server in the form CHANNELS_DVR_HOST=<hostname or ip> and CHANNELS_DVR_PORT=<port>.
      #- CHANNELS_DVR_ALTERNATES=${CHANNELS_DVR2_HOST}:${CHANNELS_DVR2_PORT} # Space separated list of alternate Channels DVR servers to choose from in the form hostname:port or ip:port.
      - CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP.
      - ALERT_SMTP_SERVER=${ALERT_SMTP_SERVER} # SMTP server to use for sending alert e-mails. smtp.gmail.com:587 for example.
      - ALERT_EMAIL_FROM=${ALERT_EMAIL_FROM} # Sender address for alert e-mails.
      - ALERT_EMAIL_PASS=${ALERT_EMAIL_PASS} # SMTP "app" password established through GMail or Yahoo Mail. Do not use your everyday e-mail address.
      - ALERT_EMAIL_TO=${ALERT_EMAIL_TO} # Recipient address for alert e-mails.
      - UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml.
      - UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts.
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc.
      - PORTAINER_TOKEN=${PORTAINER_TOKEN} # Generate via <username> dropdown (upper right of WebUI), "My account", API tokens.
      - PORTAINER_HOST=${PORTAINER_HOST} # Hostname or IP of the Docker host you're running Portainer on.
    volumes:
      - ${HOST_DIR}/olivetin-for-channels:/config # Add the parent directory on your Docker you'd like to use.
      - ${DVR_SHARE}:/mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT} # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR network share.
      - ${LOGS_SHARE}:/mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT}_logs # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR logs network share.
      #- ${DVR2_SHARE}:/mnt/${CHANNELS_DVR2_HOST}-${CHANNELS_DVR2_PORT} # Note that these volume mounts should always be to /mnt/hostname-port or /mnt/ip-port (dash rather than a colon between).
      #- ${LOGS2_SHARE}:/mnt/${CHANNELS_DVR2_HOST}-${CHANNELS_DVR2_PORT}_logs # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR logs network share.
    restart: unless-stopped

  static-file-server:
    image: halverneus/static-file-server:latest
    container_name: static-file-server
    dns_search: ${DOMAIN}
    ports:
      - ${HOST_SFS_PORT}:8080
    environment:
      - FOLDER=${FOLDER}
    volumes:
      - ${HOST_DIR}/olivetin-for-channels/data:${FOLDER}
    restart: unless-stopped

#volumes: # Use this section if you've setup docker volumes named channels-dvr and channels-dvr-logs, with CIFS or NFS, to bind to /mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT} and  /mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT}_logs inside the container. Set DVR_SHARE=channels-dvr and LOGS_SHARE=channels-dvr-logs in this example.
  #channels-dvr:
    #external: true
  #channels-dvr-logs:
    #external: true

Here's my suggested environment section:

TAG=latest
DOMAIN=local
HOST_PORT=1337
CHANNELS_DVR_HOST=10.0.1.21
CHANNELS_DVR_PORT=8089
CHANNELS_DVR2_HOST=
CHANNELS_DVR2_PORT=
CHANNELS_CLIENTS=10.0.1.81 10.0.1.151 10.0.1.112
ALERT_SMTP_SERVER=
ALERT_EMAIL_FROM=
ALERT_EMAIL_PASS=
ALERT_EMAIL_TO=
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
TZ=US/Pacific
HOST_DIR=/Volumes/Channels-DVR/Channels DVR
DVR_SHARE=
LOGS_SHARE=
HOST_SFS_PORT=8080
FOLDER=/web
PORTAINER_TOKEN=
PORTAINER_HOST=10.0.1.21

You'll need to add your PORTAINER_TOKEN, DVR_SHARE and LOGS_SHARE values. LOGS_SHARE you can get by going to your current OliveTin and doing the following:

The path shown in the output, minus the last part that'll be data, is your LOGS_SHARE path.

The DVR_SHARE path, you probably already know, as this is the path to your Channels DVR data. On my Mac-Mini-M2 it's /Users/slayer/channels-data, but it'll be different for you.

Once you have your env vars determined, you can stop your current olivetin stack, and then either replace the data with the above, or create a new stack called olivetin2 if you prefer.

Also, be aware you may need to change the port for the new static-file-server part of the stack if 8080 is in use on your system. 8081, or whatever, is fine for HOST_SFS_PORT.

@Fofer

In addition, once you have the new stack spun-up, be sure to run the OliveTin Post-Install Healthcheck to be sure everything is working as expected.

OK will do!

Do I also change the instances under services?

services:
  olivetin: # This docker-compose requires little or no editing. Set the Environment variables section of Portainer.
    # GitHub home for this project: https://github.com/bnhf/OliveTin.
    # Docker container home for this project with setup instructions: https://hub.docker.com/repository/docker/bnhf/olivetin.
    image: bnhf/olivetin:${TAG} # Add the tag like latest or test to the environment variables below.
    container_name: olivetin
    hostname: olivetin

If you were going to run them at the same time, then yes, but since you're not they can be the same. You can name the new stack olivetin-for-channels2 or just olivetin given the current stack name.

OK, mine is /Users/fofer/Library/Application Support/ChannelsDVR/

Great. I think I've got it.
But before I deploy, my HOST_DIR and DVR_SHARE are the same, is that correct?

Well, it worked, so I think we're golden. THANKS!

However, now the Project One-Click for vlc-bridge-fubo isn't working. This is the error:

JSON response from http://10.0.1.21:9000/api/stacks?type=2&method=string&endpointId=2:
{"message":"failed to deploy a stack: vlc-bridge-fubo Pulling \n vlc-bridge-fubo Error \nError response from daemon: pull access denied for jgomez177/vlc-bridge-fubo, repository does not exist or may require 'docker login': denied: requested access to the resource is denied\n","details":"failed to deploy a stack: vlc-bridge-fubo Pulling \n vlc-bridge-fubo Error \nError response from daemon: pull access denied for jgomez177/vlc-bridge-fubo, repository does not exist or may require 'docker login': denied: requested access to the resource is denied\n"}
false

I looked into it and see that particular repo has been moved/rescued recently (after joagomez posted he could no longer maintain it)

Beat me to it. I was gonna ask OP to update the container url to my own repo as the original developer has abandoned ship.

New bnhf/olivetin:latest (aka bnhf/olivetin:2024.06.29) built with vlc-bridge-fubo registry location updated to:

registry.gitlab.com/yankees4life/vlc-bridge-fubo/main:latest

Done.

As you found out, it's possible for them to be the same, assuming your OK with your Docker container data directories being mixed in with your Channels DVR folders. I keep them in a separate location myself, because not all my bound directories are CDVR related, but if all yours are it should be fine.

Excellent, I've got it all working now! Thanks so much, @bnhf.

And thanks to @joagomez and @Jean0987654321 too. Super cool software.

2 Likes

@bnhf I found the original message I sent you regarding the token. I don't know whether this is something you will want to try, or even technically possible given the context but...

This is the command to send:

POST http://localhost:9000/api/users/1/tokens

with this JSON payload:

{
  "description": "OliveTin for Channels"
}

The returned JSON value is:

{
  "rawAPIKey": "[REDACTED]",
  "apiKey": {
    "id": 1,
    "userId": 1,
    "description": "OliveTin for Channels",
    "prefix": "ptr_hlS",
    "dateCreated": 1714617817,
    "lastUsed": 0,
    "digest": "[REDACTED]"
  }
}

Not sure about "digest" but I redacted it, just in case.

I love automation and I hope this can remove one more manual step from the user. :man_shrugging:

1 Like

New bnhf/olivetin:latest (aka bnhf/olivetin:2024.07.03) has been pushed with support for deleting watched videos, either on a one-time basis or every x minutes/hours. More detail in this thread:

New bnhf/olivetin:latest (aka bnhf/olivetin:2024.07.06) pushed with support for keeping your CDVR server(s) updated to the latest pre-release. More detail here:

1 Like

I easily enabled the "Keep CDVR Server updated" action just after the latest OliveTin update. It is working beautifully. Two updates (single server setup) in the past couple days without touching a keyboard. Sweet!

How do you tell this is working (besides manually noting version number)? I checked the [server_ip]_updateprerelease.log file but it did not contain any information about updating a prerelease version.

server_ip_updateprerelease.log
Initial check complete, with continuing checks set for 4h intervals.

Background updateprerelease process running for 192.168.0.11:8089
foreground.sh is exiting for updateprerelease with exit code 0
true
Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.

true
Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.

true
Initial check complete, with continuing checks set for 4h intervals.

true
Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.


Initial check complete, with continuing checks set for 4h intervals.

The logging needs to be better than that -- thanks for pointing this out, I'll work on it.

I bookmarked the following topic: DVR Pre-Release Notes and have it tagged as "watching" so that I receive an email notification for each update.
I have the action set up to check at 3 hour intervals, and have been able to check the GUI status page to see if it has been updated to the latest pre-release version number. I also check the current "uptime" on the GUI to see when it was updated.

Trying to figure out why my action went out of sync.
I have OliveTin checking my 6 servers for Channel Lineup Change Notifications every 12 hours at 11:05 and 23:05. Five of them have kept the schedule, but one of them is now checking at 12:32 and 00:32

Check time: 2024-07-09 12:32:49
Server version: 2024.07.06.2035
No changes found in any source.
Next check: 2024-07-10 00:32:49

I had restarted OliveTin a day or two ago to correct this, but it continues on this schedule for this one server.

Any ideas what I should check or do to get it back in sync?

2024-07-02 11:05:53
Channels DVR server URL: http://192.168.1.4:8489
Channels DVR version: 2024.06.28.1813
------------------------------
Pluto: 417 channels (-2)
(http://192.168.1.3:8080/playlist.m3u)
****************************************************

2024-07-08 12:32:49
Channels DVR server URL: http://192.168.1.4:8489
Channels DVR version: 2024.07.06.2035
------------------------------
Pluto: 418 channels (+1)
(http://192.168.1.3:8080/playlist.m3u)
****************************************************

I did have a Internet outage (for 14.5hrs) on 2024-07-05, but it didn't affect the other 5 servers being monitored.

If you can't figure it out, I'll just kill the 6 actions and restart them all at 11:05 sometime this weekend.
Would be nice to be able to schedule the time of day they run (like a cron job) from within OliveTin.

No idea, unfortunately.

:thinking:
You got me thinking that maybe this could be an option in the script itself.

Let's see what @bnhf thinks about doing it in OliveTin.

I think we're going to need @mjitkop to weigh in on this, as the frequency the script is run is passed to his python script. I'm not sure how that value is handled in the script, if it's a sleep like I'd do in Bash, or some other mechanism.