Fix up Redis config (#3705)
- Move to private - Fix validation - Don't log the URL Ref #3332
This commit is contained in:
@@ -23,7 +23,6 @@ public:
|
||||
|
||||
persistence:
|
||||
dir: 'PERSISTENCE_DIR'
|
||||
redisUrl: 'REDIS_URL'
|
||||
|
||||
services:
|
||||
github:
|
||||
@@ -58,6 +57,7 @@ private:
|
||||
nexus_user: 'NEXUS_USER'
|
||||
nexus_pass: 'NEXUS_PASS'
|
||||
npm_token: 'NPM_TOKEN'
|
||||
redis_url: 'REDIS_URL'
|
||||
sentry_dsn: 'SENTRY_DSN'
|
||||
shields_secret: 'SHIELDS_SECRET'
|
||||
sl_insight_userUuid: 'SL_INSIGHT_USER_UUID'
|
||||
|
||||
@@ -63,7 +63,6 @@ const publicConfigSchema = Joi.object({
|
||||
},
|
||||
persistence: {
|
||||
dir: Joi.string().required(),
|
||||
redisUrl: optionalUrl,
|
||||
},
|
||||
services: {
|
||||
github: {
|
||||
@@ -105,6 +104,7 @@ const privateConfigSchema = Joi.object({
|
||||
nexus_user: Joi.string(),
|
||||
nexus_pass: Joi.string(),
|
||||
npm_token: Joi.string(),
|
||||
redis_url: Joi.string().uri({ scheme: ['redis', 'rediss'] }),
|
||||
sentry_dsn: Joi.string(),
|
||||
shields_ips: Joi.array().items(Joi.string().ip()),
|
||||
shields_secret: Joi.string(),
|
||||
|
||||
@@ -28,9 +28,10 @@ class GithubConstellation {
|
||||
this._debugEnabled = config.service.debug.enabled
|
||||
this._debugIntervalSeconds = config.service.debug.intervalSeconds
|
||||
|
||||
const { redisUrl, dir: persistenceDir } = config.persistence
|
||||
if (config.persistence.redisUrl) {
|
||||
log(`RedisTokenPersistence configured with ${redisUrl}`)
|
||||
const { redis_url: redisUrl } = config.private
|
||||
const { dir: persistenceDir } = config.persistence
|
||||
if (redisUrl) {
|
||||
log('RedisTokenPersistence configured with redisUrl')
|
||||
this.persistence = new RedisTokenPersistence({
|
||||
url: redisUrl,
|
||||
key: 'githubUserTokens',
|
||||
|
||||
Reference in New Issue
Block a user