Package: f2ap
f2ap (Feed to ActivityPub) is a web application that uses the RSS/Atom feed of your website to expose it on the Fediverse
through ActivityPub.How to use itPrerequisiteThe only prerequisite to use f2ap is that your website provides an RSS or Atom feed.
If you don't have one yet, you might want to make it first, as it is a Web standard that allows your visitors to stay in touch with your content with any compatible application. Plus, it is very easy to implement.InstallationWith PyPIRequired:Python 3.9+Install thef2appackage:pipinstallf2apThe application will be runnable with thef2apcommand.
You will need to use a runner like systemd to start it as a service.DockerRequired:DockerGrab the image from Docker Hub:dockerpulldeuchnord/f2apYou can get a specific version with the following syntax:deuchnord/f2ap:<tag>, where tag is one of the following (i,jandkbeing numbers):latest: the last version (default)i: the last version of theimajor versioni.j: the last version of thei.jminor versioni.j.k: the versioni.j.kunstable: the last commit in the Git history.
It is heavily discouraged to use it in production, as it can have bugs, crash, put fire in your house or, worse, kill your kitten.Docker-ComposeIf you want to use f2ap through Docker-Compose, check thedocker-compose.dist.ymlfor an example of configuration.ConfigurationTo make f2ap work, you will need to write a configuration file that will define its behavior.
It is a boring simple TOML file. You can find a self-documented file inconfig.dist.toml.
If you run f2ap with Docker, make sure to name itconfig.tomland to place it in the/datafolder.Configuring the serverTo provide a better integration to your website, you are encouraged to add some configuration lines to your server.
This will ensure the social applications will correctly discover your website's ActivityPub API.NginxEdit your configuration file and add the following lines to yourserversection.
Don't forget to adapt:the IP address on theproxy_passlines to match f2ap's configuration;the<username>part in the lastlocationto match the username of your actor.server{## ...# Propagate the domain name to f2approxy_set_headerHost$host;# The webfinger allows the social applications to find out that your website serves an ActivityPub API.location/.well-known/webfinger{proxy_passhttp://127.0.0.1:8000;}location/{# Match any request asking for an ActivityPub contentif($http_accept~.*application/activity\+json.*){proxy_passhttp://127.0.0.1:8000;}# Match any request sending an ActivityPub contentif($http_content_type="application/activity+json"){proxy_passhttp://127.0.0.1:8000;}}# Exposes the avatar and the header of the profile# Change the <username> here with the username of the actor you expose (for instance: blog)location~/actors/<username>/(avatar|header){proxy_passhttp://127.0.0.1:8000;}## ...}LimitationsBecause f2ap uses your RSS/Atom feed to connect your website to ActivityPub, the time before a new entry pops on the Fediverse will depend on the refresh frequency. You might want to choose a frequency that matches your update regularity.If this behavior is a problem, f2ap is probably not the right solution for you, and you might need to integrate ActivityPub to your application on your own.