From a86884d8a3831651bb4904704d831d9a0847f613 Mon Sep 17 00:00:00 2001 From: bashrc Date: Sat, 14 Feb 2026 12:00:22 +0000 Subject: [PATCH] Add minimal support for trust.txt --- daemon_get.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/daemon_get.py b/daemon_get.py index 9310c88a9..6ed8f683f 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -469,6 +469,18 @@ def daemon_http_get(self) -> None: write2(self, msg) return + # handle trust.txt + # see trust.txt-specification-v1.5-.pdf + if self.path == '/trust.txt' or \ + self.path.startswith('/.well-known/trust.txt'): + msg = "datatrainingallowed=no" + msg = msg.encode('utf-8') + msglen = len(msg) + set_headers(self, 'text/plain', msglen, + '', calling_domain, False) + write2(self, msg) + return + # Since fediverse crawlers are quite active, # make returning info to them high priority # get nodeinfo endpoint