Files
captoys/diigo-cache/doc
dckcandClaude Opus 5.5 992e871c56 feat(diigo-cache): refresh each cache every 3 hours
workerd has no cron triggers, but it runs Durable Object alarms, and
the cache DOs already hold their wiring to the webapp: a refresh
scheduled from inside the DO needs no credential outside it (a systemd
timer would need a cache id to call /api with).

A fill that ends (done or failed) sets an alarm 3 hours out; it starts
a fill that refetches every page through the deepest one holding an
item updated in the last 2 days (page 1 at least, where new bookmarks
land). Refetching overwrites pages in place rather than dropping them
first, so a refresh that fails leaves the cache as it was. stopFill now
also stops a finished job's refreshes.

FillStatus gains refetchThrough (optional; additive). Caches whose fill
ended before this get their first refresh alarm when they next wake.

The service starts at boot as well as on the socket: alarms fire only
while workerd runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 23:31:48 -05:00
..

Operating diigo-cache on bldbox

diigo-cache and webapp run together in one workerd on bldbox, reachable only over the tailnet at https://bldbox.tail09e44.ts.net/. Cloudflare doesn't work: diigo binds the session cookie to the IP address it was issued to, and Cloudflare's egress IPs aren't that address (see open issue 1).

browser on the tailnet
  → tailscale serve (HTTPS, bldbox.tail09e44.ts.net:443)
  → diigo-cache.socket (127.0.0.1:8790)
  → diigo-cache.service: workerd, DynamicUser
      diigo-cache worker  → state in /var/lib/diigo-cache/cache
      webapp worker       → state in /var/lib/diigo-cache/webapp (holds the cookie)
                          → diigo.com

The build is the flake: wrangler bundles each worker as wrangler deploy would, gen-config.sh fills the workerd config, and the socket and service units ship in the package. workerd comes from nixpkgs' wrangler, which bundles a patched one; nixpkgs has no standalone workerd.