Posts tagged with "PyPI"

Wasat v1.6.0

1 min read; 8 GFI

The client certificate management PR for Rogallo is very close to completion now -- although the thing has grown arms and legs and turned into a bit of a UI overhaul1. Something I wanted to add was a quick and easy way for the user to view the details of a client certificate that's being used for the current page. Rogallo lets you do this for the server certificate, but not the client certificate.

It was at this point that I realised I'd never provided easy access to the ClientCertificate on the Response object. So v1.6.0 addresses this and provides Response.client_cert.

With this in place, I think I can finally get that Rogallo PR over the line...


  1. Not unrelated. The UI overhaul was in support of the client certificate manager. ↩

Wasat v1.5.0

1 min read; 12 GFI

I'm still working on the client certificate management PR for Rogallo, which, of course, heavily leans on the API of Wasat. In most cases, I've noticed that something I want to do in the PR can already be done, but the work to perform the action would seem like unnecessary detail in a client application; I want to make using Wasat as frictionless as possible.

With this in mind, v1.5.0 adds interfaces for exporting and importing client certificate data.

Rogallo v1.12.1

1 min read; 15 GFI

I've just made a small but important bug fix to Rogallo. Currently, I'm working on a more comprehensive approach to managing client-side certificates and, in doing so, I noted a bug with how such certificates are currently created by Rogallo.

Simply put: by default, Rogallo should create certificates that effectively never expire (the actual expiry time is the end of 9999-12-31). Instead, if no actual expiry time was given, the certificates were being created to expire a year after creation.

This does mean that, if you've created a client certificate with Rogallo and didn't specify your own expiry date, it currently has a far more limited lifespan than you were probably expecting. As such, you might want to review them and consider making fresh ones and setting them up well before they expire (expiry probably being some time in July next year, given that Rogallo itself has only been fully usable since around July this year).

Apologies if you've used this facility and it accordingly results in a little extra work. Thankfully it came to light sooner rather than later, and it has come to light while I'm giving client certificate management a big overhaul.

Wasat v1.4.0

1 min read; 13 GFI

Another bump to Wasat, this being v1.4.0. This release is in support of some work I want to do on Rogallo, where I intend to add proper client certificate management.

While Wasat provided good support for the generation, storage, and use of client certificates, there was no real public API that would allow for the management of those certificates. This version addresses that.

Now there are methods for doing things like:

  • Listing all client certificates
  • Getting a specific certificate's details
  • Creating a certificate
  • Associating and disassociating a certificate with a URI
  • Deleting a certificate

This should give me everything I need to implement a simple client certificate user interface in Rogallo.

Rogallo v1.12.0

2 min read; 11 GFI

I've released v1.12.0 of Rogallo. This version contains a number of internal changes, as well as some user-facing improvements.

Improved navigation historyΒΆ

For a wee while now I've been wanting to tweak the way the navigation history works. Up until this release, this was simply a backward/forward affair with no attempt to restore the actual context of a page you've gone back to. This could best be felt if you're a fan of AstroBotany. If you were to visit the flowering plants in your community garden, with a view to visiting each one and picking petals, the natural thing to do would be to visit a specific plant, pick a petal, then go Backward twice to get back to the list of flowering plants. The problem at that point is that the link for the just-visited plant would no longer be focused. This made it just a bit more faff to go to the next plant on the list.

From this release, when going backward and forward through navigation history, Rogallo attempts to ensure that the link you had followed on that page is focused again.

Internally, this caused a fairly big overhaul of how history navigation information is recorded. I've done a fair bit of testing and all seems good; but do let me know if you experience any oddness.

Showing empty contentΒΆ

This is a small fix. If you were to visit a URI that resulted in an empty document being received, the viewer would disappear. The viewer is supposed to disappear if you are visiting nowhere, but it shouldn't disappear if you're visiting somewhere that has nothing to show. This is now fixed.

Parent/root navigationΒΆ

Rogallo has a couple of commands that make it easier to navigate to the parent directory of a visited location, and also to the root. However, I'd only implemented this for Gemini and Spartan URIs and sort of forgotten to finish this off. With this release Gopher and Nex get to join in on the parent/root navigation party.

Cancelling requestsΒΆ

This one came up because, as of the time of writing, the server where my wee capsule lives is dead1. This meant that if I checked if it was there, and got impatient and went to navigate somewhere else, the somewhere else would load and then, after the defined timeout, the error about the previous request would pop up.

Rogallo now ensures that, if you have an in-flight request running, and then navigate elsewhere, that pre-existing request is cancelled.

Custom promptsΒΆ

The in-application command line of Rogallo has two styles of prompt. The normal input prompt (shown as >), and the busy prompt (shown as a series of braille characters that animate as dots snaking around). I realised that some folk might enjoy setting their own prompts. While I think the defaults are nice and clean, if you wanted something more colourful and on-theme (in a Gemini sense anyway, which tends to be space-oriented), you could update your configuration file with:

    "command_line_prompt": "πŸš€",
    "busy_indicator_cells": "πŸŒ‘πŸŒ’πŸŒ“πŸŒ”πŸŒ•πŸŒ–πŸŒ—πŸŒ˜"

and have this:

A space-themed prompt

I'm currently running with this for my own installation of Rogallo and it's rather growing on me.


  1. From what I've seen, someone managed to break in and pretty much rm -rf / the thing. The restore of the server is being used as a good moment to change the architecture of the services it offers. This does mean it'll be a wee while before I get my capsule back. ↩

Rogallo v1.11.0

2 min read; 10 GFI

A quick little update to Rogallo, bumping to v1.11.0. This release is mainly in support of people who like to use the mouse as much as, if not more than, the keyboard; and also in support of people who might wish to reclaim a couple of lines of display for actual content.

The main change in this release is that I've swapped out the header line that Rogallo used to have (which used the stock Textual Header widget) and replaced it with a mouse-friendly toolbar.

The new Rogallo toolbar

The thinking behind this was twofold: first, the current header wasn't really very useful, showing just the name of the application and the version number. I would hope, really, that most people know what application it is they're running, so having the name there wasn't super useful. Secondly, while Rogallo aims to be keyboard-friendly -- ideally keyboard-first -- it also aims to be mouse-friendly where possible. The problem with the mouse-friendly approach is that a lot of application commands were, for the mouse user, locked behind the command palette. While not impossible to navigate and use, it wasn't the smoothest experience.

So I've swapped that header out for a configurable toolbar of command buttons. The content of the toolbar is set using the toolbar_contents setting in the configuration file. The default set looks like this:

[
    ["GoHome", "\u2302"],
    ["Reload", "\u21bb"],
    ["Backward", "\u25c0\u25c0"],
    ["Forward", "\u25b6\u25b6"],
    ["GoToParent", "\u2191"],
    ["GoToRoot", "\u21c8"],
    ["SearchHistory", "\u25f7"],
    ["SearchBookmarks", "\u2605"],
    ["ToggleView", "\u21cb"]
]

The value in the first position for each button is the name of a bindable command. The second value is the text to place on the button itself. If you simply want to use the command's name, rather than a pair of values, you can just use the command name. So suppose you wanted to use Reload, Backward and Forward as-is, you could set things like this:

[
    ["GoHome", "\u2302"],
    "Reload",
    "Backward",
    "Forward",
    ["GoToParent", "\u2191"],
    ["GoToRoot", "\u21c8"],
    ["SearchHistory", "\u25f7"],
    ["SearchBookmarks", "\u2605"],
    ["ToggleView", "\u21cb"]
]

In addition to this setting, I've also added some other toolbar-related settings. There is:

"toolbar_visible": true

which controls if the toolbar is visible at all. So if you're a keyboard-only kind of user and you want that extra line back, just set that to false.

There is also:

"toolbar_tooltips": true,

which controls the tooltips that will appear when you hover over a button in the toolbar. These are there to explain what each button does, and to also show you what keyboard binding is associated with each one. If the tooltips get irritating, set this to false so they don't appear.

Lastly, there is:

"toolbar_can_get_focus": false

As I've said: the toolbar is added in support of people who use the mouse a fair bit. This means that, by default, it can't be interacted with using the keyboard. This makes sense in that each of the commands will have a keyboard binding, so it makes more sense to simply use that. However, if you really must use the toolbar with the keyboard, you can set this setting to true to enable it. When set this way, you can navigate into the toolbar and switch focus to each of those buttons using the normal Tab and Shift+Tab navigation keys.

One other little configuration feature can also be used to reclaim an extra line in the display. If you have no need for the footer of the application (where some important keys are shown), you can turn it off with:

"footer_visible": true

Set it to false and you get one more line of content.

Rogallo v1.10.0

1 min read; 10 GFI

Rogallo v1.10.0 has been released. This is a pretty small release, with a bug fix to navigation, and an improvement to how navigable Markdown documents are if viewed in the application.

In Rogallo v1.8.0 I made some changes to how Markdown documents are shown, if they're encountered and detected in Geminispace (or any of the other protocol spaces that might let you know the content type of a document). Whereas originally the document was shown in its raw form (marked up with syntax highlighting), v1.8.0 moved to using a fully-rendered form thanks to the internal Markdown widget.

But, as I've mentioned elsewhere in this blog, I wasn't 100% happy with this. The main problem is that the Markdown widget supplied by Textual is pretty unfriendly to keyboard navigation, and I want as much of Rogallo to be navigable with the keyboard as is possible.

To solve this I've created md2gemtext and started using it here in Rogallo. This means that, by default, from now on, any time a Markdown document is received by Rogallo, the content is converted into Gemtext before being displayed. The big advantage here is that links are far easier to see and follow and the document as a whole looks more in keeping with most other pages you'll visit.

Markdown rendered as a Gemtext document

I'm sensitive to the fact that some folk might prefer the previous method of viewing Markdown, so this feature is configurable. If you'd prefer the widget-based rendering instead, set this value:

"convert_markdown_to_gemtext": true

to false.

Markdown rendered in a full Markdown widget

The other change in this release is a fix to how navigation history is saved and restored. For a couple or so weeks now, on occasion, I was finding that when I ran up Rogallo again, navigated from the restored page, and then used Backward, I would end up somewhere else. It was intermittent and, for a while, hard to pin down. Mostly I'd notice this while rapidly closing and opening Rogallo while working on some other feature. Eventually I figured out the sequence of events causing the problem and it was an easy enough fix.

md2gemtext - A library for converting Markdown to Gemtext

1 min read; 10 GFI

Following on from html2gemtext, the inevitable has happened: I couldn't let the Markdown side of things remain unaddressed. While Rogallo v1.8.0 added some extra rendering of Markdown to make it look more "pretty", I felt it really needed to be handled so it had more utility. Being fully navigable, even by keyboard, seems more important than pretty tables.

So md2gemtext now exists as a library on PyPI. I have two plans for this. While I fully intend to shake up the Markdown support in Rogallo -- either replacing the use of the Textual Markdown widget to display it, or at least giving the user a configuration option to decide how Markdown is displayed -- I also want to pay some attention to my (currently rather simple) Gemini-based log and use this library to build a tool that will convert this blog's Markdown content into Gemtext that looks just how I want it.

As with html2gemtext, this is an early version of this library, and I'm sure there will be edge cases I'll have missed and will want to tidy up. But at the moment the results are looking promising.

I'm once again in a place where I'm actually half-seriously thinking that much of what Hike does could be built into Rogallo, if I were to simply add http(s) support there.

Rogallo v1.9.0

2 min read; 10 GFI

Another update to Rogallo, another new protocol! The main change in v1.9.0 is the addition of support for the Nex protocol.

Nex support in action

As with any other supported protocol, entering a nex:// URI into the command line will cause Rogallo to load up the response in the viewer and render it. Nex is kind of fun in that it's almost a plain text system, by default, but the expectation is that any text/plain document that has => at the start of a line will have those lines be treated just like Gemtext links. So, in Rogallo, when you visit a page, and that page is text/plain, the result will be rendered like it's very simplistic Gemtext that only supports links.

Also, as per the Nex specification, the MIME type of a document is worked out from the extension of the file it points at; so if you happen to get a Gemtext or Markdown file back from a nex:// URI, this will be suitably rendered.

Another addition is a SaveSource command (bound to Ctrl+s by default). As you can probably work out from the name, this will save the source of the document you're currently viewing.

Saving the content of a page

A small housekeeping addition in this release is the cleaning of the content cache. When you start up Rogallo, in the background, any cache entries that have exceeded their time-to-live (something you can set in the configuration file) will be removed. If this results in any cache directories being left empty, they will also be removed. This should result in a nice clean cache directory that's easier to navigate and manage, if you want to go diving into it.

I've also added a small experimental development tool, mostly for myself but it might be something someone else wants to play with. I realised a few days ago that it could be fun to include screenshots of Rogallo in action in my Gemini capsule. The thing is: Gemtext doesn't allow for inline images. What it does allow for, and many clients support, is ANSI escape sequences. Meanwhile, Rogallo is a terminal-based application; its whole method of display is ANSI escape sequences. As such, it should be trivial to capture the sequences for any given screen and just include them in a Gemtext page.

I tried it out and it works a treat! So, if you happen to have ROGALLO_SCREENSHOTS in your environment and it's set to any non-empty value, pressing Ctrl+Shift+F12 writes the current screen to ~/rogallo-screenshot.ansi.

Yes, it's all horribly hard-coded: the key combination is hard-coded (and probably only good for more modern terminal emulators), and the name of the file is hard-coded. As I said: it's a development tool that's there for my own use. I might make it a little more generic in the future.

One final tweak to this release is a fix to the ToggleView command, which stopped letting you view the source of a Gopher map. That ability is now back.

SmolServe v1.1.0

1 min read; 9 GFI

Currently, I'm working on adding support for the Nex Protocol to Rogallo. Having Port1900 as the client library, and having done the bulk of the work in Rogallo, I needed things in place to be able to add some nex://-related documentation too -- which is where SmolServe comes in.

So I've dropped v1.1.0 on PyPI, which adds support for running up a simple just-good-enough Nex server (although, to be fair, Nex is so simple this is probably a fully capable one just by the very nature of how trivial the protocol is).

Now to get back to polishing that Rogallo PR...