4.3 KiB
4.3 KiB
Book Manager
This is BookManager! Will probably be renamed at some point. This repository contains:
- KOReader KOSync Compatible API
- KOReader Plugin (See
client
subfolder) - WebApp
In additional to the compatible KOSync API's, we add:
- Additional APIs to automatically upload reading statistics
- Automatically upload documents to the server (can download in the "Documents" view)
- Book metadata scraping (Thanks OpenLibrary & Google Books API)
- No JavaScript! All information is rendered server side.
Server
Docker Image: docker pull gitea.va.reichard.io/evan/bookmanager:latest
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
Configuration
Environment Variable | Default Value | Description |
---|---|---|
DATABASE_TYPE | SQLite | Currently only "SQLite" is supported |
DATABASE_NAME | bbank | The database name, or in SQLite's case, the filename |
DATABASE_PASSWORD | Currently not used. Placeholder for potential alternative DB support | |
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) |
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 go run main.go serve
Building
The Dockerfile
and Makefile
contain the build information:
# Build Local Docker Image
make docker_build_local
# Push Latest
make docker_build_release_latest
If manually building, you must enable CGO:
# Download Dependencies
go mod download
# Compile (Binary `./bookmanager`)
CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -o /bookmanager