Papyra 將筆記存為 Markdown,移除容器後仍可讀取
A Note App You Can Delete
Rahul Anand 介紹自託管筆記應用 Papyra,其筆記以 Markdown 檔案保存,停止容器並移除映像後仍可由 Obsidian、VS Code 或 grep 開啟。
Every notes app has an export button. Few have a good answer to the real question: what's left when I stop using you? Usually it's a zip of HTML with the styling stripped. That's not "you can leave". That's a weekend.
So before any feature, Papyra got one rule: uninstalling it must leave you with what you'd have had anyway. That rule decides the whole architecture.
The files are the truth
Every note is a Markdown file with a small YAML header:
There is a SQLite database and a search index. Both are caches. The test of "cache" is whether you can throw it away, so there's an endpoint that does exactly that:

Throw the index away, ask for it back, lose nothing.
Before adding any column I ask: if I delete this table, can I rebuild it from the files? If not, it belongs in the file, or it's UI state that's allowed to get lost.
What "delete it" looks like
Stop the container. Remove the image. You have this:
Obsidian opens it. VS Code opens it. grep reads it. Pictures sit next to it in media/, linked the way Obsidian links them.
What you lose is presentation and plumbing, never a sentence you wrote:
One honest exception: locked notes are encrypted on disk. That's the point of locking them.
So for locked notes the exit has one extra step: unlock your vault and use Export, which writes them out as plain Markdown in their own folder.
What it buys
Other tools can write to your notes, and Papyra keeps up:
What it costs
One deserves a closer look: catching up after downtime. The server was off; Syncthing wasn't. Notes arrived, changed, vanished. So at startup Papyra compares every file to its cache before it opens the port. Here's that, done for real:
When it runs is the interesting part:
ASP.NET Core's BackgroundService would run it while the port opens, so the first search could see stale results. Doing the work in IHostedService.StartAsync makes the host wait for it. Startup is slower; the first request is right.
And the log line says what it did. After an ordinary upgrade it reads 0 (re)indexed, 0 pruned, and you know nothing moved underneath you.
Was it worth it?
For notes, yes. Notes are small and independent, there's no cross-note rule worth a transaction, and what people fear is the ten-year risk. Plain files have the best ten-year record of any format.
If your data has foreign keys that must hold, or many writers that must merge, use a database. Files won't thank you.
The app should have to earn the next day. Not trap you into it.
I'm Rahul. I vibe-coded Papyra: what would have taken me a year or more to build by hand took a few months. It's GPLv3 and self-hosted: one Docker container, your notes as plain Markdown files.
來源:DEV Community · dev.to








