Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ActivityPub support to Known #2615

Open
benwerd opened this issue Dec 5, 2019 · 11 comments
Open

Add ActivityPub support to Known #2615

benwerd opened this issue Dec 5, 2019 · 11 comments

Comments

@benwerd
Copy link
Member

benwerd commented Dec 5, 2019

Known should support inbound and outbound ActivityPub, in order to achieve full compatibility with fediverse tools like Mastodon.

This includes:

  • Posting
  • Likes, reposts, etc
  • A feed of followed accounts

This also includes a default feed of accounts, so that a Known site doesn't feel empty when a site owner logs into it for the first time.

@Cambridgeport90
Copy link

Heck yes! That would be cool. Even better if built in. Then again, I have a friend who says that having everything built in is not always the best.

@almereyda
Copy link

almereyda commented Jan 9, 2020

I'm especially looking towards publishing to Mastodon, either via the client-server or the server-server interface, to keep Idno/Known my single source of truth for keeping a personally hosted interfaces to my social network activity.

@Cambridgeport90
Copy link

Cambridgeport90 commented Jan 9, 2020 via email

@benwerd
Copy link
Member Author

benwerd commented Dec 10, 2021

I'm bumping this and will add an OpenCollective bounty.

@benwerd benwerd changed the title ActivityPub support Add ActivityPub support to Known Dec 10, 2021
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 3004.5068 USD (3000.0 USD @ $1.0/USD) attached to it.

@gitcoinbot
Copy link

gitcoinbot commented Dec 11, 2021

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 264 years, 11 months from now.
Please review their action plans below:

1) elmondohms has applied to start work (Funders only: approve worker | reject worker).

The steps I should take is to ensure that I have steady network connectivity, set notification alert and to make sure that I don't run out of data
2) ipranjal has applied to start work (Funders only: approve worker | reject worker).

Well its a long list of task which I would keep updating on issue #2615 on GitHub but here is the baseline for getting started

  1. Extend Idno\Common\Entity with abstract class Idno\ActivityPub\Core\ObjectType which will implement the following ActivityStream core type https://www.w3.org/TR/activitystreams-core/#object and will try to fulfil following vars required by ActivityStream $id, $type, $attachment, $attributedTo, $audience, $content, $context, $name,$endTime,$generator,$icon,$image,$inReplyTo,$location,$published etc.

  2. Idno\ActivityPub\ObjectType will have a function toAcJson() which will convert the Idno\Common\Entity to ActivityPub compatible json

  3. Extend Idno\Entities\User with abstract class Idno\ActivityPub\Actor\Person which will implement https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person an actor will have following property $inbox , $outbox, $following, $followers, $liked, $streams, $preferredUsername, $endpoints,$publicKey

  4. Create Idno\ActivityPub\Actor\Inbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database

  5. Create Idno\ActivityPub\Actor\Outbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database when save() method is called on the Idno Entity it will be broadcasted via Outbox also Outbox class will be used to create Idno\Common\Entity from the public data retrieved by the Outbox

  6. Since Idno does not have a class to handle public collection a class called Idno\Common\EntityCollection would be a valid step to have which can be further Extended by Idno\ActivityPub\Core\Collection which will implement https://www.w3.org/TR/activitystreams-core/#collections. Idno\Common\EntityCollection will help is in working with collection as a group

  7. Create a Idno\Common\Entity of type Activity (Probably why plugin or maybe as a core entity) which will extend dno\ActivityPub\Core\Activity which will implement https://www.w3.org/TR/activitystreams-core/#activities

  8. We would need to modify the core plugins to create Idno\Entities\Activity for actions like : delete,create,dislike,like,update etc.

This concludes my pitch for implementing the core types Activity , Actor, Object, Collection
And the core server properties Inbox and Outbox needed to implement a working ActivityPub Integration
3) yujiri8 has applied to start work (Funders only: approve worker | reject worker).

This seems clear cut enough. I will follow the ActivityPub spec to the letter and add whatever functionality is required. Since I am not well acquainted with Known, I offer to do it for 2500.
4) douglasisraelbonfim has applied to start work (Funders only: approve worker | reject worker).

Olá, sou Full Stack PHP, posso colaborar no projeto.

Learn more on the Gitcoin Issue Details page.

@Cambridgeport90
Copy link

Cambridgeport90 commented Dec 11, 2021 via email

@ipranjal
Copy link
Contributor

ipranjal commented Dec 11, 2021

List of tasks according to my OpenCollective bounty pitch , can be used by other community members interested to work on this issue

  • Extend Idno\Common\Entity with abstract class Idno\ActivityPub\Core\ObjectType which will implement the following specification https://www.w3.org/TR/activitystreams-core/#object
  • Extend Idno\Entities\User with abstract class Idno\ActivityPub\Actor\Person which will implement https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person
  • Create Idno\ActivityPub\Actor\Inbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database
  • Create Idno\ActivityPub\Actor\Outbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database when save() method is called on the Idno Entity it will be broadcasted via Outbox also Outbox class will be used to create Idno\Common\Entity from the public data retrieved by the Outbox
  • create a new class Idno\Common\EntityCollection which can be further Extended by Idno\ActivityPub\Core\Collection which will implement https://www.w3.org/TR/activitystreams-core/#collections
  • Create a Idno\Common\Entity of type Activity (Probably via plugin or maybe as a core entity) which will extend dno\ActivityPub\Core\Activity which will implement https://www.w3.org/TR/activitystreams-core/#activities
  • We would need to modify the core plugins to create Idno\Entities\Activity for actions like : delete,create,dislike,like,update etc.

@ipranjal
Copy link
Contributor

Here I would like to leave few more resources for anyone who is planning to work on this :

  1. Here is my Complete pitch or draft process for tackling this :
1) Extend Idno\Common\Entity with abstract class Idno\ActivityPub\Core\ObjectType which will implement the following ActivityStream core type https://www.w3.org/TR/activitystreams-core/#object and will try to fulfil following vars required by ActivityStream $id, $type, $attachment, $attributedTo, $audience, $content, $context, $name,$endTime,$generator,$icon,$image,$inReplyTo,$location,$published etc.  
2) Idno\ActivityPub\ObjectType will have a function toAcJson() which will convert the Idno\Common\Entity to ActivityPub compatible json   
3) Extend Idno\Entities\User with abstract class Idno\ActivityPub\Actor\Person which will implement https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person an actor will have following property $inbox , $outbox, $following, $followers, $liked, $streams, $preferredUsername, $endpoints,$publicKey   
4) Create Idno\ActivityPub\Actor\Inbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database  
5) Create Idno\ActivityPub\Actor\Outbox which will convert message incoming towards inbox into Idno\Common\Entity and save it in the database when save() method is called on the Idno Entity it will be broadcasted via Outbox also Outbox class will be used to create Idno\Common\Entity from the public data retrieved by the Outbox  
6) Since Idno does not have a class to handle public collection a class called Idno\Common\EntityCollection would be a valid step to have which can be further Extended by Idno\ActivityPub\Core\Collection which will implement https://www.w3.org/TR/activitystreams-core/#collections. Idno\Common\EntityCollection will help is in working with collection as a group  
7) Create a Idno\Common\Entity of type Activity (Probably why plugin or maybe as a core entity) which will extend dno\ActivityPub\Core\Activity which will implement https://www.w3.org/TR/activitystreams-core/#activities  
8) We would need to modify the core plugins to create Idno\Entities\Activity for actions like : delete,create,dislike,like,update etc.  

This concludes my pitch for implementing the core types Activity , Actor, Object, Collection 
And the core server properties Inbox and Outbox needed to implement a working ActivityPub Integration
  1. Here is an unofficial guide to implementing ActivityPub :
    https://socialhub.activitypub.rocks/pub/guide-for-new-activitypub-implementers

  2. You can go through the source code of following repo to get a idea on implementing ActivityPub in PHP :
    https://github.com/landrok/activitypub

  3. Here is a really handy page for list of all types of Activity, Actor, Object and Collection :
    https://www.w3.org/TR/activitystreams-vocabulary/

And on a ending note "To silo is human, to syndicate divine."

@ipranjal
Copy link
Contributor

ipranjal commented Dec 11, 2021

Also on a side note rather than actually extending Idno/common/entity we can also work around with the following arrangement

concept

We can simple use the core and extended Types defines by https://github.com/landrok/activitypub and create a bridge to convert to and from Idno/Common/Entity during Inbox and Outbox transaction

in either case having something like Idno\Entity\Activity in the core is a must !

@almereyda
Copy link

For reference, the associated Open Collective project lives at https://opencollective.com/known/projects/activitypub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants