extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix OAuth key generation script for new API

- Update to use generateClientAssertionKey from @atcute/oauth-crypto
- Fix detection of existing keys to ignore commented lines
- Successfully generates EC keys for OAuth

+6 -5
+6 -5
scripts/generate-key.ts
··· 5 5 * Or add to package.json: "setup:key": "tsx scripts/generate-key.ts" 6 6 */ 7 7 8 - import { generatePrivateKey, exportJwkKey } from '@atcute/oauth-node-client'; 8 + import { generateClientAssertionKey } from '@atcute/oauth-crypto'; 9 9 import { writeFileSync, readFileSync, existsSync } from 'fs'; 10 10 import { join } from 'path'; 11 11 import { randomUUID } from 'crypto'; ··· 13 13 async function generateKey() { 14 14 console.log('Generating OAuth private key...'); 15 15 16 - const privateKey = await generatePrivateKey(); 17 - const jwk = await exportJwkKey(privateKey); 16 + // Generate EC key for client assertions (OAuth) 17 + const jwk = await generateClientAssertionKey(); 18 18 19 19 // Add a kid (key ID) if not present - required by atcute 20 20 if (!jwk.kid) { ··· 32 32 envContent = readFileSync(envPath, 'utf-8'); 33 33 } 34 34 35 - // Check if PRIVATE_KEY_JWK already exists in .env 36 - if (envContent.includes('PRIVATE_KEY_JWK=')) { 35 + // Check if PRIVATE_KEY_JWK already exists in .env (uncommented) 36 + const keyLineRegex = /^PRIVATE_KEY_JWK=\{/m; 37 + if (keyLineRegex.test(envContent)) { 37 38 console.log('⚠️ PRIVATE_KEY_JWK already exists in .env'); 38 39 console.log(' To regenerate, remove the existing line first or delete the value'); 39 40 console.log(' Run: sed -i.bak \'/^PRIVATE_KEY_JWK=/d\' .env');