Skip to content

bonfire-networks/activity_pub

 
 

Repository files navigation

ActivityPub

ActivityPub Library for elixir - standalone edition.

HEAVY WORK IN PROGRESS, BREAKING API CHANGES EXPECTED

Installation

  1. Add this library to your dependencies in mix.exs
defp deps do
  [...]
  {:activity_pub: git, "https://gitlab.com/CommonsPub/activitypub.git", branch: "stable"}
end
  1. Create an adapter module (more on that later) and set it in config
config :activity_pub, :adapter, MyApp.MyAdapter
  1. Set your application repo in config
config :activity_pub, :repo, MyApp.Repo
  1. Create a new ecto migration and call ActivityPub.Migration.up/0 from it

  2. Inject AP routes to your router by adding use ActivityPubWeb.Router to your app's router module

  3. 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,
  federation_publisher_modules: [ActivityPubWeb.Publisher],
  federation_reachability_timeout_days: 7,
  federating: true,
  rewrite_policy: []

config :activity_pub, :http,
  proxy_url: nil,
  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"]
    ]
  ]
  1. 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]

Now you should be able to compile and run your app and move over to integration.

About

Modular ActivityPub library in Elixir

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages