MoreRSS

site iconRobb Knight

I am the lead developer at Radweb working on InventoryBase and related products. I also work part-time as a developer for MacStories.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of Robb Knight

Installing GoToSocial on Coolify

2024-11-21 05:00:33

For various reasons I had occasion this evening to give GoToSocial a try so I installed it on my server that's running Coolify but hit a couple of issues which I was able to work around with the help of Lewis and Brandon.

First up because it's running a reverse proxy, I needed the third option in the Docker compose file.

ports:
# - "443:8080"
## For letsencrypt:
#- "80:80"
## For reverse proxy setups:
- "127.0.0.1:8082:8080"

The second issue was GoToSocial couldn't access the database, giving this error in the logs:

sqlite ping: sqlite3: unable to open database file

This GitHub issue showed it was a permissions issue where the user specified in the docker compose isn't the one that has permissions for the gotosocial/data file. I could have tried to work out what the user and group was or I could chmod my way out this problem. Guess which one I picked. In Coolify go to Terminal in the sidebar, choose the project GoToSocial is installed on then connect and cd to the directory. Then set permissions on the data directory.

$ cd /data/coolify/services/isjdbvfihsavfids/
$ chmod 777 gotosocial/data

I got the directory it's installed at (/isjdbvfihsavfids) by checking the storage tab on the GoToSocial service in Coolify.

Other notes:

  • /settings gets you to the settings page of your account.
  • Default visibility of posts is "unlisted", a difference from Mastodon where it's public by default. You can change this in settings.
  • Other instance-level settings (like custom CSS on profiles) can be changed in the config.yaml file, see the docs on configuration here.
  • Making a user an admin requires restarting the server.

I'm still playing around with GoToSocial but it's looking like a good solution for what I want - something easier to maintain than Mastodon and less resource-intensive.

Stopping Mastodon From Fetching Metadata for My Notes

2024-11-19 21:34:28

I'm trying to move towards POSSE for my short/micro posts and one thing I wasn't sure about was if those short posts should link back to the source or not. I tooted a poll about this:

People who POSSE short posts do you link back to the source or not? Seems a bit redundant but also it is nice to get to the canonical source.

And the results were:

   
Yes I link back 29%
No I don't link back 21%
I link back if it's truncated 15%
wtf is posse you weirdo 35%

This was hardly a landslide victory for one specific way but I came to the conclusion I did want to link back. However, the real reason for my poll was exactly what Kevin replied with:

Where it gets weird is if there's a preview of the post as well, so then you get the POSSE copy of the post, then underneath a preview showing the same text, then if you click through there's just the same text again. In that case a link back is creating a bad experience for your readers on the POSSE platform.

As an example, here is a short post with a link back to the source:

A post on Mastodon showing the note, plus the image preview

As proud as I am of my open graph image, in this context it's superfluous[1]. We have the content of the post "Boo! I wanted...", then a big image that tells you it's a note, then the date it was sent (which you'd know from the toot as well), then the same text as the OG image "A note from the desk...". Then if you click through you get the same text as the toot. This is no good.

I could just remove the open graph images and data all together but what if someone else links the page elsewhere? I would want them in that case. So the solution is to block the Mastodon user agent from getting them when a link to one of my notes is tooted. Into the nginx config.

I only want this to apply to pages that start with /notes so I started with a new location block and thankfully Mastodon uses the aptly-named Mastodon user agent.

location /notes {
if ($http_user_agent ~* "Mastodon" ) {
}
}

I don't want to flat-out block Mastodon so instead I return an empty web page:

location /notes {
if ($http_user_agent ~* "Mastodon" ) {
+ add_header Content-Type text/html;
+ return 200 '<html><body></body></html>';
}
}

I added this to my nginx config and tested it in Chrome by changing the user agent (Inspector > More Tools > Network Conditions) and it worked - I got a blank page back. Great success. Except now no one could access any notes page. I needed to update the config to have fallback logic for anything that wasn't Mastodon:

location /notes {
if ($http_user_agent ~* "Mastodon" ) {
add_header Content-Type text/html;
return 200 '<html><body></body></html>';
}

+ try_files $uri $uri/ /404.html?$query_string;
}

With this all deployed to my server[2], a syndicated note like this one now only shows the link on Mastodon with no title, description, or image.

A toot with a link to my site with no image or card

Update

Adam sent me his code to do it for a bunch of different fediverse servers

location /notes {
- if ($http_user_agent ~* "Mastodon") {
+ if ($http_user_agent ~* (Mastodon|Pleroma|Akkoma|Misskey|Firefish|gotosocial|Bridgy|Friendica)) {
add_header Content-Type text/html;
return 200 '<html><body></body></html>';
}
}

  1. Adam would argue they're always superfluous

  2. You can see how I'm keeping nginx changes in version control in this post

Useful Bluesky Tools

2024-11-18 23:15:19

I've been helping getting MacStories setup on Bluesky this weekend and I came across a few handy sites. There are loads of interesting Bluesky-related links in this awesome-bluesky list on GitHub, below is just the ones I happened upon and found useful.

ClearSky allows you to see which lists (starter packs) you're in, who you've blocked and who's blocked you. As an aside, the blocking data being public and having no way to opt out of a starter pack shows a complete lack of consideration for how this could be abused but that's not the point of this post. Less important but why is seven the minimum for a starter pack this makes me very sad.

I found two tools for resolving DIDs which you need for various API-related things. A DID is a "persistent, long-term identifier for every account." and they look something like this: did:plc:b3i7xuqiybecdpm3lkywmlwv.

To use Bluesky in Mastodon clients like Ivory, you can use Skybridge. I doubt I would ever check Bluesky if I couldn't use Ivory. I setup my own install of this with Coolify. Deck Blue is a nice web client though.

Finally SkyLink is a Chrome extension similar (although not as advanced) to Streetpass.

You can see all the MacStories team and podcast accounts in the MacStories starter pack and I'm there as @rknight.me.

I Was a Guest On AppStories This Week

2024-11-18 20:52:40

The past few weeks AppStories has had a different MacStories host as a guest and this week was my turn. In the AppStories+ pre-show we talk about the origins of Ruminate and in the main show we discuss the fediverse and ActivityPub, some of my projects, as well as my development setup. Stick around to find out what kind of person Federico thinks I am because I'm still reeling.

Listen to episode 412: What Kind of Person Are You? in your podcatcher of choice or you can watch the episode on YouTube.

Buffalo Sauce Recipe

2024-11-18 05:07:39

I don't know where I got this recipe but it's buffalo sauce so I suspect it's mostly the same from everyone but here we are, final day of recipe week. Enjoy.

  • 300g Hot Sauce
  • 4 Garlic Gloves
  • 20g Worcestershire Sauce
  • 15g Distilled Vinegar
  • 120g Unsalted Butter

Add hot sauce, garlic gloves, worcestershire sauce, and distilled vinegar to sauce pan over medium high heat. Whisk ingredients together and allow to cook for 5 minutes until thickened slightly. Whisk in the unsalted butter slowly on low heat. A tiny pinch of Xantham gum once it's off the heat.