TL;DR – Set up a long form, ActivityPub supporting, blogging system

Finally set up Writefreely to do my long form blogging which, hopefully, will mean I can write longer stuff of the type most people will skip over. Once I figured out why it didn't work the first time, it seems to work fine. My own platform is one I want to share with friends so there are multiple complications: it's behind a reverse proxy, and I'm using Keycloak to supply SSO.

The only issue I have with what I've configured is that registration is still a “process”, you don't automatically get dropped into the system the first time you log in with openid-connect.

For those interested, my Keycloak OpenID-Connect configuration required the following:

[app]
...
single_user           = false
open_registration     = true
disable_password_auth = true

[oauth.generic]
client_id          = (client id from Keycloak)
client_secret      = (Client secret from Keycloak)
host               = https://(keycloak prefix)/realms/(realm)
display_name       = Virctuary Login
callback_proxy     = 
callback_proxy_api = 
token_endpoint     = /protocol/openid-connect/token
inspect_endpoint   = /protocol/openid-connect/userinfo
auth_endpoint      = /protocol/openid-connect/auth
scope              = profile email
allow_disconnect   = false
map_user_id        = preferred_username
map_username       = preferred_username
map_display_name   = name
map_email          = email

In the above (client id) and (client secret) are from the configuration I set up in Keycloak's client configuration for WriteFreely. For the Keycloak prefix, if you haven't reverse proxied the /auth part of Keycloak URIs away, then you'll need that part to look something like domain/auth, otherwise just domain, eg:

host = https://login.example.social/auth/realms/example/
host = https://login.example.social/realms/example/

In terms of use, I'm still getting used to Writefreely. The formatting takes some getting used to, it's a mixture of raw HTML (the fixed font blocks above are in HTML <PRE> tags) and Markdown. In theory Markdown supports fixed font blocks too, but I can't get it to work. The fact you can always resort to raw HTML is good though, and only an issue if you actually need to use < anywhere...

One other thing, for some reason WriteFreely's installation instructions include this block in their example reverse proxy configuration:

location ~ ^/(css|img|js|fonts)/ { root /var/www/example.com/static; # Optionally cache these files in the browser: # expires 12M; }

This breaks everything. Either remove it, or introduce some smart caching for those paths. Another default configuration snafu is that the built in configurator has Writefreely listening on localhost if you tell it you're using a reverse proxy, but there's absolutely no reason for it to assume the reverse proxy is on the same computer. So when you edit your config afterwards, change “bind” from localhost to [::] if you're using an external reverse proxy.