Sign Markdown saved to the folder with the configured ENS name and key (#2)

Co-authored-by: Danny Kim <temeddix@gmail.com>
Co-committed-by: Danny Kim <temeddix@gmail.com>
This commit was merged in pull request #2.
This commit is contained in:
Danny Kim
2026-09-25 17:02:52 +00:00
committed by temeddix
parent a4d1fae1d3
commit 5db8ed318a
6 changed files with 766 additions and 12 deletions
+18 -5
View File
@@ -1,11 +1,10 @@
# Memona signature plugin
Opens a WebDAV server as a folder inside Memona. It is the foundation for
signing Markdown files with an ENS name as they are saved, writing `signer` and
`signature` into each file's frontmatter so anyone can check who wrote it
against the name's current ENSv2 records, using the
Opens a WebDAV server as a folder inside Memona and signs every Markdown file
saved to it with an ENS name, writing `signer` and `signature` into the file's
frontmatter so anyone can check who wrote it against the name's current ENSv2
records. Signing comes from the
[md-ens-signature](https://github.com/capsulizers/md-ens-signature) library.
This version is the WebDAV folder alone; signing is not in it yet.
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.
@@ -18,6 +17,9 @@ It registers one provider, `signature`, for the `signed-webdav` scheme.
| 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 |
| Signer name | The ENS name that signs, for example `laptop.alice.eth` |
| Signing key | The private key of the address the name resolves to, stored as a secret |
| Sepolia RPC address | The endpoint used to check signers against ENS, by default `https://ethereum-sepolia-rpc.publicnode.com` |
Listing, reading, writing, creating directories, renaming and deleting behave
as in the WebDAV plugin: reads and writes stream in pieces of at most 1 MiB,
@@ -25,6 +27,17 @@ conditional writes use `If-Match` and `If-None-Match`, change polling is not
supported, a rename never replaces an existing target, and a folder with
contents is refused rather than removed whole.
## Signing
Saving a `.md` file holds it whole, up to 8 MiB, and writes it once finished,
with `signer` and `signature` set in its frontmatter; every other file streams
straight through. The signature is EIP-191 `personal_sign` over the signer name
and the body's SHA-256, made with the configured key; other frontmatter and the
body stay byte for byte. A key that is not 32 bytes of hex refuses the
connection, and a `.md` file that is not UTF-8 refuses the save. Reading passes
every file through unchanged. The RPC address is for verifying signers, which a
later version adds to reads.
## Building
```sh