open source is social v-it.org
0
fork

Configure Feed

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

Merge branch 'hopper-gbmq4bcn-jetstream-config'

# Conflicts:
# src/cmd/firehose.js
# src/cmd/scan.js
# src/lib/constants.js

+9 -7
+5 -4
src/cmd/firehose.js
··· 2 2 // Copyright (c) 2026 sol pbc 3 3 4 4 import { loadConfig } from '../lib/config.js'; 5 - import { CAP_COLLECTION, JETSTREAM_URL } from '../lib/constants.js'; 5 + import { CAP_COLLECTION, DEFAULT_JETSTREAM_URL } from '../lib/constants.js'; 6 6 import { resolveRef } from '../lib/cap-ref.js'; 7 7 import { brand } from '../lib/brand.js'; 8 8 ··· 57 57 } 58 58 59 59 function connect(opts, cursor) { 60 - const jetstreamUrl = opts.jetstream || JETSTREAM_URL; 61 - const url = buildUrl(jetstreamUrl, opts.collection, opts.did, cursor); 60 + const url = buildUrl(opts.jetstreamUrl, opts.collection, opts.did, cursor); 62 61 let lastCursor = cursor; 63 62 64 63 ws = new WebSocket(url); ··· 132 131 } 133 132 } 134 133 134 + const jetstreamUrl = opts.jetstream || process.env.VIT_JETSTREAM_URL || DEFAULT_JETSTREAM_URL; 135 + opts.jetstreamUrl = jetstreamUrl; 136 + 135 137 for (const sig of ['SIGINT', 'SIGTERM']) { 136 138 process.on(sig, () => { 137 139 shuttingDown = true; ··· 141 143 }); 142 144 } 143 145 144 - const jetstreamUrl = opts.jetstream || JETSTREAM_URL; 145 146 const url = buildUrl(jetstreamUrl, opts.collection, opts.did, null); 146 147 console.log(`${brand} firehose`); 147 148 console.log(` Collection: ${opts.collection}`);
+3 -2
src/cmd/scan.js
··· 1 1 // SPDX-License-Identifier: AGPL-3.0-only 2 2 // Copyright (c) 2026 sol pbc 3 3 4 - import { CAP_COLLECTION, SKILL_COLLECTION, JETSTREAM_URL } from '../lib/constants.js'; 4 + import { CAP_COLLECTION, SKILL_COLLECTION, DEFAULT_JETSTREAM_URL } from '../lib/constants.js'; 5 5 import { resolveRef } from '../lib/cap-ref.js'; 6 6 import { resolveHandleFromDid } from '../lib/pds.js'; 7 7 import { brand } from '../lib/brand.js'; ··· 26 26 return; 27 27 } 28 28 29 + const jetstreamUrl = opts.jetstream || process.env.VIT_JETSTREAM_URL || DEFAULT_JETSTREAM_URL; 30 + 29 31 const wantCaps = !opts.skills; 30 32 const wantSkills = !opts.caps; 31 33 ··· 37 39 if (wantCaps) collections.push(CAP_COLLECTION); 38 40 if (wantSkills) collections.push(SKILL_COLLECTION); 39 41 40 - const jetstreamUrl = opts.jetstream || JETSTREAM_URL; 41 42 const url = new URL(jetstreamUrl); 42 43 for (const col of collections) { 43 44 url.searchParams.append('wantedCollections', col);
+1 -1
src/lib/constants.js
··· 4 4 export const CAP_COLLECTION = 'org.v-it.cap'; 5 5 export const VOUCH_COLLECTION = 'org.v-it.vouch'; 6 6 export const SKILL_COLLECTION = 'org.v-it.skill'; 7 - export const JETSTREAM_URL = process.env.VIT_JETSTREAM_URL || 'wss://jetstream2.us-east.bsky.network/subscribe'; 7 + export const DEFAULT_JETSTREAM_URL = 'wss://jetstream2.us-east.bsky.network/subscribe';