idno / known

A social publishing platform.
https://withknown.com/opensource
Other
1.05k stars 195 forks source link

Add ActivityPub support to Known #2615

Open benwerd opened 4 years ago

benwerd commented 4 years ago

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

This includes:

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

I agree with Mastodon, but there is also other platforms. Video posts, for instance, could be keyed to an existing Peertube instance. That might be another plugin idea, but definitely worth mentioning since Peertube uses activitypub and bitorrent.

From: jon r notifications@github.com Sent: Wednesday, January 8, 2020 7:47 PM To: idno/known known@noreply.github.com Cc: Katherine Moss kat8989@outlook.com; Comment comment@noreply.github.com Subject: Re: [idno/known] ActivityPub support (#2615)

I'm especially looking towards publishing towards 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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fidno%2Fknown%2Fissues%2F2615%3Femail_source%3Dnotifications%26email_token%3DADS4MAEYVOC3EARXHNC7M6TQ4ZX2DA5CNFSM4JWBPNW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIOQQXI%23issuecomment-572328029&data=02%7C01%7C%7C0a7472ffed804528099908d7949d8196%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637141276506039022&sdata=kBW5y7xGUqM1w%2FXZFvAHaAloiDCdS4CMl6772eZI7Fo%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADS4MACXHPZHNOJXQ74QGATQ4ZX2DANCNFSM4JWBPNWQ&data=02%7C01%7C%7C0a7472ffed804528099908d7949d8196%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637141276506049030&sdata=MM06WgM0VlAJSxTp390xqIBb0fg19lK%2FUc3NAdi7cG8%3D&reserved=0.

benwerd commented 2 years ago

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

gitcoinbot commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

From the looks of these calculations… it could be a while before we see significant progress… or is something off, here?

From: Gitcoin.co Bot @.> Sent: Saturday, December 11, 2021 6:31 AM To: idno/known @.> Cc: Katherine M. Moss @.>; Comment @.> Subject: Re: [idno/known] Add ActivityPub support to Known (#2615)

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) elmondohmshttps://gitcoin.co/elmondohms has applied to start work (Funders only: approve workerhttps://gitcoin.co/issue/idno/known/2615/100027300?mutate_worker_action=approve&worker=elmondohms | reject workerhttps://gitcoin.co/issue/idno/known/2615/100027300?mutate_worker_action=reject&worker=elmondohms).

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

Learn more on the Gitcoin Issue Details pagehttps://gitcoin.co/issue/idno/known/2615/100027300.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/idno/known/issues/2615#issuecomment-991608379, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADS4MAGHQEBERPR3EAQRK6DUQMY5RANCNFSM4JWBPNWQ.

ipranjal commented 2 years ago

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

ipranjal commented 2 years ago

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



2. Here is an unofficial guide to implementing ActivityPub :
https://socialhub.activitypub.rocks/pub/guide-for-new-activitypub-implementers

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

4. 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 commented 2 years ago

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 commented 2 years ago

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