The server knows who is writing
On your own machine, folio serve writes each comment as your git user name. On a machine others reach, the server cannot ask git: many people use it. It reads their name from the sign-in in front of it instead. Put the server behind a proxy that signs people in, and name the request header that proxy sets in folio.yaml:
comments:
identity_header: X-Forwarded-User
Ask your agent to set it; the configure skill changes the charter. Then start the server on an outside address: folio serve --host 0.0.0.0. Without the header in the charter, or on a request that lacks it, the panel shows the comments read-only and says why. A comment is never taken from someone the server cannot name.
| Served as | A comment is from | Comments |
|---|---|---|
folio serve on your machine | your git user name | taken and committed |
folio serve --host 0.0.0.0, header in the charter | the name the proxy's header carries | taken on a request that carries the header |
folio serve --host 0.0.0.0, no header in the charter | nobody the server can name | read-only; the panel says why |
folio export, a static site | no server to ask | none: no button, no comment files |
You run folio serve --host 0.0.0.0 and forgot the charter setting. What happens when a reader comments?
Each comment is a commit
Every new thread and every reply becomes one commit on the current branch. It holds only that page's comment file, its message is "Comment on" and the document's id, and its author is the commenter. Your own work in progress stays untouched, even what you have staged.
On a deployed server, add --push. The server then pulls before it writes and pushes after it commits, so your copy of the library sees the comments with a plain git pull. Step through one comment.
-
Step 1 · The reader sends a comment
A signed-in reader selects a passage and asks. The request reaches the server with the proxy's header naming them.
-
Step 2 · The server pulls first
Started with
--push, the server pulls from the remote, with rebase, before it writes anything. It writes on top of the latest comments, never beside them. -
Step 3 · It writes the comment file
The thread goes into the page's comment file, beside the document. The page itself is not touched.
-
Step 4 · It commits that file alone
One commit on the current branch, holding only that comment file, with the message "Comment on" and the document's id, authored as the reader. Anything else in the repository, staged or not, stays out of it.
-
Step 5 · It pushes
The commit goes to the remote, where every copy of the library can fetch it.
-
Step 6 · Your copy pulls it
In your own checkout, a plain
git pullbrings the comment in. Your agent can then go through it like any other.
Pull and push succeed
The comment is on the remote, authored as the reader, in a commit of its own.
The pull conflicts, or the push fails
The server undoes its write, refuses the comment and shows the reader the error. The reader can send it again; nothing is half saved.
The remote rejects a push while a reader comments. Where is the comment?
An exported site takes no comments
folio export writes plain files, with no server behind them. It leaves the comment files out, hides the Comments button and the Review page, and each page's panel says that comments are open where the library is served with folio serve. Publish the export for readers; serve the library for the people who review it.
Served, for reviewers
folio serve: the Comments button on every page, the threads beside each document, the Review page, and each comment committed as its writer.
Exported, for readers
folio export: the same pages, the same shell, no comment files, no button, no Review page, and a line in the panel pointing to where comments are open.
A reader of your exported site wants to ask about a passage. Where do they go?
folio serve, signed in. The exported site shows no comments and takes none.