An implementation of a ActivityPub bot that can communicate with Mastodon servers.
Try to say "AcitivityPub Bot Dot Net" fast three times.
It is build using Minimal API and EF Core with SQLite. It uses the KristofferStrube.ActivityStreams NuGet package for strongly typed classes for parsing the payload of endpoints and to send messages to other servers.
You can see it in action at https://kristoffer-strube.dk/API/ActivityPub/Users/bot where the bot serves my blog posts from kristoffer-strube.dk in its Outbox using the RSSFeedOutboxService
.
It is build with inspiration from David Fowler's project TodoApi.
Setup the dotnet tool dotnet-ef.
dotnet tool install dotnet-ef -g
Create the database by running the following script from the src/KristofferStrube.ActivityPubBotDotNet.Server/
folder.
dotnet ef database update
For the server project you need to add two configuration keys that will contain a RSA key value pair.
These can either be supplied through User Secrets or by setting the appropriate values in appsettings.Development.json
. The Keys are:
PEM:Public
PEM:Private
Go to the src/KristofferStrube.ActivityPubBotDotNet.Server/
folder and run.
dotnet run
- Accept Follow activities sent to Person.
- Remove subscription when someone Undo a Follow activity.
- Persist Person information in EF Core.
- Validate message signing.
- Dynamic information of Person.
- Dynamic WebFinger endpoint.
- Serve Articles of Person from RSS feed.
- Serve Notes of Person from administrative tool.
- Send Create Activity message when a new Article is created.
- Send Delete Activity message when Person information changes.