@activefs/mount
v0.1.1
Published
WebDAV server and rclone mount lifecycle helpers for ActiveFS.
Maintainers
Readme
@activefs/mount
Install @activefs/mount when host code needs the WebDAV server or rclone mount
lifecycle helpers directly. End users normally use the activefs CLI to create
an OS-visible folder.
The package requires Node.js 22 or newer. Creating a real OS mount also requires rclone and a host backend such as macFUSE, FUSE, or WinFsp.
Install
npm install @activefs/mount @activefs/coreStart the WebDAV adapter
This example starts a loopback WebDAV server over a small ActiveFS tree, prints its URL, and closes it:
import { createActiveFS, fsTree, text } from "@activefs/core";
import { startWebDAVServer } from "@activefs/mount";
const tree = fsTree({
"/hello.txt": text("hello through WebDAV\n")
});
const activefs = createActiveFS().mount("/", tree);
const server = await startWebDAVServer({
filesystem: activefs,
rootPath: "/"
});
try {
console.log(server.url);
} finally {
await server.close();
}Output uses an available loopback port:
http://127.0.0.1:<port>/The helper generates local WebDAV credentials by default. Those credentials protect the adapter endpoint; they are not Source API identity. The tree or source still makes final access and mutation decisions.
Clients that omit the generated credentials receive 401 Unauthorized. These
HTTP Basic credentials protect only the WebDAV adapter; they do not configure
upstream Source API or MCP authentication. Basic authentication does not
encrypt the connection, so keep the adapter on loopback or place any
non-loopback endpoint behind TLS.
The equivalent foreground CLI option accepts explicit credentials:
activefs server start repo --auth alice:local-onlyThat option is not enabled by default for the foreground CLI server. Because the password may appear in shell history or process listings, avoid using a long-lived secret on the command line.
Starting the WebDAV adapter does not create an OS mount. Use the CLI mounted folder workflow when rclone should attach it to a visible path.
