[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

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

db config options (#50)

* db config options

* optional

authored by

Roscoe Rubin-Rottenberg and committed by
GitHub
7c6d1af1 4655a892

+20 -2
+12
config.ts
··· 27 27 28 28 dbUri?: string; 29 29 dbName?: string; 30 + dbUser?: string; 31 + dbPass?: string; 30 32 relayUrl?: string; 31 33 plcUrl?: string; 32 34 } ··· 64 66 const dbUri = envStr("SPRK_DB_URI") ?? 65 67 "mongodb://mongo:mongo@localhost:27017/dev"; 66 68 const dbName = envStr("SPRK_DB_NAME") ?? "dev"; 69 + const dbUser = envStr("SPRK_DB_USER") ?? "mongo"; 70 + const dbPass = envStr("SPRK_DB_PASS") ?? "mongo"; 67 71 const relayUrl = envStr("SPRK_RELAY") ?? 68 72 "wss://relay1.us-east.bsky.network"; 69 73 const plcUrl = envStr("SPRK_PLC") ?? "https://plc.directory"; ··· 89 93 thumbCdn, 90 94 dbUri, 91 95 dbName, 96 + dbUser, 97 + dbPass, 92 98 relayUrl, 93 99 plcUrl, 94 100 }); ··· 158 164 } 159 165 get dbName() { 160 166 return this.cfg.dbName; 167 + } 168 + get dbUser() { 169 + return this.cfg.dbUser; 170 + } 171 + get dbPass() { 172 + return this.cfg.dbPass; 161 173 } 162 174 get relayUrl() { 163 175 return this.cfg.relayUrl;
+6
data-plane/db/index.ts
··· 22 22 23 23 connect() { 24 24 const uri = this.cfg.dbUri; 25 + const name = this.cfg.dbName; 26 + const user = this.cfg.dbUser; 27 + const pass = this.cfg.dbPass; 25 28 if (!uri) { 26 29 throw new Error("No database URI provided"); 27 30 } ··· 31 34 this.connection = mongoose.createConnection(uri, { 32 35 autoIndex: true, 33 36 autoCreate: true, 37 + dbName: name, 38 + user, 39 + pass, 34 40 }); 35 41 36 42 // Attach basic listeners for visibility
+2 -2
data-plane/db/models.ts
··· 355 355 storySchema.index({ authorDid: 1, createdAt: -1 }); 356 356 storySchema.index({ tags: 1, createdAt: -1 }); 357 357 358 - followSchema.index({ authorDid: 1, subject: 1, type: 1 }, { unique: true }); 358 + followSchema.index({ authorDid: 1, subject: 1 }); 359 359 followSchema.index({ subject: 1, createdAt: -1 }); 360 360 followSchema.index({ type: 1, createdAt: -1 }); 361 361 362 - blockSchema.index({ authorDid: 1, subject: 1 }, { unique: true }); 362 + blockSchema.index({ authorDid: 1, subject: 1 }); 363 363 blockSchema.index({ subject: 1, createdAt: -1 }); 364 364 365 365 audioSchema.index({ authorDid: 1, createdAt: -1 });