Message boards via e-mail, not Gemini

John Cowan cowan at ccil.org
Mon Jan 11 22:14:50 GMT 2021


On Sun, Jan 10, 2021 at 1:00 AM Rohan Kumar <seirdy at seirdy.one> wrote:


> This has been solved on the WWW through Webmentions. It should be
> possible to bring this to a Gemini site, though perhaps not using the
> Gemini protocol.
>

This is really a very nice design.  Here's my attempt to adapt it to Gemini:

1) Alice mentions Bob's post in a text/gemini document by posting her
response containing a link line to it.

2) Alice (or a tool that Alice uses) fetches Bob's post and scans it for a
link line whose text is (or contains) "Webmentions".  If there isn't one,
Alice can't proceed.  We'll call this the linkage URL.  It can be absolute
or relative but can't contain a fragment.

3) Otherwise, Alice takes the linkage URL and appends
"source=url1&target=url2" to it in the usual way.  That is, prefixed by "?"
if there is no query part already, or prefixed by & if there is.  Url1 is
Alice's post and url2 is Bob's post.  There is no need to %-escape either
of them.  Note that this use of parameters is specific to linkage servers.

4) Alice then makes a Gemini request to the extended linkage URL.  A 20
response means success, but Alice doesn't have to care what is returned
(perhaps an empty document or something human readable).  The server
referenced in the linkage URL, which we will call the linkage server,
queues up the request for offline processing.  This is important, as it
makes DDOSing more or less useless.

5) Alice can then do the same thing for all the other links in her post,
and then she doesn't have to worry about it any more.

6) At some future time, the linkage server referred to in Bob's post
dequeues a request:

6a) The server does some simple validation (url1 must be different from
url2, neither url must be "localhost", etc.) and makes sure that url2 is a
resource for which it is willing to accept requests.  If any of this fails,
the request is dropped.

6b) The server makes sure that it hasn't seen this request before (if so,
it drops it).

6c) The server fetches Alice's post at url1 to make sure it really does
contain a link line that points to url2.  If it gets an error other than
52, it can (but doesn't have to) queue up the request to try again.  A 52
GONE request means don't try again, as Alice has deleted the post.

7) Exactly what happens next depends on how the linkage server works.

7a) The linkage server may notify Bob by email saying "Your post <url2> has
been linked from a post at <url1>.

7b) If the linkage server has read/write access to Bob's post (through the
file system, for example, or via sftp), it may create a link line to
Alice's post using the first "#" header line in Alice's post as the link
text, and append that line to Bob's post under a header line saying "#
Responses".  This would leave a permanent record that anyone reading Bob's
post can see.

7c) Or the linkage server can do (as they say on Monty Python) something
completely different.

8)  If  Alice updates the post, she can repeat the process for any newly
added links.

9) More advanced client tools and linkage servers can cope with media types
other than text/gemini:

9a) If Bob's post is text/plain, it can be checked for a line saying
"Webmentions: " followed by an URL; if Alice's post is text/plain, its body
can be searched for url2.

9b) If Bob's post is text/html, it can be checked for a link or a element
whose rel attribute is "webmention"; if Alice's post is text/html, it can
be checked for a link, a, src, or video element whose href  or src
attribute is url2.

9c) Linkage servers can be smarter and handle schemes other than gemini,
such as http(s), in which case they should follow <
https://www.w3.org/TR/webmention/>, or gopher, or whatever.

A nice thing about this design is that Alice and Bob can do everything
pretty much by hand.  Alice has to be careful to construct the right URL,
but if she messes up, nothing very bad happens.  The linkage server is the
only part that has to be smart, and even then it is not all that smart.
Queueing up requests can be done by writing each one to a small file in a
directory, and they can be dequeued by reading a file from the directory
and unlinking it when it is processed.  Alternatively the Posix batch(1)
command can be used to run a command that processes one request.



John Cowan          http://vrici.lojban.org/~cowan        cowan at ccil.org
Andrew Watt on Microsoft:  Never in the field of human computing has so
much been paid by so many to so few! (pace Winston Churchill)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20210111/c9093f43/attachment-0001.htm>


More information about the Gemini mailing list