eagle-viewer/readme.md

74 lines
2.2 KiB
Markdown
Raw Normal View History

# Eagle Viewer
A web app for browsing Eagle libraries stored on a Synology NAS, from any browser (Chromebook, iPhone, Linux included).
Built because Eagle only runs on Mac and Windows.
## How it works
- All NAS access via SSH — metadata and thumbnails
- Metadata and thumbnails cached to disk on first load (survives container restarts)
- In-memory cache warms up from disk on first request each session
## Features
2026-08-10 12:41:27 -06:00
- Lists all Eagle libraries on the NAS
- Dark grid UI with adjustable thumbnail size
- Folder tree sidebar
- Search by name or tag
- Lightbox on click
- "Open original" streams the file (mp4, png, pdf, etc.) via HTTP with range support
2026-08-10 12:41:27 -06:00
## Caching
2026-08-10 12:41:27 -06:00
| Layer | What's cached | Survives restart? |
|---|---|---|
| Disk (metadata) | Library item list, folders, tags | Yes |
| Disk (thumbnails) | Thumbnail images | Yes |
| In-memory | Metadata (hot path after disk cache warms) | No |
2026-08-10 12:41:27 -06:00
On first click, a library is fetched from the NAS over SSH and written to disk. Every subsequent click is served from disk — instant, even after a container restart.
2026-08-10 12:41:27 -06:00
## Refreshing a library
If you add new items to a library on the NAS, the disk cache will be stale. Force a refresh with:
```bash
curl -X POST http://100.88.231.3:3737/api/library/remote_photos/refresh
```
Replace `remote_photos` with the library name. This fetches fresh metadata from the NAS and updates the disk cache. Returns `{ ok: true, imageCount: N, ms: N }` when done.
## Running with Docker (recommended)
```bash
cd ~/docker
docker compose up -d eagle-viewer
```
The thumb cache is persisted at `~/docker/eagle-viewer/thumb-cache/`.
## Running manually (development)
```bash
npm install
2026-08-10 12:41:27 -06:00
node server.js
```
Requires `sshpass` installed (`sudo apt install sshpass`).
## Environment variables
| Variable | Default | Description |
|---|---|---|
| `SSH_HOST` | `synologynas.local` | NAS hostname or IP |
| `SSH_USER` | `steve` | SSH username |
| `SSH_PASS` | `cheong` | SSH password |
| `NAS_BASE` | `/volume1/steve/Eagle_Libraries` | Libraries root path on NAS |
| `CACHE_DIR` | `./.thumb-cache` | Disk cache directory |
| `PORT` | `3737` | HTTP port |
## Gitea
[http://zen.local:9000/steve/eagle-viewer](http://zen.local:9000/steve/eagle-viewer)