Skip to content

Cairn 0.1.30

Choose a tag to compare

@stepankandrushin stepankandrushin released this 17 Nov 11:52
· 12 commits to main since this release

The server takes, ahead of the clients, what they will ask of it: passwords for the web and devices paired by a code, each user's own tokens, thumbnails, a file changed in one request, resumable uploads as the phones' systems speak them, and each folder's retention with a collection that never removes what a kept revision or an acknowledged commit names. Each is named in the server's features, so later clients ask first and work with this server and older ones alike.

This is early software. Keep another copy of anything you put through it.

Linux (static), the client on each device, cairn-0.1.30-linux-x86_64 or, on ARM64, cairn-0.1.30-linux-aarch64, and the server, x86_64, on one machine:

sha256sum -c --ignore-missing cairn-0.1.30.sha256
install -D -m 755 cairn-0.1.30-linux-x86_64 ~/.local/bin/cairn       # ARM64: cairn-0.1.30-linux-aarch64
sudo install -m 755 cairn-0.1.30-linux-x86_64-server /usr/local/bin/cairn-server

macOS: unpack cairn-0.1.30-macos-universal.app.tar.gz (Cairn.app) and cairn-0.1.30-macos-universal-tray.app.tar.gz (Cairn Tray.app) into ~/Applications; README.md has the launchd agent for Cairn.app. Windows: put cairn-0.1.30-windows-x86_64.exe and cairn-0.1.30-windows-x86_64-tray.exe in a folder of their own as cairn.exe and cairn-tray.exe. cairn-0.1.30.sha256 is every file's SHA-256, and update.json the signed list of this release's files that every installed copy checks.

Android 11 and later: open cairn-0.1.30-android.apk on the phone, and install it over the app to update it; the app's manual shows each step. It does not update itself. Every APK of the app is signed by the same key, its certificate's SHA-256 dc981e26f3084defacb05268103e31ba30eb7cd6c01734ae9f19742f56009006, which apksigner verify --print-certs cairn-0.1.30-android.apk shows; Android installs an update only when that key signed it.

Every file is at https://cairn.storage/download/0.1.30.html and in GitHub's release v0.1.30, each with its SHA-256.

The server has changed in this release: upgrade it before the clients.

Changes in 0.1.30

Added:

  • The server names what it does beyond what every server of the protocol does in features in /info and
    /v1/me so a newer client asks first and does without what an older server lacks, with no upgrade of the
    server first.
  • A web item carries its file's manifest hash, the one a client makes of the same bytes, so a phone after a
    reinstall skips what it sent before without sending it again.
  • Each user lists, makes, relabels and takes back their own tokens through /v1/tokens and /v1/me names
    the token a request came with, so a lost phone is signed out from any of the user's devices. Each token has
    a kind, device browser or paired and the hour it was last used, which cairn-server token list shows.
  • Pairing: a signed-in device or the web asks POST /v1/pair for a code, with its link and QR code, and a
    new device trades it at POST /v1/pair/claim for a token of its own, within ten minutes and once.
  • Passwords for the web: cairn-server user password sets one, a user changes their own at PUT /v1/me/password and a sign-in by one makes a token for that browser alone, which signing out takes back.
    A password changed signs out every browser it signed in.
  • PUT /file changes a file already there given base the revision the client saw, keeping everything of it
    but its mtime; changed since by another, the bytes go beside it as a conflict copy, never in its place, and
    a file deleted since comes back where it was. So a phone's Files app can change files in one request.
  • Thumbnails at GET B/thumb/{object} made on the first ask from JPEG, PNG, WebP and GIF, turned as their
    EXIF says, and kept; for HEIC and video a client sends its own, which every size is made from.
  • Resumable uploads: PUT /file speaks the IETF's resumable uploads draft in interop versions 3 5 and 6 as
    the phones' systems do, a 104 telling where an upload can go on from, so a large video cut off sends only
    what is left. The server answers on its own accept loop, which can send that 104.
  • The web interface signs in with a user's name and password beside a token, and says so where a server
    takes none. Its Settings set, change or remove the password, and list every device and browser signed in
    as the user, each renamed in place or signed out alone, this browser too; Add a device shows a pairing code
    and its QR code with the time it has left. A folder shows a thumbnail in place of each picture's and
    video's icon where there is one, loaded as it scrolls near, and a picture's preview shows the larger one
    while the file itself loads, a HEIC's in place of the file no browser shows.
  • Retention, each folder's own: cairn-server folder retention <folder> --keep or a manager at PUT /v1/ns/{ns}/retention sets a policy such as all 2d, hourly 1d, daily 30d, weekly forever; trash 30d and
    the server gives up what it does once a day, the content of each revision and nothing else of it, so a
    device away for any length of time still replays all it missed. With no policy, how every folder starts,
    everything is kept and nothing removed. What was given up answers so: a download or restore with Gone, a
    history entry with pruned an undelete past the trash period refused, and cairn export and cairn restore of a past state refuse, naming what is gone, unless given --skip-pruned which leaves it out and
    says so. A policy set again
    gives back what no collection took yet.
  • A collection inside the server, once a day, removes the chunks nothing kept names, those given up a delay
    ago, serve --gc-delay a week by default, and orphans older than the upload grace --upload-grace two
    days by default; cairn-server gc does it with the server stopped, and beside one says what it would do
    with --dry-run or what was done with --status No commit is ever acknowledged without its chunks: a
    commit holds its chunk directory's gate from its check to its commit and vouches for each chunk it looks at,
    and one-request uploads hold theirs until their commit returns. A backup holding data/backup.lock holds
    every removal back.

Changed:

  • cairn-server fsck only reads the chunk stores, so a backup's database checked against a live store's
    chunks changes nothing there, and counts what retention gave up apart from damage.

  • The server's database moves to schema 6 when a server opens it, in one transaction: room for users'
    passwords, each token's kind and last use, and each folder's retention and collections. cairn-server downgrade moves it back one schema each time it runs, and says what goes with it.

Fixed:

  • The server looks a commit's operation ID up before it checks the commit's chunks, so a commit it took whose
    answer was lost is answered as it was when it is sent again, even once its chunks are gone, as a collector
    may take them in between.