An ActivityPub home server written in Rust, implementing the Mastodon API.

Related tags

Utilities tafarn
Overview

Tafarn

An ActivityPub home server written in Rust, implementing the Mastodon API.

At present no web UI is provided, the API is the only way to interact with the server.

Configuration

Tafarn is based on Rocket, as such the configuration is handled through the Rocket configuration system. An example configuration file is provided below:

[debug]
secret_key = "<secret key>"
jwt_secret = "<secret key>"
celery = { amqp_url = "amqp://localhost:5672/tafarn" }
uri = "<external uri>"
vapid_key = "./vapid_key.pem"
# The system actor private key
as_key = "./as_key.pem"
media_path = "./media"

[debug.databases.db]
url = "postgres://postgres@localhost/tafarn"

[debug.oidc]
issuer_url = "<oidc issuer url>"
client_id = "tafarn"
client_secret = "<client secret>"

Secret keys can be generated by openssl rand -base64 32. A VAPID key can be generated by openssl ecparam -genkey -name prime256v1 -outform pem -out vapid_key.pem. A system actor key can be generated by openssl genrsa 2048 -outform pem -out as_key.pem.

Authentication

Tafarn does not have its own authentication system, instead it uses an external OIDC provider. The OIDC provider must support the /.well-known/openid-configuration configuration endpoint. On first login the display name will be set to the name claim, and the username to either the preferred_username or given_name claim, if preferred_username is not available.

Localization

Tafarn uses the Fluent localization system. To add a new language copy the en-GB folder in i18n as a starting point.

Currently supported languages are:

ActivityPub implementation status

Events the server can receive

  • Follow Person/Service/Organization/Application/Group
  • Accept follow
  • Reject follow
  • Undo follow
  • Update Person/Service/Organization/Application/Group
  • Create note
  • Announce note
  • Undo announce
  • Delete note
  • Like note
  • Undo like note

Events the server can send

  • Follow Person/Service/Organization/Application/Group
  • Accept follow
  • Undo follow
  • Update Person/Application/Group
  • Create note
  • Announce note
  • Undo announce
  • Like note
  • Undo like note

API endpoints implementation status

apps

  • POST /api/v1/apps
  • GET /api/v1/apps/verify_credentials
  • GET /oauth/authorize
  • POST /oauth/token
  • POST /oauth/revoke
  • POST /api/v1/emails/confirmation

accounts

  • POST /api/v1/accounts (likely never to be implemented)
  • GET /api/v1/accounts/verify_credentials
  • PATCH /api/v1/accounts/update_credentials
  • GET /api/v1/accounts/:id
  • GET /api/v1/accounts/:id/statuses
  • GET /api/v1/accounts/:id/followers
  • GET /api/v1/accounts/:id/following
  • GET /api/v1/accounts/:id/featured_tags
  • POST /api/v1/accounts/:id/follow
  • POST /api/v1/accounts/:id/unfollow
  • POST /api/v1/accounts/:id/remove_from_followers
  • POST /api/v1/accounts/:id/note
  • GET /api/v1/accounts/relationships
  • GET /api/v1/accounts/familiar_followers
  • GET /api/v1/accounts/search
  • GET /api/v1/accounts/lookup
  • GET /api/v1/accounts/:id/identity_proofs (likely never to be implemented)

bookmarks

  • GET /api/v1/bookmarks
  • POST /api/v1/statuses/:id/bookmark
  • POST /api/v1/statuses/:id/unbookmark

favourites

  • GET /api/v1/favourites
  • POST /api/v1/statuses/:id/favourite
  • POST /api/v1/statuses/:id/unfavourite

mutes

  • GET /api/v1/mutes
  • POST /api/v1/accounts/:id/mute
  • POST /api/v1/accounts/:id/unmute

blocks

  • GET /api/v1/blocks
  • POST /api/v1/accounts/:id/block
  • POST /api/v1/accounts/:id/unblock

domain blocks

  • GET /api/v1/domain_blocks
  • POST /api/v1/domain_blocks
  • DELETE /api/v1/domain_blocks

filters

  • GET /api/v2/filters
  • GET /api/v2/filters/:id
  • POST /api/v2/filters
  • PUT /api/v2/filters/:id
  • DELETE /api/v2/filters/:id
  • GET /api/v2/filters/:filter_id/keywords
  • POST /api/v2/filters/:filter_id/keywords
  • GET /api/v2/filters/keywords/:id
  • PUT /api/v2/filters/keywords/:id
  • DELETE /api/v2/filters/keywords/:id
  • GET /api/v2/filters/:filter_id/statuses
  • POST /api/v2/filters/:filter_id/statuses
  • GET /api/v2/filters/statuses/:id
  • DELETE /api/v2/filters/statuses/:id
  • GET /api/v1/filters
  • GET /api/v1/filters/:id
  • POST /api/v1/filters
  • PUT /api/v1/filters/:id
  • DELETE /api/v1/filters/:id

reports

  • POST /api/v1/reports

follow requests

  • GET /api/v1/follow_requests
  • POST /api/v1/follow_requests/:account_id/authorize
  • POST /api/v1/follow_requests/:account_id/reject

endorsements

  • GET /api/v1/endorsements
  • POST /api/v1/accounts/:id/pin
  • POST /api/v1/accounts/:id/unpin

featured tags

  • GET /api/v1/featured_tags
  • POST /api/v1/featured_tags
  • DELETE /api/v1/featured_tags/:id
  • GET /api/v1/featured_tags/suggestions

preferences

  • GET /api/v1/preferences

followed tags

  • GET /api/v1/followed_tags
  • POST /api/v1/tags/:id/follow
  • POST /api/v1/tags/:id/unfollow

suggestions

  • GET /api/v2/suggestions
  • DELETE /api/v1/suggestions/:account_id
  • GET /api/v1/suggestions

tags

  • GET /api/v1/tags/:id

statuses

  • POST /api/v1/statuses
  • GET /api/v1/statuses/:id
  • DELETE /api/v1/statuses/:id
  • GET /api/v1/statuses/:id/context
  • GET /api/v1/statuses/:id/reblogged_by
  • GET /api/v1/statuses/:id/favourited_by
  • POST /api/v1/statuses/:id/reblog
  • POST /api/v1/statuses/:id/unreblog
  • POST /api/v1/statuses/:id/mute
  • POST /api/v1/statuses/:id/unmute
  • POST /api/v1/statuses/:id/pin
  • POST /api/v1/statuses/:id/unpin
  • PUT /api/v1/statuses/:id
  • GET /api/v1/statuses/:id/history
  • GET /api/v1/statuses/:id/source

media

  • POST /api/v2/media
  • GET /api/v1/media/:id
  • PUT /api/v1/media/:id
  • POST /api/v1/media

Only image uploads are currently supported, videos and audio will result in a HTTP 422 Unprocessable Entity response.

polls

  • GET /api/v1/polls/:id
  • POST /api/v1/polls/:id/votes

scheduled statuses

  • GET /api/v1/scheduled_statuses
  • GET /api/v1/scheduled_statuses/:id
  • PUT /api/v1/scheduled_statuses/:id
  • DELETE /api/v1/scheduled_statuses/:id

timelines

  • GET /api/v1/timelines/public
  • GET /api/v1/timelines/tag/:hashtag
  • GET /api/v1/timelines/home
  • GET /api/v1/timelines/list/:list_id
  • GET /api/v1/timelines/direct

conversations

  • GET /api/v1/conversations
  • DELETE /api/v1/conversations/:id
  • POST /api/v1/conversations/:id/read

lists

  • GET /api/v1/lists
  • GET /api/v1/lists/:id
  • POST /api/v1/lists
  • PUT /api/v1/lists/:id
  • DELETE /api/v1/lists/:id
  • GET /api/v1/lists/:id/accounts
  • POST /api/v1/lists/:id/accounts
  • DELETE /api/v1/lists/:id/accounts
  • GET /api/v1/accounts/:id/lists

markers

  • GET /api/v1/markers
  • POST /api/v1/markers

streaming

  • GET /api/v1/streaming/health
  • GET /api/v1/streaming/user
  • GET /api/v1/streaming/user/notification
  • GET /api/v1/streaming/public
  • GET /api/v1/streaming/public/local
  • GET /api/v1/streaming/public/remote
  • GET /api/v1/streaming/hashtag
  • GET /api/v1/streaming/hashtag/local
  • GET /api/v1/streaming/list
  • GET /api/v1/streaming/direct
  • wss://<>/api/v1/streaming

notifications

  • GET /api/v1/notifications
  • GET /api/v1/notification/:id
  • POST /api/v1/notifications/clear
  • POST /api/v1/notifications/:id/dismiss

web push

  • POST /api/v1/push/subscription
  • GET /api/v1/push/subscription
  • PUT /api/v1/push/subscription
  • DELETE /api/v1/push/subscription

search

  • GET /api/v2/search

Search currently only handles accounts, hashtags and statuses are always empty.

instance

  • GET /api/v2/instance
  • GET /api/v1/instance
  • GET /api/v1/instance/peers
  • GET /api/v1/instance/activity
  • GET /api/v1/instance/rules
  • GET /api/v1/instance/domain_blocks
  • GET /api/v1/custom_emojis
  • GET /api/v1/directory

trends

  • GET /api/v1/trends/tags
  • GET /api/v1/trends/statuses
  • GET /api/v1/trends/links

announcements

  • GET /api/v1/announcements
  • POST /api/v1/announcements/:id/dismiss
  • PUT /api/v1/announcements/:id/reactions/:name
  • DELETE /api/v1/announcements/:id/reactions/:name

oembed

  • GET /api/oembed

admin

No admin API endpoint is currently implemented.

You might also like...
Rust implementation of the legacy Master Server Query Protocol

msq-rs Rust library implementation of the legacy Master Server Query Protocol. Documentation crates.io Repository Release Notes Usage Add this to your

PM-Tools - a simple Rust util to easily create server directories

PM-Tools PM-Tools is a simple Rust util to easily create server directories or plugins without the hassle of unzipping or creating directories Progres

client-server notification center for dbus desktop notifications

tsuchita A client-server notification center for dbus desktop notifications. Specifically org.freedesktop.Notifications dbus messages. Motivation I ju

A custom invoke system for Tauri that leverages a localhost server

Tauri Invoke HTTP This is a crate that provides a custom invoke system for Tauri using a localhost server. Each message is delivered through a XMLHttp

Build your service-server fast, easy (and without hosting!)
Build your service-server fast, easy (and without hosting!)

service-io is a library to build servers that offering services with really little effort. Choose an input connector. Choose an output connector. Choo

A stupidly simple and easy to self-host, personal server for file hosting on the web
A stupidly simple and easy to self-host, personal server for file hosting on the web

Grasswave CDN A stupidly simple and easy to self-host, personal server for file hosting on the web. Written in Rust. Thanks, @Maciejowski, for the sty

tree-sitter server for kakoune

tree-sitter.kak Warning This currently just a proof-of-concept, and isn't stable yet. A Tree-sitter server that keeps parsed ASTs in memory. This is u

High level rust abstractions for the libretro API

libretro-rs Design Philosophy The approach to this crate can best be summarized as wanting to expose all functionality, even if not idiomatically. The

Rust library for interacting with the VTube Studio API

vtubestudio-rs A library for interacting with the VTube Studio API. Basic usage This example creates a Client using the provided builder, which: conne

Comments
  • project logo?

    project logo?

    maybe its too early for filing random issues but do you have any ideas for what you want as a logo for the project? project colors are also a good thing to figure out early on

    opened by wakest 1
Owner
✨ Q (it/its) ✨
🏴󠁧󠁢󠁷󠁬󠁳󠁿 ISO/IEC Standard Magical Code Witch. Autistic. Vegan(ish). Pushing packets at @AS207960. PGP: 0F28DC71767B4338
✨ Q (it/its) ✨
Source to relay.fedi.buzz: the customizable ActivityPub relay

buzzrelay A follow-only ActivityPub relay that connects to Mastodon's Streaming API. You don't need to run this yourself, just use the instance at rel

Astro 7 Jan 23, 2023
"Philips Ambilight for desktops". A tool to generate color palettes from your desktop wallpaper and send them to Home Assistant.

Desktop Dye DesktopDye is an open source project written in Rust that allows users to have their lights paired with Home Assistant adjust to the most

Jeroen Meijer (Jay) 7 Feb 22, 2023
Minimal, flexible framework for implementing solutions to Advent of Code in Rust

This is advent_of_code_traits, a minimal, flexible framework for implementing solutions to Advent of Code in Rust.

David 8 Apr 17, 2022
An unofficial and incomplete no_std Rust library for implementing the ElectricUI Binary Protocol

An unofficial and incomplete no_std Rust library for implementing the ElectricUI Binary Protocol

Jon 2 Mar 29, 2022
A framework for iterating over collections of types implementing a trait without virtual dispatch

zero_v Zero_V is an experiment in defining behavior over collections of objects implementing some trait without dynamic polymorphism.

null 13 Jul 28, 2022
Derive macro implementing 'From' for structs

derive-from-ext A derive macro that auto implements 'std::convert::From' for structs. The default behaviour is to create an instance of the structure

Andrew Lowndes 4 Sep 18, 2022
A xdg-desktop-portal for wlroots based compositors implementing zwlr_screencopy

xdg-desktop-portal-luminous An alternative to xdg-desktop-portal-wlr for wlroots compositors. This project is a stand alone binary and does not depend

Waycrate 7 Aug 27, 2023
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito ?? Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

naokirin 4 Aug 30, 2022
An MVP-worthy background job server for PostgreSQL, written in Rust

Pointguard An MVP-worthy background job server for PostgreSQL, written in Rust A simple background job server (database) on top of PostgreSQL, that ca

Gal Schlezinger 23 Nov 25, 2023
A simple omegle API written in Rust

omegalul-rs omegalul-rs is a work-in-progress opensource library for building Omegle clients. Features Current Features Fetching random server from om

NV6 5 Jun 21, 2022