Dave 1e77a0a844 feat(redis-inspector): add CHANNEL, CATEGORY, and TAG to RedisInspectorGroupCode enum and update GROUP_PATTERNS 1 月之前
..
schema b3e4d25f35 feat(video): enhance video processing with sanitizedSecondTags and improved filtering 1 月之前
README.md 1608526bc6 feat(media-config): refactor media configuration handling and introduce SysConfigReaderService 1 月之前
seed-admin.ts 1e77a0a844 feat(redis-inspector): add CHANNEL, CATEGORY, and TAG to RedisInspectorGroupCode enum and update GROUP_PATTERNS 1 月之前
seed-ads.ts 95d15c8721 fix: remove unnecessary null check for adId in ensureAdIdCounterAligned function 1 月之前
seed-sys-config.ts 5f536f6a50 fix(sysConfig): add videoCdn configuration to provider settings 1 月之前
seed.ts ef4e5640f3 feat: add deletion of existing ads modules before seeding new data 2 月之前

README.md

Mongo seeds

sysConfig helper

pnpm prisma:seed:box-admin:sys-config upserts the singleton { _id: -1 } document so that appConfig.imageCdn, imageConfig, and provider are populated for box-app-api. The ts-node script is ts-node -P tsconfig.seed.json prisma/mongo/seed-sys-config.ts.

Generated document shape:

{
  "_id": -1,
  "appConfig": {
    "imageCdn": {
      "s3": "...",
      "local": "..."
    }
  },
  "imageConfig": {
    "s3Enabled": true,
    "storageStrategy": "S3_AND_LOCAL",
    "local": {
      "rootPath": "something (e.g. /opt/app/node/ww-images)",
      "baseUrl": "https://man.boxt3yk.com/images"
    },
    "limitsMb": { "image": 10, "video": 100 },
    "s3": {
      "accessKeyId": "...",
      "secretAccessKey": "...",
      "bucket": "...",
      "region": "ap-east-1",
      "endpointUrl": "https://s3.ap-east-1.amazonaws.com",
      "imageBaseUrl": "https://s3.ap-east-1.amazonaws.com/mybucket-imgs"
    }
  },
  "provider": {
    "providerCode": "PARTNER",
    "apiUrl": "https://wwapi.hxc1t.com",
    "itemsLimit": 100
  }
}

Equivalent mongosh call:

mongosh --eval "db.sysConfig.updateOne({ _id: -1 }, { $set: { appConfig: { imageCdn: { s3: 'https://s3.ap-east-1.amazonaws.com/mybucket-imgs', local: 'https://man.boxt3yk.com/' } }, imageConfig: { s3Enabled: true, storageStrategy: 'S3_AND_LOCAL', local: { rootPath: '/opt/app/node/ww-images', baseUrl: 'https://man.boxt3yk.com/images' }, limitsMb: { image: 10, video: 100 }, s3: { accessKeyId: 'AKIA6GSNGR5PISMIKCJ4', secretAccessKey: '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', bucket: 'mybucket-imgs', region: 'ap-east-1', endpointUrl: 'https://s3.ap-east-1.amazonaws.com', imageBaseUrl: 'https://s3.ap-east-1.amazonaws.com/mybucket-imgs' } }, provider: { providerCode: 'PARTNER', apiUrl: 'https://wwapi.hxc1t.com', itemsLimit: 100 } } }, { upsert: true, multi: false })"