It still surprises me what some find difficult to do

There's been ongoing discussions in Gemini [1] about a webmention [2] like mechanism. So I was intrigued by this statement:

The problem here is, that this mechanism includes some script that adds some complexity to the maintenance of the gemini capsule. As bacardi55 writes:
> > I do know that asking capsule owners to deploy a script will be the biggest concern here, but I guess there is always a "price to pay" … Yes it will require a CGI (Common Gateway Interface) script, but it should be doable even with a small bash script to not add too much complexity in maintaining a capsule.
>
I agree that some kind of programming and scripting will be necessary to get notified. However I think that we can do it at least without a CGI-script. Here is the way I think I have found.

“Gemlog responses - bacardi55's concept without CGI [3]”

And he goes on to implement a scheme that adds complexity to the configuration of the server, plus the issues with scheduling a program to scan the logfiles for Gemini requests. I've done the logfile scanning for “Project: Wolowizard [4]” and “Project: Lumbergh [5]” and it was not any easy thing to set up. Okay, in my case, it was checking the logs in real time to see if messages got logged as part of testing, but that aside, checking the logs for requests might not be straightforward. In this case, it soulds like he has easy access to the log files—but that is not always the case. There have been plenty of systems I've come across where normal users just don't have access to the logs (and I find it annoying, but that's a rant for another time). Then there's scheduling a script to run at a regular schedule. In the past, this would be cron and the bizarre syntax it uses, but I'm not sure what the new hipster Linux systemd way is these days (which itself is a whole bag of worms).

And it's not like the CGI script has to be all difficult. Here's a script that should work (it's somewhat untested—I have the concept tested and running on my Gemini server, as an an extension [6] to my Gemini server [7] and the CGI script below is based upon that extension):

#!/usr/bin/env lua

query = os.getenv("QUERY_STRING")
if query == "" then
  io.stdout:write("10 URL to send\r\n")
else
  query = query:gsub("%%%x%x", -- decode URL encoded data
            function(c)
              return string.char(tonumber(c:sub(2),16))
            end)
  mail = io.popen("/usr/sbin/sendmail me") -- send email
  if mail then
    mail:write(string.fomrmat([[
From: <me> (replace with real email address)
To: <me>
Subject: Mention, sir!

%s
]],query)
  io.stdout:write("20 text/plain\r\nIt has been accepted.\r\n")
end

os.exit(0)

Yes, this relies upon the email recipient to check the URI (Uniform Resource Indicator) has the proper link, but it's simple and to the point. The only issue here is getting the Gemini server to run this script when /.well-known/mention is requested, and I feel that is easier than dealing with scanning logfiles and running cron jobs, but that's me.

As far as the actual proposal itself [8], I don't have much to comment about it, except to say I don't like the mandated text it uses in the link. I think just finding the link should be good enough. Even better in my mind would be two links, much like webmention uses, but that doesn't seem to be a popular opinion.

[1] https://gemini.circumlunar.space/

[2] https://www.w3.org/TR/webmention/

[3] gemini://gmi.derschwarzestrahler.at/en/gemlog/gemlog-responses.gmi

[4] /boston/2010/10/11.1

[5] /boston/2018/09/11.2

[6] gemini://gemini.conman.org/extensions/GLV-1/handlers/mention.lua

[7] https://github.com/spc476/GLV-1.12556

[8] https://codeberg.org/bacardi55/gemini-mentions-rfc

Discussions about this entry

The Gemini Mention amusing coincidence

Gemlog responses - 1st update (after response from Sean Conner)

Gemini Mention this post

Contact the author