Not Very Blogged

Reader

Read the latest posts from Not Very Blogged.

from David's Ramblings

I've been trying to set up writefreely to federate with my Mastodon instance but it's been fighting me. Debug logs showed a cryptic message attempting to follow myself failed to decode PEM block:

Nov 10 03:45:39 notvery writefreely[555357]: 2022/11/10 03:45:39 Fetching actor https://notvery.social/users/therabidbanana locally
Nov 10 03:45:39 notvery writefreely[555357]: 2022/11/10 03:45:39 Not found; fetching actor https://notvery.social/users/therabidbanana remotely
Nov 10 03:45:39 notvery writefreely[555357]: 2022/11/10 03:45:39 GET https://notvery.social/users/therabidbanana
Nov 10 03:45:39 notvery writefreely[555357]: ERROR: 2022/11/10 03:45:39 activitypub.go:808: Unable to get actor! failed to decode PEM block containing private key
Nov 10 03:45:39 notvery writefreely[555357]: ERROR: 2022/11/10 03:45:39 activitypub.go:413: Unable to resolve Follow: Couldn't fetch actor.

This error turns out to come from here: https://github.com/writeas/web-core/blob/fd1559928a0f11640eded30121574376c15a396e/activitypub/keys.go#L73

But why? This is a fresh install, and writefreely generated its own keys! Turns out it is calling out to openssl to do the actual generate, and Ubuntu 22 comes with OpenSSL 3 that uses a different key format. Had to go and manually insert some traditional style RSA keys to my database to make federation work here:

https://stackoverflow.com/questions/70266909/create-pkcs1-formatted-rsa-key-using-openssl-v3-0-0

 
Read more...

from David's Ramblings

Lessons learned getting started hosting my own Mastodon instance

Getting Started

It all started with a tweet pointing to runyourown.social. This has been sitting in my browser for nearly a year – but recent Twitter events finally made it seem worth investing time and effort into.

Honestly the hardest part was probably coming up with a good name for a fake social network. I'm not very creative, so I landed on https://notvery.social/

Installation

Mastodon (and therefore the Hometown fork) is Ruby on Rails and Sidekiq, which are pretty familiar territory for me. The guides for setting up a Linux server were very easy to follow along with.

The hardest bits to get going with were setting up a Linode to send email directly (had to follow along with a guide and also set up SPF and DKIM) and also using Linode Object Storage, supposedly S3 compatible, but with some non-intuitive setup for the options – the key one here being S3_OVERRIDE_PATH_STYLE:

S3_ENABLED=true
S3_PROTOCOL=https
S3_BUCKET=files.notvery.social
S3_REGION=us-southeast-1
S3_HOSTNAME=us-southeast-1.linodeobjects.com
S3_ENDPOINT=https://us-southeast-1.linodeobjects.com
S3_OVERRIDE_PATH_STYLE=true
AWS_ACCESS_KEY_ID=….
AWS_SECRET_ACCESS_KEY=...
S3_ALIAS_HOST=us-southeast-1.linodeobjects.com/files.notvery.social/

Setting Up

Once the server was able to upload files and send emails, it was pretty straightforward to set up – just needed to find some users to follow in the fediverse. There's a growing number of tools for finding follows from Twitter – but this one I found to be most effective:

https://pruvisto.org/debirdify

You can also find some other lists of people to follow floating around, but make sure to check whether the people want to be followed.

Extras

Mastodon provides OAuth 2 which makes it also able to log into other services pretty easily.

@darius@friend.camp came up with an RSS-to-Activity Pub converter we can use to pull in some news articles.

WriteFreely.org is a blogging platform that can be subscribed to by any Mastodon instances and also runs as a self-contained service (with SQLite) with OAuth for login (which Mastodon can provide).

 
Read more...