feat(diigo-cache): production deployment with tailscale, systemd, and nix
diigo binds the session cookie to the IP it was issued to, so a Cloudflare deployment can't use a cookie minted in the browser. Run diigo-cache and webapp in one workerd on bldbox instead. The flake bundles each worker with wrangler's dry run, so the modules match what `wrangler deploy` ships, and generates the workerd config from the bundles. workerd comes from nixpkgs' wrangler, the only packaged one. A smoke check serves the home page and mints a webapp instance, which covers the WEBAPP binding and Durable Object storage. The service is a system unit with DynamicUser, so the webapp state holding the cookie isn't readable by processes running as the user. It listens on loopback behind tailscale serve: HTTPS, which PasswordCredential needs, at the tailnet name only. Operator docs in doc/; unsettled points recorded as IBIS issues. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9c3eaa9819
commit
857816166e
14 files changed
+580
-2
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# Operating diigo-cache on bldbox
|
||||
|
||||
diigo-cache and [webapp](../../webapp/README.md) 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](open-issues.md#-1-how-does-diigo-see-the-cookie-come-from-the-ip-it-was-issued-to)).
|
||||
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
- [Install, upgrade, roll back](install.md)
|
||||
- [Day to day: create a cache, logs, backups](operate.md)
|
||||
- [Open issues](open-issues.md), in IBIS style
|
||||
|
||||
The build is [the flake](../flake.nix): wrangler bundles each worker as `wrangler deploy` would, [gen-config.sh](../nix/gen-config.sh) fills [the workerd config](../nix/config.capnp.in), and the [socket](../nix/diigo-cache.socket) and [service](../nix/diigo-cache.service) units ship in the package. workerd comes from nixpkgs' `wrangler`, which bundles a patched one; nixpkgs has no standalone `workerd`.
|
||||
Reference in new issue
Block a user