From 35be993a75fa8f431002afab206b24b586607597 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 13 Jun 2018 21:14:32 +0100 Subject: [PATCH 01/73] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6232824..1ecced6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM lsiobase/alpine.python -MAINTAINER Ben White +MAINTAINER GhostWriters ADD root / WORKDIR /root -RUN git clone https://github.com/biwhite/Packt-Publishing-Free-Learning.git +RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning RUN cd Packt-Publishing-Free-Learning && git checkout add-cfgpath-argument RUN pip install -r /root/Packt-Publishing-Free-Learning/requirements.txt ENTRYPOINT ["/init"] From 62f3570a4d2e76100d95482053ad9e65806357d7 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 13 Jun 2018 21:19:21 +0100 Subject: [PATCH 02/73] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ecced6d..36bbf71a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM lsiobase/alpine.python MAINTAINER GhostWriters ADD root / WORKDIR /root -RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning +RUN apk add --update git +RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning.git RUN cd Packt-Publishing-Free-Learning && git checkout add-cfgpath-argument RUN pip install -r /root/Packt-Publishing-Free-Learning/requirements.txt ENTRYPOINT ["/init"] - From 853b6f8efcd9d3d3c473af006c7bfc1a886db505 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 13 Jun 2018 21:23:51 +0100 Subject: [PATCH 03/73] Create .travis.yml --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..4feae7ea --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +sudo: required + +services: + - docker + +language: bash + +install: + - docker build . From 945983977c680f52f9ecbf0f8c8abaf6dc5357ce Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 13 Jun 2018 21:25:44 +0100 Subject: [PATCH 04/73] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 36bbf71a..ed7414fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,5 @@ ADD root / WORKDIR /root RUN apk add --update git RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning.git -RUN cd Packt-Publishing-Free-Learning && git checkout add-cfgpath-argument RUN pip install -r /root/Packt-Publishing-Free-Learning/requirements.txt ENTRYPOINT ["/init"] From 07f0c45b64a3124c88957f4b483fb8ae126016e8 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 13 Jun 2018 21:30:29 +0100 Subject: [PATCH 05/73] Update README.md --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index fd9a1db9..e41ae22b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,8 @@ -# Container for Packt daily download script # -Upstream script available at https://github.com/igbt6/Packt-Publishing-Free-Learning +# Container for Packt daily download script # This container fires up an alpine linux docker running cron, scheduled to claim the daily free book, and download whatever's missing from your data folder once per night. -## Build ## -Build with: - -``` -docker build -t biwhite/packt . -``` - ## Run ## Run with: @@ -21,7 +13,7 @@ docker run -d --name packt --rm \ -e PACKTPASSWORD=xxxxxxxx \ -v /opt/packt/config:/config \ -v /opt/packt/data:/data \ - biwhite/packt + ghostwriters/docker-packt ``` ## Volumes and variables ## @@ -30,9 +22,15 @@ Volumes: - /config, where we can find a configFile.cfg, where log is stored, where google auth details go - /data, where files are downloaded to -Variables: +OPTIONAL Variables: - PACKTEMAIL, email address registered with Packt account - PACKTPASSWORD, password for Packt account If variables are set, they overwrite what is already in config file at container startup. If not set, config file will be left alone. + +## Special Thanks ## + +- [biwhite](https://github.com/biwhite) for creating the intital docker container. +- [igbt6](https://github.com/igbt6) for providing the upstream script available at https://github.com/igbt6/Packt-Publishing-Free-Learning + From d895a3252f850d582d2a9b2b7f05877195d18318 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 18 Jun 2018 18:52:20 +0100 Subject: [PATCH 06/73] Update root --- root/var/spool/cron/crontabs/root | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/var/spool/cron/crontabs/root b/root/var/spool/cron/crontabs/root index aa43f450..78e6c33f 100644 --- a/root/var/spool/cron/crontabs/root +++ b/root/var/spool/cron/crontabs/root @@ -1 +1 @@ -21 2 * * * /root/Packt-Publishing-Free-Learning/src/packtPublishingFreeEbook.py -c /config -g -da +0 1 * * * python3 /root/Packt-Publishing-Free-Learning/src/packtPublishingFreeEbook.py -c /config/configFile.cfg -gd > /config/packtPublishingFreeEbook.log From e4f3feb6131fdd7b4348214a7f5fce6f5b67cecb Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 18 Jun 2018 21:58:40 +0100 Subject: [PATCH 07/73] Multiple updates and fixes - Changed to use python3 - Added extra environment variables - Fixed using the wrong time and user id's - Shellcheck and Bashate fixes - Changed to just download the daily book. Otherwise you can never delete anything you don't want! --- Dockerfile | 3 +- README.md | 32 ++++++++---- root/etc/cont-init.d/20-add-config-sample.sh | 54 ++++++++++++++++---- 3 files changed, 67 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed7414fb..9d2d4831 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM lsiobase/alpine.python +FROM lsiobase/alpine.python3 MAINTAINER GhostWriters ADD root / WORKDIR /root RUN apk add --update git RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning.git RUN pip install -r /root/Packt-Publishing-Free-Learning/requirements.txt + ENTRYPOINT ["/init"] diff --git a/README.md b/README.md index e41ae22b..89986638 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Container for Packt daily download script # -This container fires up an alpine linux docker running cron, scheduled to claim the daily free book, and download whatever's missing from your data folder once per night. +This container fires up an alpine linux with python3 docker running cron, scheduled to claim the daily free book once per night at 1am. ## Run ## @@ -9,28 +9,38 @@ Run with: ``` docker run -d --name packt --rm \ - -e PACKTEMAIL=xxx@xxx.xxx \ - -e PACKTPASSWORD=xxxxxxxx \ - -v /opt/packt/config:/config \ - -v /opt/packt/data:/data \ + -e PACKT_EMAIL= \ + -e PACKT_PASSWORD= \ + -e PACKT_DOWNLOAD_FORMATS=pdf, epub, mobi, code \ + -e PACKT_ANTICAPTCHA_KEY= \ + -e PUID= \ + -e PGID= \ + -e TZ= \ + -v /home/user/packt/config:/config \ + -v /home/user/packt/books:/data \ ghostwriters/docker-packt ``` ## Volumes and variables ## Volumes: - - /config, where we can find a configFile.cfg, where log is stored, where google auth details go + - /config, where the configFile.cfg and log file are placed - /data, where files are downloaded to -OPTIONAL Variables: - - PACKTEMAIL, email address registered with Packt account - - PACKTPASSWORD, password for Packt account +OPTIONAL: Variables: + - PACKT_EMAIL, email address registered with Packt account + - PACKT_PASSWORD, password for Packt account + - PACKT_DOWNLOAD_FORMATS=pdf, epub, mobi, code + - PACKT_ANTICAPTCHA_KEY= get an api key from https://anti-captcha.com + - PACKT_DOWNLOAD_BOOK_TITLES, specify individual books -If variables are set, they overwrite what is already in config file at container startup. -If not set, config file will be left alone. +If variables are set, they overwrite what is already in the configFile.cfg file at container startup. +If not set, the config file will be left alone. +#### Anticaptcha key required to download the daily book. #### ## Special Thanks ## - [biwhite](https://github.com/biwhite) for creating the intital docker container. - [igbt6](https://github.com/igbt6) for providing the upstream script available at https://github.com/igbt6/Packt-Publishing-Free-Learning +- [LinuxServer.io](https://www.linuxserver.io/) for maintaining the base image used in this project. diff --git a/root/etc/cont-init.d/20-add-config-sample.sh b/root/etc/cont-init.d/20-add-config-sample.sh index 4e5fbc6f..bc639149 100644 --- a/root/etc/cont-init.d/20-add-config-sample.sh +++ b/root/etc/cont-init.d/20-add-config-sample.sh @@ -1,18 +1,52 @@ #!/usr/bin/with-contenv sh + +chown -R abc:abc /config CFG=/config/configFile.cfg + # This copies the sample config in place if not one present if [ ! -f $CFG ]; then - echo "No config file, providing sample" - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG + echo 'No config file, providing sample' + cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG fi # If environment arguments have been provided, switch the values in the sample config to these -echo "ENV PACKTEMAIL provided as '$PACKTEMAIL'" -if [ -n "$PACKTEMAIL" ]; then - sed -i s/email=.*/email=$PACKTEMAIL/ $CFG +if [ -n "$PACKT_EMAIL" ]; then + echo 'ENV PACKT_EMAIL provided' + sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG +else + echo 'ENV PACKTEMAIL not set' fi -echo "ENV PACKTPASSWORD provided as '$PACKTPASSWORD'" -if [ -n "$PACKTPASSWORD" ]; then - sed -i s/password=.*/password=$PACKTPASSWORD/ $CFG + +if [ -n "$PACKT_PASSWORD" ]; then + echo 'ENV PACKT_PASSWORD provided' + sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG +else + echo 'ENV PACKTEMAIL not set' fi -echo "Replacing path with /data" -sed -i "s/downloadFolderPath:.*/downloadFolderPath: \/data/" $CFG + +if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then + echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" + sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG +else + echo 'ENV PACKT_DOWNLOAD_FORMATS not set' +fi + +if [ -n "$PACKT_DOWNLOAD_BOOK_TITLES" ]; then + echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" + sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG +else + echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' + sed -i s/download_book_titles:.*/download_book_titles:/ $CFG +fi + +if [ -n "$PACKT_ANTICAPTCHA_KEY" ]; then + echo 'ENV PACKT_ANTICAPTCHA_Key provided' + sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG +else + echo 'ENV PACKT_ANTICAPTCHA_KEY not set' +fi + +echo 'Replacing path with /data' +sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG + +echo 'Set logfile path to /data' +sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG From 0dc180883faaa6e6f8225290726a279a5387b6e8 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 9 Feb 2019 09:54:35 +0000 Subject: [PATCH 08/73] Changed to support Pip install --- Dockerfile | 5 ++--- root/var/spool/cron/crontabs/root | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d2d4831..0ac2631d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM lsiobase/alpine.python3 -MAINTAINER GhostWriters +LABEL maintainer="GhostWriters" ADD root / WORKDIR /root RUN apk add --update git -RUN git clone https://github.com/igbt6/Packt-Publishing-Free-Learning.git -RUN pip install -r /root/Packt-Publishing-Free-Learning/requirements.txt +RUN pip install git+https://github.com/luk6xff/Packt-Publishing-Free-Learning.git@master ENTRYPOINT ["/init"] diff --git a/root/var/spool/cron/crontabs/root b/root/var/spool/cron/crontabs/root index 78e6c33f..4161eb51 100644 --- a/root/var/spool/cron/crontabs/root +++ b/root/var/spool/cron/crontabs/root @@ -1 +1 @@ -0 1 * * * python3 /root/Packt-Publishing-Free-Learning/src/packtPublishingFreeEbook.py -c /config/configFile.cfg -gd > /config/packtPublishingFreeEbook.log +0 1 * * * packt-cli -gd -c /config/configFile.cfg > /config/LOG_FILE.log 2>&1 \ No newline at end of file From abc3001b45541e205eb86dfedc337a2cf9be2af1 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Mar 2019 10:33:15 +0000 Subject: [PATCH 09/73] Changed pip install method --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0ac2631d..fe8d0d0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,6 @@ LABEL maintainer="GhostWriters" ADD root / WORKDIR /root RUN apk add --update git -RUN pip install git+https://github.com/luk6xff/Packt-Publishing-Free-Learning.git@master +RUN pip install packt --upgrade ENTRYPOINT ["/init"] From 253a853c4e8b8486f203b08cf05cd4bb73047196 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 19:41:44 +0000 Subject: [PATCH 10/73] Updated Readme, Alpine Image and pip3 install. Co-authored-by: Restyled.io Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> --- Dockerfile | 6 +++--- README.md | 51 ++++++++++++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe8d0d0d..5e9f4804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM lsiobase/alpine.python3 +FROM alpine:3.12 LABEL maintainer="GhostWriters" ADD root / WORKDIR /root -RUN apk add --update git -RUN pip install packt --upgrade +RUN apk add --update git py3-pip +RUN pip3 install packt --upgrade ENTRYPOINT ["/init"] diff --git a/README.md b/README.md index 89986638..68be7e63 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ +# Container for Packt daily download script -# Container for Packt daily download script # +This creates a Alpine Linux docker container running running cron, scheduled to +claim the daily free book once per night at 1am. For more information about what +this container calls visit +. -This container fires up an alpine linux with python3 docker running cron, scheduled to claim the daily free book once per night at 1am. - -## Run ## +## Run Run with: @@ -21,26 +23,29 @@ docker run -d --name packt --rm \ ghostwriters/docker-packt ``` -## Volumes and variables ## +## Volumes and variables Volumes: - - /config, where the configFile.cfg and log file are placed - - /data, where files are downloaded to + +- /config, where the configFile.cfg and log file are placed +- /data, where files are downloaded to OPTIONAL: Variables: - - PACKT_EMAIL, email address registered with Packt account - - PACKT_PASSWORD, password for Packt account - - PACKT_DOWNLOAD_FORMATS=pdf, epub, mobi, code - - PACKT_ANTICAPTCHA_KEY= get an api key from https://anti-captcha.com - - PACKT_DOWNLOAD_BOOK_TITLES, specify individual books - -If variables are set, they overwrite what is already in the configFile.cfg file at container startup. -If not set, the config file will be left alone. -#### Anticaptcha key required to download the daily book. #### - -## Special Thanks ## - -- [biwhite](https://github.com/biwhite) for creating the intital docker container. -- [igbt6](https://github.com/igbt6) for providing the upstream script available at https://github.com/igbt6/Packt-Publishing-Free-Learning -- [LinuxServer.io](https://www.linuxserver.io/) for maintaining the base image used in this project. - + +- PACKT_EMAIL - email address registered with Packt account +- PACKT_PASSWORD - password for Packt account +- PACKT_DOWNLOAD_FORMATS - pdf, epub, mobi, code +- PACKT_ANTICAPTCHA_KEY - get an api key from +- PACKT_DOWNLOAD_BOOK_TITLES - specify individual books + +If variables are set, they overwrite what is already in the configFile.cfg file +at container startup. If not set, the config file will be left alone. + +Anticaptcha key required to download the daily book. + +## Special Thanks + +- [biwhite](https://github.com/biwhite) for creating the intital docker + container. +- for maintaining + the package to handle the downloading. From 09de853418ddb5e607b26556a579d7a18966500c Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 20:50:02 +0000 Subject: [PATCH 11/73] added PYASN1 update Co-authored-by: Restyled.io Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e9f4804..25ae120f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,5 @@ LABEL maintainer="GhostWriters" ADD root / WORKDIR /root RUN apk add --update git py3-pip -RUN pip3 install packt --upgrade - +RUN pip3 install packt pyasn1 --upgrade ENTRYPOINT ["/init"] From 52a47c7fed00318439b54e4f462309224026964c Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 21:21:57 +0000 Subject: [PATCH 12/73] Removed EntryPoint --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 25ae120f..bb013849 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,3 @@ ADD root / WORKDIR /root RUN apk add --update git py3-pip RUN pip3 install packt pyasn1 --upgrade -ENTRYPOINT ["/init"] From 7c65cbe4eb3a194c6f58689118a0d588894b1893 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 26 Jan 2021 21:31:38 +0000 Subject: [PATCH 13/73] Entry point changes --- Dockerfile | 12 ++++++++++-- .../20-add-config-sample.sh => docker-entrypoint.sh} | 8 +++++--- 2 files changed, 15 insertions(+), 5 deletions(-) rename root/{etc/cont-init.d/20-add-config-sample.sh => docker-entrypoint.sh} (93%) diff --git a/Dockerfile b/Dockerfile index bb013849..278a00ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,14 @@ FROM alpine:3.12 + LABEL maintainer="GhostWriters" + ADD root / +COPY /root/docker-entrypoint.sh /opt/docker-entrypoint.sh WORKDIR /root -RUN apk add --update git py3-pip -RUN pip3 install packt pyasn1 --upgrade + +RUN apk add --no-cache py3-pip +RUN pip3 install packt --upgrade +RUN rm -rf /var/cache/apk/* +RUN chmod +x /opt/docker-entrypoint.sh + +ENTRYPOINT [ "/opt/docker-entrypoint.sh" ] diff --git a/root/etc/cont-init.d/20-add-config-sample.sh b/root/docker-entrypoint.sh similarity index 93% rename from root/etc/cont-init.d/20-add-config-sample.sh rename to root/docker-entrypoint.sh index bc639149..58669480 100644 --- a/root/etc/cont-init.d/20-add-config-sample.sh +++ b/root/docker-entrypoint.sh @@ -1,9 +1,8 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh -chown -R abc:abc /config CFG=/config/configFile.cfg -# This copies the sample config in place if not one present +# This copies the sample config if one is not present in the config dir if [ ! -f $CFG ]; then echo 'No config file, providing sample' cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG @@ -50,3 +49,6 @@ sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG echo 'Set logfile path to /data' sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG + +echo 'Start crond' +crond -f From 603e7fbbe5eeb7928dc6c5012bb9483d727a0777 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 27 Jan 2021 21:36:31 +0000 Subject: [PATCH 14/73] Dockerfile cleanup --- Dockerfile | 7 ++--- root/opt/docker-entrypoint.sh | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 root/opt/docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 278a00ec..cde207c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,9 @@ FROM alpine:3.12 LABEL maintainer="GhostWriters" ADD root / -COPY /root/docker-entrypoint.sh /opt/docker-entrypoint.sh -WORKDIR /root +RUN chmod +x /opt/docker-entrypoint.sh RUN apk add --no-cache py3-pip -RUN pip3 install packt --upgrade -RUN rm -rf /var/cache/apk/* -RUN chmod +x /opt/docker-entrypoint.sh +RUN pip3 install packt ENTRYPOINT [ "/opt/docker-entrypoint.sh" ] diff --git a/root/opt/docker-entrypoint.sh b/root/opt/docker-entrypoint.sh new file mode 100644 index 00000000..58669480 --- /dev/null +++ b/root/opt/docker-entrypoint.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +CFG=/config/configFile.cfg + +# This copies the sample config if one is not present in the config dir +if [ ! -f $CFG ]; then + echo 'No config file, providing sample' + cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG +fi +# If environment arguments have been provided, switch the values in the sample config to these +if [ -n "$PACKT_EMAIL" ]; then + echo 'ENV PACKT_EMAIL provided' + sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG +else + echo 'ENV PACKTEMAIL not set' +fi + +if [ -n "$PACKT_PASSWORD" ]; then + echo 'ENV PACKT_PASSWORD provided' + sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG +else + echo 'ENV PACKTEMAIL not set' +fi + +if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then + echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" + sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG +else + echo 'ENV PACKT_DOWNLOAD_FORMATS not set' +fi + +if [ -n "$PACKT_DOWNLOAD_BOOK_TITLES" ]; then + echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" + sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG +else + echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' + sed -i s/download_book_titles:.*/download_book_titles:/ $CFG +fi + +if [ -n "$PACKT_ANTICAPTCHA_KEY" ]; then + echo 'ENV PACKT_ANTICAPTCHA_Key provided' + sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG +else + echo 'ENV PACKT_ANTICAPTCHA_KEY not set' +fi + +echo 'Replacing path with /data' +sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG + +echo 'Set logfile path to /data' +sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG + +echo 'Start crond' +crond -f From 23f7d36cab1c16975091dd4d19ae1142a2a22819 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 28 Jan 2021 20:45:09 +0000 Subject: [PATCH 15/73] Minor cosmetic cleanup --- Dockerfile | 2 +- root/docker-entrypoint.sh | 54 ------------------------------- root/var/spool/cron/crontabs/root | 2 +- 3 files changed, 2 insertions(+), 56 deletions(-) delete mode 100644 root/docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index cde207c6..3fd86dd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ RUN chmod +x /opt/docker-entrypoint.sh RUN apk add --no-cache py3-pip RUN pip3 install packt -ENTRYPOINT [ "/opt/docker-entrypoint.sh" ] +ENTRYPOINT ["/opt/docker-entrypoint.sh"] diff --git a/root/docker-entrypoint.sh b/root/docker-entrypoint.sh deleted file mode 100644 index 58669480..00000000 --- a/root/docker-entrypoint.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -CFG=/config/configFile.cfg - -# This copies the sample config if one is not present in the config dir -if [ ! -f $CFG ]; then - echo 'No config file, providing sample' - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG -fi -# If environment arguments have been provided, switch the values in the sample config to these -if [ -n "$PACKT_EMAIL" ]; then - echo 'ENV PACKT_EMAIL provided' - sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG -else - echo 'ENV PACKTEMAIL not set' -fi - -if [ -n "$PACKT_PASSWORD" ]; then - echo 'ENV PACKT_PASSWORD provided' - sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG -else - echo 'ENV PACKTEMAIL not set' -fi - -if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then - echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" - sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG -else - echo 'ENV PACKT_DOWNLOAD_FORMATS not set' -fi - -if [ -n "$PACKT_DOWNLOAD_BOOK_TITLES" ]; then - echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" - sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG -else - echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' - sed -i s/download_book_titles:.*/download_book_titles:/ $CFG -fi - -if [ -n "$PACKT_ANTICAPTCHA_KEY" ]; then - echo 'ENV PACKT_ANTICAPTCHA_Key provided' - sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG -else - echo 'ENV PACKT_ANTICAPTCHA_KEY not set' -fi - -echo 'Replacing path with /data' -sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG - -echo 'Set logfile path to /data' -sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG - -echo 'Start crond' -crond -f diff --git a/root/var/spool/cron/crontabs/root b/root/var/spool/cron/crontabs/root index 4161eb51..8bcba667 100644 --- a/root/var/spool/cron/crontabs/root +++ b/root/var/spool/cron/crontabs/root @@ -1 +1 @@ -0 1 * * * packt-cli -gd -c /config/configFile.cfg > /config/LOG_FILE.log 2>&1 \ No newline at end of file +0 1 * * * packt-cli -gd -c /config/configFile.cfg > /config/logFile.log 2>&1 \ No newline at end of file From 73a2ae407f73c134538e696f5e3742f71f6fa282 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 16:24:43 +0000 Subject: [PATCH 16/73] Added SuperLinter workflow Added Super-Linter --- .github/workflows/superlinter.yml | 25 +++++++++++++++++++++++++ Dockerfile | 7 +++++-- README.md | 4 +++- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/superlinter.yml diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml new file mode 100644 index 00000000..e617e63c --- /dev/null +++ b/.github/workflows/superlinter.yml @@ -0,0 +1,25 @@ +name: Super-Linter + +# Run this workflow every time a new commit pushed to your repository +on: push + +jobs: + # Set the job key. The key is displayed as the job name + # when a job name is not provided + super-lint: + # Name the Job + name: Lint code base + # Set the type of machine to run on + runs-on: ubuntu-latest + + steps: + # Checks out a copy of your repository on the ubuntu-latest machine + - name: Checkout code + uses: actions/checkout@v2 + + # Runs the Super-Linter action + - name: Run Super-Linter + uses: github/super-linter@v3 + env: + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 3fd86dd6..bbb62449 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,13 @@ FROM alpine:3.12 LABEL maintainer="GhostWriters" -ADD root / +COPY root / RUN chmod +x /opt/docker-entrypoint.sh +# hadolint ignore=DL3018 RUN apk add --no-cache py3-pip -RUN pip3 install packt + +# hadolint ignore=DL3013 +RUN pip3 install --no-cache-dir packt ENTRYPOINT ["/opt/docker-entrypoint.sh"] diff --git a/README.md b/README.md index 68be7e63..167a7b2f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Container for Packt daily download script +[![GitHub Super-Linter](https://github.com/GhostWriters/docker-packt/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) + This creates a Alpine Linux docker container running running cron, scheduled to claim the daily free book once per night at 1am. For more information about what this container calls visit @@ -9,7 +11,7 @@ this container calls visit Run with: -``` +```docker docker run -d --name packt --rm \ -e PACKT_EMAIL= \ -e PACKT_PASSWORD= \ From e8cd2c58fdf8f8362d6d32b684613cbda5f8eb54 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 17:37:13 +0000 Subject: [PATCH 17/73] Updated Gitignore --- .gitignore | 364 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 359 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0c1d400c..3a8542dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,362 @@ -.git -.credentials -client_secret.json -env/ -configFile.cfg +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj *.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file From 60b5685691832930c7d6d4d2f694125b11b359a7 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 20:50:07 +0000 Subject: [PATCH 18/73] Info now also appears in Container logs --- root/var/spool/cron/crontabs/root | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/var/spool/cron/crontabs/root b/root/var/spool/cron/crontabs/root index 8bcba667..7f4dfa03 100644 --- a/root/var/spool/cron/crontabs/root +++ b/root/var/spool/cron/crontabs/root @@ -1 +1 @@ -0 1 * * * packt-cli -gd -c /config/configFile.cfg > /config/logFile.log 2>&1 \ No newline at end of file +30 20 * * * packt-cli -gd -c /config/configFile.cfg 2>&1 | tee /config/logFile.log \ No newline at end of file From 7e04b193d3111232d40e083042afa20c21424b35 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 10:57:31 +0000 Subject: [PATCH 19/73] Added badges --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 167a7b2f..467d1570 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Container for Packt daily download script -[![GitHub Super-Linter](https://github.com/GhostWriters/docker-packt/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) +[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt/graphs/contributors) +[![GitHub last commit master](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/master.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt/commits/master) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Super-Linter/master?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt/actions?query=workflow%3ASuper-Linter+branch%3Amaster) This creates a Alpine Linux docker container running running cron, scheduled to claim the daily free book once per night at 1am. For more information about what @@ -47,7 +49,7 @@ Anticaptcha key required to download the daily book. ## Special Thanks -- [biwhite](https://github.com/biwhite) for creating the intital docker +- [biwhite](https://github.com/biwhite) for creating the initial docker container. - for maintaining the package to handle the downloading. From 99cd4c4170884ce08c89ed632a618fd5a1aa2c21 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 15:20:51 +0000 Subject: [PATCH 20/73] Created LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..568a9570 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 GhostWriters + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From a28928b7cdfb2c9bb4212f2d4ed61864ec052d6e Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 15:33:03 +0000 Subject: [PATCH 21/73] Added license badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 467d1570..923d8fcc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt/graphs/contributors) [![GitHub last commit master](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/master.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt/commits/master) +[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt/blob/master/LICENSE.md) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Super-Linter/master?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt/actions?query=workflow%3ASuper-Linter+branch%3Amaster) This creates a Alpine Linux docker container running running cron, scheduled to From 120d40db7f0ab73b797ebb07bd2252701539b634 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 20:08:13 +0000 Subject: [PATCH 22/73] Update root --- root/var/spool/cron/crontabs/root | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/var/spool/cron/crontabs/root b/root/var/spool/cron/crontabs/root index 7f4dfa03..7b7dbfcc 100644 --- a/root/var/spool/cron/crontabs/root +++ b/root/var/spool/cron/crontabs/root @@ -1 +1 @@ -30 20 * * * packt-cli -gd -c /config/configFile.cfg 2>&1 | tee /config/logFile.log \ No newline at end of file +0 1 * * * packt-cli -gd -c /config/configFile.cfg 2>&1 | tee /config/logFile.log From 2ded87c04c9fcfc6c24fb8f03f26c589679b86f2 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 21:13:51 +0000 Subject: [PATCH 23/73] Linting improvements --- .editorconfig | 15 ++++++++ .../{superlinter.yml => Linters.yml} | 8 +++-- .gitignore | 2 +- .travis.yml | 4 +-- README.md | 24 +++++++------ root/opt/docker-entrypoint.sh | 36 +++++++++---------- 6 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 .editorconfig rename .github/workflows/{superlinter.yml => Linters.yml} (75%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..201b8791 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf + +[*.{yml,md}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/superlinter.yml b/.github/workflows/Linters.yml similarity index 75% rename from .github/workflows/superlinter.yml rename to .github/workflows/Linters.yml index e617e63c..ccb3ec05 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/Linters.yml @@ -1,18 +1,20 @@ name: Super-Linter -# Run this workflow every time a new commit pushed to your repository +# Run this workflow every time a new commit pushed to the repository on: push jobs: - # Set the job key. The key is displayed as the job name - # when a job name is not provided + # The key is displayed as the job name super-lint: + # Name the Job name: Lint code base + # Set the type of machine to run on runs-on: ubuntu-latest steps: + # Checks out a copy of your repository on the ubuntu-latest machine - name: Checkout code uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 3a8542dc..1ee53850 100644 --- a/.gitignore +++ b/.gitignore @@ -359,4 +359,4 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd diff --git a/.travis.yml b/.travis.yml index 4feae7ea..8a8fa2c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ sudo: required services: - - docker - + - docker + language: bash install: diff --git a/README.md b/README.md index 923d8fcc..79dbedb6 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,19 @@ this container calls visit Run with: ```docker -docker run -d --name packt --rm \ - -e PACKT_EMAIL= \ - -e PACKT_PASSWORD= \ - -e PACKT_DOWNLOAD_FORMATS=pdf, epub, mobi, code \ - -e PACKT_ANTICAPTCHA_KEY= \ - -e PUID= \ - -e PGID= \ - -e TZ= \ - -v /home/user/packt/config:/config \ - -v /home/user/packt/books:/data \ - ghostwriters/docker-packt +docker run -d \ + --name=packt --rm \ + -e PACKT_EMAIL= \ + -e PACKT_PASSWORD= \ + -e PACKT_DOWNLOAD_FORMATS=pdf, epub, mobi, code \ + -e PACKT_ANTICAPTCHA_KEY= \ + -e PUID= \ + -e PGID= \ + -e TZ= \ + -v /home/user/packt/config:/config \ + -v /home/user/packt/books:/data \ + --restart unless-stopped \ + ghostwriters/docker-packt ``` ## Volumes and variables diff --git a/root/opt/docker-entrypoint.sh b/root/opt/docker-entrypoint.sh index 58669480..1ab5522b 100644 --- a/root/opt/docker-entrypoint.sh +++ b/root/opt/docker-entrypoint.sh @@ -4,44 +4,44 @@ CFG=/config/configFile.cfg # This copies the sample config if one is not present in the config dir if [ ! -f $CFG ]; then - echo 'No config file, providing sample' - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG + echo 'No config file, providing sample' + cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG fi # If environment arguments have been provided, switch the values in the sample config to these if [ -n "$PACKT_EMAIL" ]; then - echo 'ENV PACKT_EMAIL provided' - sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG + echo 'ENV PACKT_EMAIL provided' + sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKTEMAIL not set' fi if [ -n "$PACKT_PASSWORD" ]; then - echo 'ENV PACKT_PASSWORD provided' - sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG + echo 'ENV PACKT_PASSWORD provided' + sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKTEMAIL not set' fi if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then - echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" - sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG + echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" + sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG else - echo 'ENV PACKT_DOWNLOAD_FORMATS not set' + echo 'ENV PACKT_DOWNLOAD_FORMATS not set' fi if [ -n "$PACKT_DOWNLOAD_BOOK_TITLES" ]; then - echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" - sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG + echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" + sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG else - echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' - sed -i s/download_book_titles:.*/download_book_titles:/ $CFG + echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' + sed -i s/download_book_titles:.*/download_book_titles:/ $CFG fi if [ -n "$PACKT_ANTICAPTCHA_KEY" ]; then - echo 'ENV PACKT_ANTICAPTCHA_Key provided' - sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG + echo 'ENV PACKT_ANTICAPTCHA_Key provided' + sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG else - echo 'ENV PACKT_ANTICAPTCHA_KEY not set' + echo 'ENV PACKT_ANTICAPTCHA_KEY not set' fi echo 'Replacing path with /data' From 2bc5ca2cfd456424170902e18271d1dbf5fc0d8d Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 8 Apr 2023 11:28:05 +0100 Subject: [PATCH 24/73] Dependabot Added (#19) --- .github/dependabot.yml | 23 +++++++++++++++++++++++ .github/workflows/Linters.yml | 27 --------------------------- .travis.yml | 9 --------- 3 files changed, 23 insertions(+), 36 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Linters.yml delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6e5a1535 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every day at 11:30am + interval: "daily" + time: "11:30" + + - package-ecosystem: "pip" + directory: "/" + # Check the npm registry for updates every day at 11:30am + schedule: + interval: "daily" + time: "11:30" + + - package-ecosystem: "docker" + # Look for a `Dockerfile` in the `root` directory + directory: "/" + # Check for updates once a week at 11:30am + schedule: + interval: "weekly" + time: "11:30" diff --git a/.github/workflows/Linters.yml b/.github/workflows/Linters.yml deleted file mode 100644 index ccb3ec05..00000000 --- a/.github/workflows/Linters.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Super-Linter - -# Run this workflow every time a new commit pushed to the repository -on: push - -jobs: - # The key is displayed as the job name - super-lint: - - # Name the Job - name: Lint code base - - # Set the type of machine to run on - runs-on: ubuntu-latest - - steps: - - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - uses: actions/checkout@v2 - - # Runs the Super-Linter action - - name: Run Super-Linter - uses: github/super-linter@v3 - env: - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a8fa2c0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: required - -services: - - docker - -language: bash - -install: - - docker build . From fb983e95e2a4754a59a6731b4265205816985769 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 8 Apr 2023 11:56:19 +0100 Subject: [PATCH 25/73] Dependabot auto-approve --- .github/dependabot.yml | 6 +++--- .github/workflows/dependabot-auto-approve.yml | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dependabot-auto-approve.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6e5a1535..5c8ea055 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,14 +5,14 @@ updates: schedule: # Check for updates to GitHub Actions every day at 11:30am interval: "daily" - time: "11:30" + time: "12:00" - package-ecosystem: "pip" directory: "/" # Check the npm registry for updates every day at 11:30am schedule: interval: "daily" - time: "11:30" + time: "12:00" - package-ecosystem: "docker" # Look for a `Dockerfile` in the `root` directory @@ -20,4 +20,4 @@ updates: # Check for updates once a week at 11:30am schedule: interval: "weekly" - time: "11:30" + time: "12:00" diff --git a/.github/workflows/dependabot-auto-approve.yml b/.github/workflows/dependabot-auto-approve.yml new file mode 100644 index 00000000..7a22a0a0 --- /dev/null +++ b/.github/workflows/dependabot-auto-approve.yml @@ -0,0 +1,21 @@ +name: Dependabot auto-approve +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} From 502cbdb2df7bec2ba61d434d8b11b0e6dadc9a6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:02:34 +0100 Subject: [PATCH 26/73] Bump alpine from 3.12 to 3.17 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bbb62449..be9e5d02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM alpine:3.17 LABEL maintainer="GhostWriters" From 3cba632c4ce57f207e91bc1f882179ca07c77a75 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 11:05:30 +0100 Subject: [PATCH 27/73] Old Version update check Co-authored-by: Tom Eley --- Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index be9e5d02..a5d87fe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,11 @@ -FROM alpine:3.17 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls15 LABEL maintainer="GhostWriters" COPY root / -RUN chmod +x /opt/docker-entrypoint.sh -# hadolint ignore=DL3018 -RUN apk add --no-cache py3-pip - -# hadolint ignore=DL3013 -RUN pip3 install --no-cache-dir packt +RUN apk add --no-cache py3-pip=22.3.1 && \ + pip3 install --no-cache-dir packt==1.7.0 && \ + whoami ENTRYPOINT ["/opt/docker-entrypoint.sh"] From 8632cce2431c0695d78bddde72ba14d306bf2c09 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 20:32:29 +0100 Subject: [PATCH 28/73] Various Improvements Various improvements. Switched to Mega-Linter. Automated the update of the Docker image when theres a change. --- .checkov.yml | 3 + .editorconfig | 18 ++-- .github/dependabot.yml | 5 +- .github/workflows/deploy-docker-image.yml | 62 ++++++++++++++ .github/workflows/mega-linter.yml | 99 ++++++++++++++++++++++ .gitignore | 41 ++++++++- .hadolint.yaml | 6 ++ .mega-linter.yml | 13 +++ .trivyignore | 1 + Dockerfile | 17 +++- LICENSE | 2 +- README.md | 32 +++---- root/{var/spool/cron => etc}/crontabs/root | 0 root/opt/docker-entrypoint.sh | 36 ++++---- root/opt/requirements.txt | 1 + 15 files changed, 286 insertions(+), 50 deletions(-) create mode 100644 .checkov.yml create mode 100644 .github/workflows/deploy-docker-image.yml create mode 100644 .github/workflows/mega-linter.yml create mode 100644 .hadolint.yaml create mode 100644 .mega-linter.yml create mode 100644 .trivyignore rename root/{var/spool/cron => etc}/crontabs/root (100%) mode change 100644 => 100755 root/opt/docker-entrypoint.sh create mode 100644 root/opt/requirements.txt diff --git a/.checkov.yml b/.checkov.yml new file mode 100644 index 00000000..8a6585d9 --- /dev/null +++ b/.checkov.yml @@ -0,0 +1,3 @@ +quiet: true +skip-check: + - CKV_DOCKER_3 diff --git a/.editorconfig b/.editorconfig index 201b8791..46d41608 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,21 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file root = true [*] -indent_style = tab -indent_size = 4 +charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true end_of_line = lf -[*.{yml,md}] +[**.md] +indent_style = space +indent_size = 2 + +[**.sh] +indent_style = space +indent_size = 4 +switch_case_indent = true # like -ci +space_redirects = true # like -sr + +[**.yaml,**.yml] indent_style = space indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5c8ea055..c960b7be 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,14 +5,12 @@ updates: schedule: # Check for updates to GitHub Actions every day at 11:30am interval: "daily" - time: "12:00" - package-ecosystem: "pip" - directory: "/" + directory: "/opt" # Check the npm registry for updates every day at 11:30am schedule: interval: "daily" - time: "12:00" - package-ecosystem: "docker" # Look for a `Dockerfile` in the `root` directory @@ -20,4 +18,3 @@ updates: # Check for updates once a week at 11:30am schedule: interval: "weekly" - time: "12:00" diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml new file mode 100644 index 00000000..92fd0960 --- /dev/null +++ b/.github/workflows/deploy-docker-image.yml @@ -0,0 +1,62 @@ +name: build-and-push-docker-image + +permissions: read-all + +on: + push: + +jobs: + docker: + runs-on: ubuntu-20.04 + permissions: + packages: write + steps: + # Checks out the main branch of the repository to the runner + - uses: actions/checkout@v3 + + # Sets up the QEMU emulator that emulates different architectures + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + # Sets up the Docker Buildx plugin to build multi-architecture Docker images + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # Authenticates with Docker Hub + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Authenticates with the GitHub Container Registry + - name: Login to GitHub Package Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value={{branch}} + + # Builds and pushes the Docker image to Docker Hub and the GitHub Container Registry with the following tags: + # - 'latest' for successful builds on the main branch. + # - '' pushes to non-main branches. + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml new file mode 100644 index 00000000..f3ed0f1a --- /dev/null +++ b/.github/workflows/mega-linter.yml @@ -0,0 +1,99 @@ +--- +# MegaLinter GitHub Action configuration file +# More info at https://megalinter.io +name: Mega-Linter + +permissions: read-all + +on: + # Trigger mega-linter at every push. Action will also be visible from Pull Requests to main + push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) + pull_request: + branches: [main] + +env: # Comment env block if you do not want to apply fixes + # Apply linter fixes configuration + APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) + APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) + APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + build: + name: MegaLinter + runs-on: ubuntu-20.04 + permissions: + pull-requests: write + steps: + # Git Checkout + - name: Checkout Code + uses: actions/checkout@v3 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }} + + # MegaLinter + - name: MegaLinter + id: ml + # You can override MegaLinter flavor used to have faster performances + # More info at https://megalinter.io/flavors/ + uses: oxsecurity/megalinter/flavors/documentation@v6 + env: + # All available variables are described in documentation + # https://megalinter.io/configuration/ + VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'pull_request' }} # Validates all source when its a PR, else just the git diff with main. + PAT: ${{ secrets.PAT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY + # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks + + # Upload MegaLinter artifacts + - name: Archive production artifacts + if: ${{ success() }} || ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: MegaLinter reports + path: | + megalinter-reports + mega-linter.log + + # Create pull request if applicable (for now works only on PR from same repository, not from forks) + - name: Create Pull Request with applied fixes + id: cpr + if: always() && + steps.ml.outputs.has_updated_sources == 1 && + env.APPLY_FIXES_MODE == 'pull_request' && + (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && + (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) + uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + commit-message: "[MegaLinter] Apply linters automatic fixes" + title: "[MegaLinter] Apply linters automatic fixes" + labels: bot + - name: Create PR output + if: always() && steps.cpr.conclusion == 'success' + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + + # Push new commit if applicable (for now works only on PR from same repository, not from forks) + - name: Prepare commit + id: pc + if: always() && + steps.ml.outputs.has_updated_sources == 1 && + env.APPLY_FIXES_MODE == 'commit' && + github.ref != 'refs/heads/main' && + (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && + (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) + run: sudo chown -Rc $UID .git/ + - name: Commit and push applied linter fixes + if: always() && steps.pc.conclusion == 'success' + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} + commit_message: "[MegaLinter] Apply linters fixes" + commit_user_name: megalinter-bot diff --git a/.gitignore b/.gitignore index 1ee53850..253e8522 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files *.rsuser @@ -90,6 +90,7 @@ StyleCopReport.xml *.tmp_proj *_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -293,6 +294,17 @@ node_modules/ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -349,6 +361,9 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ +# Visual Studio History (VSHistory) files +.vshistory/ + # BeatPulse healthcheck temp database healthchecksdb @@ -360,3 +375,27 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# megalinter +/megalinter-reports diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 00000000..4c622777 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,6 @@ +--- +########################## +## Hadolint config file ## +########################## +ignored: + - DL3018 diff --git a/.mega-linter.yml b/.mega-linter.yml new file mode 100644 index 00000000..384f0149 --- /dev/null +++ b/.mega-linter.yml @@ -0,0 +1,13 @@ +# Configuration file for MegaLinter +# See all available variables at https://megalinter.github.io/configuration/ and in linters documentation + +DISABLE: + - COPYPASTE + - SPELL + +SHOW_ELAPSED_TIME: true +IGNORE_GENERATED_FILES: true +PRINT_ALL_FILES: false +FORMATTERS_DISABLE_ERRORS: false +ERROR_ON_MISSING_EXEC_BIT: true +MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS: false diff --git a/.trivyignore b/.trivyignore new file mode 100644 index 00000000..dab6fbd0 --- /dev/null +++ b/.trivyignore @@ -0,0 +1 @@ +DS002 diff --git a/Dockerfile b/Dockerfile index a5d87fe8..57069a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,20 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls15 +# Set the base image +FROM ghcr.io/linuxserver/baseimage-alpine:3.17-17acebe3-ls14 +# Set the maintainer LABEL maintainer="GhostWriters" +# Copy files from host to container COPY root / -RUN apk add --no-cache py3-pip=22.3.1 && \ - pip3 install --no-cache-dir packt==1.7.0 && \ - whoami +# Install required packages and application dependencies +RUN apk add --no-cache py3-pip && \ + pip3 install --no-cache-dir -r /opt/requirements.txt +# Add a health check command to ensure the container is running correctly +HEALTHCHECK --interval=1m \ + --timeout=3s \ + CMD ps -ef | grep cron || exit 1 + +# Specify the entrypoint ENTRYPOINT ["/opt/docker-entrypoint.sh"] diff --git a/LICENSE b/LICENSE index 568a9570..0e103782 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -MIT License +# MIT License Copyright (c) 2021 GhostWriters diff --git a/README.md b/README.md index 79dbedb6..896d9af0 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ # Container for Packt daily download script -[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt/graphs/contributors) -[![GitHub last commit master](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/master.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt/commits/master) -[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt/blob/master/LICENSE.md) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Super-Linter/master?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt/actions?query=workflow%3ASuper-Linter+branch%3Amaster) - -This creates a Alpine Linux docker container running running cron, scheduled to -claim the daily free book once per night at 1am. For more information about what -this container calls visit -. +[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) +[![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) +[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Mega-Linter/main?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt-cli/actions?query=workflow%3AMega-Linter+branch%3Amain) + +These instructions detail how to set up a docker container that includes a scheduled cron job to automatically claim the daily free +book from Packt at 1am each night. Packt offers free learning e-books each day, and you can find more information about this service +at . To learn more about docker, please visit the official documentation at +. If you're new to cron jobs, you can learn more about them on the Unix/Linux man +pages at . For more information about the code used in this container, please see the +project page at . ## Run @@ -27,7 +29,7 @@ docker run -d \ -v /home/user/packt/config:/config \ -v /home/user/packt/books:/data \ --restart unless-stopped \ - ghostwriters/docker-packt + ghostwriters/docker-packt-cli:latest ``` ## Volumes and variables @@ -42,17 +44,15 @@ OPTIONAL: Variables: - PACKT_EMAIL - email address registered with Packt account - PACKT_PASSWORD - password for Packt account - PACKT_DOWNLOAD_FORMATS - pdf, epub, mobi, code -- PACKT_ANTICAPTCHA_KEY - get an api key from +- PACKT_ANTICAPTCHA_KEY - get an api key from [anti-captcha.com](https://anti-captcha.com) - PACKT_DOWNLOAD_BOOK_TITLES - specify individual books If variables are set, they overwrite what is already in the configFile.cfg file at container startup. If not set, the config file will be left alone. -Anticaptcha key required to download the daily book. +**NOTE:** Anticaptcha key required to download the daily book. ## Special Thanks -- [biwhite](https://github.com/biwhite) for creating the initial docker - container. -- for maintaining - the package to handle the downloading. +- [packt-cli](https://gitlab.com/packt-cli/packt-cli) for maintaining the package to handle the downloading. +- [LinuxServer.io](https://www.linuxserver.io) for maintaining most Docker images used in this project. diff --git a/root/var/spool/cron/crontabs/root b/root/etc/crontabs/root similarity index 100% rename from root/var/spool/cron/crontabs/root rename to root/etc/crontabs/root diff --git a/root/opt/docker-entrypoint.sh b/root/opt/docker-entrypoint.sh old mode 100644 new mode 100755 index 1ab5522b..58669480 --- a/root/opt/docker-entrypoint.sh +++ b/root/opt/docker-entrypoint.sh @@ -4,44 +4,44 @@ CFG=/config/configFile.cfg # This copies the sample config if one is not present in the config dir if [ ! -f $CFG ]; then - echo 'No config file, providing sample' - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG + echo 'No config file, providing sample' + cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG fi # If environment arguments have been provided, switch the values in the sample config to these if [ -n "$PACKT_EMAIL" ]; then - echo 'ENV PACKT_EMAIL provided' - sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG + echo 'ENV PACKT_EMAIL provided' + sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKTEMAIL not set' fi if [ -n "$PACKT_PASSWORD" ]; then - echo 'ENV PACKT_PASSWORD provided' - sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG + echo 'ENV PACKT_PASSWORD provided' + sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKTEMAIL not set' fi if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then - echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" - sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG + echo "ENV PACKT_DOWNLOAD_FORMATS provided as '$PACKT_DOWNLOAD_FORMATS'" + sed -i s/download_formats:.*/download_formats:\ "$PACKT_DOWNLOAD_FORMATS"/ $CFG else - echo 'ENV PACKT_DOWNLOAD_FORMATS not set' + echo 'ENV PACKT_DOWNLOAD_FORMATS not set' fi if [ -n "$PACKT_DOWNLOAD_BOOK_TITLES" ]; then - echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" - sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG + echo "ENV PACKT_DOWNLOAD_BOOK_TITLES provided as '$PACKT_DOWNLOAD_BOOK_TITLES'" + sed -i s/download_book_titles:.*/download_book_titles:\ "$PACKT_DOWNLOAD_BOOK_TITLES"/ $CFG else - echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' - sed -i s/download_book_titles:.*/download_book_titles:/ $CFG + echo 'ENV PACKT_DOWNLOAD_BOOK_TITLES not set' + sed -i s/download_book_titles:.*/download_book_titles:/ $CFG fi if [ -n "$PACKT_ANTICAPTCHA_KEY" ]; then - echo 'ENV PACKT_ANTICAPTCHA_Key provided' - sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG + echo 'ENV PACKT_ANTICAPTCHA_Key provided' + sed -i s/key:.*/key:\ "$PACKT_ANTICAPTCHA_KEY"/ $CFG else - echo 'ENV PACKT_ANTICAPTCHA_KEY not set' + echo 'ENV PACKT_ANTICAPTCHA_KEY not set' fi echo 'Replacing path with /data' diff --git a/root/opt/requirements.txt b/root/opt/requirements.txt new file mode 100644 index 00000000..66dcd063 --- /dev/null +++ b/root/opt/requirements.txt @@ -0,0 +1 @@ +packt==1.7.0 From a60770dc36098b3638e14b7cd78a253449808021 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 21:07:01 +0100 Subject: [PATCH 29/73] Bump peter-evans/create-pull-request from 4 to 5 (#23) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index f3ed0f1a..555351bd 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" From dfca4a36b0f03b228f123cd937053c17b6c8ace2 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 21:44:29 +0100 Subject: [PATCH 30/73] Update pip dir --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c960b7be..41a5cfb2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,7 @@ updates: interval: "daily" - package-ecosystem: "pip" - directory: "/opt" + directory: "/root/opt" # Check the npm registry for updates every day at 11:30am schedule: interval: "daily" From 27e0e81b8ff0ed9cfc37535b2477b9ed9b2a1a6e Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 18:16:11 +0100 Subject: [PATCH 31/73] Added dependabot merge --- .github/workflows/dependabot-auto-approve.yml | 21 ------------------- .github/workflows/dependabot-auto-merge.yml | 19 +++++++++++++++++ .github/workflows/deploy-docker-image.yml | 4 +++- .github/workflows/mega-linter.yml | 2 +- Dockerfile | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/dependabot-auto-approve.yml create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/workflows/dependabot-auto-approve.yml b/.github/workflows/dependabot-auto-approve.yml deleted file mode 100644 index 7a22a0a0..00000000 --- a/.github/workflows/dependabot-auto-approve.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Dependabot auto-approve -on: pull_request - -permissions: - pull-requests: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..38dd14d2 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,19 @@ +name: auto-merge + +permissions: read-all + +on: + pull_request: + +jobs: + auto-merge: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v2 + - uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + target: minor + github-token: ${{ secrets.PAT }} diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 92fd0960..cdb05e50 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -4,10 +4,12 @@ permissions: read-all on: push: + branches: + - main jobs: docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: packages: write steps: diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 555351bd..088cc77c 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -24,7 +24,7 @@ concurrency: jobs: build: name: MegaLinter - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: pull-requests: write steps: diff --git a/Dockerfile b/Dockerfile index 57069a3c..f8835d5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-17acebe3-ls14 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # Set the maintainer LABEL maintainer="GhostWriters" From 88072b61129e573d5254f6ba15123fe8077ff56c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 18:21:41 +0100 Subject: [PATCH 32/73] Bump packt from 1.7.0 to 1.8.0 in /root/opt Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- root/opt/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/opt/requirements.txt b/root/opt/requirements.txt index 66dcd063..f2bd5a05 100644 --- a/root/opt/requirements.txt +++ b/root/opt/requirements.txt @@ -1 +1 @@ -packt==1.7.0 +packt==1.8.0 From b123c2ec45536788912a28ae59e4f48f06cb0814 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 18:41:57 +0100 Subject: [PATCH 33/73] Bump actions/checkout from 2 to 3 (#27) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 38dd14d2..dcdeb7b4 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -12,7 +12,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ahmadnassri/action-dependabot-auto-merge@v2 with: target: minor From e3fef0867c5435518d51144d9735e4818a95a96a Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 19:00:22 +0100 Subject: [PATCH 34/73] Changed dependabot action --- .github/dependabot.yml | 6 ++--- .github/workflows/dependabot-auto-merge.yml | 27 +++++++++++++++------ .github/workflows/deploy-docker-image.yml | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 41a5cfb2..80333276 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,18 +3,18 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions every day at 11:30am + # Check for updates to GitHub Actions every day interval: "daily" - package-ecosystem: "pip" directory: "/root/opt" - # Check the npm registry for updates every day at 11:30am + # Check the npm registry for updates every day schedule: interval: "daily" - package-ecosystem: "docker" # Look for a `Dockerfile` in the `root` directory directory: "/" - # Check for updates once a week at 11:30am + # Check for updates once a week schedule: interval: "weekly" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index dcdeb7b4..56529ea8 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,19 +1,30 @@ -name: auto-merge +name: Dependabot auto-merge and approve permissions: read-all -on: - pull_request: +on: pull_request jobs: - auto-merge: + dependabot: runs-on: ubuntu-latest permissions: contents: write pull-requests: write + if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: actions/checkout@v3 - - uses: ahmadnassri/action-dependabot-auto-merge@v2 + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 with: - target: minor - github-token: ${{ secrets.PAT }} + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable auto-merge for Dependabot PRs + if: ${{contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.PAT}} diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index cdb05e50..7ab2af49 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -49,7 +49,7 @@ jobs: ghcr.io/${{ github.repository }} tags: | type=raw,value=latest,enable={{is_default_branch}} - type=raw,value={{branch}} + # type=raw,value={{branch}} # Builds and pushes the Docker image to Docker Hub and the GitHub Container Registry with the following tags: # - 'latest' for successful builds on the main branch. From f623e2e0ef25bd7da4fdebc8af1a105cf81a4e96 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 19:06:09 +0100 Subject: [PATCH 35/73] Action Version check --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 088cc77c..4a231f85 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" From 9e354a94d05122f06f71d073d2daa78f79f0a7da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:25:54 +0100 Subject: [PATCH 36/73] Bump peter-evans/create-pull-request from 4 to 5 (#30) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 4a231f85..088cc77c 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" From 818552d66dcca4e285b28781e20de51f78bb74c8 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 12 Apr 2023 18:03:20 +0100 Subject: [PATCH 37/73] versions downgraded for testing --- .github/workflows/dependabot-auto-merge.yml | 27 ++++++--------------- .github/workflows/deploy-docker-image.yml | 14 +++++------ .github/workflows/mega-linter.yml | 10 ++++---- 3 files changed, 20 insertions(+), 31 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 56529ea8..d9acd64f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,30 +1,19 @@ -name: Dependabot auto-merge and approve +name: auto-merge permissions: read-all -on: pull_request +on: + pull_request: jobs: - dependabot: + auto-merge: runs-on: ubuntu-latest permissions: contents: write pull-requests: write - if: ${{ github.actor == 'dependabot[bot]' }} steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 + - uses: actions/checkout@v3.4.0 + - uses: ahmadnassri/action-dependabot-auto-merge@v2.6.5 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Enable auto-merge for Dependabot PRs - if: ${{contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}} - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.PAT}} + target: minor + github-token: ${{ secrets.PAT }} diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 7ab2af49..4c6a3815 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -14,19 +14,19 @@ jobs: packages: write steps: # Checks out the main branch of the repository to the runner - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.5.0 # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v1.2.0 # Sets up the Docker Buildx plugin to build multi-architecture Docker images - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v2.4.1 # Authenticates with Docker Hub - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v2.0.0 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -34,7 +34,7 @@ jobs: # Authenticates with the GitHub Container Registry - name: Login to GitHub Package Registry - uses: docker/login-action@v2 + uses: docker/login-action@vv1.14.0 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v4.2.0 with: images: | ${{ github.repository }} @@ -55,7 +55,7 @@ jobs: # - 'latest' for successful builds on the main branch. # - '' pushes to non-main branches. - name: Build and push Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@vv3.3.1 with: context: . push: true diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 088cc77c..1e7d4846 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -30,7 +30,7 @@ jobs: steps: # Git Checkout - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v2.7.0 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }} @@ -40,7 +40,7 @@ jobs: id: ml # You can override MegaLinter flavor used to have faster performances # More info at https://megalinter.io/flavors/ - uses: oxsecurity/megalinter/flavors/documentation@v6 + uses: oxsecurity/megalinter/flavors/documentation@v6.22.1 env: # All available variables are described in documentation # https://megalinter.io/configuration/ @@ -53,7 +53,7 @@ jobs: # Upload MegaLinter artifacts - name: Archive production artifacts if: ${{ success() }} || ${{ failure() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.1 with: name: MegaLinter reports path: | @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v4.2.4 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" @@ -92,7 +92,7 @@ jobs: run: sudo chown -Rc $UID .git/ - name: Commit and push applied linter fixes if: always() && steps.pc.conclusion == 'success' - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v4.15.4 with: branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} commit_message: "[MegaLinter] Apply linters fixes" From 29a619d60865272c3a640ba425acf6e189d7e45a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:04:16 +0000 Subject: [PATCH 38/73] Bump docker/login-action from 2.0.0 to 2.1.0 Bumps [docker/login-action](https://github.com/docker/login-action) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v2.1.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 4c6a3815..25ec4d6f 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -26,7 +26,7 @@ jobs: # Authenticates with Docker Hub - name: Login to Docker Hub - uses: docker/login-action@v2.0.0 + uses: docker/login-action@v2.1.0 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -34,7 +34,7 @@ jobs: # Authenticates with the GitHub Container Registry - name: Login to GitHub Package Registry - uses: docker/login-action@vv1.14.0 + uses: docker/login-action@v2.1.0 with: registry: ghcr.io username: ${{ github.repository_owner }} From 2ad4c199a96637bff079b2675acc74e296250445 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:04:19 +0000 Subject: [PATCH 39/73] Bump docker/metadata-action from 4.2.0 to 4.3.0 Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v4.2.0...v4.3.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 4c6a3815..c2ff09d4 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.2.0 + uses: docker/metadata-action@v4.3.0 with: images: | ${{ github.repository }} From 1b094e1ceca8bce9e04fd3071550582a303e491a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:04:23 +0000 Subject: [PATCH 40/73] Bump docker/setup-buildx-action from 2.4.1 to 2.5.0 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.1 to 2.5.0. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2.4.1...v2.5.0) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 4c6a3815..6ee78430 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -22,7 +22,7 @@ jobs: # Sets up the Docker Buildx plugin to build multi-architecture Docker images - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.4.1 + uses: docker/setup-buildx-action@v2.5.0 # Authenticates with Docker Hub - name: Login to Docker Hub From 65db279bc856a603af68efbe1ec5c6ae9ab1a973 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:04:28 +0000 Subject: [PATCH 41/73] Bump oxsecurity/megalinter from 6.22.1 to 6.22.2 Bumps [oxsecurity/megalinter](https://github.com/oxsecurity/megalinter) from 6.22.1 to 6.22.2. - [Release notes](https://github.com/oxsecurity/megalinter/releases) - [Changelog](https://github.com/oxsecurity/megalinter/blob/main/CHANGELOG.md) - [Commits](https://github.com/oxsecurity/megalinter/compare/v6.22.1...v6.22.2) --- updated-dependencies: - dependency-name: oxsecurity/megalinter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 1e7d4846..c3395760 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -40,7 +40,7 @@ jobs: id: ml # You can override MegaLinter flavor used to have faster performances # More info at https://megalinter.io/flavors/ - uses: oxsecurity/megalinter/flavors/documentation@v6.22.1 + uses: oxsecurity/megalinter/flavors/documentation@v6.22.2 env: # All available variables are described in documentation # https://megalinter.io/configuration/ From 6caaf2362be2641452554083d46d371464a61326 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 18:11:26 +0100 Subject: [PATCH 42/73] Bump actions/checkout from 2.7.0 to 3.5.1 (#36) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependabot-auto-merge.yml | 2 +- .github/workflows/deploy-docker-image.yml | 2 +- .github/workflows/mega-linter.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index d9acd64f..c443ee90 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -12,7 +12,7 @@ jobs: contents: write pull-requests: write steps: - - uses: actions/checkout@v3.4.0 + - uses: actions/checkout@v3.5.1 - uses: ahmadnassri/action-dependabot-auto-merge@v2.6.5 with: target: minor diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index d4fdcf2d..25f9b1ed 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: # Checks out the main branch of the repository to the runner - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3.5.1 # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index c3395760..8dee3cad 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -30,7 +30,7 @@ jobs: steps: # Git Checkout - name: Checkout Code - uses: actions/checkout@v2.7.0 + uses: actions/checkout@v3.5.1 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }} From 6a41a05225b34ab54add06e6622ec1e8f2aea322 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:14:32 +0000 Subject: [PATCH 43/73] Bump stefanzweifel/git-auto-commit-action from 4.15.4 to 4.16.0 Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4.15.4 to 4.16.0. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.4...v4.16.0) --- updated-dependencies: - dependency-name: stefanzweifel/git-auto-commit-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 8dee3cad..ec850cf7 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -92,7 +92,7 @@ jobs: run: sudo chown -Rc $UID .git/ - name: Commit and push applied linter fixes if: always() && steps.pc.conclusion == 'success' - uses: stefanzweifel/git-auto-commit-action@v4.15.4 + uses: stefanzweifel/git-auto-commit-action@v4.16.0 with: branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} commit_message: "[MegaLinter] Apply linters fixes" From 4aa8e67f897f5ae76b36727615dc643b7b8b01d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:14:35 +0000 Subject: [PATCH 44/73] Bump actions/upload-artifact from 3.1.1 to 3.1.2 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3.1.1...v3.1.2) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 8dee3cad..60b83b5a 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -53,7 +53,7 @@ jobs: # Upload MegaLinter artifacts - name: Archive production artifacts if: ${{ success() }} || ${{ failure() }} - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v3.1.2 with: name: MegaLinter reports path: | From 36b55e84f13d123b87830aa94a4881160576b39e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:14:39 +0000 Subject: [PATCH 45/73] Bump ahmadnassri/action-dependabot-auto-merge from 2.6.5 to 2.6.6 Bumps [ahmadnassri/action-dependabot-auto-merge](https://github.com/ahmadnassri/action-dependabot-auto-merge) from 2.6.5 to 2.6.6. - [Release notes](https://github.com/ahmadnassri/action-dependabot-auto-merge/releases) - [Commits](https://github.com/ahmadnassri/action-dependabot-auto-merge/compare/v2.6.5...v2.6.6) --- updated-dependencies: - dependency-name: ahmadnassri/action-dependabot-auto-merge dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index c443ee90..270693dc 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - uses: actions/checkout@v3.5.1 - - uses: ahmadnassri/action-dependabot-auto-merge@v2.6.5 + - uses: ahmadnassri/action-dependabot-auto-merge@v2.6.6 with: target: minor github-token: ${{ secrets.PAT }} From ae96fd564f0a1148fcdde07e991c6a79866973ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 18:26:59 +0100 Subject: [PATCH 46/73] Bump docker/setup-qemu-action from 1.2.0 to 2.1.0 (#41) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 25f9b1ed..0371eb05 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -18,7 +18,7 @@ jobs: # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU - uses: docker/setup-qemu-action@v1.2.0 + uses: docker/setup-qemu-action@v2.1.0 # Sets up the Docker Buildx plugin to build multi-architecture Docker images - name: Set up Docker Buildx From 673123d6a299d86ca301a8912309e681c2060e50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 18:27:30 +0100 Subject: [PATCH 47/73] Bump peter-evans/create-pull-request from 4.2.4 to 5.0.0 (#37) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index eb326b0b..19d7f7d9 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v4.2.4 + uses: peter-evans/create-pull-request@v5.0.0 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" From 7182073b91c03345667e7513ee751db6ac47423c Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 17:52:47 +0100 Subject: [PATCH 48/73] Remove dependabot (#44) Co-authored-by: Tom Eley --- .github/dependabot.yml | 20 -------------------- .github/workflows/dependabot-auto-merge.yml | 19 ------------------- 2 files changed, 39 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 80333276..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - # Check for updates to GitHub Actions every day - interval: "daily" - - - package-ecosystem: "pip" - directory: "/root/opt" - # Check the npm registry for updates every day - schedule: - interval: "daily" - - - package-ecosystem: "docker" - # Look for a `Dockerfile` in the `root` directory - directory: "/" - # Check for updates once a week - schedule: - interval: "weekly" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index 270693dc..00000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: auto-merge - -permissions: read-all - -on: - pull_request: - -jobs: - auto-merge: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - uses: actions/checkout@v3.5.1 - - uses: ahmadnassri/action-dependabot-auto-merge@v2.6.6 - with: - target: minor - github-token: ${{ secrets.PAT }} From 28f9ec2a3483abdbe3a8d87773e511febff99c6a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:57:55 +0100 Subject: [PATCH 49/73] Configure Renovate (#45) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] --- renovate.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..4bd832f5 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base"] +} From fe6c546bacb298c5f76687ff8129a02f884831b5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:59:53 +0100 Subject: [PATCH 50/73] Update actions/checkout action to v3.5.2 (#46) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- .github/workflows/mega-linter.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 0371eb05..845bf857 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: # Checks out the main branch of the repository to the runner - - uses: actions/checkout@v3.5.1 + - uses: actions/checkout@v3.5.2 # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 19d7f7d9..df74a8fe 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -30,7 +30,7 @@ jobs: steps: # Git Checkout - name: Checkout Code - uses: actions/checkout@v3.5.1 + uses: actions/checkout@v3.5.2 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }} From 1a4cbdb78110c6c2adbb551cc9d4609cffffdfcb Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 18:43:33 +0100 Subject: [PATCH 51/73] Changed Actions to SHA tags (#47) Co-authored-by: Tom Eley --- .github/workflows/deploy-docker-image.yml | 14 +++++++------- .github/workflows/mega-linter.yml | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 845bf857..382b37bd 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -14,19 +14,19 @@ jobs: packages: write steps: # Checks out the main branch of the repository to the runner - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU - uses: docker/setup-qemu-action@v2.1.0 + uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0 # Sets up the Docker Buildx plugin to build multi-architecture Docker images - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 + uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 # Authenticates with Docker Hub - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 + uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.4.1 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -34,7 +34,7 @@ jobs: # Authenticates with the GitHub Container Registry - name: Login to GitHub Package Registry - uses: docker/login-action@v2.1.0 + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v2.0.0 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.3.0 + uses: docker/metadata-action@05d22bf31770de02e20c67c70365453e00227f61 # v4.2.0 with: images: | ${{ github.repository }} @@ -55,7 +55,7 @@ jobs: # - 'latest' for successful builds on the main branch. # - '' pushes to non-main branches. - name: Build and push Docker image - uses: docker/build-push-action@vv3.3.1 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v3.3.1 with: context: . push: true diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index df74a8fe..fd085d41 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -30,7 +30,7 @@ jobs: steps: # Git Checkout - name: Checkout Code - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }} @@ -40,7 +40,7 @@ jobs: id: ml # You can override MegaLinter flavor used to have faster performances # More info at https://megalinter.io/flavors/ - uses: oxsecurity/megalinter/flavors/documentation@v6.22.2 + uses: oxsecurity/megalinter/flavors/documentation@fe568b3592efcd04d21632d99501fc120df8110a # v6.22.1 env: # All available variables are described in documentation # https://megalinter.io/configuration/ @@ -53,7 +53,7 @@ jobs: # Upload MegaLinter artifacts - name: Archive production artifacts if: ${{ success() }} || ${{ failure() }} - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: MegaLinter reports path: | @@ -68,7 +68,7 @@ jobs: env.APPLY_FIXES_MODE == 'pull_request' && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) - uses: peter-evans/create-pull-request@v5.0.0 + uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5 # v5.0.0 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" @@ -92,7 +92,7 @@ jobs: run: sudo chown -Rc $UID .git/ - name: Commit and push applied linter fixes if: always() && steps.pc.conclusion == 'success' - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0 with: branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} commit_message: "[MegaLinter] Apply linters fixes" From 9c5407078b2b82ce34ecfa39faed07c790c6889e Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 19:09:47 +0100 Subject: [PATCH 52/73] Minor update of comments Co-authored-by: Tom Eley --- .github/workflows/mega-linter.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index fd085d41..74857bba 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -38,8 +38,8 @@ jobs: # MegaLinter - name: MegaLinter id: ml - # You can override MegaLinter flavor used to have faster performances - # More info at https://megalinter.io/flavors/ + # To improve performance, you have the option to change the MegaLinter flavor that is being used. + # Complete details on available flavors can be found at https://megalinter.io/flavors/. uses: oxsecurity/megalinter/flavors/documentation@fe568b3592efcd04d21632d99501fc120df8110a # v6.22.1 env: # All available variables are described in documentation @@ -47,8 +47,6 @@ jobs: VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'pull_request' }} # Validates all source when its a PR, else just the git diff with main. PAT: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY - # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks # Upload MegaLinter artifacts - name: Archive production artifacts From c45bbc547032daba87fe0bd56bbf188fbd8e98ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:43:23 +0100 Subject: [PATCH 53/73] Update docker/setup-buildx-action action to v2.5.0 (#56) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 382b37bd..0734dce7 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -22,7 +22,7 @@ jobs: # Sets up the Docker Buildx plugin to build multi-architecture Docker images - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 + uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0 # Authenticates with Docker Hub - name: Login to Docker Hub From b3d66f8e1f975e9da0c230815ceff92f16a61410 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:43:50 +0100 Subject: [PATCH 54/73] Update oxsecurity/megalinter action to v6.22.2 (#53) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 74857bba..7c7f011f 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -40,7 +40,7 @@ jobs: id: ml # To improve performance, you have the option to change the MegaLinter flavor that is being used. # Complete details on available flavors can be found at https://megalinter.io/flavors/. - uses: oxsecurity/megalinter/flavors/documentation@fe568b3592efcd04d21632d99501fc120df8110a # v6.22.1 + uses: oxsecurity/megalinter/flavors/documentation@93700f8c21c59ea784a32abe23896e49e54463b8 # v6.22.2 env: # All available variables are described in documentation # https://megalinter.io/configuration/ From 5eaec44d404518010f05937bfecba9eb6d595593 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:47:08 +0100 Subject: [PATCH 55/73] Update docker/build-push-action action to v4 (#57) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 0734dce7..11678420 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -55,7 +55,7 @@ jobs: # - 'latest' for successful builds on the main branch. # - '' pushes to non-main branches. - name: Build and push Docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v3.3.1 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0 with: context: . push: true From 9b598ef95ce0c4ea80e405f29f3bda00aaa913ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:49:08 +0100 Subject: [PATCH 56/73] Update docker/login-action action to v1.14.1 (#54) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 11678420..995087eb 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -26,7 +26,7 @@ jobs: # Authenticates with Docker Hub - name: Login to Docker Hub - uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.4.1 + uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.14.1 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} From cd603c4c899677cb280530b73f79b552bc8fac78 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:54:12 +0100 Subject: [PATCH 57/73] Update docker/login-action action to v2.1.0 (#58) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 995087eb..36699f74 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -26,7 +26,7 @@ jobs: # Authenticates with Docker Hub - name: Login to Docker Hub - uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.14.1 + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -34,7 +34,7 @@ jobs: # Authenticates with the GitHub Container Registry - name: Login to GitHub Package Registry - uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v2.0.0 + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 with: registry: ghcr.io username: ${{ github.repository_owner }} From e810e3f155af191f95c0358de16d0299317f7e26 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 19:56:41 +0100 Subject: [PATCH 58/73] Update docker/metadata-action action to v4.3.0 (#55) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 36699f74..b6e939af 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@05d22bf31770de02e20c67c70365453e00227f61 # v4.2.0 + uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0 with: images: | ${{ github.repository }} From 89af0234e923cd8ae229ebba0f519fbcddc36e1f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:00:31 +0100 Subject: [PATCH 59/73] Update actions/checkout action to v3.5.2 (#59) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index b6e939af..30b0f158 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -14,7 +14,7 @@ jobs: packages: write steps: # Checks out the main branch of the repository to the runner - - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU From ee1801a5da4c051932edfdf80af53c21ce03baba Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 20:33:00 +0100 Subject: [PATCH 60/73] 3.17-17acebe3-ls14 (#60) Co-authored-by: Tom Eley --- Dockerfile | 2 +- renovate.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8835d5a..57069a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17-17acebe3-ls14 # Set the maintainer LABEL maintainer="GhostWriters" diff --git a/renovate.json b/renovate.json index 4bd832f5..c5c1d0d9 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,5 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:base"] + "extends": ["config:base"], + "automerge": true } From 44332530bf62007c14e22bb9c797d33316bcc85c Mon Sep 17 00:00:00 2001 From: Tom Eley Date: Thu, 13 Apr 2023 20:57:20 +0100 Subject: [PATCH 61/73] sha256 linux --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 57069a3c..e0e5c808 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-17acebe3-ls14 +FROM ghcr.io/linuxserver/baseimage-alpine@sha256:0c07a583b2466d85d92cbebff3b72a6c471cc8662fae9df50b3241e5d1db26d5 # Set the maintainer LABEL maintainer="GhostWriters" From 7bf1f143eee39cec8569403ba66a71cfbb116a06 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 21:09:13 +0100 Subject: [PATCH 62/73] 3.17 version fix (#61) Co-authored-by: Tom Eley --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e0e5c808..f8835d5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine@sha256:0c07a583b2466d85d92cbebff3b72a6c471cc8662fae9df50b3241e5d1db26d5 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # Set the maintainer LABEL maintainer="GhostWriters" From ea07d65109d3eb28d61fd93562ed6f53aec2d76c Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 20:50:54 +0100 Subject: [PATCH 63/73] Fix for getting config if not present (#62) Co-authored-by: Tom Eley --- Dockerfile | 2 +- renovate.json | 9 +++++++++ root/opt/docker-entrypoint.sh | 13 +++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8835d5a..c10723a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls16 # Set the maintainer LABEL maintainer="GhostWriters" diff --git a/renovate.json b/renovate.json index c5c1d0d9..ede851e8 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], + "docker": { + "registryUrl": "docker.io", + "baseImage": ["linuxserver/docker-baseimage-alpine"] + }, + "schedule": ["every day"], + "labels": ["docker"], + "matchDatasource": [ + "docker|alpine|linuxserver/docker-baseimage-alpine:3\\.\\d{2}-[a-f0-9]{8}-ls\\d{2}" + ], "automerge": true } diff --git a/root/opt/docker-entrypoint.sh b/root/opt/docker-entrypoint.sh index 58669480..5e8ea42d 100755 --- a/root/opt/docker-entrypoint.sh +++ b/root/opt/docker-entrypoint.sh @@ -2,24 +2,25 @@ CFG=/config/configFile.cfg -# This copies the sample config if one is not present in the config dir +# Downloads and copies a new configfile template if one is not present in the config dir. if [ ! -f $CFG ]; then echo 'No config file, providing sample' - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG + wget -O $CFG https://gitlab.com/packt-cli/packt-cli/-/raw/master/configFileTemplate.cfg fi -# If environment arguments have been provided, switch the values in the sample config to these + +# If environment arguments have been provided, switch the values in the config to these. if [ -n "$PACKT_EMAIL" ]; then echo 'ENV PACKT_EMAIL provided' sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKT_EMAIL not set' fi if [ -n "$PACKT_PASSWORD" ]; then echo 'ENV PACKT_PASSWORD provided' sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKT_PASSWORD not set' fi if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then @@ -50,5 +51,5 @@ sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG echo 'Set logfile path to /data' sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG -echo 'Start crond' +echo 'Start crond in the foreground' crond -f From 0a579800ea09a44c07e3a0186d01567762cad3a3 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 21:08:02 +0100 Subject: [PATCH 64/73] Fix for getting config if not present (#63) Co-authored-by: Tom Eley --- renovate.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/renovate.json b/renovate.json index ede851e8..ea058819 100644 --- a/renovate.json +++ b/renovate.json @@ -1,14 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "docker": { - "registryUrl": "docker.io", - "baseImage": ["linuxserver/docker-baseimage-alpine"] - }, "schedule": ["every day"], - "labels": ["docker"], - "matchDatasource": [ - "docker|alpine|linuxserver/docker-baseimage-alpine:3\\.\\d{2}-[a-f0-9]{8}-ls\\d{2}" - ], "automerge": true } From f2186f56bb7b8e5d0ef1b357ad118cbc067bf942 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 07:42:41 +0100 Subject: [PATCH 65/73] renovate fix (#65) Co-authored-by: Tom Eley --- Dockerfile | 2 +- renovate.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c10723a5..f8835d5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls16 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # Set the maintainer LABEL maintainer="GhostWriters" diff --git a/renovate.json b/renovate.json index ea058819..c5c1d0d9 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,5 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "schedule": ["every day"], "automerge": true } From 81dd87808e8c6b599f695116b2c9f4d232ccd288 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:30:26 +0000 Subject: [PATCH 66/73] Update docker/metadata-action action to v4.4.0 --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 30b0f158..e74d915f 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0 + uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0 with: images: | ${{ github.repository }} From cadb993ee9e338915dece655a489563b54abe1e9 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 21:07:53 +0100 Subject: [PATCH 67/73] Changed badges (#67) Co-authored-by: Tom Eley --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 896d9af0..55b7023e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ # Container for Packt daily download script -[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) -[![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) -[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Mega-Linter/main?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt-cli/actions?query=workflow%3AMega-Linter+branch%3Amain) +[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) +[![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt-cli/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) +[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) +[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://renovatebot.com) These instructions detail how to set up a docker container that includes a scheduled cron job to automatically claim the daily free book from Packt at 1am each night. Packt offers free learning e-books each day, and you can find more information about this service -at . To learn more about docker, please visit the official documentation at -. If you're new to cron jobs, you can learn more about them on the Unix/Linux man -pages at . For more information about the code used in this container, please see the +at . +To learn more about docker, please visit the official documentation at . +If you're new to cron jobs, you can learn more about them on the Unix/Linux manpages at . +For more information about the code used in this container, please see the project page at . ## Run From 5de891ed2a5aee8dc48783f328dfbb44442b3ee7 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 18:03:21 +0100 Subject: [PATCH 68/73] Fix Badge (#68) Co-authored-by: Tom Eley --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55b7023e..d3dab420 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) [![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt-cli/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) [![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) -[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://renovatebot.com) +[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://github.com/renovatebot/renovate) These instructions detail how to set up a docker container that includes a scheduled cron job to automatically claim the daily free book from Packt at 1am each night. Packt offers free learning e-books each day, and you can find more information about this service From eff0521418e1aa366082cc3d1ef1358a97e3f661 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 19:34:33 +0100 Subject: [PATCH 69/73] Bump version (#69) Co-authored-by: Tom Eley --- .github/workflows/deploy-docker-image.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index e74d915f..29a35456 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -15,6 +15,15 @@ jobs: steps: # Checks out the main branch of the repository to the runner - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + with: + fetch-depth: "0" + + # This action creates a new git tag of the main branch with the new version number + - name: Bump version and push tag + uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU From 37805905530406623023fe1de8c08e61406d6ebb Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 21:20:18 +0100 Subject: [PATCH 70/73] Added action to create a release (#70) --- .github/workflows/deploy-docker-image.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 29a35456..fb32f0a5 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -50,7 +50,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker - id: meta + id: metadata uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0 with: images: | @@ -69,5 +69,11 @@ jobs: context: . push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + + # Create a release based on the new tag + - name: Create release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b47928ab5cba5c8c30fbe5e6dd97127360032df1 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 17:58:01 +0100 Subject: [PATCH 71/73] Add tag for release (#71) --- .github/workflows/deploy-docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index fb32f0a5..28a66c87 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -20,6 +20,7 @@ jobs: # This action creates a new git tag of the main branch with the new version number - name: Bump version and push tag + id: tag uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -75,5 +76,7 @@ jobs: # Create a release based on the new tag - name: Create release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + with: + tag_name: ${{ steps.tag.outputs.tag_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fd3a36ed07c6b90bc1f300e74156f23b71d894aa Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:21:49 +0100 Subject: [PATCH 72/73] bumpTag (#72) --- .github/workflows/deploy-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 28a66c87..5ddc5f53 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -20,7 +20,7 @@ jobs: # This action creates a new git tag of the main branch with the new version number - name: Bump version and push tag - id: tag + id: bumpTag uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -77,6 +77,6 @@ jobs: - name: Create release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 with: - tag_name: ${{ steps.tag.outputs.tag_name }} + tag_name: ${{ steps.bumpTag.outputs.new_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7230c9336afab4e725cd407241b61bd2e77a11d5 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:46:27 +0100 Subject: [PATCH 73/73] Changed action Token (#73) --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 5ddc5f53..18a6bca4 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -79,4 +79,4 @@ jobs: with: tag_name: ${{ steps.bumpTag.outputs.new_tag }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }}