Nav apraksta

david d4b8f1840e massive update 7 gadi atpakaļ
bookworm d4b8f1840e massive update 7 gadi atpakaļ
docs d4b8f1840e massive update 7 gadi atpakaļ
front d4b8f1840e massive update 7 gadi atpakaļ
screenshots bad8599dc8 clean up + doc for alpha 0.1 10 gadi atpakaļ
services d4b8f1840e massive update 7 gadi atpakaļ
.gitignore d4b8f1840e massive update 7 gadi atpakaļ
README.md 136ed7740e update docs 7 gadi atpakaļ
nginx_file 9c84333678 add basic nginx file with kindle redirect and ws upgrade 8 gadi atpakaļ
requirements.txt db5824b28b refactor to make use of websockets instead of polling, automatically convert EPUB to MOBI 8 gadi atpakaļ
setup.py d4251e6ae8 add entrypoints 7 gadi atpakaļ

README.md

Requirements

  • S3 (minio can be used for a local instance).
  • Redis
  • sqlite
  • Python3.6

Batch process

To remove the initial roundtrip when looking for books, I keep a cache in postgres.
To populate this cache, I triggered each of the bot's LIST command, at #ebooks

I executed:

@pondering42
@dv8
@shytot
@dragnbreaker
@Xon-new

Then fetched all of the files, unarchived, concatenated them together and deduped them. On the resulting file I ran parse.py which inserts it into the database.

Services

Diagram

Installation

sudo cp services/bookworm@.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start bookworm@ircclient.service
sudo systemctl start bookworm@file_fetcher.service
sudo systemctl start bookworm@unpacker.service
sudo systemctl start bookworm@web.service

IRC Client

In charge of processing received commands and sending them via IRC.
Will forward details from DCC to the file fetcher via redis.

File fetcher

In charge of fetching files specified via DCC.
Will store the file in S3 and notify file details to the unpacker.

Unpacker

In charge of taking a file (as provided from IRC), unpacking it and, if necessary, converting it to mobi.

Web

API

  • Lists jobs in progress (/books/status)
  • Serves available books (Anything in the S3 bucket)
  • Exposes a search endpont /book/search?terms=...
  • Fetches books via /book/fetch/

Web interface

--

Basic (Kindle) Web interface

The kindle has a very basic webbrowser (I believe it renders up to HTML4, CSS2.1), which can be used to download (available) books directly.
At the moment I re-route at nginx based on user agent

To test, you can use dillo which has a set of features similar to the kindle's web browser.

if ($http_user_agent ~* "armv7l") {
    rewrite ^/(.*)$ /books/kindle;
}

CLI

To be re-implemented