jansppenrade2 / Docker-Container-Updater

Automatic Docker Container Updater
The Unlicense
6 stars 2 forks source link

remove reliance on tput? #27

Closed skyw33 closed 1 month ago

skyw33 commented 1 month ago

I love the concept of this project and I would like to deploy it on my Synology NAS. However, synology does not come with the tput command-line tool. Could reliance on this tool be removed or are there other easier workarounds?

skyw33 commented 1 month ago

This command works as a replacement: stty size < /dev/tty | cut -d' ' -f2-

jansppenrade2 commented 1 month ago

Hey @skyw33,

Thanks for your interest on this project, much appreciated! Pretty sure I’ve got a Synology NAS lying around here… somewhere. Might even dust it off and run a quick test for you. Stay tuned, I’ll update the script.

In the meantime, ever thought about using the Docker image for “Docker Container Updater”?

Cheers!

skyw33 commented 1 month ago

Thank you. I didn't want to use the docker container simply because I wanted a Synology-specific solution that would allow me to add the command to a scheduled task and run it as root. Maybe there is an easy way to do this with the docker container too -- I'm not sure...

skyw33 commented 1 month ago

Also, notifications are easier for my application if using a script. I'd like to use the notification system built by the dockcheck project. They have a specific solution for synology: https://github.com/mag37/dockcheck/blob/main/notify_templates/notify_DSM.sh ...and I have already modified your script to use that.

jansppenrade2 commented 1 month ago

Alright, if I got you right, you could use the Docker image like this:

docker run  -d \
            --name=Docker-Container-Updater \
            --hostname=Docker-Container-Updater \
            --restart=always \
            --privileged \
            --tty \
            --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
            --mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
            --env DCU_TEST_MODE=true \
            --env DCU_CRONTAB_EXECUTION_EXPRESSION='' \
            janjk/docker-container-updater:latest

In this example, the DCU_CRONTAB_EXECUTION_EXPRESSION is intentionally left blank so no cron job is created inside the container.

Then, from your Synology host, you can simply run one of the following commands (or just include them in your existing scheduled tasks):

docker exec -it Docker-Container-Updater dcu --run
docker exec -it Docker-Container-Updater dcu --dry-run

For more command parameters and details, check out the Command Line Parameters section.

Now, to be honest, I’ve been considering phasing out support for QNAP systems, as maintaining specific systems and different OS' has proven to be quite a challenge. Given that, it wouldn’t make much sense to start adding specific support for Synology now. That’s exactly why container solutions exist — so they can handle the complexity across different platforms more easily.

That said, I’d love for you to test this approach and let me know if it works for your setup. If you still feel there’s a compelling reason to directly support Synology systems, I’m open to discussing it further and would be happy to explore a solution. I’ll leave this issue open for now and look forward to hearing your thoughts!

jansppenrade2 commented 1 month ago

Ah, wait… I just read your last comment. Now that would be a valid reason…

jansppenrade2 commented 1 month ago

In version 2024.10.04-1: