Skip to content

Commit

Permalink
docs: Docker Information Updates (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyE123 authored May 1, 2023
1 parent b263cb1 commit 4f4bd6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ docker run -d \
-v /home/user/packt/config:/config \
-v /home/user/packt/books:/data \
--restart unless-stopped
ghcr.io/ghostwriters/docker-packt-cli/docker-packt-cli:latest
ghcr.io/ghostwriters/docker-packt-cli:latest
```

You will need to replace `<xxx@xxx.xxx>` 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.
To automatically solve the CAPTCHA, you will need an [AntiCaptcha](https://anti-captcha.com/) API key, which you can set by attaching the `-e PACKT_ANTICAPTCHA_KEY=<key>` flag to your docker run command.

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.

Once you run the container, it will automatically download a free eBook each day from Packt publishing and store the files in the `/home/user/packt/books` directory on your host system.

If you would prefer to use an alternative to ghcr.io, you can use the image hosted on [Docker Hub](https://hub.docker.com/repository/docker/ghostwriters/docker-packt-cli) `ghostwriters/docker-packt-cli:latest`,

## GitHub Actions Used

- [actions/checkout](https://github.com/actions/checkout) - Action for checking out code from a repository.
Expand Down
8 changes: 0 additions & 8 deletions root/etc/s6-overlay/s6-rc.d/init-packt-cli-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ 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"
Expand Down

0 comments on commit 4f4bd6b

Please sign in to comment.