Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
1#!/usr/bin/env tsx
2/**
3 * Debug script to check cached settings for a site
4 * Usage: tsx debug-settings.ts <did> <rkey>
5 */
6
7import { readFile } from 'fs/promises';
8import { existsSync } from 'fs';
9
10const CACHE_DIR = './cache';
11
12async function debugSettings(did: string, rkey: string) {
13 const metadataPath = `${CACHE_DIR}/${did}/${rkey}/.metadata.json`;
14
15 console.log('Checking metadata at:', metadataPath);
16 console.log('Exists:', existsSync(metadataPath));
17
18 if (!existsSync(metadataPath)) {
19 console.log('\n❌ Metadata file does not exist - site may not be cached yet');
20 return;
21 }
22
23 const content = await readFile(metadataPath, 'utf-8');
24 const metadata = JSON.parse(content);
25
26 console.log('\n=== Cached Metadata ===');
27 console.log('CID:', metadata.cid);
28 console.log('Cached at:', metadata.cachedAt);
29 console.log('\n=== Settings ===');
30 if (metadata.settings) {
31 console.log(JSON.stringify(metadata.settings, null, 2));
32 } else {
33 console.log('❌ No settings found in metadata');
34 console.log('This means:');
35 console.log(' 1. No place.wisp.settings record exists on the PDS');
36 console.log(' 2. Or the firehose hasn\'t picked up the settings yet');
37 console.log('\nTo fix:');
38 console.log(' 1. Create a place.wisp.settings record with the same rkey');
39 console.log(' 2. Wait for firehose to pick it up (a few seconds)');
40 console.log(' 3. Or manually re-cache the site');
41 }
42}
43
44const [did, rkey] = process.argv.slice(2);
45if (!did || !rkey) {
46 console.log('Usage: tsx debug-settings.ts <did> <rkey>');
47 console.log('Example: tsx debug-settings.ts did:plc:abc123 my-site');
48 process.exit(1);
49}
50
51debugSettings(did, rkey).catch(console.error);