- JavaScript 41.8%
- Go 38.6%
- TypeScript 9%
- Svelte 8.6%
- HTML 1.4%
- Other 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
CI / changes (pull_request) Successful in 8s
CI / go-lint (pull_request) Successful in 32s
CI / web (pull_request) Successful in 4m32s
CI / go-test (sync) (pull_request) Successful in 2m41s
CI / go-test (parity) (pull_request) Successful in 6m14s
CI / go-test (wire) (pull_request) Successful in 12m17s
CI / go-test (usecases) (pull_request) Successful in 18m58s
CI / go-test (rest) (pull_request) Successful in 27m29s
CI / CI (pull_request) Successful in 15s
CI / changes (push) Has been skipped
CI / go-lint (push) Successful in 1m36s
CI / web (push) Successful in 4m19s
CI / go-test (parity) (push) Successful in 4m46s
CI / go-test (usecases) (push) Successful in 2m32s
Release / Release (push) Successful in 42s
CI / go-test (wire) (push) Successful in 11m18s
CI / go-test (rest) (push) Successful in 18m1s
CI / go-test (sync) (push) Successful in 15m18s
CI / CI (push) Successful in 9s
|
||
| .forgejo/workflows | ||
| cmd | ||
| docs | ||
| internal | ||
| scripts | ||
| testdata | ||
| web | ||
| webui | ||
| .gitignore | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| config.example.yaml | ||
| config.schema.json | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| mise.toml | ||
| README.md | ||
| releasaurus.toml | ||
| renovate.json | ||
Dogear
Dogear is a self-hosted reading tracker. It records the books you own, want and read, with your reading history, reviews, tags, shelves and statistics. Alcove is the library beside it. Alcove holds the book files, and Dogear tracks what you read.
Dogear started as a Go port of Jelu 0.88.2, a self-hosted book tracker. Dogear is now its own app. It is not a drop-in replacement for Jelu.
Dogear is small. Jelu runs on the JVM (the Java virtual machine), and it uses about 440 MB of memory when idle. Dogear uses tens of megabytes. The measurements are under "Memory" in docs/design.md. That file is also the spec of Dogear.
Running it
The container image is built in Exikle/containers (apps/dogear). Its name is git.dcunha.io/exikle/dogear. The image listens on port 8080 and keeps all data under /data. The SQLite database is /data/database/dogear.db.
To run Dogear from source, use these commands:
go build ./cmd/dogear
DOGEAR_DATABASE_PATH=./data/database DOGEAR_WEBUI_DIR=./web/build ./dogear
DOGEAR_WEBUI_DIR names the directory that holds the built web UI. The image provides this directory. See "Web UI" below.
Configuration
Dogear reads built-in defaults first. Then it reads an optional YAML file, and then the DOGEAR_* environment variables. A variable beats the file. A variable name is DOGEAR_ plus the key path in upper case, with _ between the parts. For example, the key http.port is DOGEAR_HTTP_PORT.
config.example.yamllists every key with its default and a short note. SetDOGEAR_CONFIGto the path of your copy.config.schema.jsonis the JSON Schema of the file. An editor can use it to check your file.dogear --check-configloads the configuration, logs it with the secrets hidden, and exits. A wrong key or value ends with exit code 78.
A secret never goes in the file. These are passwords, API keys, client secrets and the Postgres URL. Set each one with its variable, for example DOGEAR_ADMIN_PASSWORD.
To read your reading progress from Alcove, set DOGEAR_ALCOVE_URL to the base URL of your Alcove server (an http:// or https:// URL). If it is empty, the sync is off. DOGEAR_ALCOVE_INTERVAL is how often Dogear reads Alcove, 5m by default. Each user then saves their Alcove username and a device token. See entry 36 of docs/design.md.
To keep your library in step with Hardcover, each user saves a Hardcover personal token on the page Profile, Hardcover. The sync is off for a user until they do. DOGEAR_HARDCOVER_SYNC_INTERVAL is how often Dogear syncs with Hardcover, 10m by default. Changes go both ways. Dogear never deletes anything at Hardcover. A new link sends nothing until you press Start sending on that page, after a preview of what Dogear would send. At the first start after the update that added this, Dogear clears the to-read flag on every book that is being read or was read (the newest reading event is finished or reading), and logs how many it cleared. See entry 38 of docs/design.md.
Dogear adds three features on top of the configuration:
- Settings page: An admin can change the runtime settings while Dogear runs. These settings are the metadata providers (enabled, order, configuration, API key), calibre, cover resizing, CORS origins, session duration, OAuth2 account creation, OIDC email verification, and the default language and theme of the UI. A change applies at once. Dogear stores it in its own
jelugo_settingtable. If an environment variable or a configuration file sets a value, the page shows that value as locked, with the name of the variable or file. The page shows startup-only settings (paths, port, OAuth2, LDAP, proxy auth) as read-only. The API isGET /api/v1/dogear/settingsandPUT/DELETE /api/v1/dogear/settings/{key}. See/v3/api-docs, tagDogear. - Admin from the environment: Set
DOGEAR_ADMIN_LOGINandDOGEAR_ADMIN_PASSWORD. For a mounted Secret, setDOGEAR_ADMIN_FILEto the path of the password file instead of the password. At startup, Dogear creates that admin, or it makes the existing user with that login an admin. Dogear resets the password only ifDOGEAR_ADMIN_RESET=true. - Admins from OIDC groups: Set
DOGEAR_AUTH_GROUPS_ADMIN=dogear-admin. At every login, Dogear makes an OIDC user an admin if thegroupsclaim of that user has one of the listed groups. If it does not, the user is not an admin.
For details, see "Runtime settings and admin bootstrap" in docs/design.md.
Upgrading from JeluGo
Dogear is the new name of JeluGo. Read these points before you start the new version on an old data directory.
- Remove every variable that starts with
JELU_,JELUGO_,SPRING_,SERVER_orLOGGING_LEVEL_, in upper or lower case. Dogear reads none of them. If one is set, Dogear logs an error that names it and exits with code 78. This check stops a setting that Dogear no longer reads from putting the database in a wrong place. Variables that Kubernetes sets for a Service of that name (JELU_SERVICE_HOST,JELU_PORT,SERVER_SERVICE_HOSTand like them) do not count. - Use the
DOGEAR_*names instead. The names are inconfig.example.yaml. For example,JELU_DATABASE_PATHisDOGEAR_DATABASE_PATH,JELUGO_ADMIN_LOGINisDOGEAR_ADMIN_LOGIN, andLOGGING_LEVEL_IO_GITHUB_BAYANG_JELUisDOGEAR_LOG_LEVEL. An OAuth2 client moves fromSPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_<ID>_*toDOGEAR_AUTH_CLIENTS_<ID>_*. There is noapplication.ymlany more. Use the YAML file ofconfig.example.yaml. - Set
DOGEAR_HTTP_FORWARDED=truebehind a reverse proxy that is not on Kubernetes. Like JeluGo, Dogear turns it on by itself whenKUBERNETES_SERVICE_HOSTis set.DOGEAR_HTTP_FORWARDED=falseturns it off. - The port is 8080 by default, not 11111. Change your probes, your Service and your proxy.
- On the first start, Dogear renames
jelu.dbtodogear.dbin the database folder, with its-wal,-shmand-journalfiles. It stops with an error if both files exist. The tables keep their names. Dogear also moves the stored settings and the stored login provider to the new names. - Roll back only to a copy of the data made before Dogear first started: Dogear renames jelu.db and rewrites user and setting rows, so JeluGo on the same volume starts empty.
- Everyone signs in again. The names of the session attributes changed, so Dogear does not read the old sessions.
- New API tokens start with
dogear_. Tokens that start withjelu_keep working. - The LDAP admin group is
dogear-admin, notjelu-admin. For OIDC, list your admin group inDOGEAR_AUTH_GROUPS_ADMIN.
Web UI
Dogear ships its own web UI in web/. It uses SvelteKit. It works on phones (as an installable PWA, a web app that you install) and on desktops. You do not need Node on the host. To build the UI in a container, run scripts/web.sh run build. To make a directory for DOGEAR_WEBUI_DIR, run scripts/build-web.sh <dir>. To run the Playwright specs against a Dogear built from this repository, run scripts/web.sh run e2e.
The Vue UI of Jelu also works with Dogear. If you prefer it, webui/ builds it from the source of Jelu with the patches of Dogear. The script is scripts/build-webui.sh.
Database
By default, Dogear uses a sqlite database, <database.path>/dogear.db. This is the supported setup. Dogear can also run on Postgres. Then it can share a server and backups with other apps. Postgres support is experimental. Pages are 2 to 7 times slower than on sqlite (the measurements are in docs/design.md), and the default tests do not run on Postgres.
To use Postgres, set the database URL:
DOGEAR_DATABASE_URL=postgres://dogear:secret@db:5432/dogear?sslmode=disable
On first start, Dogear creates its schema in that database. If the URL has a search_path, Dogear creates the schema in the schema that the search_path names. Images and imports stay in the data directory. The settings page shows the URL as read-only, and it masks the password.
To move an existing sqlite library to Postgres, stop Dogear. Then run this command with your usual configuration, so that Dogear finds dogear.db:
dogear migrate-db --to postgres://dogear:secret@db:5432/dogear
The command copies every table into an empty database in one transaction. It makes sure that every table has as many rows as in sqlite. It refuses a database that already has the tables of Dogear. After the copy, set DOGEAR_DATABASE_URL and start Dogear. The command only reads the sqlite data. It opens the file in the same way as a normal start. So the sqlite data stays usable if you want to go back.
The script scripts/test-postgres.sh runs the whole test suite on an embedded PostgreSQL 18.6.
Behaviour
docs/design.md is the spec. It lists the documented behaviour of Dogear, entry by entry. Some examples:
- The search index lives in memory. Jelu uses a Lucene directory.
- There is no log file. Dogear logs JSON lines to stdout.
- SSO signs in in the same tab.
- An admin can add SSO providers and change settings in the UI.
- Dogear does not bundle calibre.
The tests record request scenarios against real Jelu 0.88.2 and replay them against Dogear in go test. They are regression tests. They show that a change in the API is on purpose.
License
Dogear uses the MIT license, like Jelu. It carries the copyright notice of Jelu.