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

Community bans not federating. #1287

Closed
dessalines opened this issue Nov 28, 2020 · 8 comments
Closed

Community bans not federating. #1287

dessalines opened this issue Nov 28, 2020 · 8 comments
Labels
area: federation support federation via activitypub bug Something isn't working

Comments

@dessalines
Copy link
Member

They're still able to make federated comments even after being banned. Thought we'd checked for this but apparently not.

@dessalines dessalines added the bug Something isn't working label Nov 28, 2020
@Nutomic Nutomic added enhancement New feature or request and removed bug Something isn't working enhancement New feature or request labels Nov 30, 2020
@Nutomic
Copy link
Member

Nutomic commented Nov 30, 2020

Not a big mystery here, we arent sending out any activity about community bans, meaning remote instances wont know that the user is banned in the community.

So to explain it based on the example of @user1@lemmy.ml who was banned from !fullcommunism@lemmygrad.ml:

  • they were only banned from that community, so they could still interact with eg !anarchism@lemmygrad.ml
  • @user1@lemmy.ml can still create new posts in the version of !fullcommunism@lemmygrad.ml shown on lemmy.ml, because there is no activity that would tell about the ban

So what we need to do is implement a Block/User, sent by the community to its followers.

@Nutomic Nutomic added the area: federation support federation via activitypub label Nov 30, 2020
@Nutomic
Copy link
Member

Nutomic commented Nov 30, 2020

#1205 is also related to this. If we had that implemented, then @user1@lemmy.ml could still submit a post to !fullcommunism@lemmygrad.ml after being banned, but that post wouldnt be visible on lemmy.ml.

@dessalines
Copy link
Member Author

dessalines commented Nov 30, 2020

I'll need to test this again, probably between ds9 and fanonwave, but user1 was banned from fullcommunism, and then was able to make another comment after that ban (and that comment even showed up on lemmygrad) : https://lemmygrad.ml/post/9593/comment/16119

@Nutomic
Copy link
Member

Nutomic commented Nov 30, 2020

Hmm you're right, made 10 minutes after the ban. This is the activity for that comment which lemmy.ml sent out.

{
"cc": [
"https://lemmygrad.ml/c/fullcommunism",
"https://lemmygrad.ml/u/muad_dibber"
],
"id": "https://lemmy.ml/activities/create/2169b8f8-f976-4e0b-a0a1-cd9c91bf5fe9",
"to": "https://www.w3.org/ns/activitystreams#Public",
"tag": [],
"type": "Create",
"actor": "https://lemmy.ml/u/user1",
"object": {
"id": "https://lemmy.ml/comment/21808",
"to": "https://lemmygrad.ml/c/fullcommunism",
"type": "Note",
"content": "There's not a single sentence in that article that is able to describe any aspect of anarchism without trying to caste it in a negative light. It comes across as incredibly arrogant to someone with some anarchistic beliefs.\n\nIf you want to include Marxist critique of anarchism, then you should put it in a section titled \"Marxist Critiqueof Anarchism,\" not in the fucking opening paragraph.",
"@context": "https://www.w3.org/ns/activitystreams",
"inReplyTo": [
"https://lemmygrad.ml/post/9593",
"https://lemmygrad.ml/comment/16047"
],
"published": "2020-11-28T04:34:06.539528+00:00",
"attributedTo": "https://lemmy.ml/u/user1"
},
"@context": "https://www.w3.org/ns/activitystreams"
}

@dessalines dessalines added the bug Something isn't working label Dec 1, 2020
@dessalines
Copy link
Member Author

Lets say for this ticket, just to fix that ability to comment issue.

@Nutomic Nutomic removed the enhancement New feature or request label Dec 1, 2020
@Nutomic
Copy link
Member

Nutomic commented Dec 1, 2020

Okay I opened #1298 to track the implementation of Block/User. As for this issue, I figured out a way to reproduce it:

  • start with an admin/mod M on instance alpha, with community C, and two users U1 and U2 on instance beta
  • U1 makes a post or comment in C
  • M bans U1 from the community
  • U1 makes another post/comment in C (this is possible because instance beta doesnt know about the ban, Federated user bans #1298)
  • at this point everything is fine, the activity gets sent to alpha but rejected in the inbox
  • now U2 upvotes or downvotes the post/comment

Result: U2 is not banned, so the activity is accepted by the inbox. Instance alpha notices that the post/comment referenced by the vote is missing, and fetches it. But in this case there is no check against community bans, only site bans are checked.

So to solve this, we need to add a check for community bans in fetcher.rs, probably in get_or_fetch_and_insert_post() and get_or_fetch_and_insert_comment(). Search will also require the same check.

@dessalines
Copy link
Member Author

Nice, that was probably pretty tricky to figure out. Who knew a third party doing an action to a banned user would let it pass through.

@Nutomic
Copy link
Member

Nutomic commented Dec 1, 2020

Actually I just suddenly had the idea when looking at this thread again in the morning, then tested and confirmed it :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: federation support federation via activitypub bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants