GoActivityPub library

The release just after Christmas

As I had a week off between Christmas and the New Year’s it looks like this changelog is slightly bigger. Notable mentions are the speeding of FedBOX, having Tags as standalone objects, and allowing usernames in directory listings for some sites.

I also did some performance tests on FedBOX that resulted in some more work for gob encoding and more aggresive caching in the fs storage.

Tags as standalone ActivityPub Objects

Improving handling of Tags as full ActivityPub objects.

Improvements to saving mentions and tags to the objects collection

Filters improvements

Fix private message filters.

Display 404 if ~handler page doesn’t find a valid actor on FedBOX.

Trim spaces from user handles at registration time.

Improvement to filtering out Objects that are missing the required properties that the filter would match against (eg, a request that contains Activity based filters skips regular objects, links, actors, etc).

Ensure an Item collection passes if one of the items passes.

Added filtering based on tag names.

Speed improvements

Fix caching of a logged account’s FedBOX Outbox.

Adding a Reset method on the FedBOX fs storage so we can reset caches.

Improvements to FedBOX’s fs storage by adding an in memory cache.

Moderation improvements.

Allow both moderation items and regular items in listings.

Fix for not showing the same item multiple times in the moderation listing.

Session improvements.

Try to avoid loop redirect when not being able to save session.

Fixing errors when unable to access underlying session backend.

Disable sessions if unable to access the sessions path folder when initializing fs storage in Brutalinks.

Remove session file on user logout.

Better errors when loading account from session and refreshing its collections.

Check that the session stored account matches a valid actor on the FedBOX backend.

Fix a crash when a session cookie points to invalid account.

UI/UX improvements

Adding user names to how we display the directory link for submissions coming from some websites. The supported websites are GitHub and GitLab, Twitter, Twitch, and the ones with ~ as a prefix for usernames (eg, this project, SourceHut).

Don’t display Reply on the Edit button when editing private messages.

Change the HTML sanitation policies for titles and content.

Add flash error for trying to call actions on items that don’t belong to the logged user.

Moved max width for content.

Fix for not showing titles of private messages.

Avoid redirecting to same URL when not logged in.

Other smaller changes

Broke and then fixed editing.

Moved cli executable signal handling behaviour to separate package to be used in both Brutalinks and FedBOX.

Add routes to items based on their dates. This allows access to deleted items or items belonging to deleted accounts.

Removing some static variables that were storing FedBOX endpoints.

Changes to interacting with IRIs coming from the configured FedBOX backend. We’re replacing them to use our configured API_URL value. This is useful for docker setups.

Improve account registration and resulting errors.

Added explicit 404 route for the favicon in FedBOX

Removed replacing the hosts of items with the host from the request in favour of moving this type of logic in the client.

ActivityPub

Improvements to decoding objects without a type (these are referring mostly to Tags).

Added some convenience functions for checking if an Item is an Object or an IRI.

When unmarshaling from Json allow InReplyTo to be a single item, not always an item collection.

Don’t depend on having the Type set when trying to call OnSomething functions.

In integration tests add functionality to our custom deepEquals to take into account comparisons of values that can be coerced to basic types.

Added ToLink and OnLink convenience functions.

Client

Added some higher level functionality to the activitypub client.

This allows accessing directly Collections on Objects and Actors and pushing activities to Inboxes (S2S) and Outboxes (C2S) for any ActivityPub server. The API is not very useful at the moment but it’s a starting point. This change was meant to be used from Brutalinks initially, but some custom functionality we’re using wasn’t possible on top of this generic client ( ensuring we’re using the configured API_URL when accessing FedBOX IRIs).

Processing

Trying to improve how we detect that an IRI belongs to the running service, or is remote, by using IP validation against localhost or a predefined slice of IRIs.

Adding automatic saving of an Object if it doesn’t have an ID when it’s embedded in an another’s Object Tag collection.

/Marius Berlin 12th Jan, 2021