From a3f28a2eb79e015bdcaf183c7a82f6c0bf61607d Mon Sep 17 00:00:00 2001 From: eskwisit Date: Tue, 27 Feb 2024 08:36:30 +0100 Subject: [PATCH] chore(): remove cron task --- Dockerfile | 13 ++++--------- README.md | 12 +++++++++++- entrypoint.sh | 22 ---------------------- 3 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 41c045f..118a285 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,9 @@ LABEL email='mru2683@gmail.com' # Prepare Nut install RUN apt-get update && apt-get -y install \ - gcc \ - cron \ wget \ unzip \ + gcc \ libssl-dev \ libcurl4-openssl-dev \ zlib1g-dev \ @@ -21,7 +20,7 @@ RUN wget https://github.com/blawar/nut/archive/refs/tags/v3.3.zip RUN unzip v3.3.zip -d /root RUN mv /root/nut-3.3 /root/nut -# Tune config +# Edit config RUN mv /root/nut/conf/nut.default.conf /root/nut/conf/nut.conf RUN sed -i '/scan/c "scan": ["\/titles"]' /root/nut/conf/nut.conf @@ -36,11 +35,7 @@ RUN echo markupsafe==2.0.1 >>/root/nut/requirements.txt RUN pip3 install -U pip RUN pip3 install -r /root/nut/requirements.txt -COPY /entrypoint.sh / - -RUN chmod +x /entrypoint.sh - -VOLUME [ "/titles" ] +VOLUME [ "/titles", "/root/nut/conf", "/root/nut/_NSPOUT" ] EXPOSE 9000 @@ -48,4 +43,4 @@ EXPOSE 9000 RUN rm v3.3.zip RUN apt-get autoremove -ENTRYPOINT ["/entrypoint.sh"] +CMD ["python3", "/root/nut/nut.py", "--server"] diff --git a/README.md b/README.md index 730a1df..7ae2e75 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Slim Docker image featuring embedded Nut server from [blawar/nut](https://github - Thin Docker image. - Very low memory usage. - Designed to work on amd64 arch (Linux, Unix). -- Cron task to poll new titles. +- Auto refresh of titles directory. - Zero config bundle. - Seamless integration for [Tinfoil](https://tinfoil.io/). @@ -20,3 +20,13 @@ docker pull eskwisit/nut-server # Run image docker run -d --name=nut-server -v /path/to/titles:/titles:rw eskwisit/nut-server ``` + +## Volumes + +If you need to tune the configuration, you can mount titles, conf and NSPOUT volumes. + +```bash +-v /path/to/titles:/titles:rw # For titles +-v /path/to/conf:/root/nut/conf:rw # For config files +-v /path/to/_NSPOUT:/root/nut/_NSPOUT/:rw # For NSP out +``` diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 0c00ec9..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -e - -CRON_CMD='wget --spider --user guest --password guest' -HOSTED_API=http://127.0.0.1:9000/api -CRON_FOLDER=/etc/cron.d - -echo 'Registering cron task' - -rm -f $CRON_FOLDER/polling-titles && touch $CRON_FOLDER/polling-titles - -echo "0 1 * * * $CRON_CMD $HOSTED_API/scan" >>$CRON_FOLDER/polling-titles - -chmod 0644 $CRON_FOLDER/polling-titles - -crontab $CRON_FOLDER/polling-titles - -service cron start - -echo 'Starting nut server on port 9000' - -python3 /root/nut/nut.py --server