Sam Wilson's Website

T7: Twyne

Twyne is a the name of the software that I buid my website in. I started it in 2020, after finally getting sick of every other system of website building not doing what I want.

RSS feed icon. RSS feed for the "Twyne" tag

  1. By .

    I’ve been trying to get some work done on how my website does Posse, because I want to be able to pushto other sites as easily as possible. I’ve had it working well with Wikimedia Commons for ages, and find it much quicker than othet means to get my photos uploaded there. Now I’m trying to get it sorted for Flickr, and (probably easier) for Twitter.

    The general process is to a) edit a post to satisfaction; b) open it in one of the Posse forms and change any metadata as appropriate (this doesn’t get saved locally); c) send the post to the remote site. This will upload the post and also create a local syndication record pointing to its remote URL.

    So far so good, but it’s really a post-by-post operation — I wonder if its worth figuring out a bulk cross-posting system?

    The other part of the Flickr Posse feature will be to do a bit more work on PhpFlickr hopefully including releasin a new major version (with all the deprecated code removed at last).

  2. By .

    Sometimes, being a programmer feels like it just means that I spend my spare time building software for my own purposes, with some idea that each is a necessary step towards doing what I actually want to get done. Of course, the lie of this is that I like writing code, and so the fact that every problem looks like it needs more code is quite natural. I find that it can be stressful when I don’t acknowledge this (i.e. working on something because it’s a stepping-stone towards the “actual work”), but when I give up and just work on the code because it’s fun in itself then it feels calm and easy! It also might be useful… but it might not be, and that’s okay too.

    Last night I was working on adding location-tracking to my website, so I can upload photos and have the website suggest approximate locations for them. I just went out for a coffee, and now have a nice track of where I went. There’s probably a downside to storing hundreds of thousands of points, but (oh well) at least it’s entertaining me…

  3. By .

    I’m feeling thoroughly annoyed with the ORM system I’m using in Symfony. All I want to do is merge tags! It should be a matter of an update statement, followed by a delete. But with Doctrine ORM I have to all sorts of confusing things (well, not that confusing, it has to be said, but still…). So I think I might just go back to the simple days when things made sense and database statements behaved properly (i.e. ran when and how you thought they would within a transaction).

  4. By .

    The thunder has been thundering all morning here, and now the rain has come, making for a nice Sunday morning of good coffee and some code that’s making sense. It always feels better when the code makes sense. When it stops making sense (in about an hour, I suspect), I’ll return to cutting mortises.

    I’m adding a system of redirects to Twyne, so that Tags can be merged and their old IDs redirected to the new IDs, and Posts deleted and a correct 410 Gone response returned. I’ll also add a 404 log thing, so that a site admin can keep track of what URLs are missed by users, and if appropriate redirect them to a new page (good if a domain has been migrated from a different CMS).

  5. By .

    Everyone says you should’ve build your own blogging platform, because then all you’ll ever write about is the platform itself and no one wants to read that. It’s a fairly accurate idea, unfortunately. In my defence, I’m actually finding that having my own blogging (and photo) platform is saving me lots of time on things like copying photos to Commons and finding duplicates — so even if no one reads any of this, it’s still been worth making this thing.

    Anyway, one of the reasons I’ve always avoided building my own platform is that I’ve been worried about security. I’m feeling a bit better on that front now, because of using a bunch of common Symfony patterns and libraries, and also now because I’ve added two-factor authentication to it.

    This means that, after registering a new account and logging in, users are not able to view any page on the site until they’ve set up 2FA. Instead, they’re presented with a QR code, which they scan with a phone app such as Google Authenticator, and that app gives them a six-digit code that is entered in a text box under the QR code. This info is saved against their user account (and for simplicity, it’s only possible to have one such pairing at the moment), and next time they log in they need to provide three pieces of information: their username, password, and a six-digit code from the app.

    There are plenty of issues with my implementation: it forces 2FA; doesn’t have backup codes; doesn’t allow multiple devices; can’t easily be reset; and the login flow is likely quite confusing. I’m happy enough at the moment because none of these are security issues, and I’ll slowly work my way through fixing them. Primarily, I wanted to make the site more secure, and as all the users are either me or people I know personally, I can handle any usability issues.

    I think this is one of the great things about indieweb development: you build what you need, as you need it, and you don’t have to cater to some unknown simplified user. I do try to build everything here as general and reusable as possible (such that it should be possible for someone to set up their own Twyne-powered site, although I dare say that’s reasonably unlikely), but I no longer think it’s worth compromising on features that I actually want.

  6. By .

    I’ve added two-factor authentication support to Twyne. I’ve had this work done for ages, but just haven’t found time to actually merge and deploy it, but I’ve done that now.

    Perhaps at some point I’ll get back to sorting out photos.

  7. By .

    There’s been too much going on lately, for me to post anything on my blog. I’ve got nothing to say — but that has never stopped me in the past!

    I’ve been working on adding 2FA to Twyne, but it’s slow going because there’s too much else happening. I’ve got all the details figured out, and it’s basically working, I just need to find a day or two to get back and tidy up the patch. The rest of Twyne is going well, especially the uploading-with-duplicate-detection: it’s meant I’ve been able to process a good 20GB of stuff in my ~/life/unsorted/ directory!

    Mostly, Wikisource OCR has been top of the list. It’s pretty much done, and can be used while editing any Page namespace page on any Wikisource. See a random example here:

  8. By .

    I’ve added better pagination to Twyne post lists now. Dates were showing everything for a given month, but now if there’s more than ten there’s a link to page two and so on. It’s the same as was already working for tags.

    Now I can get back to adding 2FA support, and then fix up the editing form’s display on small screens (it’s been broken since I added the Select2 auto-completion for tags).

  9. By .

    I’ve recently added support to my website for linking posts’ tags to Wikidata entities. This means that each tag (which has it’s own URL at where nn is the tag ID) can be linked to a Wikidata ID, and have a little table of facts displayed. This means that tags are no longer just strings, but are firmly linked to a meaningful concept — a tag such as ‘York’ is definitely the town in Western Australia and not the one in Yorkshire. No two tags are allowed to be linked to the same Wikidata item.

    The other part of this work was adding a lookup widget to the tag entry form field. Before, it was just a text box and tags had to be entered with semicolons separating them. Now, you start typing and a dropdown appears with suggestions firstly from existing tags on the site and then below them with labels and descriptions of Wikidata items. It makes entering new tags much easier.

    It’s great fun going back through my archives and linking all the tags, although it’s also highlighting the fact that I often create duplicate tags (e.g. misspellings, or Fremantle Railway Station vs Fremantle Train Station). To add a tag-merging system I first need to add a system of tracking and redirecting old URLs (something I should’ve added ages ago when I added the ability to delete duplicate posts).

  10. By .

    I’ve finally got the Twyne CLI client working, and it’s churning away uploading all of my past photographic archives (from Piwigo at the moment, 90 GB). The work for this has mostly been done before now, but I didn’t get back to it to actually tidy it up and set it running. Hopefully this will set me off further down the path of actually having everything a) in one place, b) organised, c) backed up, and d) actually useful.

    I’m not sure if I’ll tackle the export-to-Commons feature next, or sort out some of the UI bugs that are annoying me (like being able to zoom in on a photo). At the moment, I’m just poking through old photos and randomly fixing up metadata where I can; certainly there’s some UI tweaks that will help with that process.