From a96db2e0cba25c0470156515dda08ee8efb824d2 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Sat, 4 Nov 2023 19:40:32 -0400 Subject: [PATCH] [add] rename to AnthoLume --- .drone.yml | 2 +- Dockerfile | 14 +++--- Dockerfile-BuildKit | 14 +++--- Makefile | 8 ++-- README.md | 97 ++++++++++++++++++--------------------- api/opds-routes.go | 6 +-- assets/local/index.html | 2 +- assets/manifest.json | 4 +- assets/reader/index.html | 2 +- client/README.md | 8 ++-- config/config.go | 2 +- docker-compose.yml | 2 +- main.go | 6 +-- notes/README.md | 13 ++++++ screenshots/pwa/README.md | 24 +++++----- screenshots/web/README.md | 24 +++++----- shell.nix | 1 + templates/base.html | 4 +- templates/error.html | 2 +- templates/login.html | 2 +- 20 files changed, 121 insertions(+), 116 deletions(-) diff --git a/.drone.yml b/.drone.yml index cd2ba63..f163ca0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: - name: publish_docker image: plugins/docker settings: - repo: gitea.va.reichard.io/evan/bookmanager + repo: gitea.va.reichard.io/evan/antholume registry: gitea.va.reichard.io tags: - dev diff --git a/Dockerfile b/Dockerfile index 345a700..8bbe97a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,17 +10,17 @@ WORKDIR /src COPY . . # Create Package Directory -RUN mkdir -p /opt/bookmanager +RUN mkdir -p /opt/antholume # Compile -RUN go build -o /opt/bookmanager/server; \ - cp -a ./templates /opt/bookmanager/templates; \ - cp -a ./assets /opt/bookmanager/assets; +RUN go build -o /opt/antholume/server; \ + cp -a ./templates /opt/antholume/templates; \ + cp -a ./assets /opt/antholume/assets; # Create Image FROM busybox:1.36 COPY --from=certs /etc/ssl/certs /etc/ssl/certs -COPY --from=build /opt/bookmanager /opt/bookmanager -WORKDIR /opt/bookmanager +COPY --from=build /opt/antholume /opt/antholume +WORKDIR /opt/antholume EXPOSE 8585 -ENTRYPOINT ["/opt/bookmanager/server", "serve"] +ENTRYPOINT ["/opt/antholume/server", "serve"] diff --git a/Dockerfile-BuildKit b/Dockerfile-BuildKit index 7abef33..da9c6fb 100644 --- a/Dockerfile-BuildKit +++ b/Dockerfile-BuildKit @@ -7,7 +7,7 @@ FROM --platform=$BUILDPLATFORM golang:1.20 AS build # Create Package Directory WORKDIR /src -RUN mkdir -p /opt/bookmanager +RUN mkdir -p /opt/antholume # Cache Dependencies & Compile ARG TARGETOS @@ -15,14 +15,14 @@ ARG TARGETARCH RUN --mount=target=. \ --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ - GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /opt/bookmanager/server; \ - cp -a ./templates /opt/bookmanager/templates; \ - cp -a ./assets /opt/bookmanager/assets; + GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /opt/antholume/server; \ + cp -a ./templates /opt/antholume/templates; \ + cp -a ./assets /opt/antholume/assets; # Create Image FROM busybox:1.36 COPY --from=certs /etc/ssl/certs /etc/ssl/certs -COPY --from=build /opt/bookmanager /opt/bookmanager -WORKDIR /opt/bookmanager +COPY --from=build /opt/antholume /opt/antholume +WORKDIR /opt/antholume EXPOSE 8585 -ENTRYPOINT ["/opt/bookmanager/server", "serve"] +ENTRYPOINT ["/opt/antholume/server", "serve"] diff --git a/Makefile b/Makefile index 3405f74..79473ac 100644 --- a/Makefile +++ b/Makefile @@ -11,20 +11,20 @@ build_local: build_tailwind env GOOS=darwin GOARCH=amd64 go build -o ./build/server_darwin_amd64 docker_build_local: build_tailwind - docker build -t bookmanager:latest . + docker build -t antholume:latest . docker_build_release_dev: build_tailwind docker buildx build \ --platform linux/amd64,linux/arm64 \ - -t gitea.va.reichard.io/evan/bookmanager:dev \ + -t gitea.va.reichard.io/evan/antholume:dev \ -f Dockerfile-BuildKit \ --push . docker_build_release_latest: build_tailwind docker buildx build \ --platform linux/amd64,linux/arm64 \ - -t gitea.va.reichard.io/evan/bookmanager:latest \ - -t gitea.va.reichard.io/evan/bookmanager:`git describe --tags` \ + -t gitea.va.reichard.io/evan/antholume:latest \ + -t gitea.va.reichard.io/evan/antholume:`git describe --tags` \ -f Dockerfile-BuildKit \ --push . diff --git a/README.md b/README.md index f6f89bc..f819f36 100644 --- a/README.md +++ b/README.md @@ -1,101 +1,92 @@ -# Book Manager +

AnthoLume

+

Track and Illuminate Your Reading Journey

- - + Web App - PWA +

+ +

+ + - - + + - - + + - - + + - - + +

-

Screenshots

+

Demo Server

+

user: demo pass: demo

+

- Web App - PWA -

-

- - + +

--- -**TL;DR:** Show me the [demo](https://books-demo.cloud.reichard.io/)! +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](https://github.com/koreader/koreader-sync-server) compatible API, and a [KOReader](https://github.com/koreader/koreader) Plugin used to sync activity from your Kindle. Some additional features include: -- Username: `demo` -- Password: `demo` +- OPDS API Endpoint +- Local / Offline Reader (via ServiceWorker) +- Metadata Scraping (Thanks [OpenLibrary](https://openlibrary.org/) & [Google Books API](https://developers.google.com/books/docs/v1/getting_started)) +- Words / Minute (WPM) Tracking & Leaderboard (Amongst Server Users) -This is BookManager! Will probably be renamed at some point. This repository contains: +While some features require JavaScript (Service Worker & EPUB Reader), we make an effort to limit JavaScript usage. Outside of the two aforementioned features, no JavaScript is used. -- Web App / Progressive Web App (PWA) -- [KOReader](https://github.com/koreader/koreader) Plugin (See `client` subfolder) -- [KOReader KOSync](https://github.com/koreader/koreader-sync-server) compatible API -- OPDS API endpoint that provides access to the uploaded documents +## Server -In additional to the compatible KOSync API's, we add: +Docker Image: `docker pull gitea.va.reichard.io/evan/antholume:latest` -- 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](https://openlibrary.org/) & [Google Books API](https://developers.google.com/books/docs/v1/getting_started)) -- 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 - - Local / Offline Mode - - Service Worker +### Local / Offline Reader -# Server - -Docker Image: `docker pull gitea.va.reichard.io/evan/bookmanager:latest` - -## Local / Offline Reader - -The Local / Offline reader allows you to use any BookManager server as a standalone offline accessible reading app! Some features: +The Local / Offline reader allows you to use any AnthoLume server as a standalone offline accessible reading app! Some features: - Add local EPUB documents - Read both local and any cached server documents - Maintains progress for all types of documents (server / local) - Uploads any progress or activity for cached server documents once the internet is accessible -## KOSync API +### KOSync API The KOSync compatible API endpoint is located at: `http(s):///api/ko` -## OPDS API +### OPDS API The OPDS API endpoint is located at: `http(s):///api/opds` -## Quick Start +### Quick Start ```bash # Make Data Directory -mkdir -p bookmanager_data +mkdir -p antholume_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 + -v ./antholume_data:/config \ + -v ./antholume_data:/data \ + gitea.va.reichard.io/evan/antholume: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 +### 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 | +| DATABASE_NAME | antholume | 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 | @@ -118,11 +109,11 @@ The service is now accessible at: `http://localhost:8585`. I recommend registeri - 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) +## Client (KOReader Plugin) -See documentation in the `client` subfolder: [SyncNinja](https://gitea.va.reichard.io/evan/BookManager/src/branch/master/client/) +See documentation in the `client` subfolder: [SyncNinja](https://gitea.va.reichard.io/evan/AnthoLume/src/branch/master/client/) -# Development +## Development SQLC Generation (v1.21.0): @@ -137,7 +128,7 @@ Run Development: CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true go run main.go serve ``` -# Building +## Building The `Dockerfile` and `Makefile` contain the build information: diff --git a/api/opds-routes.go b/api/opds-routes.go index 1ba77f1..a783688 100644 --- a/api/opds-routes.go +++ b/api/opds-routes.go @@ -91,7 +91,7 @@ func (api *API) opdsDocuments(c *gin.Context) { // TODO // Links: []opds.Link{ // { - // Title: "Search Book Manager", + // Title: "Search AnthoLume", // Rel: "search", // TypeLink: "application/opensearchdescription+xml", // Href: "search.xml", @@ -105,8 +105,8 @@ func (api *API) opdsDocuments(c *gin.Context) { func (api *API) opdsSearchDescription(c *gin.Context) { rawXML := ` - Search Book Manager - Search Book Manager + Search AnthoLume + Search AnthoLume ` c.Data(http.StatusOK, "application/xml", []byte(rawXML)) diff --git a/assets/local/index.html b/assets/local/index.html index 7ef9de2..ebf88fa 100644 --- a/assets/local/index.html +++ b/assets/local/index.html @@ -22,7 +22,7 @@ media="(prefers-color-scheme: dark)" /> - Book Manager - Local + AnthoLume - Local diff --git a/assets/manifest.json b/assets/manifest.json index 8965f24..be9a329 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Book Manager", - "name": "Book Manager", + "short_name": "AnthoLume", + "name": "AnthoLume", "theme_color": "#1F2937", "display": "standalone", "scope": "/", diff --git a/assets/reader/index.html b/assets/reader/index.html index b4f9a15..8ec5567 100644 --- a/assets/reader/index.html +++ b/assets/reader/index.html @@ -14,7 +14,7 @@ /> - Book Manager - Reader + AnthoLume - Reader diff --git a/client/README.md b/client/README.md index 7c2d1e8..4e55d0a 100644 --- a/client/README.md +++ b/client/README.md @@ -1,6 +1,6 @@ -# Book Manager - SyncNinja KOReader Plugin +# AnthoLume - SyncNinja KOReader Plugin -This is BookManagers KOReader Plugin called `syncninja.koplugin`. Features include: +This is AnthoLume's KOReader Plugin called `syncninja.koplugin`. Features include: - Syncing read activity - Uploading documents @@ -12,10 +12,10 @@ Copy the `syncninja.koplugin` directory to the `plugins` directory for your KORe ## Configuration -You must configure the BookManager server and credentials in SyncNinja. Afterwhich you'll have the ability to configure the sync cadence as well as whether you'd like the plugin to sync your activity, document metadata, and/or documents themselves. +You must configure the AnthoLume server and credentials in SyncNinja. Afterwhich you'll have the ability to configure the sync cadence as well as whether you'd like the plugin to sync your activity, document metadata, and/or documents themselves. ## KOSync Compatibility -BookManager implements API's compatible with the KOSync plugin. This means that you can utilize this server for KOSync (and it's recommended!). SyncNinja provides an easy way to merge configurations between both KOSync and itself in the menu. +AnthoLume implements API's compatible with the KOSync plugin. This means that you can utilize this server for KOSync (and it's recommended!). SyncNinja provides an easy way to merge configurations between both KOSync and itself in the menu. The KOSync compatible API endpoint is located at: `http(s):///api/ko`. You can either use the previous mentioned merge feature to automatically configure KOSync once SyncNinja is configured, or you can manually set KOSync's server to the above. diff --git a/config/config.go b/config/config.go index 4765077..85f6748 100644 --- a/config/config.go +++ b/config/config.go @@ -33,7 +33,7 @@ func Load() *Config { return &Config{ Version: "0.0.2", DBType: trimLowerString(getEnv("DATABASE_TYPE", "SQLite")), - DBName: trimLowerString(getEnv("DATABASE_NAME", "book_manager")), + DBName: trimLowerString(getEnv("DATABASE_NAME", "antholume")), ConfigPath: getEnv("CONFIG_PATH", "/config"), DataPath: getEnv("DATA_PATH", "/data"), ListenPort: getEnv("LISTEN_PORT", "8585"), diff --git a/docker-compose.yml b/docker-compose.yml index ee36dc8..3893a57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ --- services: - bookmanager: + antholume: environment: - CONFIG_PATH=/data - DATA_PATH=/data diff --git a/main.go b/main.go index 536249d..9f15017 100644 --- a/main.go +++ b/main.go @@ -24,13 +24,13 @@ func main() { log.SetFormatter(UTCFormatter{&log.TextFormatter{FullTimestamp: true}}) app := &cli.App{ - Name: "Book Manager", + Name: "AnthoLume", Usage: "A self hosted e-book progress tracker.", Commands: []*cli.Command{ { Name: "serve", Aliases: []string{"s"}, - Usage: "Start Book Manager web server.", + Usage: "Start AnthoLume web server.", Action: cmdServer, }, }, @@ -42,7 +42,7 @@ func main() { } func cmdServer(ctx *cli.Context) error { - log.Info("Starting Book Manager Server") + log.Info("Starting AnthoLume Server") // Create Channel wg := sync.WaitGroup{} diff --git a/notes/README.md b/notes/README.md index 535ef78..634d4d8 100644 --- a/notes/README.md +++ b/notes/README.md @@ -1,3 +1,16 @@ # Notes This folder consists of various notes / files that I want to save and may come back to at some point. + +# Ideas / To Do + +- Rename! +- Google Fonts -> SW Cache and/or Local +- Search Documents + - Title, Author, Description +- Change Device Name / Assume Device +- Hide Document per User (Another Table?) +- Admin User? + - Reset Passwords + - Actually Delete Documents +- Document & Activity Pagination diff --git a/screenshots/pwa/README.md b/screenshots/pwa/README.md index 3ebc8d2..06ad43b 100644 --- a/screenshots/pwa/README.md +++ b/screenshots/pwa/README.md @@ -1,25 +1,25 @@ # PWA Screenshots

- - + + - - + + - - + +

- - + + - - + + - - + +

diff --git a/screenshots/web/README.md b/screenshots/web/README.md index 1a5f012..8b24da9 100644 --- a/screenshots/web/README.md +++ b/screenshots/web/README.md @@ -1,28 +1,28 @@ # Web Screenshots

- - + + - - + +

- - + + - - + +

- - + + - - + +

diff --git a/shell.nix b/shell.nix index 25b18b1..2dca837 100644 --- a/shell.nix +++ b/shell.nix @@ -4,5 +4,6 @@ pkgs.mkShell { packages = with pkgs; [ go nodePackages.tailwindcss + python311Packages.grip ]; } diff --git a/templates/base.html b/templates/base.html index 7eadf48..11f352a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -9,7 +9,7 @@ - Book Manager - {{block "title" .}}{{end}} + AnthoLume - {{block "title" .}}{{end}} @@ -134,7 +134,7 @@