From 19f7b248d88805e6595b671a7447b0ba5e1451fa Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 14 May 2018 17:51:15 +0200 Subject: adding redis unix connection --- server/initializers/checker.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'server/initializers/checker.ts') diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index d5402098f..52a1aeb50 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts @@ -44,7 +44,6 @@ function checkMissedConfig () { 'webserver.https', 'webserver.hostname', 'webserver.port', 'trust_proxy', 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', - 'redis.hostname', 'redis.port', 'redis.auth', 'redis.db', 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', 'log.level', @@ -56,6 +55,12 @@ function checkMissedConfig () { 'instance.default_nsfw_policy', 'instance.robots', 'services.twitter.username', 'services.twitter.whitelisted' ] + const requiredAlternatives = [ + [ // set + ['redis.hostname', 'redis.port'], // alternative + ['redis.socket'] + ] + ] const miss: string[] = [] for (const key of required) { @@ -64,6 +69,13 @@ function checkMissedConfig () { } } + const missingAlternatives = requiredAlternatives.filter( + set => !set.find(alternative => !alternative.find(key => !config.has(key))) + ) + + missingAlternatives + .forEach(set => set[0].forEach(key => miss.push(key))) + return miss } -- cgit v1.2.3