From a6970708ad4422c9826b10bac5b014cb836616ad Mon Sep 17 00:00:00 2001 From: teutat3s Date: Fri, 21 Apr 2023 15:12:59 +0200 Subject: [PATCH] flora-6: pub.solar webfinger should redirect to mastodon, if the query parameter matches resource See: https://docs.joinmastodon.org/spec/webfinger/ and: https://docs.joinmastodon.org/admin/config/#web_domain --- hosts/flora-6/caddy.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hosts/flora-6/caddy.nix b/hosts/flora-6/caddy.nix index 9a1a3250..acd53964 100644 --- a/hosts/flora-6/caddy.nix +++ b/hosts/flora-6/caddy.nix @@ -25,6 +25,9 @@ output discard ''; extraConfig = '' + # Named matcher, used below for Mastodon webfinger + @query query resource=* + # PubSolarOS images handle /os/download/* { root * /data/srv/www @@ -36,8 +39,12 @@ redir https://mastodon.pub.solar{uri} } - # Tailscale OIDC requirement + # Tailscale OIDC webfinger requirement plus Mastodon webfinger redirect handle /.well-known/webfinger { + # Redirect requests that match /.well-known/webfinger?resource=* to Mastodon + handle @query { + redir https://mastodon.pub.solar{uri} + } respond 200 { body `{ "subject": "acct:admins@pub.solar",