Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55742ded11 |
@@ -314,8 +314,8 @@ refused, because both files would land on it.
|
||||
#### `quak get-thumb <fileID> [--out <path>]`
|
||||
|
||||
Downloads and decrypts one file's thumbnail, the small JPEG Ente shows in a
|
||||
grid. It works as `get` does. Without `--out`, the name is `thumb_` followed by
|
||||
the title.
|
||||
grid. It writes one file, also for a live photo. Without `--out`, the name is
|
||||
`thumb_` followed by the title. In all else it works as `get` does.
|
||||
|
||||
#### `quak backup <dir> [--json] [--verify]`
|
||||
|
||||
@@ -362,7 +362,8 @@ Writes the metadata quak keeps about the account, its collections and its files
|
||||
as JSON files under `<dir>`. The layout is described under "The metadata dump
|
||||
directory". Photo content is not written. With `--exif`, or its alias `--all`,
|
||||
the command also fetches each file's original and records the image's own
|
||||
metadata from it (see "The metadata dump directory").
|
||||
metadata from it (see "The metadata dump directory"). Each original it fetches
|
||||
stays in the cache.
|
||||
|
||||
Ente's apps compute machine-learning data for each photo, such as the faces in
|
||||
it (see "The JSON beside each original"). The command fetches it in requests of
|
||||
@@ -377,9 +378,9 @@ word, and does not change the exit status.
|
||||
|
||||
#### `quak helper list-missing-thumbnails [--json]`
|
||||
|
||||
Finds the files whose thumbnail is missing on the server. It downloads every
|
||||
thumbnail in the account, one collection at a time, newest collection first, so
|
||||
on a large account it takes a while. A thumbnail counts as missing when the
|
||||
Finds the files whose thumbnail is missing on the server. It downloads the
|
||||
thumbnail of every file you own, one collection at a time, newest updated first,
|
||||
so on a large account it takes a while. A thumbnail counts as missing when the
|
||||
server answers with an empty body or with HTTP 404. Any other failure is logged
|
||||
as `[<collection>] Could not check <title>: <reason> (not reported as missing)`,
|
||||
and the file is left out of the list. The command exits 0 even when some files
|
||||
@@ -477,16 +478,16 @@ before any request is sent. The command logs `Invalid file ID: <arg>` or
|
||||
|
||||
### What quak prints
|
||||
|
||||
stdout holds only a command's output: the listing, the JSON, or nothing. The
|
||||
prompts of `login` go to stdout too. Every other line goes to stderr as a log
|
||||
line at one of six levels. From the quietest, the levels are fatal, error,
|
||||
warning, info, debug and trace. A run prints the lines at its own level and at
|
||||
every quieter one. The level is info unless `-v`, `-vv` or `-q` says otherwise.
|
||||
stdout holds a command's output, such as the listing or the JSON, and the
|
||||
prompts of `login`. Every other line goes to stderr as a log line at one of six
|
||||
levels. From the quietest, the levels are fatal, error, warning, info, debug and
|
||||
trace. A run prints the lines at its own level and at every quieter one. The
|
||||
level is info unless `-v`, `-vv` or `-q` says otherwise.
|
||||
|
||||
The one exception is a command line quak cannot parse, such as a missing
|
||||
argument, an unknown option or `-q` with `-v`. quak refuses it with one
|
||||
`error: …` line that is not a log line, and exits 1. `-q` does not hide that
|
||||
line. `quak` with no command prints the usage on stderr and exits 1.
|
||||
Two things on stderr are not log lines. A command line quak cannot parse, such
|
||||
as a missing argument, an unknown option or `-q` with `-v`, is refused with an
|
||||
`error: …` message, and quak exits 1. `-q` does not hide the message. `quak`
|
||||
with no command prints the usage on stderr and exits 1.
|
||||
|
||||
`yarn quak` prints yarn's own lines on stdout as well. To pipe a command's
|
||||
output, run `yarn --silent quak files --json` or
|
||||
@@ -783,10 +784,11 @@ goes away.
|
||||
Each run removes every symlink in a collection's directory that points into the
|
||||
date folders and is not one of its current links, yours included. A file or
|
||||
symlink of yours at the name of one of its links is replaced by the link. A
|
||||
directory at that name stays, and the file goes into `failures.json`. Anything
|
||||
else you put under `collections/` stays. A run removes the directory and JSON of
|
||||
a collection that was deleted or renamed, once the directory holds nothing else.
|
||||
One that still holds something of yours stays, with its JSON.
|
||||
directory of yours at that name stays, and the photo whose link it blocks goes
|
||||
into `failures.json`. Anything else you put under `collections/` stays. A run
|
||||
removes the directory and JSON of a collection that was deleted or renamed, once
|
||||
the directory holds nothing else. One that still holds something of yours stays,
|
||||
with its JSON.
|
||||
|
||||
A collection whose directory or JSON cannot be written does not stop the run.
|
||||
For example, a file you put there may already have the directory's name. The run
|
||||
@@ -831,7 +833,7 @@ Each entry holds:
|
||||
|
||||
- `fileID` and `title`;
|
||||
- `classification`: the kind of failure;
|
||||
- `attempts`: how many runs have tried the file;
|
||||
- `attempts`: how many runs in a row have failed the file;
|
||||
- `lastTriedAt`: when it was last tried, as a Unix time in milliseconds;
|
||||
- `error`: the error, as quak printed it.
|
||||
|
||||
@@ -1183,11 +1185,11 @@ progress of that one file.
|
||||
keyed by tag name, each as exifreader decodes it with its `id`, `value`,
|
||||
`description` and `computed` value. For example, `Make` is
|
||||
`{ id: 271, value: ["Example"], description: "Example", computed: "Example" }`.
|
||||
A tag exifreader has no name for is keyed `undefined-<tag number>`. The tags
|
||||
of the thumbnail embedded in the file are under `Thumbnail`, so they cannot
|
||||
hide the main image's tags of the same name. The thumbnail image itself is
|
||||
left out. Any file exifreader cannot read gives `{}`, and a video gives `{}`
|
||||
without being downloaded.
|
||||
A tag that exifreader has no name for is keyed `undefined-<tag number>`. The
|
||||
tags of the thumbnail embedded in the file are under `Thumbnail`, so they
|
||||
cannot hide the main image's tags of the same name. The thumbnail image itself
|
||||
is left out. Any file exifreader cannot read gives `{}`, and a video gives
|
||||
`{}` without being downloaded.
|
||||
- `await photo.make(opts?)` returns one common EXIF field, picked from the tags
|
||||
`exif()` returns and typed as in `PhotoExif`, or `undefined` when the file
|
||||
lacks it. These methods do the same for their fields:
|
||||
@@ -1307,8 +1309,9 @@ Only the requests named above go through the pools. A refresh,
|
||||
with
|
||||
`new RequestPools({ metadataConcurrency, contentConcurrency, thumbnailConcurrency })`
|
||||
and pass it as `pools`. Each pool serves on-demand work ahead of background
|
||||
work. A task submitted under a key that is still pending is not run a second
|
||||
time. An idle pool never lends its slots to a busy one.
|
||||
work. Two tasks given to `BoundedPool.run()` with the same `key` run once while
|
||||
the first is pending, and both get its result. An idle pool never lends its
|
||||
slots to a busy one.
|
||||
|
||||
`lib.backup()` works on as many originals at once as the content pool allows, 5
|
||||
by default. `quak backup` uses the default. The limit covers everything it does
|
||||
@@ -1402,13 +1405,13 @@ that rule although they look like connect-time failures. On Linux they are also
|
||||
delivered on an established socket, after the request may have been written.
|
||||
They stay retryable for requests that change nothing. Bun's `ConnectionRefused`
|
||||
and `FailedToOpenSocket` are treated the same way: a request that changes
|
||||
nothing is retried on them, and a `POST` or `PUT` is not replayed on them. When
|
||||
a connection bun kept open from an earlier request closes before any answer, bun
|
||||
sends the request again on a new connection. If that one fails, bun gives one of
|
||||
these codes although the server may already have the request. The upload of a
|
||||
thumbnail to its presigned URL is exempt from the rule. It stores one whole
|
||||
object at one key in one request, so replaying it has no partial state to
|
||||
damage.
|
||||
nothing is retried on them, and a `POST` or `PUT` is not replayed on them. Bun
|
||||
reuses a connection it kept open from an earlier request. When that connection
|
||||
closes before any answer, bun sends the request again on a new one. If that one
|
||||
fails, bun gives one of these codes although the server may already have the
|
||||
request. The upload of a thumbnail to its presigned URL is exempt from the rule.
|
||||
It stores one whole object at one key in one request, so replaying it has no
|
||||
partial state to damage.
|
||||
|
||||
A download is retried as a whole: the request, the reading of the body and the
|
||||
decryption. A socket reset after the response headers have arrived surfaces in
|
||||
@@ -1446,11 +1449,11 @@ working client from that snapshot without logging in again. It checks every
|
||||
field and each key's length first, and throws an error naming the bad field.
|
||||
|
||||
`Client.fromJSON` works only once libsodium, the cryptography library quak uses,
|
||||
is loaded. Only `Client.login` loads it. A program that restores a session in a
|
||||
new process first runs `await sodium.ready`, with `sodium` imported from
|
||||
`libsodium-wrappers-sumo`, which quak depends on. The exported `beginLogin`,
|
||||
`unwrapAuth`, `decryptCollection`, `decryptFile`, `downloadFile` and
|
||||
`downloadThumbnail` need the same.
|
||||
is loaded. `Client.login` loads it, and `Client.fromJSON` does not. A program
|
||||
that restores a session in a new process first runs `await sodium.ready`, with
|
||||
`sodium` imported from `libsodium-wrappers-sumo`, which quak depends on. The
|
||||
exported `beginLogin`, `unwrapAuth`, `decryptCollection`, `decryptFile`,
|
||||
`downloadFile` and `downloadThumbnail` need the same.
|
||||
|
||||
`client.logout()` clears the token and zeroes the key buffers in place. After
|
||||
it, every other method on that client throws. It does not contact the server, so
|
||||
@@ -1907,7 +1910,9 @@ These apply to people and to coding agents alike.
|
||||
- Not pinned:
|
||||
- bun, which `make build-bin` takes from `nix-shell -p bun`;
|
||||
- `make` and `git`, which `script/bootstrap` installs from the system
|
||||
package manager when they are missing, as every `Dockerfile` stage does.
|
||||
package manager when they are missing, as every `Dockerfile` stage does;
|
||||
- `bash` and `curl`, which `script/bootstrap` installs the same way when it
|
||||
has to install Node.
|
||||
- Follow the workflow above: branches off `next`, tests first and committed
|
||||
failing, and `next` merged into `main` by sneak alone.
|
||||
- Before every commit, `make lint` and `make fmt-check` must pass. `make lint`
|
||||
|
||||
Reference in New Issue
Block a user