Optional Senpai integration: "Who's here" side sheet and /api/senpai proxy

- server.js: GET /api/senpai/v1/{locate,xray,characters/<ref>[/timeline],portraits/<ref>} forwarded to
  SENPAI_URL (plain http/https, no dependencies) with SENPAI_TOKEN, X-Senpai-User and the user's horizon
  (furthest chapter with progress, its version and furthest page); off when SENPAI_URL is unset
- progress records "top", the furthest page read in a version, so paging back does not lower the horizon
- /api/me reports senpai: true|false
- reader: Who's here button (key x) with This page / This chapter / So far, character card, timeline with
  jump links, figure outlines on the page; options "only up to this page" and "show unconfirmed"
- read.html?...&p=<index> opens a page; readUrl takes p
This commit is contained in:
Maashkinoozhe committed 2026-10-17 16:41:46 +02:00
1 parent cfb2d79103
commit f3304732fb
6 files changed
+257 -10

No files matched your search

+13
View File
@@ -37,6 +37,8 @@ docker compose up -d --build
| `SIGNUP` | `closed` | `open` lets anyone create an account. Otherwise the admin adds users under Settings |
| `SCAN_INTERVAL` | `10` | Minutes between automatic library rescans (`0` = only at start and on "Rescan") |
| `COOKIE_SECURE` | – | `1` marks the login cookie `Secure` (use it when you serve over HTTPS) |
| `SENPAI_URL` | – | Optional: base URL of a [Senpai](#whos-here-senpai-optional) story companion, e.g. `http://senpai-api:8780`. Unset = feature off |
| `SENPAI_TOKEN` | – | Service token for `SENPAI_URL` |
Serve it behind a reverse proxy with HTTPS if it is reachable from the internet. All pages use relative URLs, so a sub-path like `/manga/` works.
@@ -95,6 +97,17 @@ library/
- **Progress** is saved per user and chapter version: the last page, whether the chapter is done, and book-mode shifts. The manga page offers *Continue*. Tap a chapter's status to mark it read/unread.
- **Notifications:** press *Notify me* on a manga. When a rescan finds new chapter numbers, they show up under the bell. Optionally, the server also POSTs a short text to a webhook URL of your choice (e.g. an ntfy.sh or Gotify topic, set in Settings).
## Who's here (Senpai, optional)
With `SENPAI_URL` set, the reader's top bar gets a **Who's here** button (key `x`). It opens a side sheet with
*This page* / *This chapter* / *So far*: the characters on the visible page(s) (hover or tap outlines them on the
page), the cast of the chapter and of the series with their prominence, and a character card with the names known so
far, first appearance and a timeline whose links jump to the page. Everything is limited to what you have read: the
server forwards `GET /api/senpai/v1/…` to Senpai with your reading horizon in this manga (the furthest page of the
furthest chapter you have opened; paging back to re-read does not lower it). Options in the sheet: *Only up to this
page* (for re-reading) and *Show unconfirmed* (machine findings). Without `SENPAI_URL` nothing changes.
Running both together: Senpai's `docker-compose.circus.yml` and `docs/runbook.md`.
## Files
```