summaryrefslogtreecommitdiff
path: root/ZeEpube.md
blob: 99d4eebe79a9840844cee96f8cc59cfc93c068a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
title: The Epube
hide:
  - navigation
---

<style>
  .md-typeset h1,
  .md-content__button {
    display: none;
  }
</style>

# The Epube

Self-hosted web EPUB reader using [EPUB.js](https://github.com/futurepress/epub.js), Bootstrap, and [Calibre](https://calibre-ebook.com).

## Screenshots

### Desktop

![](images/epube/Screenshot_2025-05-16_at_15.50.58.webp){ width="420", align=left }
![](images/epube/Screenshot_2025-05-16_at_15.52.29.webp){ width="420" }

### Mobile

![](images/epube/mobile/Screenshot_20250516_155939.webp){ width="120", align=left }
![](images/epube/mobile/Screenshot_20250516_164212.webp){ width="120", align=left }
![](images/epube/mobile/Screenshot_20250516_160100.webp){ width="120", align=left }
![](images/epube/mobile/Screenshot_20250516_164304.webp){ width="120", align=left }
![](images/epube/mobile/Screenshot_20250516_160122.webp){ width="120", align=left }
![](images/epube/mobile/Screenshot_20250516_164403.webp){ width="120", align=left }

## Features

* responsive, offline-capable design;
* integrates with Calibre library;
* can use either SQLite or PostgreSQL for its own database;
* multi-device sync of last-read pages (when online);
* word definition lookups using dictd / Wiktionary;
* supports Chrome homescreen "app mode";
* optional hyphenation using [hyphen](https://github.com/ytiurin/hyphen) library;
* dark mode, themes, etc;

## UI cheat sheet

* Switch pages: Left, Right, space, taps/clicks on left and right sides of the window
* Show UI if it's hidden: escape or tap somewhere in the middle of reader window
* Dictionary lookup: double click/select one word

## Installation

Use the following compose setup to either pull or build your own images:

### .env

```ini
# Put any local modifications here.

OWNER_UID=1000
OWNER_GID=1000

# Calibre library base directory (mounts to /books)
BOOKS_DIR=/home/user/calibre/Books

# Default user to create (if it doesn't exist)
EPUBE_ADMIN_USER=admin
EPUBE_ADMIN_PASS=password

# APP_WEB_ROOT=/var/www/html/books
# APP_BASE=

# bind exposed port to 127.0.0.1 by default in case reverse proxy is used.
# if you plan to run the container standalone and need origin port exposed
# use next HTTP_PORT definition (or remove "127.0.0.1:").
HTTP_PORT=127.0.0.1:8280
#HTTP_PORT=8280

# Optional OAuth
# EPUBE_OIDC_URL=
# EPUBE_OIDC_NAME=
# EPUBE_OIDC_CLIENT_ID=
# EPUBE_OIDC_CLIENT_SECRET=

# PostgreSQL is optional, default is SQLite
# EPUBE_DB_TYPE=pgsql
# EPUBE_DB_USER=postgres
# EPUBE_DB_PASS=password
# EPUBE_DB_NAME=postgres
```

### docker-compose.yml

```yaml
version: '3'

services:
  # optional dictionary server (add other dictionaries via Dockerfile)
  # comment it out if you don't need it
  dict:
    restart: unless-stopped
    image: cthulhoo/the-epube-dict:latest

  app:
    image: cthulhoo/the-epube-fpm-static:latest
    restart: unless-stopped
    volumes:
      - app:/var/www/html
      - ${BOOKS_DIR}:/books:ro

  web-nginx:
    image: cthulhoo/the-epube-web-nginx:latest
    restart: unless-stopped
    ports:
      - ${HTTP_PORT}:8080
    volumes:
      - app:/var/www/html:ro
    depends_on:
      - app

volumes:
  app:
```

## FAQ

### Moving between pages is slow with some books

This happens sometime on slow devices, i.e. phones. The usual reason is Epub chapters are too large. Those can be split into smaller sections with Calibre epub converter: *EPUB Output -> Split files larger than ->* set a smaller value, 100KB should be fine.