AnthoLume is a Progressive Web App (PWA) that manages your EPUB documents, provides an EPUB reader, and tracks your reading activity! It also has a KOReader KOSync compatible API, and a KOReader Plugin used to sync activity from your Kindle.
Go to file
Evan Reichard f74c81dc9b
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
[add] service worker & offline reader
2023-10-29 21:17:47 -04:00
_test_files [add] better error handling, [add] font selector, [add] tailwind generation 2023-10-25 19:52:01 -04:00
api [add] service worker & offline reader 2023-10-29 21:17:47 -04:00
assets [add] service worker & offline reader 2023-10-29 21:17:47 -04:00
client [add] service worker & offline reader 2023-10-29 21:17:47 -04:00
config [add] configurable cookie attribute settings 2023-10-24 22:14:19 -04:00
database [add] tests, [add] refactor epub feat 2023-10-23 20:18:16 -04:00
graph [add] tests, [add] refactor epub feat 2023-10-23 20:18:16 -04:00
metadata [fix] server word count, [add] client word count 2023-10-26 21:50:05 -04:00
opds [add] opds catalog, [add] migrate to non-cgo sqlite driver 2023-10-05 19:56:19 -04:00
screenshots [add] docker instructions, [add] metadata gathering, [add] screenshots 2023-09-26 18:57:48 -04:00
search [add] better search error handling 2023-10-26 06:20:56 -04:00
server [add] document view, [add] html sanitization, [add] google books metadata enrichment, [improve] db query performance 2023-09-22 22:12:36 -04:00
templates [add] service worker & offline reader 2023-10-29 21:17:47 -04:00
utils [add] better error handling, [add] font selector, [add] tailwind generation 2023-10-25 19:52:01 -04:00
.drone.yml [add] docker publish 2023-10-24 08:25:27 -04:00
.envrc Initial Commit 2023-09-19 08:01:15 -04:00
.gitignore [add] split wanted files vs wanted metadata for ko apis, [add] documentation 2023-09-19 19:29:55 -04:00
.sqlfluff Initial Commit 2023-09-19 08:01:15 -04:00
docker-compose.yml [add] split wanted files vs wanted metadata for ko apis, [add] documentation 2023-09-19 19:29:55 -04:00
Dockerfile [add] docker publish 2023-10-24 08:25:27 -04:00
Dockerfile-BuildKit [add] docker publish 2023-10-24 08:25:27 -04:00
go.mod [add] tests, [add] refactor epub feat 2023-10-23 20:18:16 -04:00
go.sum [add] tests, [add] refactor epub feat 2023-10-23 20:18:16 -04:00
LICENSE Initial Commit 2023-09-19 08:01:15 -04:00
main.go [add] document view, [add] html sanitization, [add] google books metadata enrichment, [improve] db query performance 2023-09-22 22:12:36 -04:00
Makefile [add] better error handling, [add] font selector, [add] tailwind generation 2023-10-25 19:52:01 -04:00
README.md [add] service worker & offline reader 2023-10-29 21:17:47 -04:00
shell.nix [add] better error handling, [add] font selector, [add] tailwind generation 2023-10-25 19:52:01 -04:00
sqlc.yaml [fix] store times as rfc3339 format 2023-10-05 21:04:57 -04:00
tailwind.config.js [add] service worker & offline reader 2023-10-29 21:17:47 -04:00

Book Manager

Screenshots

Web App - PWA


This is BookManager! Will probably be renamed at some point. This repository contains:

  • Web App / Progressive Web App (PWA)
  • KOReader Plugin (See client subfolder)
  • KOReader KOSync compatible API
  • OPDS API endpoint that provides access to the uploaded documents

In additional to the compatible KOSync API's, we add:

  • Additional APIs to automatically upload reading statistics
  • Upload documents to the server (can download in the "Documents" view or via OPDS)
  • Book metadata scraping (Thanks OpenLibrary & Google Books API)
  • Limited JavaScript use. Server-Side Rendering is used wherever possible. The main app is fully operational without any JS. JS is only required for:
    • EPUB Reader
    • Offline Mode / Service Worker

Server

Docker Image: docker pull gitea.va.reichard.io/evan/bookmanager:latest

KOSync API

The KOSync compatible API endpoint is located at: http(s)://<SERVER>/api/ko

OPDS API

The OPDS API endpoint is located at: http(s)://<SERVER>/api/opds

Quick Start

# Make Data Directory
mkdir -p bookmanager_data

# Run Server
docker run \
    -p 8585:8585 \
    -e REGISTRATION_ENABLED=true \
    -v ./bookmanager_data:/config \
    -v ./bookmanager_data:/data \
    gitea.va.reichard.io/evan/bookmanager:latest

The service is now accessible at: http://localhost:8585. I recommend registering an account and then disabling registration unless you expect more users.

Configuration

Environment Variable Default Value Description
DATABASE_TYPE SQLite Currently only "SQLite" is supported
DATABASE_NAME book_manager The database name, or in SQLite's case, the filename
CONFIG_PATH /config Directory where to store SQLite's DB
DATA_PATH /data Directory where to store the documents and cover metadata
LISTEN_PORT 8585 Port the server listens at
REGISTRATION_ENABLED false Whether to allow registration (applies to both WebApp & KOSync API)
COOKIE_SESSION_KEY Optional secret cookie session key (auto generated if not provided)
COOKIE_SECURE true Set Cookie Secure attribute (i.e. only works over HTTPS)
COOKIE_HTTP_ONLY true Set Cookie HttpOnly attribute (i.e. inacessible via JavaScript)

Security

Authentication

  • Web App / PWA - Session based token (7 day expiry, refresh after 6 days)
  • KOSync & SyncNinja API - Header based - X-Auth-User & X-Auth-Key (KOSync compatibility)
  • OPDS API - Basic authentication (KOReader OPDS compatibility)

Notes

  • Credentials are the same amongst all endpoints
  • The native KOSync plugin sends an MD5 hash of the password. Due to that:
  • We store an Argon2 hash and per-password salt of the MD5 hashed original password

Client (KOReader Plugin)

See documentation in the client subfolder: SyncNinja

Development

SQLC Generation (v1.21.0):

go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
~/go/bin/sqlc generate

Run Development:

CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true go run main.go serve

Building

The Dockerfile and Makefile contain the build information:

# Build Local (Linux & Darwin - arm64 & amd64)
make build_local

# Build Local Docker Image
make docker_build_local

# Build Docker & Push Latest or Dev (Linux - arm64 & amd64)
make docker_build_release_latest
make docker_build_release_dev

# Generate Tailwind CSS
make build_tailwind

# Clean Local Build
make clean

# Tests (Unit & Integration - Google Books API)
make tests_unit
make tests_integration

Notes