A couple of Bluesky feeds focused around PDSes

Expose DID record for feed

+32 -6
+32 -6
feedgen.ts
··· 55 55 `SELECT a.uri, a.indexed_at FROM posts a 56 56 INNER JOIN authors b ON a.author = b.did 57 57 WHERE b.pds = ?1 58 - ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?2;` 58 + ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?2;`, 59 59 ), 60 60 cursor: db.prepare( 61 61 `SELECT a.uri, a.indexed_at FROM posts a 62 62 INNER JOIN authors b ON a.author = b.did 63 63 WHERE b.pds = ?1 64 64 AND a.indexed_at < ?2 65 - ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?3;` 65 + ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?3;`, 66 66 ), 67 67 pds: true, 68 68 }, ··· 72 72 INNER JOIN authors b ON a.author = b.did 73 73 WHERE b.pds_base != 'bsky.network' 74 74 AND b.pds_base != 'brid.gy' 75 - ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?1;` 75 + ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?1;`, 76 76 ), 77 77 cursor: db.prepare( 78 78 `SELECT a.uri, a.indexed_at FROM posts a ··· 80 80 WHERE b.pds_base != 'bsky.network' 81 81 AND b.pds_base != 'brid.gy' 82 82 AND a.indexed_at < ?1 83 - ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?2;` 83 + ORDER BY a.indexed_at DESC, a.cid DESC LIMIT ?2;`, 84 84 ), 85 85 pds: false, 86 86 }, ··· 88 88 89 89 const requireAuth = async ( 90 90 request: Request, 91 - lxm: Nsid 91 + lxm: Nsid, 92 92 ): Promise<VerifiedJwt> => { 93 93 const auth = request.headers.get("authorization"); 94 94 if (auth === null) { ··· 205 205 }, 206 206 }); 207 207 208 - export default app; 208 + export default { 209 + fetch(request) { 210 + const url = new URL(request.url); 211 + if (url.pathname === "/.well-known/did.json") { 212 + return new Response( 213 + JSON.stringify({ 214 + "@context": ["https://www.w3.org/ns/did/v1"], 215 + id: baseDID, 216 + service: [ 217 + { 218 + id: "#bsky_fg", 219 + type: "BskyFeedGenerator", 220 + serviceEndpoint: `https://${hostname}`, 221 + }, 222 + ], 223 + }), 224 + { 225 + headers: { 226 + "Content-Type": "application/json", 227 + }, 228 + }, 229 + ); 230 + } else { 231 + return app.fetch(request); 232 + } 233 + }, 234 + } satisfies Deno.ServeDefaultExport;