Your one-stop-cake-shop for everything Freshly Baked has to offer

fix(pm): fix some Tranquil/Anisota compatibility

I've observed the following issues with Anisota:

1. It appears to proxy chat to the wrong endpoint (did:web:api.bsky.app
instead of did:web:api.bsky.chat) - this causes messages not to load
with Tranquil PDS
2. It appears to be missing the `$type` field on records it tries to
create. This leads to Tranquil rejecting them as invalid records...
3. It appears to proxy some endpoints that it shouldn't. This leads to
bluesky stating that some XRPC routes are unsupported

I've applied the following fixes:

1. I've applied an nginx location which forces all PDS routes starting
in `/xrpc/chat.bsky.` to proxy to did:web:api.bsky.chat. It's a bad
hack but I suspect it'll never actually do the wrong thing
2. I've made a patch to Tranquil (https://tangled.org/tranquil.farm/tranquil-pds/pulls/21)
to automatically elide `$type` when it's missing. The code is not
particularly good IMHO but it does work...
3. I've made a patch to Tranquil (https://tangled.org/tranquil.farm/tranquil-pds/pulls/20)
to ban proxying on some more routes. @nel.pet has mentioned that this
probably breaks social-app in some cases (see that PR's comments),
but it's fine as a stopgap for us now
4. I've updated the Tranquil pin to apply patches from #2 and #3

I currently believe that *neither* of the Tranquil fixes are
upstreamable. This means that, unless we want to turn them into actual
`patches = []` and maintain them out of tree forever, we will need to
drop them eventually. The True Fix is to help the Anisota developers
debug and fix these issues, which we are in the process of doing...

+16 -4
+4 -4
npins/sources.json
··· 631 631 "type": "Git", 632 632 "repository": { 633 633 "type": "Git", 634 - "url": "https://tangled.org/tranquil.farm/tranquil-pds" 634 + "url": "https://tangled.org/a.starrysky.fyi/tranquil-pds" 635 635 }, 636 - "branch": "feat/nix-module", 636 + "branch": "private/minion/push-qxsvvqowootl", 637 637 "submodules": false, 638 - "revision": "e6b4698735918c5c6ee2572ef7d4fd29f791f219", 638 + "revision": "440e8f58f0ad06ede849104f2d900d53010994ea", 639 639 "url": null, 640 - "hash": "sha256-7r113ZJ0Y7inOHPlfRldItrh2DMC/RuxyeDw3ZMSJfE=" 640 + "hash": "sha256-36eqoNtGNxlOAmRmMDHNzAR9bXQJdJXJwPsEIQW9d3I=" 641 641 }, 642 642 "treefmt-nix": { 643 643 "type": "Git",
+12
packetmix/systems/teal/pds.nix
··· 90 90 services.nginx.virtualHosts."at.freshly.space" = { 91 91 acmeRoot = null; 92 92 93 + locations."^~ /xrpc/chat.bsky." = { 94 + proxyPass = "http://127.0.0.1:1039"; 95 + proxyWebsockets = true; 96 + extraConfig = '' 97 + proxy_read_timeout 86400; 98 + proxy_send_timeout 86400; 99 + proxy_buffering off; 100 + proxy_request_buffering off; 101 + proxy_set_header 'atproto-proxy' 'did:web:api.bsky.chat#bsky_chat'; 102 + ''; 103 + }; 104 + 93 105 serverAliases = lib.mkForce [ "*.at.freshlybakedca.ke" "*.at.freshly.space" ]; 94 106 }; 95 107