Gemini

Gemini is a light-weight text protocol, a spiritual successor to Gopher. There’s more information to be found at the Projekt Gemini site and on the mailing list.

I wrote Soweli Lukin to read both Gopher and Gemini sites. Feel free to use it, too. If you’re an Emacs user, I have a Gemini+Write setup that allows me to edit pages via Gemini!

This site is available via Gemini!

The wiki raw text is transformed into Gemini format on a best-effort basis.

2020-07-04 Is Gemini from North Korea?

I was hanging out on the #gemini channel on irc.tilde.chat and people noticed that Hacker News was talking about Gemini, and this got posted in a thread about a toffelblog post, A look at the Gemini protocol: a brutally simple alternative to the web.

lukee: another juicy quote from HN to entertain you “In a way Gemini could have been published by writer of European Union, North Korea or Soviet Union laws, I can’t belive this is a US products, as it contains too much to liberty constrain 😉 “

There’s more in that Hacker News thread. I don’t know what to say. How do you respond to somebody who says that there is something in common between the European Union, North Korea, the Soviet Union, and the Gemini protocol? It’s a waste of time. So how about something different... How about imagining this being a good response! How could we rephrase it and have an interesting conversation?

How about translating it into “Why is minimalism a thing? Why does it have to be mandated? Minimalism in the web has meaning because you can do otherwise. Brutalism in architecture because you could be hiding it all. The decision to show that concrete only has meaning because you could be hiding it. To mandate minimalism is simply to mandate poverty. It has no meaning.”

So, let’s imagine that; let’s reply to this imagined intelligent challenge, and hope for a good conversation.

I think the first question would be: who does the choosing? In a world where we all use the web, some authors can choose to use minimalism in web design: little CSS, simple HTML, no Javascript, no content from other domains, a focus on documents instead of imagining the web as a generic interface to all applications. It’s possible to do. The choice lies with the web author.

The choice does not lie with the reader, though! The reader who tries to surf the web with text browsers such as w3m, lynx, or eww, or with very limited browsers such as dillo, soon runs into problems. Sometimes the text itself can be read, but interaction is difficult. Headers and footers are often terrible. The list of links at the top of pages is terribly long and messy. It’s hard to find the text of a tweet if you visit the URL on Twitter. There’s too much garbage on that page! It’s also hard to find the beginning of that README if you visit a project’s page on GitHub. So many links!

The choice also does not lie with developers, surprisingly. The developer who tries to create a different browser, the developer who tries to extend HTML, the developer who tries to extend Javascript, all developers on the web soon realise that everything is fucking huge. The code base for Firefox is huge. The code base for Chromium is huge. The number of web standards is huge. The Javascript APIs are huge. The number of open issues in the bug trackers is huge. The Mozilla Developer Network (MDN) wiki is huge. Even the processes one has to follow to propose new things are huge. The hoops one has to jump through to propose new Emojis for Unicode.

And how much weight there is to all these things. How much business, money, capital, investments, jobs. Unicode is going to be forever and ever as long as we use text, I think. All those stupid pictures of technology that we no longer use are going to stay with us for the next ten thousand years. It boggles the mind.

Therefore, individual developers effectively have no choice. The number of people and the amount of capital required to create a new fully-featured web browser is unimaginable.

That’s why people like @alcinnz working on the Odysseus browser have very specific opinions on what to implement and what to drop.

That is why Gemini matters. Gemini allows many developers to write clients and servers. It gives users back choice.

I’d love to read your take on it.

Here’s what I’ve found so far:

@solderpunk wrote Why not just use a subset of HTTP and HTML?

“… to create a clearly demarcated space where people can go to consume only that kind of content in only that kind of way, which is what I think we really want.”

Tags:

Add Comment

2020-07-02 An overview over my Gemini projects

A while ago I started writing lots of stuff for Gemini. Time for an overview, both for myself and for you, the hypothetical reader. 😀

I’m not going to link to the various blog posts where I’ve talked about the various projects before. If you want to find them, take a look at the Gemini tag.

Gemini Server is a server that serves an existing Oddmuse wiki via Gemini protocol. It also tries translate the wiki text from a typical Markdown + Wiki mess like the one I’m using on this wiki here into Gemini format. I think it works and you can look at it using your favourite Gemini Client. It’s at alexschroeder.ch:1965.

Gemini & Titan for Bash are two functions for bash. I use them all the time to debug stuff. The gemini function uses the Gemini protocol to fetch stuff from the Internet and dumps it. No formatting, header and all. The titan function uses the Titan protocol to write text and files to a Titan-enabled Gemini server, such as the ones I run.

Titan is where I’ve written down a few words on the protocol I use to upload files to my wiki. There hasn’t been much talk about the Titan protocol, partly because I felt pretty much alone in my interest for wikis. On the Gemini mailing list, people were talking about using SFTP or mail to upload or comment, or about how they disliked commenting, and so on. I figured I’ll just have to implement some stuff and then maybe other people might get interested, once it’s shown its utility, even if we then change small aspects of the protocol. If you want to talk about Titan, feel free to contact me, or comment or edit that Titan page. It’s also hosted on a wiki!

Community Wiki, where the Titan page is being hosted, is also reachable via Gemini and editable via Titan. The quality of the translation from wiki text to Gemini format isn’t all that great because it never switched to Markdown. It’s mostly Wiki Creole and a bunch of specific extensions. It’s available at communitywiki.org:1966.

Next, I wanted to see how to translate a dense hypertext like Wikipedia to the Gemini format and I wrote Gemini Wikipedia, a Wikipedia proxy strips most of the links in order to provide you with a nice reading experience; it also tries its best to translate tables to text (probably not a good way to read those tables if you’re blind, sadly). If you really want to, you can always get the HTML including all the links, and depending on your browser, it might work. It’s available at alexschroeder.ch:1967. I recommend starting with the Project Gemini page. It’s the page I used to check my code as I was developing it. 😀

Gemini Wiki, finally, is my wiki for everybody. It builds on the Gemini Server I used for this site. It uses a Gemini format internally. It allows you to add pages and files to the wiki directly. It even has a very simple, read-only web interface! It has “spaces” so you can host multiple wikis for different people. I’ve been using my installation to write about it. It’s at alexschroeder.ch:1968, and as I said, you can also access it via a web browser on the same port.

Oh, and if you’re an Emacs person, there’s more...

Gemini Write is an extension to Elpher, the Emacs Gopher and Gemini client, which allows you to edit pages right there, in Emacs. I also started working on a “multiple buffers” branch for Elpher. You can find it in The Lambda Lab’s git repository, via Gopher!

Ah, and before I forget: here’s a video of me editing Gemini Wiki, from Emacs! You might have to right-click the preview image and choose “Play” from the context menu. It depends on your browser and your settings, I guess.

So happy. 😀

Tags:

Add Comment

2020-06-29 Smolnet

@Shufei says:

There’s a nascent movement offing, I think. Retrotech started it, hacker culture and tech, natch, but it’s incorporating new stuff like Gemini. Textnet, “slow internet”, I call it smolnet. People are tired of the corporate behemoths and cacophony. Demimondes like SDF provide a respite from all that, and a forum for some resistance and development apart from the bloat and blather. There’s a demotic tinge to it all in the hacker tradition, but without necessitating 1337ness.

I like to see my Gemini Wiki in this light. Slow net, small net, yes! Gemini Wiki is a Perl script which also acts as a web server. No need for Apache or nginx if you don’t want to. I need to write more about this, I’m so excited.

The Gemini Wiki also serves its pages via HTTP and HTML, so regular web browsers can access it. That means, it can act as a gateway...

You can start the Gemini Wiki such that it serves the wiki on both the standard Gemini port (1965) and on the standard HTTPS port (443) – your users don’t even have to know about any of this.

I’m currently running it on this site:

And this is what it looks like, using Elpher, the Emacs Gopher and Gemini client:

Screenshot

And this is what it looks like, using eww, the “Emacs Web Wowser”, i.e. the Emacs web browser:

Image 2

Tags:

Comments on 2020-06-29 Smolnet

Gemini Wiki (Giki!) is right at the heart of smolnet!

We need reference and permeable media across the board. And Giki is ever so light and airy.

– Shufei 2020-06-29 19:51 UTC


😀

We’re at 1547 lines of code, comments and documentation, now...

– Alex Schroeder 2020-06-29 19:59 UTC

Add Comment

2020-06-27 Gemini Wiki

It’s done! A simple wiki, for a simple protocol: Gemini Wiki. Visit the demo wiki.

Written in about 1000 lines of Perl code. From the documentation:

This server serves a wiki as a Gemini site.

It does two things:

  • It’s a program that you run on a computer and other people connect to it using their client in order to read the pages on it.
  • It’s a wiki, which means that people can edit the pages without needing an account. All they need is a client that speaks both Gemini and Titan, and the password. The default password is “hello”. 😃

How do you edit a Gemini Wiki?

You need to use a Titan-enabled client.

Known clients:

What is Titan?

Titan is a companion protocol to Gemini: it allows clients to upload files to Gemini sites, if servers allow this. Gemini Wiki, you can edit the “raw” pages. That is, at the bottom of a page you’ll see a link to the “raw” page. If you follow it, you’ll see the page content as plain text. You can submit a changed version of this text to the same URL using Titan. There is more information for developers available on Community Wiki.

Tags:

Add Comment

2020-06-19 Wikipedia via Gemini

When is this Gemini posting finally going to stop‽ I don’t know.

I don’t know.

It’s easy to work with, and so it’s easy to write new software for it. And so, when I saw a post on the mailing list jokingly ask when Wikipedia was going to be available via Gemini, I sat down and wrote a little server that acts as a proxy. It asks for the language and page, it goes and looks at Wikipedia and returns with some plain text, which the server then translates into some form of Gemini response and returns to you.

Here’s an example page: Project Gemini on Wikipedia. If you’re interested in the source code, take a look at the source repository. It’s written in a few lines of Perl 5.

Peter Vernigorov also wrote a Gemini to Wikipedia proxy, which looks quite different from mine. Compare this rendering of the same page as above: Project Gemini on Wikipedia, again.

I think there’s something to be learned, here. Both of our attempts seem to illustrate that it’s hard to shoehorn a dense hypertext like Wikipedia back into a simple text with separate links for references.

Here’s what Peter’s code produces, for the Project Gemini page:

Gemini’s objective was the development of space travel techniques to support the Apollo mission to land astronauts on the Moon. In doing so, it allowed the United States to catch up and overcome the lead in human spaceflight capability the Soviet Union had obtained in the early years of the Space Race, by demonstrating: mission endurance up to just under fourteen days, longer than the eight days required for a round trip to the Moon; methods of performing extra-vehicular activity (EVA) without tiring; and the orbital maneuvers necessary to achieve rendezvous and docking with another spacecraft. This left Apollo free to pursue its prime mission without spending time developing these techniques.

→ NASA
→ human spaceflight
→ Mercury
→ Apollo
→ low Earth orbit
→ land astronauts on the Moon
→ human spaceflight
→ Soviet Union
→ Space Race
→ Moon
→ extra-vehicular activity
→ orbital maneuver
→ rendezvous
→ docking

All Gemini flights were launched from Launch Complex 19 (LC-19) at Cape Kennedy Air Force Station in Florida. Their launch vehicle was the Gemini–Titan II, a modified Intercontinental Ballistic Missile (ICBM). Gemini was the first program to use the newly built Mission Control Center at the Houston Manned Spacecraft Center for flight control.

→ Launch Complex 19
→ Cape Kennedy Air Force Station
→ launch vehicle
→ Titan II
→ Intercontinental Ballistic Missile
→ Mission Control Center
→ Manned Spacecraft Center
→ flight control

Having every paragraph followed by so many links makes it hard to read as a complete text. Now, many people don’t read an encyclopedia like that. You’re often looking for a particular section and so it makes sense to keep all the links with the text. But still...

In this respect, my copy does better:

Gemini’s objective was the development of space travel techniques to support the Apollo mission to land astronauts on the Moon. In doing so, it allowed the United States to catch up and overcome the lead in human spaceflight capability the Soviet Union had obtained in the early years of the Space Race, by demonstrating: mission endurance up to just under fourteen days, longer than the eight days required for a round trip to the Moon; methods of performing extra- vehicular activity (EVA) without tiring; and the orbital maneuvers necessary to achieve rendezvous and docking with another spacecraft. This left Apollo free to pursue its prime mission without spending time developing these techniques.

All Gemini flights were launched from Launch Complex 19 (LC-19) at Cape Kennedy Air Force Station in Florida. Their launch vehicle was the Gemini–Titan II, a modified Intercontinental Ballistic Missile (ICBM).The only Gemini spacecraft not launched by a Titan II was the reflight of Gemini 2 for a Manned Orbiting Laboratory test in 1966, which used a Titan IIIC Gemini was the first program to use the newly built Mission Control Center at the Houston Manned Spacecraft Center for flight control.Gemini 3 used the Mercury Control Center located at Cape Kennedy for flight control, as the new center was still in a test status. Gemini 4 was the first to be guided from Houston, with Mercury Control as a backup. From Gemini 5 through today, all flights are controlled from Houston.

But where have the links gone? They’re on a separate page because the library I used (WWW::Wikipedia for Perl) provides a separate list of references for each entry. The problem is that this article, for example, has over 250 of them.

→ NASA
→ Gemini 8
→ Gemini 9A
→ Cape Canaveral Air Force Station
→ NASA
→ human spaceflight
→ Project Mercury
→ Apollo program
→ low Earth orbit
→ Moon landing
→ human spaceflight
→ Soviet Union
→ Space Race
→ Moon
→ Extravehicular activity
→ orbital maneuver
→ space rendezvous
→ docking and berthing of spacecraft
→ Cape Canaveral Air Force Station Launch Complex 19
→ Cape Canaveral Air Force Station
→ launch vehicle
→ Titan II GLV
→ Intercontinental ballistic missile

And on and on, for many pages. In my first attempt to render this Wikipedia page with links I had appended all the links at the end. All 250 of them. That didn’t work too well.

I guess this is the interesting question with ramifications for hypertext in general: what user-interface do we use if all we have in terms of structure is headings, text paragraphs, list items, code blocks, and link items (and these are separate from text paragraphs and list items). It’s a bit better than Gopher, where we have link pages (menus) and text pages, but still, Wikipedia was obviously written with the original vision of hypertext in mind. Whenever there is a term you don’t understand, or a term, that seems related, you can click on it, and it takes you on an on through all the texts. Wikipedia is a dense hypertext. It doesn’t just link an item here or there, like I might do on this blog.

I’m starting to wonder how well a format like Gemini is suited for the task. Does that mean there’s no point in translating Wikipedia and other dense hypertexts for Gemini? Is there a need for manual curation? Or, looking at it from the other end: is dense hypertext maybe not a good idea? How valuable are all those bot links in Wikipedia, anyway?

I sometimes wonder whether there’s a link-to-word ratio that we shouldn’t exceed when writing text for humans to read in a linear form, like a Wikipedia page section. And now I’m wondering whether the Gemini affordance miraculously matches my imagined link-to-word ratio limit.

I think I love dense hypertext. I love the promise that eventually you can click on any term you are interested in and learn more. Just that. There is always more. I love that idea. I’m starting to suspect that this idea is not well suited for the Gemini format.

Perhaps the three protocols reflect three mindsets:

  • Gopher is a hypertext on the page level: a page is either a menu with a ton of links, or a text file to be read.
  • Gemini is a hypertext on the paragraph level: a paragraph is either a link, possibly in a list of links, or a text paragraph to be read.
  • The web is usually a hypertext on the word and phrase level: words can be linked, but they are always embedded in the text we read.

The people that like the separation of text and links seem to think of these links as visual clutter, like they are on paper, in Gopher text files, or in Gemini documents, best relegated to “after the text” wherever that may be, like footnotes in a paper document, a letter written to a friend or an article written in a journal.

The people that like dense hypertext like I do, the people that come from the old wiki culture where we used CamelCase to indicate “this should be a link and even if the page does not exist, somebody please write more about it,” I think we don’t see a problem in reading the text of a heavily linked page. The links don’t register as visual clutter. Instead, they are the sweet, sweet promise of further information.

I love that aspect of hypertext.

Tags:

Comments on 2020-06-19 Wikipedia via Gemini

What I like about Gopher and Gopherpedia Vs Wikipedia is easier keyboard navigation. I find keyboard navigation impractical on the web, especially Wikipedia with its “heavy hypertext”. On Gopher I find the separation of content and navigation makes it ideal for keyboard nav., and I like that. On the other hand I love the functionality of hyperlinks too. I’m not sure if Gemini is the best of both worlds or the worst of them in this regard. Possibly I’d be happy with hypertext pages indexed with gophermaps in a standardised way, so you can always jump to a page from a hyperlink, but then jump to a simple gophermap for navigation away from there. Like the web if index.htm actually was always a gophermap-like index, and content was always kept in meaningful directories.

On Wikipedia the index might be the category pages. They are often underused and disorganised, but have potential to be useful.

– Anonymous 2020-06-20 13:31 UTC


Hyperlink arrangement in gopher is one of the reasons I ended up preferring the web as I wrote in a phlog some time ago.

edkalrio 2020-06-20 14:29 UTC


I made some changes to my proxy.

  • it uses the API directly
  • it transforms the wiki text to plain text manually
  • it strips all links and references, aiming for maximum reading pleasure
  • it handles wiki tables

– Alex Schroeder 2020-06-25

Add Comment

2020-06-17 Tiny Gemini Client in Bash

This defines the function “gemini” such that you can visit a Gemini URL from the command line.

function gemini () {
    if [[ $1 =~ gemini://([^/:]+)(:([0-9]+))? ]]; then
	host=${BASH_REMATCH[1]}
	port=${BASH_REMATCH[3]:-1965}
	echo Contacting $host:$port...
	echo "$1" | openssl s_client -quiet -connect $host:$port 2>/dev/null
    else
	echo $1 is not a Gemini URL
    fi
}

I should write another one that uses a client certificate, too. 🙂

And here’s an uploader using Titan.

function titan () {
    if [[ -z "$2" ]]; then
        echo Usage: $0 URL TOKEN [FILE]
	exit
    else
	token=$2
    fi
    if [[ $1 =~ titan://([^/:]+)(:([0-9]+))? ]]; then
	host=${BASH_REMATCH[1]}
	port=${BASH_REMATCH[3]:-1965}
	echo Reading ${2:-/dev/stdin}
	read -d "" file < "${3:-/dev/stdin}"
	size=${#file}
	echo Posting $size bytes to $host:$port...
	printf "$1;token=$token;mime=text/plain;size=$size\r\n$file" \
	    | openssl s_client -quiet -connect $host:$port 2>/dev/null
    else
	echo $1 is not a Titan URL
    fi
}

Here’s how to call it:

echo "This is a Titan test." \
    | titan titan://alexschroeder.ch/raw/Test hello

I put these two functions into a git repo.

Tags:

Comments on 2020-06-17 Tiny Gemini Client in Bash

I guess the URL schema is superfluous. 🙂

If somebody uses a client certificate with a common name set, we could use this to save a username when saving pages. An excellent way to self-identify.

Sadly, on the server side, I have not found a way to learn anything about the client certificate used. 😟

– Alex Schroeder 2020-06-17 21:41 UTC


I depends upon the library you are using for TLS. I use libtls, which makes it not only easy to use TLS, but to obtain information from the client certificate.

Sean Conner 2020-06-17 22:21 UTC


Hm. I use Perl’s IO::Socket::SSL which allows me to examine the peer certificate, according to the do documentation but when I do it, there is nothing. 😕

– Alex Schroeder 2020-06-18 12:42 UTC

Add Comment

2020-06-15 Why Wiki‽

Indeed, why? I’m writing this because I want a wiki and I’m interested in Gemini and I’ve read some things on the mailing list that make me think other people don’t love wiki as much as I do. (Start with Sean Conner’s post if you’re interested. Some quotes from that thread can be found in the comments on 2020-06-04 Gemini Upload.)

Some people think that we should all self-host the things we write. This is a good idea. We don’t want to depend on faceless corporations that can take away our online presence on a whim.

At the same time, however, not all of us have the means to self-host. Some of us have no time, because system administration takes time to learn, takes time to practice, takes time to do. Some of us lack the know-how. We can write, and we want to write, but we can’t host. Perhaps we don’t have the money to pay for a host. Or we don’t have the energy or the time to look for the cheapest host out there. Perhaps we want to write but we feel comfortable with our phones and so we want to write on our phones. It’s like the best camera being the one you have on you. The best writing implement is the one you have on you. These days, it might be your phone.

Also, let us not forget that not every service is rendered by a faceless corporation. We can get service from cooperatives, from neighbours, from family members, from friends, from schools, from libraries, from friends we’ve made online. To design solutions that make it hard for friends to help each other, we design for the cold alienation of modern capitalism. We need to grow networks and help each other. Sure, we can write to each other. But we can also host each other. Like all these pubnix systems out there, we’re sharing a resource. Why should sharing shell access be any different from sharing text hosting?

And finally, let’s not forget that self-hosting means self-writing. But what if you’re collaborating? Of course, we could pull in yet another dependency: use git, or some other distributed version control system! Or how about the systems we us allow us to collaborate naturally, because they are inherently designed to do so? I share Sir Tim Berners-Lee’s original vision for a read-write web that Sean Conner dug up in RFC-1945, where we read that the POST method can be used for the “Annotation of existing resources” and for “Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles”, and that “the PUT method requests that the enclosed entity be stored” and that “the origin server can create the resource”. Yes! That’s exactly it.

And wikis were the big break through: we had browsers, we had forms, and that was it. But Ward Cunningham wrote the WikiWikiWeb, a website with pages that are quickly editable by users. The barrier to entry was extremely low.

Sure, it also attracted vandalism and spam, and like email, and like the fediverse, the technology is in a constant arms race to block and ban miscreants. But it still works and barriers to entry can still be low. We can all come together under a banner, be it the biggest encyclopedia known to humankind, or wikis on Star Wars, or the Malazan Empire of the Fallen, or Emacs, or any other kind of topic, really, and we can collaborate. It’s the simplest collaboration platform that works. You write some text. I fix mistakes. You make additions. I reorganise. You split it up. I link it. The hypertext grows without necessary “ownership” of pages.

The effort required to maintain a wiki is worth it, to me, because we have a viable alternative to the isolation of self-hosting, and the surrender to value-extracting corporations. Doing things together, achieving things together, is important to teach the new generation of people coming online, it is important to teach ourselves that resistance is not futile, resistance is not a struggle, resistance to the machine is the simple act of having fun and building things together.

Tags:

Comments on 2020-06-15 Why Wiki‽

A vision for Gemini (that doesn’t focus on wikis) by Solderpunk.

– Alex Schroeder 2020-06-16 21:27 UTC


Dunno, nowadays even large, popular wikis I see are being overrun by spam, or at least spambot accounts. Edits become rare. Discussions even more so. The whole point of a wiki is to enable communities, otherwise there are much better ways; and the community spirit has largely been lost in most places.

But I wrote all that before. Possibly even here. And at least with wikis I experienced that community spirit for a while; with shell accounts, not so much. Got to try again sometime.

A better question may be what exactly you’re inviting people to build with you. Because they are still coming together often enough. But they’re doing that on software forges, and on Neocities, and on forums. And I think what makes all of those different is that you can fork a project and submit pull requests, or quote other people and link to their posts (you can do that on any ordinary blog farm, too – oh look, another form of online community), until ownership begins to blur... but in an organic way. You can still say, “okay, by now I’ve crossed from my backyard into my neighbor’s”.

Guess that would be a village, then.

Felix 2020-06-17 15:29 UTC


Sure, and I understand those activities as well. All the RPG blogging goes there. People post new ideas, other people comment on it, or pick up on it using their own blogs, incorporate ideas into their own products, it’s true. And yet... I see the problem in the Emacs World. I’m depending on somebody like Sacha Chua to understand what’s going on. There are so many packages being posted, blog posts, and on and on. I guess I miss that feeling when people used Emacs Wiki to drop their half-finished stuff. But now we have MELPA and it’s all git, and what can I say, I feel the isolation of capitalism. Everything belongs to somebody, everybody is the king of their garden, all the exchanges are carefully gatekept, transactional, I send you mail, you accept merge requests, and so on.

I might be alone in this, but I still want that fluidity. I still want that lack of ownership, that building together, that communal aspect.

And in really small ways, it works: Campaign Wiki is where RPG groups can create their own wikis, just for them, an audience of three or four or five, and that makes them happy. It makes me happy, even if my players don’t write a lot – hardly anything, to be honest. But this is how I can have a quick and easy website that works with the browser as it’s only interface.

I really like that aspect, too. I’m not sure how many of the other authors (few as there are) would remain if they had to register by requesting a client certificate and got shell access, or a sftp account, or whatever one uses these days for sites like Neocities.

To me, these are all inferior solutions to just using wikis.

– Alex Schroeder 2020-06-17 15:41 UTC


So people wanting credit for their work is capitalism now? Artists wanting attribution? Writers wanting to own their words (and others to own their words as well)? Sure, we have a bit of a problem with capitalism too, as another friend of mine pointed out some months ago: this idea that everything we do, and every waking moment we have, should be monetized. But that’s a different problem.

People need and want their own little corners, and the ability to set boundaries, however blurry and permeable. And they prove it by flocking to those kinds of online media that provide.

Felix 2020-06-17 16:19 UTC


Sure. But at the same time, I also want the alternative. Let those people do what they want. I also have this blog, which is “mine”, and the software I maintain, and so on. What I called the “isolation of capitalism” is something different. It’s the feeling when every commons is privatised, all the land is enclosed, and every project has one benevolent dictator. I want the alternatives, too. I want cooperatives, associations, gaming groups, spontaneous collaboration, anonymous contributions. I want them on top of everything else.

– Alex Schroeder 2020-06-17 20:45 UTC

Add Comment

2020-06-14 Using Titan to edit a Gemini wiki

Update: I think the two functions I wrote on 2020-06-17 Tiny Gemini Client in Bash are more elegant, and you get two: gemini to read and titan to write. Also note that gemini://communitywiki.org:1966 is now the real Community Wiki. 🙂


I’ve set up a Gemini wiki for testing on gemini://communitywiki.org:1966 – note the non-standard port!

If you want to edit or create a page, use the following shell script if you’re not using Gemini Write, my Elpher extension. Use your regular Gemini client to read, of course.

#!/bin/bash

# If you set HOST, PORT, TOKEN, or PAGE as environment variables,
# those values are used instead. If you want to edit Alex' wiki,
# for example:
# HOST=alexschroeder.ch PORT=1965 TOKEN=hello PAGE=Test ./gemini-wiki

HOST=${HOST:-communitywiki.org}
PORT=${PORT:-1966}
TOKEN=${TOKEN:-Elrond}
FILE=$(tempfile)
PAGE=${PAGE:-$(date --iso-8601=date)}
read -p "Edit which page on $HOST? [$PAGE] "
PAGE=${REPLY:-$PAGE}
PAGE=$(echo "$PAGE" | perl -p -e 'chomp; s/ /_/g; s/([^A-Za-z0-9_-])/sprintf("%%%02X", ord($1))/seg')
echo "Requesting gemini://$HOST/raw/$PAGE"
echo "gemini://$HOST/raw/$PAGE" \
    | openssl s_client -quiet -connect $HOST:$PORT 2>/dev/null \
    | tail --lines=+2 \
    > "$FILE"
$EDITOR "$FILE"
SIZE=$(wc -c < "$FILE")
read -p "Post $SIZE bytes to $PAGE? [y/n] " -n 1
echo
if [[ "$REPLY" == "y" ]]; then
    echo Posting it...
    (echo "titan://$HOST/raw/$PAGE;token=$TOKEN;size=$SIZE;mime=text/plain";
     cat "$FILE" ) \
	| openssl s_client -quiet -connect $HOST:$PORT 2>/dev/null
    echo Verifying gemini://$HOST/$PAGE
    echo "gemini://$HOST/$PAGE" \
	| openssl s_client -quiet -connect $HOST:$PORT 2>/dev/null
else
    echo Abort!
    echo Your page was left here: $FILE
fi

Tags:

Comments on 2020-06-14 Using Titan to edit a Gemini wiki

Slowly starting to add peer review features to the Gemini side of things. Today: page history.

Things I’d like to see:

  1. diff links
  2. reverts or rollbacks

– Alex Schroeder 2020-06-15 15:29 UTC

Add Comment

2020-06-12 Serving image galleries via Gemini

As an experiment, I’m serving images via Gemini! Let me know what you think of the user interface. It’s a bit weird since you can’t actually scan the thumbnails. If you’re looking at newer galleries, there’s going to be textual descriptions. For older galleries, it’s just a long list of thumbnail and image links. I don’t see how that can be improved, so there you have it.

In order to do this, I added support for a gemini_config file in the wiki’s data directory. There, you can add more links to the main menu, and add your own selector interpretations.

And this is my gemini_config with the gallery support for Sitelen Mute.

# -*- mode: perl -*-
use Modern::Perl;
use Mojo::JSON;
use Mojo::DOM;
use File::Slurper qw(read_text read_binary read_dir);

our (@extensions, @main_menu_links);

push(@main_menu_links, "=> gemini://alexschroeder.ch/do/gallery Galleries");

push(@extensions, \&galleries);

my $parent = "/home/alex/alexschroeder.ch/gallery";

sub galleries {
  my $self = shift;
  my $url = shift;
  my $selector = shift;
  if ($selector eq "do/gallery") {
    $self->success();
    $self->log(3, "Serving galleries");
    say "# Galleries";
    for my $dir (
      sort {
	my ($year_a, $title_a) = split(/-/, $a, 2);
	my ($year_b, $title_b) = split(/-/, $b, 2);
	return ($year_b <=> $year_a || $title_a cmp $title_b);
      } grep {
	-d "$parent/$_"
      } read_dir($parent)) {
      $self->print_link(ucfirst(NormalToFree($dir)), "do/gallery/" . FreeToNormal($dir));
    };
    return 1;
  } elsif (my ($dir) = $selector =~ m!do/gallery/([^/?]*)$!) {
    if (not -d "$parent/$dir") {
      say "40 This is not actuall a gallery";
      return 1;
    }
    if (not -r "$parent/$dir/data.json") {
      say "40 This gallery does not contain a data.json file like the one created by sitelen-mute or fgallery";
      return 1;
    }
    my $bytes = read_binary("$parent/$dir/data.json");
    if (not $bytes) {
      say "40 Cannot read the data.json file in this gallery";
      return 1;
    }
    my $data;
    eval { $data = decode_json $bytes };
    $self->log(1, "decode_json: $@") if $@;
    if ($@ or not %$data) {
      say "40 Cannot decode the data.json file in this gallery";
      return 1;
    }
    $self->success();
    $self->log(3, "Serving gallery $dir");
    if (-r "$parent/$dir/index.html") {
      my $dom = Mojo::DOM->new(read_text("$parent/$dir/index.html"));
      $self->log(3, "Parsed index.html");
      my $title = $dom->at('*[itemprop="name"]');
      $title = $title ? $title->text : ucfirst(NormalToFree($dir));
      say "# $title";
      my $description = $dom->at('*[itemprop="description"]');
      say $description->text if $description;
      say "## Images";
    } else {
      say "# " . ucfirst(NormalToFree($dir));
    }
    for my $image (@{$data->{data}}) {
      say join("\n", @{$image->{caption}}) if $image->{caption};
      $self->print_link("Thumbnail", "do/gallery/" . FreeToNormal($dir) . "/" . $image->{thumb}->[0]);
      $self->print_link("Image", "do/gallery/" . FreeToNormal($dir) . "/" . $image->{img}->[0]);
    }
    return 1;
  } elsif (my ($file, $extension) = $selector =~ m!do/gallery/([^/?]*/(?:thumbs|imgs)/[^/?]*\.(jpe?g|png))$!i) {
    if (not -r "$parent/$file") {
      say "40 Cannot read $file";
    } else {
      $self->success($extension =~ /^png$/i ? "image/png" : "image/jpg");
      $self->log(3, "Serving image $file");
      print(read_binary("$parent/$file"));
    }
    return 1;
  }
  return;
}

Tags:

Comments on 2020-06-12 Serving image galleries via Gemini

Not as fancy as on the web (for obious reasons) but still looks good and is useable. I’d add filesizes to the links and some kind of imageid if there is no description in order to not get lost in a long list of Image Thumbnail Image ...

– baschdel 2020-06-13 15:52 UTC

Add Comment

2020-06-12 Leaving comments on a Gemini site

This page explains how comments are implemented on this site, from a technical point of view. Before you can leave a comment, you need to answer a security question. On this site, the question is simple: “Please say HELLO” and then you need to say “hello” and you’re probably not a bot. Then you see the prompt for the comment, and then you’re redirected back to the comments page.

Client                               	                                Server
| Read a page                                                                |
| gemini://alexschroeder.ch/Test                                             |
|--------------------------------------------------------------------------->|
|                                                      Text of the Test page |
|                                                             20 text/gemini |
|<---------------------------------------------------------------------------|
| Follow the link to the comment page                                        |
| gemini://alexschroeder.ch/Comments_on_Test                                 |
|--------------------------------------------------------------------------->|
|                                                       Text of the comments |
|                                                             20 text/gemini |
|<---------------------------------------------------------------------------|
| Follow the link "Leave a comment"                                          |
| gemini://alexschroeder.ch/do/comment/Comments_on_Test                      |
|--------------------------------------------------------------------------->|
|                                                     Redirect to a question |
|                 30 gemini://alexschroeder.ch/do/comment/Comments_on_Test/0 |
|<---------------------------------------------------------------------------|
| Get the question                                                           |
| gemini://alexschroeder.ch/do/comment/Comments_on_Test/0                    |
|--------------------------------------------------------------------------->|
|                                                     Send back the question |
|                                                 10 Who rules in Rivendell? |
|<---------------------------------------------------------------------------|
| Answer the question                                                        |
| gemini://alexschroeder.ch/do/comment/Comments_on_Test/0?Elrond             |
|--------------------------------------------------------------------------->|
|                                             Redirect to the comment prompt |
|          30 gemini://alexschroeder.ch/do/comment/Comments_on_Test/0/Elrond |
|<---------------------------------------------------------------------------|
| Get the comment prompt                                                     |
| gemini://alexschroeder.ch/do/comment/Comments_on_Test/0/Elrond             |
|--------------------------------------------------------------------------->|
|                                                    Send the comment prompt |
|                                                                 10 Comment |
|<---------------------------------------------------------------------------|
| Send the comment                                                           |
| gemini://alexschroeder.ch/do/comment/Comments_on_Test/0/Elrond?YOLO!       |
|--------------------------------------------------------------------------->|
|                                              Redirect back to the comments |
|                              30 gemini://alexschroeder.ch/Comments_on_Test |
|<---------------------------------------------------------------------------|
| Get the page with all the comments, including the new one                  |
| gemini://alexschroeder.ch/Comments_on_Test                                 |
|--------------------------------------------------------------------------->|
|                                                       Text of the comments |
|                                                             10 text/gemini |
|<---------------------------------------------------------------------------|

In order to explain the security question URL with the zero in it: the wiki can be set up with a bunch of question, so I need to remember what question the user is answering when I get back the reply. Zero is simply the index of the first question.

Tags:

Add Comment

More...

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Just say HELLO

Referrers: Planet Emacslife