-
-
Notifications
You must be signed in to change notification settings - Fork 887
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
Compliance with ActivityPub standard #1220
Comments
more refactoring with tons of changes: - inbox functions return LemmyError instead of HttpResponse - announce is done directly in community inbox - reorganized functions for handling inbox activities - additional checks for private messages - moved inbox handler functions for post, comment, vote into separete file - ensure that posts, comments etc are addressed to public (ref #1220) - probably more
…from user-outbox into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/135
…arkdown (ref #1220)' (#141) from apub-media-type2 into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/141
…' (#142) from apub-context into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/142
…ref #1220)' (#150) from inbox-headers into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/150
I'm pretty much out of ideas on the status codes (most importantly, returning http 404 for #[derive(Debug)]
pub struct LemmyError {
pub inner: anyhow::Error,
pub status_code: Option<StatusCode>
}
impl<T> From<T> for LemmyError
where
T: Into<anyhow::Error>,
{
default fn from(t: T) -> Self {
LemmyError { inner: t.into(), status_code: None }
}
}
impl From<diesel::result::Error> for LemmyError {
fn from(e: diesel::result::Error) -> Self {
let status_code = match e {
diesel::result::Error::NotFound => Some(StatusCode::NOT_FOUND),
_ => None
};
LemmyError { inner: e.into(), status_code }
}
}
impl actix_web::error::ResponseError for LemmyError {
fn status_code(&self) -> StatusCode {
self.status_code.unwrap_or(StatusCode::INTERNAL_SERVER_ERROR)
}
} But there are two problems with this code:
|
I like this solution... why does it say that feature is necessary? |
Without that feature, the compilation fails with this error:
|
This issue should be finished, as far as I can tell we are now fully compatible with ActivityPub. |
Nice! We can re-open if other issues of being out of spec arise. |
…163) from optional-apub-extensions into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/163
@vpzomtrrfrt @lanodan We fixed the ActivityPub problems that you reported, and some others as well. The fixes are already live on our test and production servers. So please give it a try, and let us know if you find any additional federation problems. |
I'm guessing lemmy.ml is up-to-date enough:
|
This is an inconsistency between HTTP and JSON routes, the comment ID is actually
We only have community outboxes implemented for now (and they only contain the last 20 posts, nothing else). We would implement it as part of #752
I opened an issue at #1420
Thanks, we weren't sure if that should be set on the activities or on the objects, sounds like it should be on both. I added it in !167
This is for compatibility with older Lemmy versions, but I already have a commit ready to change it to HTML. We can merge that any time, but its a breaking change and not urgent for now, so we are waiting to release it together with some other breaking changes. |
> ``Page`` (in example https://lemmy.ml/post/52763) is missing ``https://www.w3.org/ns/activitystreams#Public`` in ``to`` or ``cc`` so it ends up being hidden like a direct message to it's Group (in example ``https://lemmy.ml/c/lemmy``) rather than a public post.
Thanks, we weren't sure if that should be set on the activities or on the objects, sounds like it should be on both. I added it in [!167](https://yerbamate.ml/LemmyNet/lemmy/pulls/167)
Yeah, most important in addressing is objects since the Create activity is not always seen. And pleroma is moving to requiring the Activity and Objects to have the same addressing anyway.
> ``Page``'s content field seems to still be in markdown, we already have a conversion because of Peertube but I'd rather keep that as the exception than the rule as markdown format is seriously implementation-defined.
This is for compatibility with older Lemmy versions, but I already have a [commit ready](https://yerbamate.ml/LemmyNet/lemmy/pulls/164) to change it to HTML. We can merge that any time, but its a breaking change and not urgent for now, so we are waiting to release it together with some other breaking changes.
Okay, will add a check that our markdown→HTML conversion works for your objects as well. If you have an example Page showing all your markdown features that would be nice.
Thanks for the quick response
|
@lanodan I think this page has everything: https://join.lemmy.ml/docs/en/about/guide.html#markdown-guide And FYI, we use different libraries for markdown in the frontend (for html) and in the backend (for activitypub. So its possible that there are also differences between them. |
…1220)' (#167) from comments-posts-public into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/167
So I tested federation between lemmy(using
Also after looking at your markdown guide, we're missing:
Btw the way we do previews in pleroma is by sending a false request to the backend and in our experience it's not too slow. |
Is there any difference between the two? The description in Activitystreams Vocabulary is almost identical.
We haven't implemented user following yet. Which field can we use for that?
It prints this error when fetching your user: Btw you can also open a new issue for federation with Pleroma ;) |
Well de-facto summary is used as a smaller version of "content" that can be used for a spoiler-tag, like the
None in ActivityStreams but you can extend it. That said if it's a "yet" I don't think it would be worth it to add a new one.
The default limits in pleroma are 100 for the name, 5000 for the bio, and 5000 for the post payload (
Ack, will do for next ones |
In fact we used |
…ary` (ref #1220)' (#173) from apub-post-name into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/173
…#1220)' (#164) from remove-backwards-compatibility into main Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/164
These should be the most important items, but I left out some of the more complicated requirements.
content
field of posts/comments with html, and put markdown intosource
field-> for now both
content
andsource.content
are Markdown, we need to revert b2288fc after a while (and remove this line as well)curl -H "Accept: application/activity+json" https://enterprise.lemmy.ml/post/asd -v
https://git.asonix.dog/Aardwolf/activitystreams/issues/5
Content-Type: application/activity+json
(or long variant)https://www.w3.org/TR/activitypub/#server-to-server-interactions
https://www.w3.org/TR/activitypub/#outbox
/c/{community_name}/inbox
and sharedinbox (same for user)Announce
)/activities/follow/fd05d28e-5d8c-4787-8bcd-68aebda7fe30
)correctly parse incoming activities which are differently formatted (eg array value vs string value)(its not clear which fields would benefit from this, lets wait for other projects to actually request this)return correct error codes (Error handling for federation #1259)The text was updated successfully, but these errors were encountered: