From 013c46ac6f91d79080c7dd0ed9bdf52bef626655 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Mar 2019 10:33:15 +0000 Subject: [PATCH 01/66] Changed pip install method --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0ac2631d7..fe8d0d0d0 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 e71af1462d09d63347c07b52bbbcd10c95e20f18 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 19:41:44 +0000 Subject: [PATCH 02/66] 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 fe8d0d0d0..5e9f4804b 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 899866388..68be7e63e 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 810684fcae57db5767745f341fa1b18799469398 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 20:50:02 +0000 Subject: [PATCH 03/66] 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 5e9f4804b..25ae120f6 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 915eb29e315e0695e18b203304976987eb676c0c Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 Jan 2021 21:21:57 +0000 Subject: [PATCH 04/66] Removed EntryPoint --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 25ae120f6..bb0138495 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 005771a951a0530ab6297903dadcdc32af5c4936 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 26 Jan 2021 21:31:38 +0000 Subject: [PATCH 05/66] 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 bb0138495..278a00ec5 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 bc6391498..58669480b 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 8807482b938e75ebd9f86b900dc4a88eb940c486 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 27 Jan 2021 21:36:31 +0000 Subject: [PATCH 06/66] 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 278a00ec5..cde207c6c 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 000000000..58669480b --- /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 5401735a32abe1514eb014fd0e9a2a53150d5e82 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 28 Jan 2021 20:45:09 +0000 Subject: [PATCH 07/66] 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 cde207c6c..3fd86dd65 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 58669480b..000000000 --- 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 4161eb516..8bcba6672 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 9541f6b8c1892da4f9af33f7cac76563c0044f7f Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 16:24:43 +0000 Subject: [PATCH 08/66] 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 000000000..e617e63c1 --- /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 3fd86dd65..bbb62449d 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 68be7e63e..167a7b2f9 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 4ccfa984979dd574002f7b9ad89892b606593861 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 17:37:13 +0000 Subject: [PATCH 09/66] Updated Gitignore --- .gitignore | 364 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 359 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0c1d400c3..3a8542dc0 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 83136b38ec809fe6ec0812a4b63d5d8b59db6c12 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 30 Jan 2021 20:50:07 +0000 Subject: [PATCH 10/66] 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 8bcba6672..7f4dfa035 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 d85378635d2d56eb36062e1540c707765f22bbc3 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 10:57:31 +0000 Subject: [PATCH 11/66] Added badges --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 167a7b2f9..467d15707 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 b0afdf062ded740a3d59fb1a814b3c1426617caf Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 15:20:51 +0000 Subject: [PATCH 12/66] Created LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..568a95704 --- /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 df222be7f2b47263871f574bfea09e3cd2f1e2a9 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 15:33:03 +0000 Subject: [PATCH 13/66] Added license badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 467d15707..923d8fcc3 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 3974dd37197f4ca2f4aae26755f433c6f880d314 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 20:08:13 +0000 Subject: [PATCH 14/66] 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 7f4dfa035..7b7dbfcc7 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 3bc99635dbf964399c9713b66853980e60460d3d Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 31 Jan 2021 21:13:51 +0000 Subject: [PATCH 15/66] 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 000000000..201b87912 --- /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 e617e63c1..ccb3ec05e 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 3a8542dc0..1ee53850b 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 4feae7eac..8a8fa2c03 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 923d8fcc3..79dbedb6c 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 58669480b..1ab5522b2 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 d5eb04db823da9dde4c796889f42bb1ad704c662 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 8 Apr 2023 11:28:05 +0100 Subject: [PATCH 16/66] 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 000000000..6e5a15359 --- /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 ccb3ec05e..000000000 --- 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 8a8fa2c03..000000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: required - -services: - - docker - -language: bash - -install: - - docker build . From 639d224c0f7af2e45eb2fc176f44879c68d0ada6 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 8 Apr 2023 11:56:19 +0100 Subject: [PATCH 17/66] 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 6e5a15359..5c8ea055f 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 000000000..7a22a0a04 --- /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 6838f68e170df2b7ee5072e7ad9fedceda7357fa 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 18/66] 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 bbb62449d..be9e5d02f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM alpine:3.17 LABEL maintainer="GhostWriters" From fe0c4f13703e435b7ac61bfa389462d8170b48b3 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 11:05:30 +0100 Subject: [PATCH 19/66] 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 be9e5d02f..a5d87fe8c 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 80ace2fba212c14d8944d221d96be61cd01b3318 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 20:32:29 +0100 Subject: [PATCH 20/66] 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 000000000..8a6585d9a --- /dev/null +++ b/.checkov.yml @@ -0,0 +1,3 @@ +quiet: true +skip-check: + - CKV_DOCKER_3 diff --git a/.editorconfig b/.editorconfig index 201b87912..46d41608d 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 5c8ea055f..c960b7be2 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 000000000..92fd09602 --- /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 000000000..f3ed0f1a1 --- /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 1ee53850b..253e85226 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 000000000..4c6227775 --- /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 000000000..384f01493 --- /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 000000000..dab6fbd05 --- /dev/null +++ b/.trivyignore @@ -0,0 +1 @@ +DS002 diff --git a/Dockerfile b/Dockerfile index a5d87fe8c..57069a3cc 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 568a95704..0e103782f 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 79dbedb6c..896d9af06 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 1ab5522b2..58669480b --- 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 000000000..66dcd0632 --- /dev/null +++ b/root/opt/requirements.txt @@ -0,0 +1 @@ +packt==1.7.0 From 5321157437ef9a5cf8ca6d2e2c2f1e5cea51c24f 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 21/66] 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 f3ed0f1a1..555351bde 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 ad2022a08cc89aa45bad621a825362e7dd9b7b43 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 10 Apr 2023 21:44:29 +0100 Subject: [PATCH 22/66] 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 c960b7be2..41a5cfb2d 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 c0c01d3ac6ea5449274c19b76bf69daf1193da84 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 18:16:11 +0100 Subject: [PATCH 23/66] 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 7a22a0a04..000000000 --- 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 000000000..38dd14d2b --- /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 92fd09602..cdb05e50f 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 555351bde..088cc77ca 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 57069a3cc..f8835d5a1 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 5ab24b7db110be6acd20b53966a20229ec3fa7db 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 24/66] 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 66dcd0632..f2bd5a05f 100644 --- a/root/opt/requirements.txt +++ b/root/opt/requirements.txt @@ -1 +1 @@ -packt==1.7.0 +packt==1.8.0 From 90580843395127a9207d7e6a0f09c821b5af5311 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 25/66] 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 38dd14d2b..dcdeb7b40 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 f97a6a1c1fac55a7eb138c3a28958c42543f82e5 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 19:00:22 +0100 Subject: [PATCH 26/66] 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 41a5cfb2d..803332766 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 dcdeb7b40..56529ea8d 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 cdb05e50f..7ab2af49e 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 a2b0e90a65c9b8c37d49ee7083d90cbc88ec3b3d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 11 Apr 2023 19:06:09 +0100 Subject: [PATCH 27/66] 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 088cc77ca..4a231f854 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 0f7c4cfe94bf0dd1f0fc9e3493ba5c8fb46057c0 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 28/66] 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 4a231f854..088cc77ca 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 3dfc921d251ea8bfc61d82ab4691d69c3ec2123a Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 12 Apr 2023 18:03:20 +0100 Subject: [PATCH 29/66] 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 56529ea8d..d9acd64f9 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 7ab2af49e..4c6a3815d 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 088cc77ca..1e7d4846a 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 458ef176d187d2278fc442c8dbf103c4a5547b25 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 30/66] 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 4c6a3815d..25ec4d6fb 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 8256a43f8699858f5695e151f8fe4f6c369d8f61 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 31/66] 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 4c6a3815d..c2ff09d4d 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 83748a72a220daf0a6c0db7919995c1f2f4bb0e9 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 32/66] 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 4c6a3815d..6ee78430f 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 62b09909439635fd0dd8338373ac984e3ef644da 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 33/66] 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 1e7d4846a..c33957605 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 080e1ea383bf091fa1b46036e02efdc06b2bb5d4 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 34/66] 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 d9acd64f9..c443ee90c 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 d4fdcf2d5..25f9b1eda 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 c33957605..8dee3cadd 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 8373d02e33c8717e5ac66cf6bde6d4b5df596928 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 35/66] 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 8dee3cadd..ec850cf73 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 3c79bf57b14a578fd4bb7826840019f15c0670cd 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 36/66] 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 8dee3cadd..60b83b5a6 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 20c9bad4bb8c11014a99b5811523efdf2a6ddaa2 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 37/66] 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 c443ee90c..270693dce 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 c774db2da2d74aac2018f197f0a40fcd22f6a0be 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 38/66] 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 25f9b1eda..0371eb05a 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 245ddfd33538a3c27021f5ecf13af13ec71895be 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 39/66] 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 eb326b0ba..19d7f7d99 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 d22efb6edec6b63d1dba1b4041bf078d7f79e071 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 17:52:47 +0100 Subject: [PATCH 40/66] 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 803332766..000000000 --- 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 270693dce..000000000 --- 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 bb552ceedd5fbb74e7ed0b5944b8dfd12aa004c2 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 41/66] 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 000000000..4bd832f5f --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base"] +} From e130132315d49cc177e0811437fc8dc4fa0863ce 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 42/66] 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 0371eb05a..845bf857a 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 19d7f7d99..df74a8fed 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 3d6048ac2c4d59aa90287436bd3b71f3772a60ab Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 18:43:33 +0100 Subject: [PATCH 43/66] 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 845bf857a..382b37bde 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 df74a8fed..fd085d410 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 c06fe60eca665662ba393d874ac22fe97332de4a Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 19:09:47 +0100 Subject: [PATCH 44/66] 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 fd085d410..74857bba1 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 205be2f47e1c2d4e12b70209271bc41593905441 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 45/66] 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 382b37bde..0734dce73 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 aa18b45f5a64ae23c4231c454d015e9a27d11499 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 46/66] 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 74857bba1..7c7f011fd 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 947344e1ededaa2ed82f9aaea05fd5fa6cef3a80 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 47/66] 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 0734dce73..116784207 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 c38691bea637885625006dbd2236ab0ac37fe24d 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 48/66] 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 116784207..995087eb9 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 b04278e5d27ba84668ba2679aa47916a36fbc3e2 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 49/66] 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 995087eb9..36699f743 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 a056ea0b4db2b35273490ae2feadffb0afa691e8 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 50/66] 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 36699f743..b6e939af4 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 dd7c87e46f9d27ddfdb9c7e4a66976878df8275b 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 51/66] 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 b6e939af4..30b0f1581 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 7e797c642f96d6d9b77defbbe81dfc87f7c393bb Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 20:33:00 +0100 Subject: [PATCH 52/66] 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 f8835d5a1..57069a3cc 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 4bd832f5f..c5c1d0d98 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 efaaec58230bb08b407db69c9de3d8a1d6d89dee Mon Sep 17 00:00:00 2001 From: Tom Eley Date: Thu, 13 Apr 2023 20:57:20 +0100 Subject: [PATCH 53/66] sha256 linux --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 57069a3cc..e0e5c8083 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 427a045b9e8f254dc83b76d1d712a5f62f2d9648 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 21:09:13 +0100 Subject: [PATCH 54/66] 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 e0e5c8083..f8835d5a1 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 7e52bff687ee1a569dcb7b843ae85fe96625517a Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 20:50:54 +0100 Subject: [PATCH 55/66] 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 f8835d5a1..c10723a5a 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 c5c1d0d98..ede851e82 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 58669480b..5e8ea42d5 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 3c837cf52da6ba2efefd29c23f9dbcafb329fd57 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 21:08:02 +0100 Subject: [PATCH 56/66] 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 ede851e82..ea0588193 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 7831b1f74cbeac541cfd86b183f389f9bc8e833d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 07:42:41 +0100 Subject: [PATCH 57/66] 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 c10723a5a..f8835d5a1 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 ea0588193..c5c1d0d98 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 97e06bc4bc708ad4aa579c0aaebcec123a740b8b 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 58/66] 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 30b0f1581..e74d915fd 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 a3f05bdc8156fa0562e5d85e19cdec19a46e140d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 21:07:53 +0100 Subject: [PATCH 59/66] 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 896d9af06..55b7023e1 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 88cc1a22db7c62f2af69a03b4be864732f634aa7 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 18:03:21 +0100 Subject: [PATCH 60/66] 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 55b7023e1..d3dab4205 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 b49d518004c90355f6c5566d4ec27d766e2c49f5 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 19:34:33 +0100 Subject: [PATCH 61/66] 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 e74d915fd..29a35456d 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 b39dcf8d81ff3970bbf631f842c3c0ca936ae07e Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 21:20:18 +0100 Subject: [PATCH 62/66] 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 29a35456d..fb32f0a5c 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 571cf34ef4827d95bac5370e889c30abcd15f4ff Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 17:58:01 +0100 Subject: [PATCH 63/66] 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 fb32f0a5c..28a66c876 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 3722cdd245e79288dbd55393431218bdef4a93e2 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:21:49 +0100 Subject: [PATCH 64/66] 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 28a66c876..5ddc5f538 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 ebe127508e5bd4f2707dc395d4eb8d8bca160480 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:46:27 +0100 Subject: [PATCH 65/66] 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 5ddc5f538..18a6bca4b 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 }} From d30725f5960f73fb06c29bc8763586002a61277d Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 20:22:09 +0100 Subject: [PATCH 66/66] Merge branch 'main' of https://github.com/GhostWriters/docker-packt-cli into PrivacyCleanup