social icon indicating copy to clipboard operation
social copied to clipboard

Integrating Nextcloud and XWiki with ActivityPub

Open surli opened this issue 5 years ago • 6 comments

I'm a developer for XWiki project, and I'm starting to work on an implementation of ActivityPub for XWiki. As part of this implementation I'd like to make the first social integration with Nextcloud. You can find some details about what we want to achieve in our Forum post announcing it and the first implementation I'm working on, in its dedicated repository

My first usecase here would be to be able to follow peope from Nextcloud on XWiki and if possible to follow people from XWiki on Nextcloud.

ActivityPub aims at defining a common protocol for everyone, but AFAIU it's vague enough to allow different implementation, so starting this issue as a communication channel to understand choices made on Nextcloud side to ensure both entities could communicate :)

I already started the work on XWiki side and performed some first tests on Nextcloud, so I already have some questions:

  1. it seems that all the JSON answers provided by Nextcloud Social are encapsulated in a main result object which itselfs contains an object whose name depends on the kind of activity, which contains finally the activitystream entity. For example, when accessing to my account I can see:
{ 
  "result": { 
      "account": {
          "@context": "https://www.w3.org/ns/activitystream",
          "id": "http://localhost:4242/apps/social/@surli",

and when posting a note:

{
   "result": {
      "post": {
        "id": "http:\/\/localhost:4242\/apps\/social\/@surli\/15816895591748213246",
        "type": "Note"

Have you defined some way to know the name of the object in result based on ActivityStream vocabulary? On XWiki side I was going to use directly the ActiviyStream objects in the JSON answers (no wrapper around), could that be a problem for them to be processed by Nextcloud?

  1. I gave a try to post a very simple Follow activity in a Nextcloud inbox using the following request:
curl -X POST -H 'Content-Type: application/activity+json' -i 'http://localhost:4242/apps/social/@surli/inbox' --data '{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "XWiki Admin follow Nextcloud @surli",
  "type": "Follow",
  "actor": "http://localhost:8080/xwiki/activitypub/Person/XWiki.Admin",
  "object": "attributedTo: http://localhost:4242/apps/social/@surli"
}'

and I obtained the following answer:

{"status":-1,"exception":"daita\MySmallPhpTools\Exceptions\MalformedArrayException","message":"source: [] - missing key: keyId"}

which I find quite cryptic :) Sounds like Nextcloud is expecting an id? Or is it related to the wrapping object I mentioned just before?

surli avatar Feb 14 '20 14:02 surli

@daita , @violoncelloCH for the technical part (and maybe @jospoortvliet and @jancborchardt for the collaboration between projects).

Could you provide some help?

Consider also this thread in the forum on other hypotheses of joint use between the two software (https://help.nextcloud.com/t/experience-reports-and-or-suggestions-managing-files-and-documentation-with-a-wiki-and-nextcloud/55084)

Spartachetto avatar Feb 21 '20 08:02 Spartachetto

@daita could you reply here? :)

jancborchardt avatar Mar 26 '20 22:03 jancborchardt

Any update?

radoeka avatar Mar 07 '21 19:03 radoeka

Is there a possibility that this will go on? We have NC and would love to go for xwiki.

Numrollen avatar Apr 22 '21 08:04 Numrollen

So for information, on XWiki side we published an extension that implements the ActivityPub protocol (information about it can be found there: https://extensions.xwiki.org/xwiki/bin/view/Extension/ActivityPub%20Application/). We performed some tests with the nextcloud social plugin, which is in our knowledge the only implementation of ActivityPub in Nextcloud, but it was only allowing to share messages with XWiki which was not that much of interest for us. So we focused more on testing with Mastodon and improving the implementation of the protocol to allow a fediverse of wikis, to allow sharing documents using ActivityPub.

It would be of great interest for us to go further with Nextcloud to use ActivityPub for connecting XWiki and Nextcloud for new interactions like sharing an XWiki document to a Nextcloud user, or things like that.

surli avatar Apr 22 '21 09:04 surli

Yes that would be great. NC as a source for the files, calender and such features. Is it somehow possible to put a "wanted" marker on this topic? ;)

Numrollen avatar Apr 22 '21 09:04 Numrollen