Skip to content

GhostWriters/docker-packt-cli

Repository files navigation

docker-packt-cli

Banner

GitHub contributors GitHub last commit main GitHub license Renovate

A Docker container for automatically downloading a free eBook each day from Packt publishing using the packt-cli tool.

Usage

To run the docker-packt-cli container, use the following docker run command:

docker run -d \
    --name=packt --rm \
    -e PACKT_EMAIL=<[email protected]> \
    -e PACKT_PASSWORD=<password> \
    -e PACKT_DOWNLOAD_FORMATS=pdf,epub,mobi,code \
    -e PACKT_ANTICAPTCHA_KEY=<key> \
    -e PACKT_SMTP_HOST <smtp.poczta.onet.pl> \
    -e PACKT_SMTP_PORT <587> \
    -e PACKT_SMTP_PASSWORD <youremailpassword> \
    -e PACKT_SMTP_EMAIL <[email protected]> \
    -e PACKT_SMTP_TO_EMAILS <[email protected], [email protected]> \
    -e PACKT_SMTP_KINDLE_EMAILS <[email protected]> \
    -e PUID=<UID> \
    -e PGID=<GID> \
    -e TZ=<timezone> \
    -v /home/user/packt/config:/config \
    -v /home/user/packt/books:/data \
    --restart unless-stopped
    ghcr.io/ghostwriters/docker-packt-cli:latest

You will need to replace <[email protected]> and <password> with your Packt account email and password, respectively. Additionally, you can customize the output formats of the downloaded books by modifying the PACKT_DOWNLOAD_FORMATS environment variable. The default formats are pdf, epub, mobi, and code.

To automatically solve the CAPTCHA, you will need an AntiCaptcha API key, which you can set by attaching the -e PACKT_ANTICAPTCHA_KEY=<key> flag to your docker run command.

PACKT_SMTP_HOST, PACKT_SMTP_PORT, PACKT_SMTP_PASSWORD, PACKT_SMTP_EMAIL, PACKT_SMTP_TO_EMAILS, PACKT_SMTP_KINDLE_EMAILS: These parameters are related to the email notifications feature. If you want to receive email notifications about the downloaded eBooks, you need to provide the SMTP server details and the email addresses for sending the notifications.

You can mount two volumes to persist the Packt credentials and store the downloaded books in a directory on your host system. The /config directory will store your Packt credentials, and the /data directory will store the downloaded books. You can change the paths of the host directories by modifying the values after the -v flag.

If you would prefer to use an alternative to ghcr.io, you can use the image hosted on Docker Hub ghostwriters/docker-packt-cli:latest,

GitHub Actions Used

Contributing

If you have any feedback or run into issues with the container, please open an issue on the GitHub repository. If you would like to contribute to this project, you can submit a pull request.

Special Thanks

  • packt-cli for maintaining the package to handle the downloading.
  • LinuxServer.io for maintaining the Docker image used in this project.

License

This project is licensed under the MIT License. See the LICENSE file for more details.