···1414- [x] Backfill network
1515 - [x] Store did+route -> blob & mime type in database
1616 - [x] Store blobs for CDN (max ~0.25gb per user)
1717-- [ ] Moderate illegal content or hope that people are niceys
1717+- [x] Moderate illegal content or hope that people are niceys
1818+ (Hope that people are niceys)
1819- [ ] Finish CLI tool
1920 - [ ] Sign in via app password
2020- - [ ] Sign in via oAuth (for interactive)
2121 - [ ] Clear old site
2222 - [ ] Upload new site
2323- [ ] Fuse uploader
+18-11
server/src/backfill/blob.ts
···55 did: `did:${"plc" | "web"}:${string}`,
66 cid: string
77): Promise<Blob> {
88+ // if the user has been manually taken down (cache dir deleted and replaced with empty file)
99+ // this errors out for quick exit
1010+ // saving the round trip to resolve the pds and blob.
1111+ await Deno.mkdir(`./blobs/${did}`, { recursive: true });
1212+813 const pds = await getPds(did);
914 if (!pds) throw "PDS not found";
1015···20252126 if (!ok) throw `${data.error}`;
22272323- // check for CSAM etc here
2424-2525- await Deno.mkdir(`./blobs/${did}`, { recursive: true });
2626- let size = 0;
2727- for await (const file of Deno.readDir(`./blobs/${did}`)) {
2828- size += (await Deno.stat(`./blobs/${did}/${file.name}`)).size;
2828+ // if the file size cant be calculated or the file cant be written, still return the blob
2929+ try {
3030+ let size = 0;
3131+ for await (const file of Deno.readDir(`./blobs/${did}`)) {
3232+ size += (await Deno.stat(`./blobs/${did}/${file.name}`)).size;
3333+ }
3434+ // only write if total stays below max site size
3535+ if (size + data.size <= MAX_SITE_SIZE)
3636+ await Deno.writeFile(`./blobs/${did}/${cid}`, await data.bytes(), {
3737+ createNew: true,
3838+ });
3939+ } catch (e) {
4040+ console.warn(e);
2941 }
3030- // only write if total stays below max site size
3131- if (size + data.size <= MAX_SITE_SIZE)
3232- await Deno.writeFile(`./blobs/${did}/${cid}`, await data.bytes(), {
3333- createNew: true,
3434- });
35423643 return data;
3744}
+4-1
server/src/routes/user.ts
···106106 console.error(e);
107107 return new Response(`${ascii}
108108109109-This page couldn't be resolved. Either the blob does not exist, or contained illegal content.
109109+This page could not be resolved. Either:
110110+- The user has no PDS
111111+- The blob does not exist
112112+- The user has been manually hidden for uploading illegal content.
110113`);
111114 }
112115 }