Toki
Toki copied to clipboard
A C# Fediverse server.
Toki
n. (toki pona) - communication, speech

A C# ActivityPub Fediverse-compatible server designed mostly for small-ish instances.
I'm working on it as sort of a personal challenge, considering I've always wanted to implement the ActivityPub protocol.
While Toki has its own frontend called luka, it supports the Mastodon API protocol, allowing it to be used with your favorite client.
Do note that Toki isn't considered truly stable for the time being, and while it is very much usable for usage, it might still undergo changes.
Usage
Toki doesn't have an admin panel yet. There are plans to make one and the required steps are outlined in the Administration Roadmap issue. (If anyone would want to help out with it, I'd be insanely thankful...)
Running Toki for the first time
Firstly, make sure that the .NET 8 runtime is installed, alongside Docker.
-
Clone the repository to a directory of your choice.
-
Inside of the repository, run
docker compose up -dto initialize and run all of the docker containers required by Toki. -
After that, navigate to the
Toki.Adminrepository. -
Inside of there, execute
dotnet run <path to appsettings.json> setupto perform the first-time setup.a. NOTE: The
appsettings.jsonfile is located in theTokifolder, and the path to it must be absolute. (that is, if the folder of theTokifolder is/opt/toki/Toki, the path toappsettings.jsonwould be/opt/toki/Toki/appsettings.json)b. NOTE 2: You must create the directory you've specified as the upload directory. Toki doesn't do it automatically.
-
Navigate to the
Tokidirectory. From there rundotnet run --configuration Release --auto-migrateto perform the neccessary migrations and run Toki for the first time.
Toki should now be up and running!
Updating Toki
In order to update an already existing version of Toki, you must:
-
Stop the currently running Toki instance
-
Navigate to the root of the git repository and
git pullthe latest changes. -
Navigate to the
Tokidirectory and from there rundotnet run --configuration Release --auto-migrate. This will automatically perform the database migrations (if any happened).
Installing Luka
By default Toki doesn't launch with a frontend. Unlike Pleroma/Akkoma we don't support installing frontends from the admin panel yet, but manual installation is still possible.
As a prerequisite, the latest version of Node.JS is required.
-
Clone luka into a directory of your choice.
-
Navigate to the luka folder.
-
Inside of the luka git repository, navigate to
src/configand inside of theconfig.jsfile, edit it to point to the domain of your Toki instance. -
Run
npm installto install all of the required packages. -
Run
npm run buildto build the release version of Luka. -
Copy all of the files from the
distfolder to<toki git repo>/Toki/wwwroot. -
In the
appsettings.jsonfile, add (or modify if it already exists) the following section:
"Frontend": {
"Enabled": true,
"SpaFilename": "index.html"
}
- Restart Toki, and luka should be already running!
Importing emojis from packs
As a prerequisite, the emojis should be packed in a zip file without any subdirectories with the names <the emoji name you want>.<extension>.
If you already have the zip file ready:
-
Navigate to the
Toki.Adminfolder. -
From there, execute
dotnet run <path to appsettings.json> importemojipack --path <path to your zip file>. Toki should automatically extract the emojis and add them to the database. -
Restart Toki, and enjoy your emojis!
Modules
Toki contains the server & Web backend.
Toki.ActivityPub contains all of the ActivityPub related logic, like the models, and various resolvers.
Toki.ActivityStreams contains the ActivityStreams implementation.
Toki.HTTPSignatures contains our HTTP signatures implementation.
Contributing Guide
If you'd really want to contribute to this project (thank you!) please adhere to the Conventional Commits commit format as much as you can.
Requirements
- .NET 8
- PostgreSQL (as the database)
- Redis (for the job queue)