Skip to content

An implementation of a ActivityPub bot that can communicate with Mastodon servers.

License

Notifications You must be signed in to change notification settings

KristofferStrube/ActivityPubBotDotNet

Repository files navigation

License: MIT GitHub issues GitHub forks GitHub stars

Introduction

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.

Local Development

Setup Database

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

Adding SSH Keys

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

Running the Server

Go to the src/KristofferStrube.ActivityPubBotDotNet.Server/ folder and run.

dotnet run

Goals

Server Interaction Goals

Administration Goals

  • Be able to authenticate the admin somehow.
  • Be able to update a Person information.
  • Be able to create new Notes
  • Be able to delete a Person.

Client Goals

  • Show Person information if someone hits the API and doesn't request valid content-type.
  • Show Person's Articles below Profile information.

About

An implementation of a ActivityPub bot that can communicate with Mastodon servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published