Code: Storing data in the cloud: S3, WebDAV, Koofr and Seafile
Storing data in the cloud: the code
The programs behind the slides, for Jennifer 0.27.0. S3 and WebDAV use the bundled s3.j and webdav.j modules; Koofr and Seafile use the @deckyard/koofr and @deckyard/seafile decks listed in deck.toml, so run jvc install once in this folder to fill vendor/. Run everything from this folder after . ./env.sh, which sets the server URLs and the placeholder credentials below.
The servers, all on 127.0.0.1
- S3: MinIO (Bitnami image), buckets
backupsandmirror:docker run --rm -d --name academy-cloud-minio -p 127.0.0.1:19000:9000 -e MINIO_ROOT_USER=academy -e MINIO_ROOT_PASSWORD=academy-secret-123 -e MINIO_DEFAULT_BUCKETS=backups,mirror bitnamilegacy/minio:2025.7.23 - WebDAV: Apache httpd 2.4 with
mod_davon port 18081, useralice:webdav/start.sh(writeswebdav/htpasswd, then starts the container withwebdav/httpd.conf). - Seafile: Seafile 12 (
seafileltd/seafile-mc:12.0-latest, with MariaDB), set up with Seafile's Docker instructions and published on127.0.0.1:18082; the admin account isSEAFILE_USER/SEAFILE_PASSWORD. - Koofr: Koofr is hosted, so
koofrfake.jstands in for the few API endpoints the talk uses, in memory. It is not the real service.jennifer run koofrfake.j 18083 &(withFAKE_BUSY=2it answers the first two uploads with 429 andRetry-After: 1).
The programs
s3basics.j: put with metadata, list by prefix ("S3: keys, metadata and a listing"). Run:jennifer run s3basics.js3more.j: a missing key as a status, copy, and a presigned link fetched without credentials ("S3: errors are values, links are signed"). Run:jennifer run s3more.jmultipart.j: a multipart upload with a checked ETag per part, aborted on failure ("S3: a large file in parts", "What the bucket got"). Make a test file first:head -c 12582912 /dev/urandom > big.bin, thenjennifer run multipart.j big.bindav.j: mkcol, put, propfind, get ("WebDAV: HTTP verbs for a file tree"). Run:jennifer run dav.jdavmatch.j: write withIf-Matchso a concurrent change is not lost ("Never overwrite someone else's change"). Run:jennifer run davmatch.jprops.j: set and read a dead property in the owncloud namespace ("Nextcloud and ownCloud are WebDAV servers"). Needs/report.txton the server (put there bybackup.j docs). Run:jennifer run props.jdaverr.j: the WebDAV error struct and the statuses behind it ("Errors: one struct per backend", "The statuses you will meet"). Run:jennifer run daverr.jkoofr1.j: mounts, mkdir, put, list, a public link, a 409 on a second create ("Koofr: mounts, files and links"). Run:jennifer run koofr1.jkoofrretry.j:withRetriesagainst a busy server ("Retries: who does what"). Run the stand-in withFAKE_BUSY=2, thenjennifer run koofrretry.jsea.j: login, a library, mkdir with parents, put, a share link ("Seafile: libraries, files and links"). Run:jennifer run sea.jseaenc.j: an encrypted library, locked and unlocked ("Seafile: encrypted libraries"). NeedsVAULT_PASSWORD(set inenv.sh). Run:jennifer run seaenc.jlarge.j: the response size caps ofwebdav.jand the Seafile deck, kind"limit"("Large files and limits"). Needs a file bigger than 1 MiB, such asbig.binabove. Run:jennifer run large.j big.bincreds.j: the decks refuse credentials over plain http to a non-loopback host ("Credentials"). Run:jennifer run creds.jbackup.j: mirrors a folder to themirrorbucket and to WebDAV, sending only changed files, with a SHA-256 manifest ("Checksums: trust, but verify", "A backup job: mirror one folder to two backends", "Four runs, one outage").docs/is the sample folder. Run:jennifer run backup.j docs
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 3.7 KiB | raw |
| backup.j | 5.1 KiB | raw |
| creds.j | 1.1 KiB | raw |
| dav.j | 867 B | raw |
| daverr.j | 1.3 KiB | raw |
| davmatch.j | 959 B | raw |
| deck.toml | 281 B | raw |
| docs/2026/invoices/rent.txt | 5 B | raw |
| docs/report.txt | 17 B | raw |
| env.sh | 518 B | raw |
| koofr1.j | 993 B | raw |
| koofrfake.j | 6.3 KiB | raw |
| koofrretry.j | 1.0 KiB | raw |
| large.j | 992 B | raw |
| multipart.j | 1.5 KiB | raw |
| props.j | 552 B | raw |
| s3basics.j | 927 B | raw |
| s3more.j | 944 B | raw |
| sea.j | 988 B | raw |
| seaenc.j | 1.0 KiB | raw |
| webdav/httpd.conf | 20.6 KiB | raw |
| webdav/start.sh | 748 B | raw |