Two Ente servers' accounts with the same user ID share one cache directory #254

Closed
opened 2026-11-13 19:49:22 +01:00 by clawbot · 1 comment
Collaborator

quak keeps a local cache of each account's decrypted album and file lists, plus downloaded originals and thumbnails. Without --cache-dir, the cache directory is named by the account's user ID alone (~/.cache/quak/<userID>), and the check for "this cache belongs to another account" also compares the user ID alone.

An Ente server hands out user IDs from a database sequence, so two self-hosted servers give their first users the same ID. File IDs repeat across servers the same way.

Example: someone logs in to https://ente.example.com (user ID 1), runs quak files, then logs in to a second server at https://photos.example.org where they are also user ID 1. Both sessions use the same cache directory. The cache's refresh cursor, album list and cached originals come from the first server, so quak files lists the first server's albums, and quak get can serve another server's original for a matching file ID.

The library has this today for any program that sets apiOrigin. The command line reaches it once quak login --server lands (#253, for #243).

Proposed fix: name a self-hosted account's default cache directory by the server as well as the user ID, so each server's accounts get their own. Accounts on Ente's hosted service keep ~/.cache/quak/<userID>.

Model: opus-5-5

quak keeps a local cache of each account's decrypted album and file lists, plus downloaded originals and thumbnails. Without `--cache-dir`, the cache directory is named by the account's user ID alone (`~/.cache/quak/<userID>`), and the check for "this cache belongs to another account" also compares the user ID alone. An Ente server hands out user IDs from a database sequence, so two self-hosted servers give their first users the same ID. File IDs repeat across servers the same way. Example: someone logs in to `https://ente.example.com` (user ID 1), runs `quak files`, then logs in to a second server at `https://photos.example.org` where they are also user ID 1. Both sessions use the same cache directory. The cache's refresh cursor, album list and cached originals come from the first server, so `quak files` lists the first server's albums, and `quak get` can serve another server's original for a matching file ID. The library has this today for any program that sets `apiOrigin`. The command line reaches it once `quak login --server` lands (https://git.eeqj.de/sneak/quak/pulls/253, for https://git.eeqj.de/sneak/quak/issues/243). Proposed fix: name a self-hosted account's default cache directory by the server as well as the user ID, so each server's accounts get their own. Accounts on Ente's hosted service keep `~/.cache/quak/<userID>`. Model: opus-5-5
Author
Collaborator

Fixed in #253, as its review asked; that PR closes this issue when it merges.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/quak/pulls/253, as its review asked; that PR closes this issue when it merges. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/quak#254