Open a WebDAV server as a folder in Memona
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Memona WebDAV plugin
|
||||
|
||||
Opens a WebDAV server as a folder inside Memona, so agents and the file
|
||||
manager work in it like any local directory. The plugin is a WASI component: it
|
||||
speaks no sockets of its own and makes every request through the host's HTTP
|
||||
interface, under the connection's permissions.
|
||||
|
||||
It registers one provider, `webdav`, for the `webdav` and `davs` schemes.
|
||||
|
||||
## Connecting
|
||||
|
||||
| Field | Meaning |
|
||||
| --- | --- |
|
||||
| Server address | The folder's address, for example `https://dav.example.com/files/` |
|
||||
| Username | Optional account name for HTTP basic authentication |
|
||||
| Password | Optional password, stored as a secret |
|
||||
|
||||
Listing, reading, writing, creating directories, renaming and deleting are
|
||||
supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any
|
||||
size moves without either side holding it whole. Conditional writes use
|
||||
`If-Match` and `If-None-Match`, which servers that return etags honour. Change
|
||||
polling and publishing are not supported, and a rename never replaces an
|
||||
existing target.
|
||||
|
||||
## Building
|
||||
|
||||
```sh
|
||||
rustup target add wasm32-wasip2
|
||||
cargo build --locked --release --target wasm32-wasip2
|
||||
```
|
||||
|
||||
The component lands at
|
||||
`target/wasm32-wasip2/release/memona_plugin_webdav.wasm`.
|
||||
|
||||
`wit/filesystem.wit` is a copy of the canonical Memona filesystem contract, and
|
||||
`src/sdk.rs` generates the guest bindings from it, so this repository builds
|
||||
without a Memona checkout. Refresh the copy from `plugin_system/sdk/wit` in the
|
||||
[Memona repository](https://git.capsulizers.com/lead/memona) when the contract
|
||||
moves, and keep `apiVersion` in `manifest.json` in step.
|
||||
|
||||
## Packaging for the plugin store
|
||||
|
||||
A `.memona-plugin` package is a ZIP archive with the files at its root, never
|
||||
inside a directory:
|
||||
|
||||
```sh
|
||||
cargo build --locked --release --target wasm32-wasip2
|
||||
cp target/wasm32-wasip2/release/memona_plugin_webdav.wasm plugin.wasm
|
||||
zip memona-plugin-webdav.memona-plugin \
|
||||
manifest.json plugin.wasm README.md LICENSE
|
||||
```
|
||||
|
||||
`manifest.json` and `plugin.wasm` are required; `README.md` becomes the guide on
|
||||
the plugin's public page and `LICENSE` is shown beside it.
|
||||
Reference in New Issue
Block a user