publish.list|enable|disable and share.link.create|list|revoke over the bound server, token only in the minted URL, read-only and unbound sessions refused. Built by MiniMax M3.1 Flash (OpenCode Zen free route); verified from a clean checkout of the staged files: notescraft-engine tests 729 pass, clippy -D warnings clean. Integration tests use a stub server speaking the server's JSON. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
4.6 KiB
Capture and publish: share targets, quick capture, web clipper, publish
Source: research (mobile-platform.md findings on Obsidian mobile quick capture and share targets; security-and-server.md adjacent features ranking: web clipper, email-to-note, voice transcription, publish, OCR, read-only links). All except the share target and quick capture need a server-readable (non-E2EE) vault.
Problem
Notes start outside the app: a link in a browser, text in another app, a voice thought, a photo of a page. Today the user must open NotesCraft, create a note and paste. On a phone that is the main reason notes never get written. Publishing a note as a web page needs a third-party service.
Goal
One action from anywhere puts content into the vault (inbox note, daily note or chosen folder), and a note or folder can be published read-only on the owner's own domain.
Non-Goals
Hosting for other people's domains, comments, analytics, a rich-text CMS, offline OCR on the device in v1.
Design (ranked by value over effort)
- Quick capture (P0, phone and desktop): a command
note.capture {text, title?, target?}and a global shortcut / phone sheet that appends to the daily note or createsInbox/<timestamp>.md; works with no vault window open on desktop through the control channel. - Share target (P0 phone): Android intent filter for
text/plainandimage/*, iOS share extension (native Swift, writes into the app group container, picked up on next launch); both callnote.capture; images land in the attachment folder with an embed. - Web clipper (P1): a bookmarklet-free approach:
POST /v1/vaults/{v}/capture {url?, title, markdown, source}on the sync server (device token) so a browser extension, a shortcut orcurlcan drop a clipped page; the server stores it asClips/<title>.mdwith frontmatter (source,clipped), and file sync delivers it. The extension itself is out of scope (a documented API). - Email to note (P1): an inbound webhook on the homelab (n8n exists) calls the same capture endpoint.
- Voice memo (P1): record on the phone, save
.m4ainto attachments with an embed note; transcription runs on the homelab (whisper-class model, server-readable vaults only) and appends the transcript; shows "transcribing..." state. - Publish (P1):
publish.enable {folder|note}marks content public; the server renders Markdown to static HTML (reusingcrates/markdown, no new parser) underhttps://<host>/p/<vault slug>/<path>behind Traefik, with theme, backlinks off by default; unpublish deletes. Read-only share links with an expiry token are the same renderer behind a secret path. - OCR (P2): a server job turns an image attachment into text appended under the embed.
Acceptance Criteria
- Given text shared from another phone app, then within 5 seconds a note exists in
Inbox/with the text and a creation date, even if the app was closed (picked up on next start for iOS). - Given
curl -H "Authorization: Bearer <token>" -d '{"title":"T","markdown":"# x","url":"https://e.x"}' .../capture, thenClips/T.mdappears on every paired device withsource: https://e.x. - Given a published folder, then an anonymous GET of a note page returns HTML with no script, the vault's other notes are not reachable, and unpublishing returns 404 within a minute.
- Given an expired share link, then 404.
Open Questions
- Which transcription model on the homelab (the cluster has GPU workloads; needs a capacity check per
HOMELAB_OPERATIONS.md)? - Subdomain per user for publish, or one host with slugs? Recommended: one host, slugs.
Tasks
- Engine:
note.capturecommand, inbox rules, tests. Done 2026-10-20 by the orchestrator (MiniMax and GLM were both out of quota):crates/engine/src/capture/, 5 rule tests and 9 command tests (daily append, heading block, inbox numbering, folder target, attachment, size limits, read-only, open buffer with undo, hostile params). - Server:
/captureendpoint with size caps and audit; docs for a clipper. - Phone: share target spike (Android intent first).
- Server: static renderer and
/p/...and/s/...routes, share links, rate limits (done 2026-10-20 by MiniMax M3.1 Flash via the harness:src/publish/, raw HTML escaped, strict CSP,publish: falsehonoured; verified). Engine commandspublish.list|enable|disableandshare.link.create|list|revokedone 2026-10-20 by MiniMax M3.1 Flash (OpenCode Zen free route; tests use a stub server because the engine does not depend on the server crate). Publish UI is open. - Voice memo and transcription job (after a capacity decision).