mirror of
https://github.com/Metastem/wikiless
synced 2024-12-06 19:16:58 +01:00
fix redis ignoring configs (fixes #41). now redis_url is used instead of redis_host and redis_port
This commit is contained in:
+3
-4
@@ -15,14 +15,13 @@ const config = {
|
||||
ssl_port: process.env.SSL_PORT || 8088,
|
||||
cert_dir: process.env.CERT_DIR || ``, // For example '/home/wikiless/letsencrypt/live/wikiless.org'. No trailing slash.
|
||||
redirect_http_to_https: process.env.REDIRECT_HTTP_TO_HTTPS === 'true' || false, // If true, HTTP requests will be redirected to HTTPS.
|
||||
|
||||
|
||||
/**
|
||||
* You can configure redis below if needed.
|
||||
*/
|
||||
redis_host: process.env.REDIS_HOST || '127.0.0.1',
|
||||
redis_url: process.env.REDIS_HOST || 'redis://127.0.0.1:6379',
|
||||
redis_password: process.env.REDIS_PASSWORD,
|
||||
redis_port: process.env.REDIS_PORT || 6379,
|
||||
|
||||
|
||||
/**
|
||||
* You might need to change these configs below if you host through a reverse
|
||||
* proxy like nginx.
|
||||
|
||||
+2
-14
@@ -10,20 +10,8 @@ const bodyParser = require('body-parser')
|
||||
|
||||
const redis = (() => {
|
||||
const redisOptions = {
|
||||
host: '127.0.0.1',
|
||||
port: 6379
|
||||
}
|
||||
|
||||
if(config.redis_host) {
|
||||
redisOptions.host = config.redis_host
|
||||
}
|
||||
|
||||
if(config.redis_port && config.redis_port > 0) {
|
||||
redisOptions.port = config.redis_port
|
||||
}
|
||||
|
||||
if(config.redis_password) {
|
||||
redisOptions.password = config.redis_password
|
||||
url: config.redis_url,
|
||||
password: config.redis_password
|
||||
}
|
||||
|
||||
const client = r.createClient(redisOptions)
|
||||
|
||||
Reference in New Issue
Block a user