Skip to content

About

A client for the Koofr cloud storage API: mounts, files, search, public links, receivers and the trash

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

@deckyard/koofr

test Documentation release

A client for the Koofr cloud storage API, for Jennifer programs: the account and its mounts, files and folders (list, recursive list, download, upload with overwrite conditions, rename, copy and move across mounts), search, public links, receivers (upload links) and the trash. call reaches any other endpoint. Other providers running the same API work with their own base URL.

Plain file sync can use the interpreter's webdav module against https://app.koofr.net/dav/Koofr with the same app password; this deck covers what WebDAV cannot.

Documentation

Install

jvc add @deckyard/koofr

This vendors the deck to vendor/deckyard/koofr/. Without jvc, unpack the src/ subtree of a release archive (deckyard-koofr-<version>.tar.gz) there.

Usage

use fs;
use io;
use os;

import "@deckyard/koofr/" as koofr;

def c as koofr.Client init koofr.client(koofr.DEFAULT_URL);
$c = koofr.withAppPassword($c, "me@example.com", os.getEnv("KOOFR_PASSWORD"));
def m as koofr.Mount init koofr.primaryMount($c);

koofr.mkdirAll($c, $m.id, "/backups/2026");
def opts as koofr.PutOptions;
$opts.overwrite = true;
koofr.put($c, $m.id, "/backups/2026/db.sql", fs.readBytes("db.sql"), $opts);
io.printf("%s\n", koofr.createLink($c, $m.id, "/backups/2026/db.sql").shortUrl);

Download and upload a file, no WebDAV needed:

def data as bytes init koofr.get($c, $m.id, "/backups/2026/db.sql", 0);
fs.writeBytes("db-copy.sql", $data);
def keep as koofr.PutOptions;
koofr.put($c, $m.id, "/backups/2026/notes.txt", fs.readBytes("notes.txt"), $keep);

get caps the body at DOWNLOAD_LIMIT (64 MiB) for maxBytes 0. put with the zero PutOptions refuses a taken name (HTTP 409); overwrite replaces the file, autorename stores it as notes (1).txt. The returned File has the name it got.

Requirements

Jennifer 0.26.0 or newer, the default jennifer binary (not jennifer-tiny), and the net capability. Uploads and downloads are held in memory: the interpreter's http module does not stream yet.

Development

tools/check-all.sh                   # the full gate, as CI runs it
jennifer test src/koofr_test.j       # the test overlay
tools/check-docs.sh                  # docs against the code
tools/pack.sh dist                   # build the release archive

Licence

LGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <mplx@jennifer-lang.dev>.

tools/check-headers.sh checks every source file's SPDX header against deck.toml.

About

A client for the Koofr cloud storage API: mounts, files, search, public links, receivers and the trash

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors