1. a tale of two releases

    hey friends! i haven’t released a lemoncurry update in about a month, but i have been working on it! since last time, i’ve made versions 1.9.3 and 1.9.4 (whoa!! i know, right?) so here’s what happened in both of them :o

    first up, lemoncurry 1.9.3!

    • bootstrap 4 came out of beta, so i switched from the beta to the final release!! woo
    • i set up continuous integration with gitlab ci! what that means is that the unit tests are automatically run every time i push a new commit, and a cute little checkmark is displayed on the commit when i view it on gitlab? unless the tests failed, in which case i get an unpleasant little cross instead? so at a glance i know if a commit Broke The Tests, which is handy info!
    • font awesome put out a few more releases, so now i’m on v5.0.8 instead! neat
    • lots of refactoring: i previously defined separate named routes in django for each kind of post, like entries:notes_index and entries:articles_index, but that makes figuring out whether a particular url points to an entry or something else way more of a hassle, since there are lots of different route names to match? and it turns out you need to know whether a given url on your site points at an entry to receive webmentions (!!!!!!!) for that entry, so i changed all that stuff around :o now there’s just a route called entries:index that takes a parameter for the entry kind, which is much easier to process c:
    • the permalink pages, like /notes/3 and such, weren’t checking whether the entry with id 3 actually existed. which meant it crashed and gave you a 500 server error. now, it checks upfront and returns the correct error if you ask for a nonexistent entry - 404, not found!

    and now, lemoncurry 1.9.4!!

    • i started writing code to receive webmentions!!!!!!!! it’s nowhere near finished yet, and i haven’t made it discoverable so other people’s sites won’t know to use it, but it can receive mentions, figure out which entry was being mentioned, and save that information to the database?? next, i need to use the job queue to test whether the webmention is valid (i.e., whether the source page really mentions the target page) and then if it’s valid to actually display it someplace :o really good start so far tho!
    • i decided to install the lovely highlight.js, for pretty code colours every time i post a code block :3
    • previously, the nya.as short urls were being generated by a third-party plugin called django-shorturls, but that plugin hasn’t been updated since 2016! since it doesn’t really do much anyway, i decided to spend a few hours reimplementing its functionality myself. easy peasy
    • the big advantage of dropping django-shorturls is that it wasn’t compatible with django 2 - since i’m not using it any more, i upgraded django to 2.0.3!! yay!! it seems pretty much the same as before but still!! yay!!

    so that’s what’s up! here’s a pretty little python code block to celebrate :o

    def is_cutie(person):
      """
      Test whether the person provided is an absolute cutie pie.
      """
      if person.is_reading_this:
        return True
      return True # yes, even people not reading this are cuties
    
  2. two cool things in lemoncurry 1.8

    i decided to bump the minor version because there are two fairly big improvements in lemoncurry 1.8!

    first up, lemoncurry does pagination!! 📄

    • every entry feed page now automatically paginates, ten entries to a page, which is good because i’ve now written thirteen entries here. which actually is.......... not a lot, i guess? but it’d have gotten real slow eventually if it kept on having to load every single entry all the time 😉
    • all the paginated feeds use rel="next" and rel="prev" appropriately, so it’s still very easy for programs to navigate. this is very good for indieweb feed readers, like woodwind, as well as for sufficiently advanced screen readers?

    the other exciting thing is improved micropub support! there are two major improvements that make lemoncurry more compliant with the micropub spec and therefore more compatible with a variety of micropub clients

    • my previous implementation only supported formencoded requests, which is the default format that all micropub servers are required to handle. however, micropub also defines a json request format, which happens to be more powerful in various ways, so now i support that too!
    • to authorise any micropub request, you have to provide a token - i supported one way of doing this, which is setting the Authorization http header, but the spec also allows the token to be passed as a query or form parameter, so now i support that too ✨

    yay!!

    but what’s next? well, the infrastructure changes i made while implementing those two improvements will make it way easier to implement the other aspects of micropub i haven’t yet, too:

    • you’re supposed to verify the oauth scopes attached to the client’s micropub token? that’s stuff like “yes, this particular token has been granted permission to create new entries”. you’ve probably seen the little prompts while oauthing with sites before, when you give your third-party twitter clients permission to post tweets and stuff like that. my previous token auth code made scope verification pretty annoying to do, but it should be as simple as a cute little check like this now?

      if 'create' not in token:
        return deny("you can't create new entries!!")
      
    • the micropub spec allows you to update existing entries as well as make new ones! however, it only allows updates to be provided in the json request format, not the formencoded request format. so of course that wasn’t possible when i only supported formencoded requests, but it should be easy enough to do now 🐱 yay!

    • the auth logic was pretty much hardcoded into the POST /micropub view handler before, which is bad because you actually need to use it in a few other places too - i had duplicate auth logic in GET /auth/token, since its whole job is verifying that the token is valid and will be accepted by POST /micropub? there’s also additional endpoints, like GET /micropub, that i haven’t implemented yet but that will need to reuse the same logic too

    pretty rad?? 🐎

  3. lemoncurry 1.7 - introducing cats!

    that’s right, the big new thing here is support for cats - or “categories”, as the microformats2 spec calls them because it isn’t nearly as much a furry as i am? ridiculous

    and yeah, they’re basically like categories or tags. each entry can have zero or more cats assigned, so i can organise them better! this one has several to show off how they look and work :3

    i’ve also started on getting replies, likes, and reposts to work, but i’m not happy with those just yet so i haven’t released them in 1.7 :o but they’ll be here Soon!

  4. lemoncurry 1.5.0: now with indieauth!

    yep, lemoncurry 1.5 can act as its own indieauth-powered authorisation server, which means i can log into various indieweb sites as 00dani.me! cool beans???

    since you can’t log in as me (i hope!), you can’t actually see how the new indieauth support works, so i’ve taken a few screenshots to give you an idea! here’s me logging into two prominent indieauth-capable sites:

    authenticating with IndieAuth.com

    authenticating with Telegraph

    the cute little ☑ and ? icons indicate whether the client has been verified!! indieauth uses a really simple approach to establish client trust, which is that the client id (for example, https://indieauth.com) should contain a publicly-visible reference to its redirect uri (for example, https://indieauth.com/auth/indieauth/redirect). then, indieauth servers can check whether that reference is present, which proves the redirect uri really “goes with” that client id

    unfortunately doing this is still an experimental feature? so i’ve made verification optional and displayed cute little icons, rather than just rejecting unverified clients. the icons also have cute tooltips to explain what they mean:

    indieauth.com is verified

    telegraph.p3k.io is not verified

    adorable!!

  5. what's new in lemoncurry 1.4.0??

    yes, it’s here! gasp 😮

    here’s what’s been added

    • the markdown rendering is a lot smarter now: rather than having the markdown processor escape html, i’m using a pipeline of markdown and bleach, which makes it a lot easier to use a little bit of Harmless html here and there in my content
    • it also does “smart” quotes and other cute stuff like that now so that’s neat too
    • code now looks way nicer, and i made a few other little style tweaks
    • i started implementing indieauth support! it’s not finished yet but it’s gonna be rad 🐱
    • i introduced simple support for host-meta and webfinger - they’re basically ways to discover machine-parseable information from a website, like microformats2 but less nice?? everything is less nice than microformats2
    • speaking of less nice than microformats2, https://schema.org/BreadcrumbList and https://schema.org/Person objects are generated now! this is good because google can display a little more info about the site by reading them, but bad because the same info is already on the pages thanks to microformats2

    yeah!

  6. rise from the ashes

    (yes that was a phoenix wright reference)

    status update: lebd is essentially abandoned now, mostly because it was way too difficult to achieve basic things i wanted in it. instead, 00dani.me is now running on a django codebase i’ve dubbed lemoncurry

    (yes that was a monty python reference)

    lemoncurry’s only seen a few days of development (i started on monday) but already it can basically do everything that lebd could:

    • my h-card’s nicely rendered on the home page, with rel="me" links and all that jazz
    • i can write notes and articles (this is an article) using markdown syntax, and they’re rendered properly as an h-feed with nested h-entry elements
    • syndications are trackable - it’s manual, like it was with lebd, but whatevs

    and a few things that lebd couldn’t:

    • there’s an actual admin panel, which is where i’m typing this, rather than having to insert stuff into the database manually. django has tools to automatically generate the site admin, and i’m using them. pretty rad! in practice i’ll probably end up posting content over micropub anyway but it’s nice to have a site admin
    • two-factor auth!!!! yessssss
    • the html looks a lot nicer! it’s still not perfect, and there’s some messy indentation, but it’s a lot friendlier than it was and i’m pretty happy with it

    so, um, that’s cool?? neat