Explore what your community could build.
FeaturesBUILD Building blocks your community can combine. Comparison tableCOMPARE How Bonfire differs from other community platforms. Case studiesSTORIES How communities are shaping Bonfire for their needs. About BonfireABOUT The project, principles, and people behind it. Try Bonfire at the campground ↗ Launch your BonfireChoose how much you want to run yourself.
Self-hostDIY Your infrastructure and some sysadmin comfort. Cooperative hostingHOST Your own space without a sysadmin job. Co-design with usWITH For communities, organisations and funders with specific needs. Compare all three routes → EcosystemFind people, answers, and tools around Bonfire.
ParticipateJOIN Contribute, collaborate, or help sustain the commons. FAQsASK Licensing, federation, privacy, and governance. DocumentationDOCS Setup guides and technical reference for hosts and builders. Browse the source code ↗ Blog Get startedModular ActivityPub library in Elixir
ActivityPub Library for elixir.
WORK IN PROGRESS, TESTING FEDERATION WITH DIFFERENT IMPLEMENTATIONS IS UNDERWAY
mix.exsdefp deps do
[...]
{:activity_pub, git: "https://github.com/bonfire-networks/activity_pub.git", branch: "stable"} # branch can "stable", or "develop" for the bleeding edge
end
lib/my_app/adapter.ex might look likedefmodule MyApp.Adapter do
@moduledoc """
Adapter functions delegated from the `ActivityPub` Library
"""
@behaviour ActivityPub.Federator.Adapter
end
Note that, due to the defined @behavior, Elixir will warn you that
the required functions
base_url/0get_actor_by_id/1get_actor_by_username/1get_follower_local_ids/1get_following_local_ids/1get_redirect_url/1handle_activity/1maybe_create_remote_actor/1maybe_publish_object/2update_local_actor/2update_remote_actor/1have not yet been implemented though you will be able to start your
app. Defining these allows ActivityPub to handle ActivityPub HTTP
and database calls and operations. An example of an implemented
adaptor can be found
here.
Then set it in config
config :activity_pub, :adapter, MyApp.Adapter
config :activity_pub, :repo, MyApp.Repo
Create a new ecto migration and call ActivityPub.Migration.up/0 from it
Inject AP routes to your router by adding use ActivityPub.Web.Router to your app's router module
Copy the default AP config to your app's confix.exs
config :activity_pub, :mrf_simple,
media_removal: [],
media_nsfw: [],
report_removal: [],
accept: [],
avatar_removal: [],
banner_removal: []
config :activity_pub, :instance,
hostname: "example.com",
federation_publisher_modules: [ActivityPub.Federator.APPublisher],
federation_reachability_timeout_days: 7,
federating: true,
rewrite_policy: []
config :activity_pub, :http,
proxy_url: nil,
user_agent: "Your app name",
send_user_agent: true,
adapter: [
ssl_options: [
# Workaround for remote server certificate chain issues
partial_chain: &:hackney_connect.partial_chain/1,
# We don't support TLS v1.3 yet
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
]
]
Change the hostname value in the instance config block to your instance's hostname
If you don't already have Oban set up, follow the Oban installation intructions and add the AP queues:
config :my_app, Oban, queues: [federator_incoming: 50, federator_outgoing: 50, remote_fetcher: 20]
Now you should be able to compile and run your app and move over to integration.