Articles tagged #ftl-infra

The thumbnail for this page

Open sourcing the home CMS

I’ve been bragging about my website software for years! For… whew, it’s been 5 years!

A screenshot of github commits for the beginning of my website. It has commit messages like 'learning rusqlite', 'walk stuff', 'import input files', 'parse frontmatter and stuff', and 'do stuff in parallel'.

I didn't want to make a CMS! I did it out of spite!

I’ve been teasing folks about the cool things I did from the beginning — here’s all the articles and series I’ve written that mention it:

The thumbnail for this page

State of the fasterthanlime 2024

It’s time for some personal and professional news!

TL;DR: I started a podcast with James, I’m stable on antidepressants, I’m giving a P99 CONF about my Rust/io_uring/HTTP work, I’m trying on “they/them” as pronouns, I’m open-sourcing merde_json, rubicon and others, I got a divorce in 2023, I found a new business model.

Now that we’re on the same page: let’s unpack this a bit!

The thumbnail for this page

Cut for time

This series has to end somewhere, so let’s end it here!

However, here is a list of some things I’d like to come back to:

Bundling & TypeScript

Using a bundler like Parcel so I can write some of the client-side logic in TypeScript, have it take care of building the SCSS, etc.

I do that to great effect in another project of mine and I’d like to show you how I did it!

The thumbnail for this page

Async fn in trait, for real this time

async_trait’s one weird type ascription trick

Now that I got the Log in with GitHub feature working, let’s explore what this would’ve looked like with the async_trait crate.

First up, the trait definition:

/// Something that can refresh credentials #[async_trait::async_trait] pub trait CredentialsRefresher { async fn refresh(&self, creds: &FutileCredentials) -> eyre::Result<FutileCredentials>; }
The thumbnail for this page

Implementing "Log in with GitHub"

Because I started accepting donations via GitHub Sponsors, and because donating at the “Silver” tier or above gives you advance access to articles and your name in the credits, I need to interface with the GitHub API the same way I do the Patreon API.

Because I’d rather rely on third-party identity providers than provide my own sign up / log in / password forgotten / 2FA flow, user identifiers on my website are simply {provider}:{provider_specific_user_id}:

The thumbnail for this page

Trying to use nix

Now that my website is deployed as a container image, I wanted to give nix a try. I’m still doing it the old-fashioned way right now: with a Dockerfile, running cargo in a “builder” image, copying stuff out of there into a slimmer image (that still has an Ubuntu base, even though distroless images are a thing now).

But why?

I was mostly interested in nix because some parts of my website have pretty big native dependencies. futile itself mostly relies on sqlite3 and some JS engine (used to be quickjs, currently duktape because MSVC Windows builds). But the asset processing pipeline, salvage (which I’d like to integrate with futile at some point) has a bunch more!

The thumbnail for this page

Deploying at the edge

Disclaimer:

Although I no longer work for the company my website is hosted on, and this article is written in way that mentions neither my previous or current hosting provider: at the time of this writing, I don’t pay for hosting.

One thing I didn’t really announce (because I wanted to make sure it worked before I did), is that I’ve migrated my website over completely from a CDN (Content Delivery Network) to an ADN (Application Delivery Network), and that required some architectural changes.

The thumbnail for this page

Async fn in trait... not

Async fn in trait… not

I was planning on showing the in-progress async_fn_in_trait feature in the context of my website, but it turns out, I can’t!

My website uses two databases: one local SQLite database for content, and a shared Postgres database for user credentials, preferences etc. Migrations are run on startup, and each migration implements one of the following traits:

Go back to the homepage.