summaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/views/activitypub.py7
-rw-r--r--users/views/admin/federation.py2
2 files changed, 8 insertions, 1 deletions
diff --git a/users/views/activitypub.py b/users/views/activitypub.py
index 2c7020a..cca57fb 100644
--- a/users/views/activitypub.py
+++ b/users/views/activitypub.py
@@ -150,6 +150,13 @@ class Inbox(View):
f"Inbox error: cannot fetch actor {document['actor']}"
)
return HttpResponseBadRequest("Cannot retrieve actor")
+ # See if it's from a blocked domain
+ if identity.domain.blocked:
+ # I love to lie! Throw it away!
+ exceptions.capture_message(
+ f"Inbox: Discarded message from {identity.domain}"
+ )
+ return HttpResponse(status=202)
# If there's a "signature" payload, verify against that
if "signature" in document:
try:
diff --git a/users/views/admin/federation.py b/users/views/admin/federation.py
index da8209a..4d6b179 100644
--- a/users/views/admin/federation.py
+++ b/users/views/admin/federation.py
@@ -30,7 +30,7 @@ class FederationEdit(FormView):
class form_class(forms.Form):
blocked = forms.BooleanField(
- help_text="If this domain is blocked from interacting with this server",
+ help_text="If this domain is blocked from interacting with this server.\nAll incoming posts from this domain will be irrecoverably dropped.",
widget=forms.Select(choices=[(True, "Blocked"), (False, "Not Blocked")]),
required=False,
)