diff --git a/README.md b/README.md index 239e78e35dd68d1704298b0ea3d50d3264c28ebb..082e9bc6170b4407f2c5c6b8984a5a8574809608 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,26 @@ # ActivityPub for Drupal +Implements the ActivityPub protocol for your site. Readers will be able to +follow content on Mastodon and other federated platforms that support +ActivityPub. Responses are possible too (Like, Announce, Reply) with more to +come. + +The module works with the following federated platforms: + +- Mastodon + +## Features + +- Enable ActivityPub per user +- Block remote domains from posting +- Map Activity types to content types +- discovery via Webfinger module +- outbox and followers endpoints +- HttpSignature for authorization +- Accept follow requests, Undo (follow) as well +- Configure Activity types and properties +- Send posts via drush or cron + ## Public and Private keys Public and private keys are saved in private://activitypub/keys. @@ -9,21 +30,33 @@ The default path can be overridden in settings.php via settings: $settings['activitypub_keys_path'] = '/your/path/'; ``` -## Inbox +## Default avatar -Every user has an inbox which currently only accepts a few activities: +The default avatar path can be overridden in settings.php via settings: -'Accept', 'Delete', 'Undo'. All other activity types are ignored. +``` +$settings['activitypub_default_avatar_path'] = '/default/image.png'; +``` + +## Inbox and outbox + +Every user has an inbox and outbox where activities from remote users are stored. + +'Accept', 'Undo' and handled by the 'Static types' plugin. All other activity +types will be stored, but do not have any impact. + +An overview can be found at user/x/activitypub. ## Sending posts to followers Activities in the outbox are stored in a queue and send either by -cron or drush. +cron or drush. Configure this at /admin/config/services/activitypub -## Default avatar +The drush command is activitypub:send-activities -The default avatar path can be overridden in settings.php via settings: +## Drush commands -``` -$settings['activitypub_default_avatar_path'] = '/default/image.png'; -``` +- activitypub:send-activities: send activities ready to be processed +- activitypub:add-to-queue: adds an outbox activity to the queue +- activitypub:delete-activity: send a delete request +- activitypub:webfinger-info: test command to get info about a remote user diff --git a/src/Commands/ActivityPubCommands.php b/src/Commands/ActivityPubCommands.php index 263345251bd49ae9e5e5fdfcf8a07ba88b34ea2b..676eaa264eab6effbb90d68aaa0236ae3aabde24 100644 --- a/src/Commands/ActivityPubCommands.php +++ b/src/Commands/ActivityPubCommands.php @@ -127,22 +127,12 @@ class ActivityPubCommands extends DrushCommands { * @param $field * @param $entity_type_id */ - public function deleteField($field, $entity_type_id) { - $definition_manager = \Drupal::entityDefinitionUpdateManager(); - $field_storage_definition = $definition_manager->getFieldStorageDefinition($field, $entity_type_id); - $definition_manager->uninstallFieldStorageDefinition($field_storage_definition); - } + public function deleteField($field, $entity_type_id) {} /** * Adds a field. This is a command used during development. * * @command activitypub:add-field */ - public function addField() { - $created_field = BaseFieldDefinition::create('created') - ->setLabel(t('Created')) - ->setDescription(t('The time that the activity was created.')); - $definition_manager = \Drupal::entityDefinitionUpdateManager(); - $definition_manager->installFieldStorageDefinition('created', 'activitypub_activity', 'activitypub', $created_field); - } + public function addField() {} }