-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: Federated following, starring, issues, forks, and pull requests #20391
Conversation
…for the various action types
…typub module since we need more Write and Load functions exported
…f modifying the include everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be me, but we might also implement the prevention of impersonation(AttributedTo
still seems to be not checked)
routers/api/v1/activitypub/person.go
Outdated
Actor: ctx.ContextUser, | ||
IncludePrivate: false, | ||
IncludeDeleted: false, | ||
ListOptions: db.ListOptions{Page: 1, PageSize: 1000000}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh for performance reasons we likely want to not do this(Increased pagesize is fine), does AP supports list/pages options like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AP does support pagination, but the problem is we only want the repo creation actions, but we don't know how many pages of the DB we'll have to query for. Is there a way we can make models.GetFeeds
only return repo creation actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2373b41 is the right direction but we need to implement star action types in another PR so we can remove the stars code.
Thanks for reminding me to implement that. I'll do it today. |
I moved around a lot of files to fix import cycles
…sport and IRI code to services/activitypub This is to follow https://docs.gitea.io/en-us/guidelines-backend/ and avoid import cycles.
EDIT: I'm now working on federation for Forgejo, and after it is merged in Forgejo, I will create a new PR to upstream federation to Gitea.
This (very WIP) pull request implements the federated features of following, starring, issues, forks, and pull requests. 🎉
Much of the code is still incomplete, but I wanted to create the PR now since I'd like to get some feedback on some of the high-level design decisions here, such as the UI, or how remote users and repos are handled.
Remote users
This PR stores remote users in the database using the new LoginType
Federated
, with the fullusername@instance.com
as the username.More information: #2
Closes #9045
Following
See #19981
ForgeFed vocabulary implementation
This PR includes an implementation of the ForgeFed vocabulary using a custom fork of go-ap. The fork exports more helper functions to make it easier to add AP extensions to go-ap. Discussion about this can be found on the go-ap mailing lists.
Issues and comments
I haven't written the implementation for federated issues yet, but it should be relatively easy. Federated commenting works, but Gitea<->Mastodon interoperability is tricky. There is currently an issue in Mastodon that prevents Mastodon users from commenting on Gitea issues. Also, Mastodon has threads and Gitea doesn't.
Forks and pull requests
TODO, since the code will be rewritten to use the AGit flow for handling federated pull requests.
More information: #7
Closes #184, closes #15392
Federation.md
A Federation.md file describes how a certain software uses ActivityPub. This PR's
FEDERATION.md
describes Gitea's future federation capabilities, not what features that this PR adds to Gitea.UI
I'm working on a UI right now, see #8. Since the UI is far from finished, for now I'm hand-writing ActivityStreams objects and then POSTing them to the inbox API endpoints with the help of some scripts.
Limitations
This PR only implements a few federated features to prevent the PR from getting too big. For a list of features that will be implemented later but not in this PR, see the task list.
TODO
/api/v1/activitypub/ticket/username/reponame/number
.