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 ActivityStreams2 URL field to Accounts and populate it during WebFinger lookup. #3827
Conversation
@@ -36,6 +36,7 @@ | |||
# followers_count :integer default(0), not null | |||
# following_count :integer default(0), not null | |||
# last_webfingered_at :datetime | |||
# activitystreams2_url :string |
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.
maybe activitypub_url?
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.
Yeah I thought about that option, but technically AP is only the protocol for server/client communication, built on top of AS2 representations. The URL is the user's AS2 representation (which happens to implement AP), so that seemed like the more accurate name. Not a big deal either way though.
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.
If I understand correctly AS2 could also be used for OStatus, so this might be confusing.
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.
I'm for activitystrams2_url
because Webfinger does not tell if it has ActivityPub extensions such as inbox
and outbox
. Methods referring to this column must NOT assume it has ActivityPub extensions and must do some checks. I'm worrying that naming it as activitypub_url
would promote such mistakes.
I'm thinking about all the URLs we need to store for an AP user:
Things that are the same for both AP and OStatus users:
I am not sure if it makes sense to create new columns for each of these, or perhaps create some serialized field? |
Actually we may need to consider about variables other than
However, the specification does not say
Obviously |
In fact, the purpose of the publicInbox URL is to consolidate payloads to a common server when multiple recipients share one: https://www.w3.org/TR/activitypub/#public-inbox-delivery |
@Gargron But it is still possible to have different values in an instance. For example, an instance may want to distribute the load of the inbox server and then have multiple |
As you can see there is some overlap in meaning, attributes could be renamed more generically, we could add an "account type" enum which is either Anyway, just some ideas. There are also some definitely new attributes, such as |
I don't like the semantics of overloading the OStatus columns. Renaming them would help, but I think it's still a bit messy to try to merge the two standards together. That said, it looks like we could do a bit of mixing and matching, so that each account would have the following columns (not an exhaustive list):
An account type enum seems useful either way, though maybe we could have that be generated on the fly based on which columns are set. Also I agree it's a good idea to cache the follower/following/statuses counts as they'll be requested quite a lot. |
I'm for renaming, but public inbox should have different column because it is different from So we could have the following change:
|
I'm very 👎 on adding an account type enum or overloading existing OStatus fields, since it completely closes the door on any possible gradual migration path between ostatus and activitypub for mastodon. (For example, using AP for private posts while still federating public posts using ostatus) It seems very bad to switch completely from ostatus to AP in a single version or pull request—I would be much happier if we did a gradual implementation that got some of this code shipping before we migrated everything. It seems a lot less likely to be "biting off more then we can chew", as well. |
Additional code will be required to support gradual migration anyway. We can add columns then if we need the feature. |
@nightpool These fields are for remote accounts.... You don't need to know them to publish OStatus content via PubSubHubbub.... And when a remote account is ActivityPub-ready, what's the point of still using OStatus to send stuff to it? |
@Gargron because that assumes that we're going to implement AP in one fell swoop, rather then incrementally over a series of changes? One makes it very hard to test and use this code, and it ends up with writing lots and lots of code that will never see use in the codebase until we "switch it on". |
@nightpool It is not possible to have partial ActivityPub in my opinion. |
You're right this is superseded by that |
Fairly simple. The FollowRemoteAccountService now looks for a rel-self value in the WebFinger response and if it's present, assigns it to a new Account field,
activitystreams2_url
. I'm relatively new to this area of the code, so let me know if I missed any gotchas!