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

feat(worker/activitypub):implement additional support for complete ActivityPub Integration with full engine capability #542

Merged
merged 47 commits into from
Sep 24, 2024

Conversation

FrankLi123
Copy link
Contributor

@FrankLi123 FrankLi123 commented Sep 13, 2024

Summary

This PR adds additional support for AP integration such as API support, Global-Indexer integration, and advanced monitor support.

Checklist

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Create Note Object:

{
          "id": "https://airwaves.social/users/VicRB/statuses/112836523057177095",
          "network": "mastodon",
          "index": 0,
          "from": "@[email protected]",
          "to": "@[email protected]",
          "tag": "unknown",
          "type": "post",
          "platform": "Mastodon",
          "total_actions": 0,
          "actions": [
            {
              "tag": "unknown",
              "type": "post",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "body": "\u003cp\u003e#VesselAlert #Vaixell ... \u003c/p\u003e",
                "profile_id": "https://airwaves.social/users/VicRB",
                "publication_id": "https://airwaves.social/users/VicRB/statuses/112836523057177095",
                "timestamp": 1721748703
              }
            }
          ],
          "success": true,
          "timestamp": 1721748703
}

Comment Note Object:

{
          "id": "https://beekeeping.ninja/users/Pagan_Animist/statuses/112840117527501203",
          "network": "mastodon",
          "index": 0,
          "from": "@[email protected]",
          "to": "@[email protected]",
          "tag": "unknown",
          "type": "comment",
          "platform": "Mastodon",
          "total_actions": 0,
          "actions": [
            {
              "tag": "unknown",
              "type": "comment",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "body": "\u003cp\u003e\u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mas.to/@evedazzle\" class=\"u-url mention\"\u003e@\u003cspan\u003eevedazzle\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003c/p\u003e\u003cp\u003eCan communities band together ...\u003c/p\u003e\u003cp\u003eWould they help?\u003c/p\u003e\u003cp\u003eI’m just thinking of your power grid and next time.\u003c/p\u003e",
                "profile_id": "https://beekeeping.ninja/users/Pagan_Animist",
                "publication_id": "https://beekeeping.ninja/users/Pagan_Animist/statuses/112840117527501203",
                "timestamp": 1721803551,
                "target": {
                  "publication_id": "https://mas.to/users/evedazzle/statuses/112802025232873362"
                }
              }
            }
          ],
          "success": true,
          "timestamp": 1721803551
}

Comment Note Object (with 2 Mentions)

{
          "id": "https://epicure.social/users/Island_Martha/statuses/112840097961400438",
          "network": "mastodon",
          "index": 0,
          "from": "@[email protected]",
          "to": "@[email protected]",
          "tag": "unknown",
          "type": "comment",
          "platform": "Mastodon",
          "total_actions": 0,
          "actions": [
            {
              "tag": "unknown",
              "type": "comment",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "body": "\u003cp\u003e\u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@SpookieRobieTheCat\" class=\"u-url mention\"\u003e@\u003cspan\u003eSpookieRobieTheCat\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@eunews\" class=\"u-url mention\"\u003e@\u003cspan\u003eeunews\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cbr /\u003eOr at very least restrict or remove their voting rights. Orban is not MAGA Mike\u003c/p\u003e",
                "profile_id": "https://epicure.social/users/Island_Martha",
                "publication_id": "https://epicure.social/users/Island_Martha/statuses/112840097961400438",
                "timestamp": 1721803252,
                "target": {
                  "publication_id": "https://mastodon.social/users/SpookieRobieTheCat/statuses/112840076342641439"
                }
              }
            },
            {
              "tag": "unknown",
              "type": "share",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "body": "\u003cp\u003e\u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@SpookieRobieTheCat\" class=\"u-url mention\"\u003e@\u003cspan\u003eSpookieRobieTheCat\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@eunews\" class=\"u-url mention\"\u003e@\u003cspan\u003eeunews\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cbr /\u003eOr at very least restrict or remove their voting rights. Orban is not MAGA Mike\u003c/p\u003e",
                "profile_id": "https://epicure.social/users/Island_Martha",
                "publication_id": "https://epicure.social/users/Island_Martha/statuses/112840097961400438",
                "timestamp": 1721803252,
                "target": {
                  "publication_id": "https://mastodon.social/users/SpookieRobieTheCat/statuses/112840076342641439"
                }
              }
            },
            {
              "tag": "unknown",
              "type": "share",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "body": "\u003cp\u003e\u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@SpookieRobieTheCat\" class=\"u-url mention\"\u003e@\u003cspan\u003eSpookieRobieTheCat\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cspan class=\"h-card\" translate=\"no\"\u003e\u003ca href=\"https://mastodon.social/@eunews\" class=\"u-url mention\"\u003e@\u003cspan\u003eeunews\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e \u003cbr /\u003eOr at very least restrict or remove their voting rights. Orban is not MAGA Mike\u003c/p\u003e",
                "profile_id": "https://epicure.social/users/Island_Martha",
                "publication_id": "https://epicure.social/users/Island_Martha/statuses/112840097961400438",
                "timestamp": 1721803252,
                "target": {
                  "publication_id": "https://mastodon.social/users/SpookieRobieTheCat/statuses/112840076342641439"
                }
              }
            }
          ],
          "success": true,
          "timestamp": 1721803252
}

Announce Note Object (Share)

{
          "id": "https://relay.an.exchange/activities/d93bf6f6-832d-49d0-b841-3654d8da0b79",
          "network": "mastodon",
          "index": 0,
          "from": "@[email protected]",
          "to": "@[email protected]",
          "tag": "unknown",
          "type": "share",
          "platform": "Mastodon",
          "total_actions": 0,
          "actions": [
            {
              "tag": "unknown",
              "type": "share",
              "platform": "Mastodon",
              "from": "@[email protected]",
              "to": "@[email protected]",
              "metadata": {
                "handle": "@[email protected]",
                "profile_id": "https://relay.an.exchange/actor",
                "publication_id": "https://relay.an.exchange/activities/d93bf6f6-832d-49d0-b841-3654d8da0b79",
                "timestamp": 1721606400,
                "target": {
                  "publication_id": "https://cr8r.gg/users/SarraceniaWilds#announces/112250337669855051/undo"
                }
              }
            }
          ],
          "success": true,
          "timestamp": 1721606400
}

FrankLi123 and others added 30 commits July 10, 2024 12:48
…typub data-sourcing workflow

add files for basic activitypub data-sourcing workflow
…logic with both 'decentralized' and 'federated' workers
…ish federated and decentralized types of network
…531)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@FrankLi123 FrankLi123 changed the base branch from main to worker-dev September 13, 2024 10:30
@FrankLi123 FrankLi123 self-assigned this Sep 13, 2024
@FrankLi123 FrankLi123 marked this pull request as ready for review September 22, 2024 02:31
config/config.go Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we divide it using federated/activitypub/mastodon or just federated/mastodon for project structure, do we have more federated protocols in the future?

Copy link
Contributor Author

@FrankLi123 FrankLi123 Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered placing Mastodon directly within the federated directory. However, to ensure scalability for future additions of federated protocols (if any) and better management of various kinds of ActivityPub-related workers, organizing it under a subdirectory like activitypub/ will maintain a cleaner and easier structure.

@pseudoyu
Copy link
Member

should add ActivityPubSource related logics in handler_network.go

@pseudoyu
Copy link
Member

should test all info APIs to see if it's still work.

@FrankLi123 FrankLi123 merged commit 4aea9b7 into worker-dev Sep 24, 2024
5 checks passed
@FrankLi123 FrankLi123 deleted the feat/integrate-activitypub-mastodon-engine branch September 24, 2024 11:42
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

Successfully merging this pull request may close these issues.

3 participants