December Adventure 2024
Entries
2024-12-01
Time to adventure.
We’ll see how this month meanders across projects. Top of mind right now is Cerca’s invites function (PR). I started to build it out while visiting friends in Trento last week:
Cerca is a forum software I created after a long time of missing that type of slow cooking long-form interaction, and feeling disappointed with the present state of solutions. It was originally created to host the Merveilles community forums, but has now grown into its own project.
When the forum was started, registration was limited to already existing members of a community. Accounts could be registered by validating a verification code received from the registration form.
How it worked: Each visit to the registration page would show a newly generated verification code. The idea was that anyone part of the community could take the code presented to them and put it on a domain allowlisted as being part of the community, and tying a bow on the process by including a link to where the verification code was hosted, back in the register form; essentially proving you were part of the community. The forum software would validate that the specific code had been generated by the forum, and that it was hosted on an allowed domain, and if both checks passed you would now have an account!
This was great for bootstrapping the forum with people from the community. One avenue used to populate the domain allowlist was our Mastodon instance, and the other was the set of sites part of the community webring. Over time, this way of posting codes on Mastodon broke because its devs decided stop statically generating pages and to instead to require Javascript to render content, making it difficult to agnostically scrape (i.e. not use Masto APIs) a post with a verification code. However by this time, most of the people from the webring that wanted an account had one. The idea to remove the now-obsolete routine started to percolate.
Account registration then went into a phase of having admins create accounts for people as-needed. First it was me doing it with a cli tool directly on the server, then later using an administrative panel hosted in the forum which I cooked up last December Adventure. This works quite well actually. But recently invites came up again, and I finally had a good idea of how to solve it in a way compatible with the forum software’s internal logic and values.
Today’s Side Quests
oh shit i discovered by posting this that i need to fix my rss generation for the new nested posts functionality of my ssg <.<
- Fix nesting under /posts/ wrt rss
- Consider some way of not creating yet another subfeed when just wanting to add rss items to another of
the feeds. e.g. use
cc
with an empty / shibboleth operand to say “just append to<x>
feed”
Fixed the <hr>
styling of the ssg and created a cosy lil theme for this page :]
- Implemented a first pass of a routine that returns all unclaimed invites by batch (commit)
- Remembered that i have to be careful when manipulating contents retrieved from a map, and to sprinkle around references to make sure values are recorded as i expect them to (commit)
- Think that’s enough coding for today! Now to switch to baking vegan lussebullar. In an attempt to make them a bit healthier, i’ll switch the usual margerine / butter for oil—following the rule of thumb: oil amount in grams = 80% butter amount in gram—and use half and half sugar / date sugar!
2024-12-02
Today, in December Adventure
The day’s by far largest priority is… to clean! Not anything code, just my apartment. It’s in a state of semi-chaos after traveling and having arrived back home with a cold that lasted most of last week. Yesterday’s lussebullar never happened ‘cause I ran out of steam. The revised plan is to bake a half batch during the week, and a restored kitchen will be a big boon to that end!
On the code-front it’s time to wire up my database routines for the invite functionality to something that can actually call them. I’ll be implementing handlers for the different HTTP calls that will be originating from the invitation panel and the register form. I’ll start with the invites panel and its generate button, and then see where things start to break.
While reading Lee’s decadv log, I started to wonder if I should shoot him a build of the new static site gen tool I’ve been working on. Maybe not, he seems to be having fun creating a new Lee-shaped generator. But, maybe the input he’s created for his generator could be another useful testbed for my tool. To see where its functionality is lacking, what can be improved. I’ll ask him for the repo when my december adventuring swings away from forum stuff and back into tinkering in site gen land!
Dreary day, weather-wise. Like the dregs of a coffee cup, or a foggy day without any of the mystery. Brewed the last leaves of my Henta Asanoka sencha. *sigh* I guess it’s time to tidy. Currently listening to a set by Maï-Linh on NTS from earlier this year; excellent mix of trance and other tracks.
Skimmed HTMHell’s 2024 advent calendar entry for
today. It was about
autofocus
,
which focuses an element on page load. Decided to sprinkle some around the forum; one for the title <input>
when
creating a new thread, another for the <textarea>
in the edit post view
(commit).
Recorded a stray Idea (TM, etc) I might prototype later in the month.
Noticed I was missing superscript styling on the blog, snuck some in:
sup {
position: relative;
top: -0.5rem;
font-size: 0.5rem;
}
Ahhh, finally, the ritual of tidy is complete. I am free once more!!! While not a member of the fanclub of recreational tidying, I do enjoy its effects, such as having an empty sink.
After a bowl of yoghurt and a cup of rosemary tea it’s time to start today’s Cerca session in earnest!
We can now press a button to generate a batch of invites and display them without any mocked up HTML! (commit)
During implementation, I realized I was being a bit verbose when creating descriptive errors:
// i was doing this
err := errors.New(fmt.Sprintf("nice and descriptive text for this error i'm preparing to throw"))
// but i changed it to this v------------v
err := fmt.Errorf("nice and descriptive text for this error i'm preparing to throw")
THE DIFFERENCE!
Done for today!
For tomorrow, maybe I’ll see about revamping the register view and update the parts dealing with the old approach to use invite codes instead. It’ll let me delete a lot of lines that aren’t going to be useful anymore :)
2024-12-03
Previously, on December Adventure
We have the basics of invite creation and deletion working. All the scaffolding is in place for the actually important part: being able to register an account by claiming an invite! That’s what I’ll start to dig into now. I bet it will be a bit gnarly, that there will be unexpected changes and considerations to take into account. Exciting! I’m eager to remove vestigial parts of the forum’s structure, and instead introduce something that will be useful going forward.
This morning’s tea is an ecologically certified Longjing aka Dragon’s Well. It is a Chinese-style of tea, where leaves are usually panfried and for this particular tea it is smooshed in a just-so characteristic way. I was rummaging around my cupboard and inspected a large packet and re-discovered I’d bought a respectable amount during a previous foray at the local tea shop. Less kick compared to sencha, and an always pleasing taste.
One chunky change later, and the forum is now able to register accounts using invite codes! This change removes so much incidental complexity in the codebase, i love it. (commit)
I think this feature is fundamentally done now??? I will take tomorrow to look through the
changes done so far and see where I can spot any clean up opportunities. One clear point of
improvement has to do with the invites panel, html/admin-invite.html
, where I need to create
better register links.
Once that’s sorted the adventure will detour away from code and into the realm of wrangling ones and zeroes in another manner…