• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    Lua
  • License
    GNU Affero Genera...
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

self hostable synchronization service for koreader devices

Build Status AGPL Licence Koreader Sync Server

Koreader sync server is built on top of the Gin JSON-API framework which runs on OpenResty and is entirely written in Lua.

Users of koreader devices can register their devices to the synchronization server and use the sync service to keep all reading progress synchronized between devices.

This project is licenced under Affero GPL v3, see the COPYING file.

Setup your own server

Using docker, you can spin up your own server in two commands:

# for quick test
docker run -d -p 7200:7200 --name=kosync koreader/kosync:latest

# for production, we mount redis data volume to persist state
mkdir -p ./logs/{redis,app} ./data/redis
docker run -d -p 7200:7200 \
    -v `pwd`/logs/app:/app/koreader-sync-server/logs \
    -v `pwd`/logs/redis:/var/log/redis \
    -v `pwd`/data/redis:/var/lib/redis \
    --name=kosync koreader/kosync:latest

The above command will spin up a sync server in a docker container.

To build your own docker image from scratch:

docker build --rm=true --tag=koreader/kosync .

Alternatively, if you'd rather use docker compose:

docker compose up -d --build

To setup the server manually, please refer to the commands used in Dockerfile and travis config file.

You can use the following command to verify that the sync server is ready to serve traffic:

curl -k -v -H "Accept: application/vnd.koreader.v1+json" https://localhost:7200/healthcheck
# should return {"state":"OK"}

Privacy and security

Koreader sync server does not store file name or file content in the database. For each user it uses a unique string of 32 digits (MD5 hash) to identify the same document from multiple koreader devices and keeps a record of the furthest reading progress for that document. Sample progress data entries stored in the sync server are like these:

"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:percentage"  --> "0.31879884821061"
"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:progress"    --> "/body/DocFragment[20]/body/p[22]/img.0"
"user:chrox:document:0b229176d4e8db7f6d2b5a4952368d7a:device"      --> "PocketBook"

And the account authentication information is stored like this:

"user:chrox:key"  --> "1c56000eef209217ec0b50354558ab1a"

the password is MD5 hashed at client when authorizing with the sync server.

In addition, all data transferred between koreader devices and the sync server are secured by HTTPS (Hypertext Transfer Protocol Secure) connections.

More Repositories

1

koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
Lua
16,198
star
2

kindlepdfviewer

(DEPRECATED, please use KOReader instead) A PDF (plus DJVU, ePub, TXT, CHM, FB2, HTML...) viewer made for e-ink framebuffer devices, using muPDF, djvulibre, crengine
Lua
498
star
3

kpvbooklet

KPVBooklet is a Kindle booklet for starting koreader/kindlepdfviewer and updating last access and percentage finished information in Kindle content catalog entry of the opened document.
Java
208
star
4

android-luajit-launcher

Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Kotlin
131
star
5

koreader-base

Base framework offering a Lua scriptable environment for creating document readers
Lua
130
star
6

libk2pdfopt

k2pdfopt library for koreader, based on http://willus.com/k2pdfopt
C
89
star
7

crengine

This is the KOReader CREngine fork. It cross-pollinates with the official CoolReader repository at https://github.com/buggins/coolreader, in case you were looking for that one.
C++
70
star
8

koxtoolchain

Build script for various toolchains used by KOReader
Shell
54
star
9

contrib

Collection of non-official plugins designed for KOReader
Lua
34
star
10

virdevenv

virtual dev environment for koreader
Dockerfile
17
star
11

KoboUSBMS

Small helper to handle USBMS on Kobo in KOReader
C
15
star
12

ffi-cdecl

Automated C declaration extraction for FFI interfaces
Lua
14
star
13

sdcv

console version of StarDict formerly used by koreader; fork of https://github.com/Dushistov/sdcv
Makefile
10
star
14

koreader-misc

helper scripts and tools used/created by the dev team.
Python
9
star
15

lj-wpaclient

wpa_supplicant client library for LuaJIT
Lua
8
star
16

koreader-translations

KOReader localization.
7
star
17

koreader-fonts

Fonts for use in KOReader
6
star
18

evernote-sdk-lua

Unofficial Evernote SDK for Lua
Lua
6
star
19

android-send2ebook

**deprecated** send2ebook lets you send articles found on your android device to your ereader
Java
5
star
20

stardict-dictionaries

Script to quickly convert zip files to .tar.lz
Shell
2
star
21

doc

github page repo for hosting KOReader's documentation (write only)
HTML
1
star
22

koreader.github.io

Landing page for KOReader project
HTML
1
star
23

test-data

Test suit for various document formats
1
star